Repository Documentation Policy¶
๐ฏ Purpose¶
This policy ensures all user-facing documentation is properly organized in the docs/ structure for MkDocs integration and prevents broken links from scattered documentation files.
๐ Business Model Self-Containment Principle¶
๐ Each Model = Complete Functional Unit¶
Business models represent MAJOR functionality additions and should be completely self-contained:
- All model-related code (agents, FSM definitions, configuration)
- All model-specific documentation (workflows, specifications, status)
- All model setup data (templates, sample configurations)
- All model tests (unit tests, scenario tests, integration tests)
- Model-specific diagrams (state diagrams, interaction flows)
๐ Cross-Reference Pattern¶
Models should reference platform architecture docs in docs/ for:
- Shared design patterns and principles
- Platform-wide architectural guidelines
- Common development practices
- Integration patterns with other system components
Example: models/bss/README.md links to docs/architecture/fsm-duality-framework.md for FSM implementation guidelines.
๐ Documentation Organization Rules¶
โ REQUIRED: All Served Documentation in docs/¶
- All user-facing documentation MUST be in
docs/structure - MkDocs navigation is built from
docs/content only - No documentation should exist outside
docs/that needs to be publicly accessible
๐๏ธ Standard Directory Structure¶
docs/
โโโ index.md # Homepage (replaces README.md in docs)
โโโ architecture/ # Platform architecture documentation
โโโ business/ # Business model documentation
โโโ design/ # Design specifications and guides
โโโ developer/ # Quick start and developer overview
โโโ developer-guides/ # Detailed developer guides
โโโ diagrams/ # Architectural diagrams and analysis
โโโ archived/ # Legacy/deprecated documentation
models/ # Business model implementations (SELF-CONTAINED)
โโโ bss/ # Battery Swap Service (complete model)
โ โโโ README.md # Model overview and documentation
โ โโโ model-status.md # Implementation status
โ โโโ bss-agent-v2.ts # Agent implementation
โ โโโ bss-fsm-v1.json # FSM definitions
โ โโโ design-intent/ # Business logic and workflows
โ โโโ setup-data/ # Configuration files
โ โโโ tests/ # Model-specific tests
โ โโโ diagrams/ # Model-specific diagrams
โโโ [future-models]/ # Additional business models
๐ซ PROHIBITED: Documentation Outside docs/¶
- No markdown files for user documentation outside
docs/ - Ad-hoc documentation in root directory
- Duplicate documentation in multiple locations
- Development notes mixed with user documentation
๐ File Classification Guidelines¶
โ Belongs in docs/ (Platform Documentation)¶
- Platform architecture specifications
- Cross-model design patterns
- Developer guides and tutorials
- Platform API documentation
- System overviews
- Infrastructure documentation
- Platform-wide reference materials
โ Belongs in models/ (Business Model Implementation)¶
- Model-specific documentation (README.md, model-status.md)
- Business logic specifications
- Model implementation code
- Model-specific workflows and design intent
- Model configuration and setup data
- Model-specific tests and diagrams
- Model interaction patterns
๐ซ Does NOT belong in docs/ (Keep in repo root or other locations)¶
README.md(repository overview - stays in root)- Setup/installation scripts
- Deployment instructions for internal use
- Development environment setup
- Temporary communication files
- Personal notes and drafts
- Build/CI configuration documentation
- Internal team processes
๐ง Implementation Guidelines¶
When Adding New Documentation¶
- Determine audience: Public users vs. internal developers
- Choose proper location:
docs/for public, appropriate directory for internal - Follow naming conventions: Use descriptive, lowercase-with-hyphens names
- Update navigation: Add to
mkdocs.ymlnav structure if public-facing - Cross-reference properly: Use relative links within
docs/structure
When Moving Existing Documentation¶
- Check for references: Search for links to the file before moving
- Update all cross-references: Fix broken links after moving
- Test build: Ensure MkDocs builds without warnings
- Remove duplicates: Delete redundant copies
Link Management¶
- Use relative paths within
docs/structure:../architecture/overview.md - Test all links regularly with MkDocs build
- No absolute paths to internal repository files
- Update links when restructuring files
๐ ๏ธ Enforcement Tools¶
Automated Checks¶
- MkDocs build process will fail on broken links
- GitHub Actions can validate documentation structure
- Link checkers can identify orphaned files
Manual Reviews¶
- Regular audits of markdown files outside
docs/ - Review process for new documentation
- Periodic cleanup of obsolete files
๐งน Cleanup Procedures¶
When Files Are Found Outside docs/¶
- Evaluate purpose: Is this user-facing documentation?
- If yes: Move to appropriate
docs/subdirectory - If no: Delete if obsolete, or keep in appropriate location
- Update references: Fix any broken links
- Test build: Ensure documentation still builds correctly
Duplicate File Resolution¶
- Compare content: Identify the most current version
- Choose canonical location: Prefer
docs/version for user content - Delete duplicates: Remove redundant copies
- Update links: Point all references to canonical location
๐ Quality Metrics¶
Success Indicators¶
- โ MkDocs builds without link warnings
- โ No documentation files outside appropriate locations
- โ Clear navigation structure in published documentation
- โ No duplicate content across multiple files
Regular Maintenance¶
- Monthly review of files outside
docs/ - Quarterly cleanup of obsolete documentation
- Immediate fix of any broken links reported by MkDocs
- Team education on proper documentation placement
๐ Migration Completed¶
Removed Files (2025-01-06)¶
The following ad-hoc files were removed during the initial consolidation:
- _sidebar.md - Legacy navigation (not used by MkDocs)
- mkdocs-setup.md - Setup instructions (internal documentation)
- SHAREPOINT_*.md and TEAMS_*.md - Deployment guides (internal processes)
- diagrams/ERD_SCHEMA_COMPARISON.md - Duplicate content (canonical version in docs/diagrams/)
Models Directory Restored (2025-01-06)¶
The models/ directory was initially moved to docs/models/ but has been restored to its original location following the business model self-containment principle:
- models/bss/ - Complete Battery Swap Service implementation with all documentation, code, and configuration
- MkDocs navigation updated to reference ../models/ for model documentation
- Each business model remains a self-contained functional unit
Current State¶
- โ
Platform documentation centralized in
docs/ - โ
Business models self-contained in
models/ - โ MkDocs builds without link warnings
- โ Clean separation between platform and model documentation
- โ Cross-references between platform docs and model implementations
๐ Contact¶
For questions about documentation organization or policy violations, please create an issue in the repository or contact the documentation maintainers.