Skip to main content

CODITECT Directory Structure Standard

Purpose

This standard defines the canonical directory structure for all CODITECT projects, ensuring consistency, discoverability, and production readiness across all repositories.

Scope

Applies to:

  • CODITECT master repository (coditect-rollout-master)
  • All CODITECT submodules (74+ repositories)
  • Customer projects using CODITECT framework
  • New repositories created within the CODITECT ecosystem

1. Root Level Structure

1.1 Master/Orchestration Repository

<project-root>/
├── .claude/ # Claude Code configuration (symlink to .coditect)
├── .coditect/ # CODITECT framework (symlink to core)
├── .github/ # GitHub configuration
│ ├── workflows/ # CI/CD pipelines
│ ├── ISSUE_TEMPLATE/ # Issue templates
│ ├── PULL_REQUEST_TEMPLATE.md
│ └── CODEOWNERS
├── config/ # Configuration files ONLY
├── docs/ # User-facing documentation
├── scripts/ # Automation scripts
├── submodules/ # Git submodules (categorized)
├── .gitignore # Git ignore rules
├── .gitmodules # Submodule definitions
├── CLAUDE.md # AI agent context (REQUIRED)
├── LICENSE # License file
├── README.md # Project overview (REQUIRED)
└── [PROJECT-SPECIFIC].md # e.g., WHAT-IS-CODITECT.md

1.2 Application Repository

<project-root>/
├── .claude/ # Claude Code configuration
├── .coditect/ # CODITECT framework (if using)
├── .github/ # GitHub configuration
├── src/ # Source code
│ ├── components/ # UI components (if frontend)
│ ├── services/ # Business logic
│ ├── utils/ # Utilities
│ └── types/ # Type definitions
├── tests/ # Test files
│ ├── unit/
│ ├── integration/
│ └── e2e/
├── docs/ # Documentation
├── scripts/ # Build/automation scripts
├── config/ # Configuration files
├── public/ # Static assets (if frontend)
├── .gitignore
├── CLAUDE.md # AI agent context
├── LICENSE
├── README.md
├── package.json # (Node.js projects)
├── Cargo.toml # (Rust projects)
└── pyproject.toml # (Python projects)

1.3 Library/Package Repository

<project-root>/
├── .github/
├── src/ # Library source
│ └── lib.rs / index.ts / __init__.py
├── tests/
├── examples/ # Usage examples
├── docs/
├── benches/ # Benchmarks (if applicable)
├── .gitignore
├── CLAUDE.md
├── LICENSE
├── README.md
├── CHANGELOG.md
└── [package manifest]

2. Documentation Structure (docs/)

2.1 Standard Documentation Hierarchy

docs/
├── README.md # Documentation index
├── getting-started/ # Onboarding
│ ├── README.md
│ ├── INSTALLATION.md
│ ├── QUICK-START.md
│ └── PREREQUISITES.md
├── guides/ # How-to guides
│ ├── README.md
│ └── [GUIDE-NAME].md
├── reference/ # API/component reference
│ ├── README.md
│ └── [REFERENCE-NAME].md
├── architecture/ # Architecture documentation
│ ├── README.md
│ ├── OVERVIEW.md
│ └── diagrams/
├── project-management/ # Planning (if applicable)
│ ├── README.md
│ ├── PROJECT-PLAN.md
│ ├── TASKLIST.md
│ └── checkpoints/
├── security/ # Security documentation
│ └── README.md
└── archive/ # Deprecated/old docs
└── README.md

2.2 Internal vs External Documentation

TypeLocationAudience
User-facingdocs/End users, customers
Contributorinternal/ or docs/contributing/Developers
Architecturedocs/architecture/ or internal/architecture/Technical team
ADRsinternal/architecture/adrs/Architects, developers

3. Source Code Structure (src/)

3.1 Frontend (React/TypeScript)

src/
├── components/ # React components
│ ├── common/ # Shared components
│ ├── layout/ # Layout components
│ └── features/ # Feature-specific components
├── hooks/ # Custom React hooks
├── services/ # API services
├── stores/ # State management
├── types/ # TypeScript types
├── utils/ # Utility functions
├── styles/ # Global styles
├── assets/ # Static assets
├── App.tsx
└── index.tsx

3.2 Backend (Python/Django)

src/ or <app_name>/
├── api/ # API endpoints
│ ├── v1/
│ └── v2/
├── models/ # Database models
├── services/ # Business logic
├── utils/ # Utilities
├── middleware/ # Custom middleware
├── tasks/ # Background tasks
├── tests/ # Tests (or separate tests/)
├── settings/ # Configuration
│ ├── base.py
│ ├── development.py
│ └── production.py
├── manage.py
└── wsgi.py

3.3 Backend (Rust)

src/
├── api/ # API handlers
├── models/ # Data models
├── services/ # Business logic
├── db/ # Database layer
├── utils/ # Utilities
├── config/ # Configuration
├── error/ # Error types
├── lib.rs # Library entry
└── main.rs # Binary entry

4. Scripts Structure (scripts/)

scripts/
├── README.md # Script documentation
├── core/ # Core functionality
│ ├── __init__.py
│ └── [core-scripts].py
├── utils/ # Utility scripts
├── deployment/ # Deployment automation
│ ├── deploy.sh
│ └── rollback.sh
├── maintenance/ # Maintenance scripts
│ ├── backup.sh
│ └── cleanup.sh
├── ci/ # CI/CD scripts
└── dev/ # Development helpers

5. Submodule Structure (submodules/)

5.1 Category-Based Organization

submodules/
├── README.md # Submodule index
├── archives/ # Archived/legacy projects
├── cloud/ # Cloud infrastructure
│ ├── coditect-cloud-infra/
│ ├── coditect-cloud-frontend/
│ └── coditect-cloud-backend/
├── compliance/ # Compliance & legal
├── core/ # Core framework
│ └── coditect-core/
├── dev/ # Development tools
├── docs/ # Documentation repos
├── gtm/ # Go-to-market
└── ops/ # Operations

5.2 Submodule Naming Convention

Pattern: <organization>-<category>-<name>

Examples:

  • coditect-cloud-infra
  • coditect-core
  • coditect-dev-generative-ui

6. Configuration Structure (config/)

config/
├── README.md
├── component-counts.json # Component inventory
├── settings.json # Default settings
├── settings.local.json # Local overrides (gitignored)
├── settings.production.json # Production settings
└── [feature-config].json # Feature-specific config

7. Required Files

7.1 Every Repository MUST Have

FilePurpose
README.mdProject overview, setup instructions
LICENSELicense terms
.gitignoreGit ignore rules

7.2 CODITECT Repositories MUST Also Have

FilePurpose
CLAUDE.mdAI agent context
docs/README.mdDocumentation index

7.3 Every Directory SHOULD Have

FilePurpose
README.mdDirectory purpose and contents

8. Prohibited Items at Root

The following MUST NOT exist at project root:

PatternReasonAction
*.logLogs belong in logs/ or are transientDelete or gitignore
*.tmp, *.bakTemporary filesDelete or gitignore
CHECKPOINT-*.mdCheckpoints belong in docs/Move to docs/project-management/checkpoints/
*.py (loose scripts)Scripts belong in scripts/Move to scripts/
Build artifactsShould be gitignoredDelete and gitignore
node_modules/, venv/, .venv/DependenciesGitignore
.env with secretsSecurity riskGitignore, use Secret Manager

9. Depth Limits

DirectoryMax DepthRationale
docs/4 levelsMaintainability
src/5 levelsCode organization
scripts/3 levelsDiscoverability
config/2 levelsSimplicity
submodules/2 levels (category/repo)Git submodule limitation

10. Validation

10.1 Automated Validation

# Validate structure
/structure --validate

# Check compliance
python scripts/analyze-project-structure.py --check

10.2 Compliance Scoring

ScoreLevelRequirements
90-100PlatinumAll standards met, automation enabled
80-89GoldAll required files, 95% README coverage
70-79SilverRequired files, 80% README coverage
60-69BronzeREADME at root, basic structure
<60Non-compliantMissing critical elements

11. Migration Guide

11.1 From Non-Compliant Structure

  1. Audit current structure: /organize --analyze
  2. Generate migration plan: /organize --plan
  3. Create missing directories: Follow hierarchy above
  4. Move files: Use git mv to preserve history
  5. Generate READMEs: /readme-gen --recursive
  6. Validate: /structure --validate

11.2 Common Migrations

FromToCommand
Loose docs at rootdocs/git mv *.md docs/
Scripts at rootscripts/git mv *.py scripts/
Mixed configconfig/git mv *.json config/

References


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