Skip to main content

CODITECT File Naming Conventions

Purpose

This standard defines naming conventions for all files and directories within CODITECT projects, ensuring consistency, discoverability, and cross-platform compatibility.

Scope

Applies to all files and directories in:

  • CODITECT repositories
  • Customer projects using CODITECT framework
  • Generated files and automation outputs

1. General Principles

1.1 Core Rules

RuleDescriptionExample
Lowercase preferredUse lowercase for most filesconfig.json, utils.py
UPPERCASE for standardsUse UPPERCASE for important docsREADME.md, CLAUDE.md
Hyphens for multi-wordSeparate words with hyphensuser-authentication.ts
No spacesNever use spaces in namesmy-file.md not my file.md
ASCII onlyAvoid special characterscafe.md not café.md
Descriptive namesNames should indicate purposegenerate-reports.py

1.2 Case Conventions

ConventionUse ForExample
UPPERCASEStandards, important docsREADME.md, LICENSE, CLAUDE.md
UPPER-KEBAB-CASEStandard documents, ADRsPROJECT-PLAN.md, ADR-001.md
kebab-caseMost files, foldersuser-service.ts, api-handlers/
snake_casePython modulesuser_service.py, api_handlers/
camelCaseJavaScript/TypeScript variablesInternal code only
PascalCaseReact components, classesUserProfile.tsx, ApiService.ts

2. Directory Naming

2.1 Standard Directories

DirectoryConventionExamples
Top-levelkebab-casedocs/, scripts/, config/
Source codekebab-casesrc/, components/, services/
Python packagessnake_caseuser_auth/, api_v1/
Test directorieskebab-casetests/, unit/, integration/
Hidden directories.name.github/, .claude/, .coditect/

2.2 Directory Patterns

✅ CORRECT
docs/
scripts/
config/
src/
components/
services/
utils/
tests/
unit/
integration/

❌ INCORRECT
Docs/ # No PascalCase for directories
my scripts/ # No spaces
src_code/ # Use src/ or source/
Tests/ # Lowercase preferred

2.3 Category Directories (Submodules)

Pattern: <category>/

submodules/
├── archives/ # Archived projects
├── cloud/ # Cloud infrastructure
├── compliance/ # Compliance & legal
├── core/ # Core framework
├── dev/ # Development tools
├── docs/ # Documentation
├── gtm/ # Go-to-market
└── ops/ # Operations

3. File Naming by Type

3.1 Documentation Files

TypeConventionExamples
READMEREADME.mdREADME.md (exactly)
StandardsUPPER-KEBAB-CASE.mdPROJECT-PLAN.md, TASKLIST.md
GuidesUPPER-KEBAB-CASE.mdQUICK-START.md, INSTALLATION.md
ADRsADR-NNN-title.mdADR-001-database-choice.md
CheckpointsCHECKPOINT-YYYY-MM-DD.mdCHECKPOINT-2026-01-02.md
AI ContextCLAUDE.mdCLAUDE.md (exactly)

3.2 Source Code Files

LanguageConventionExamples
TypeScript/JavaScriptkebab-case.tsuser-service.ts, api-handler.ts
React ComponentsPascalCase.tsxUserProfile.tsx, Dashboard.tsx
Pythonsnake_case.pyuser_service.py, api_handler.py
Rustsnake_case.rsuser_service.rs, api_handler.rs
Gosnake_case.gouser_service.go, api_handler.go
Shellkebab-case.shdeploy-app.sh, run-tests.sh

3.3 Configuration Files

TypeConventionExamples
JSON configkebab-case.jsoncomponent-counts.json
Environment-specificname.environment.extsettings.production.json
Local overridesname.local.extsettings.local.json
YAMLkebab-case.yamldocker-compose.yaml
TOMLkebab-case.tomlpyproject.toml, Cargo.toml

3.4 Test Files

TypeConventionExamples
Unit testsname.test.ext or test_name.extuser-service.test.ts, test_user_service.py
Integrationname.integration.test.extapi.integration.test.ts
E2Ename.e2e.test.extlogin.e2e.test.ts
Spec filesname.spec.extuser-service.spec.ts

3.5 CODITECT Components

ComponentConventionExamples
Agentskebab-case.mdproject-structure-analyzer.md
Skillskebab-case/SKILL.mdproject-organization/SKILL.md
Commandskebab-case.mdorganize.md, structure.md
Hookskebab-case.py or .shpre-commit-naming-check.py
WorkflowsUPPER-KEBAB-CASE.mdPROJECT-REORGANIZATION-WORKFLOW.md
Promptskebab-case-prompt.mdanalyze-structure-prompt.md

4. Special Files

4.1 Required Exact Names

These files MUST use exact names (case-sensitive):

FileExact NameLocation
ReadmeREADME.mdEvery directory
LicenseLICENSE or LICENSE.mdRoot
AI ContextCLAUDE.mdRoot, key directories
Git Ignore.gitignoreRoot
Git Modules.gitmodulesRoot (if using submodules)
ChangelogCHANGELOG.mdRoot
ContributingCONTRIBUTING.mdRoot
Code of ConductCODE_OF_CONDUCT.mdRoot

4.2 Package Manifests

LanguageExact Name
Node.jspackage.json
Pythonpyproject.toml or setup.py
RustCargo.toml
Gogo.mod
RubyGemfile

5. Naming Patterns

5.1 Versioned Files

Pattern: name-vN.N.N.ext or name.vN.ext

✅ CORRECT
api-v1/
api-v2/
schema-v2.0.0.json

❌ INCORRECT
api_version_1/
apiV1/
schema-version-2.json

5.2 Date-Stamped Files

Pattern: NAME-YYYY-MM-DD.ext

✅ CORRECT
CHECKPOINT-2026-01-02.md
backup-2026-01-02.sql
report-2026-01-02.pdf

❌ INCORRECT
CHECKPOINT-01-02-2026.md # Wrong date format
backup_20260102.sql # No separators
report-Jan-02-2026.pdf # Text month

5.3 Numbered Files

Pattern: NNN-name.ext (3-digit prefix)

✅ CORRECT
001-introduction.md
002-getting-started.md
010-advanced-topics.md

❌ INCORRECT
1-introduction.md # Single digit
01-introduction.md # Two digits
introduction-1.md # Number at end

6. Prohibited Patterns

6.1 Never Use

PatternProblemAlternative
SpacesCross-platform issuesUse hyphens
Special chars !@#$%^&*()Shell escaping issuesUse alphanumeric
Leading dots (except hidden)Confusion with hidden filesRemove dot
Trailing dotsWindows issuesRemove dot
Mixed case directoriesCross-platform issuesLowercase
Very long names (>50 chars)Display issuesAbbreviate
Underscores in docsInconsistencyUse hyphens

6.2 Platform-Specific Issues

IssueProblemSolution
CON, PRN, AUX, NULWindows reserved namesAvoid completely
Case-only differencesmacOS/Windows conflictsDon't rely on case
Colons :Windows path issuesNever use
Backslashes \Path issuesNever use

7. Enforcement

7.1 Automated Checking

# Check naming conventions
/naming-check

# Check and auto-fix where possible
/naming-check --fix

# Check specific directory
/naming-check --path docs/

7.2 Pre-commit Hook

# .pre-commit-config.yaml
repos:
- repo: local
hooks:
- id: naming-check
name: Check file naming conventions
entry: python scripts/enforce-naming-conventions.py
language: python
types: [file]

7.3 CI/CD Integration

# .github/workflows/naming-check.yml
name: Naming Convention Check
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: python scripts/enforce-naming-conventions.py --check

8. Migration Guide

8.1 Renaming Files

Always use git mv to preserve history:

# Single file
git mv "Old Name.md" "new-name.md"

# Batch rename (example: uppercase to kebab-case)
for f in docs/*.md; do
new=$(echo "$f" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
git mv "$f" "$new"
done

8.2 Common Migrations

FromToCommand
My Document.mdmy-document.mdgit mv "My Document.md" my-document.md
userService.tsuser-service.tsgit mv userService.ts user-service.ts
API_Handler.pyapi_handler.pygit mv API_Handler.py api_handler.py

9. Quick Reference Card

DIRECTORIES:
Standard: kebab-case/ (docs/, scripts/, config/)
Python packages: snake_case/ (user_auth/, api_v1/)
Hidden: .name/ (.github/, .claude/)

FILES:
Standards: UPPER-KEBAB.md (README.md, CLAUDE.md)
Documents: UPPER-KEBAB.md (PROJECT-PLAN.md)
Source (TS/JS): kebab-case.ts (user-service.ts)
Source (Python): snake_case.py (user_service.py)
React: PascalCase.tsx (UserProfile.tsx)
Config: kebab-case.json (app-config.json)
Tests: name.test.ext (user.test.ts)

PATTERNS:
Versioned: name-v1.0.0.ext
Dated: NAME-YYYY-MM-DD.ext
Numbered: NNN-name.ext

Version: 1.0.0 Status: Active Owner: CODITECT Core Team Last Updated: 2026-01-02