================================================================================ CONTENT-AS-CODE METADATA SYSTEM SPECIFICATION Complete Delivery Package ================================================================================ Created: November 4, 2025 Location: /templates/roadcrew/memory-bank/requirements/source-docs/content-as-code-metadata/ Total Size: 72 KB Total Lines: 2,027 Status: READY FOR REVIEW ================================================================================ DELIVERABLES (4 Files) ================================================================================ 1. INDEX.md (8.3 KB) - Quick reference guide - Reading paths (quick, standard, deep) - Use-case specific recommendations - FAQ navigation - Implementation checklist 2. README.md (6.6 KB) - Executive overview - Key concepts explained - Implementation roadmap (4 phases, 10-15 hours) - Complete workflow example - Success metrics (before/after comparison) 3. SPECIFICATION.md (25 KB) - 14 detailed sections - System architecture - 5 data file formats with examples - Frontmatter schema - Metadata resolver algorithm (pseudocode) - 4 rendering formats (Markdown, HTML, JSON, GitHub) - Publishing pipeline - Validation rules - Test scenarios - Migration path - Success metrics 4. ARCHITECTURE-DIAGRAMS.md (21 KB) - 12 ASCII architecture diagrams: 1. Metadata resolution cascade (5-layer hierarchy) 2. Directory structure hierarchy 3. Data file dependencies 4. Publishing pipeline 5. Rendering format decision tree 6. Metadata inheritance example 7. Reference resolution flow 8. Validation & quality checks 9. Content lifecycle (Draft → Deprecated → Archived) 10. Build time vs runtime processing 11. Publishing safety (internal-only stripping) 12. System interaction map ================================================================================ KEY FEATURES ================================================================================ ✅ Metadata Inheritance (5-layer cascading) - Global defaults → Scope → Type → File → References - Reduces metadata per-file by 50-80% ✅ Data File References (Single Source of Truth) - authors.yml, licenses.yml, tags.yml - Edit once, updates everywhere ✅ Programmatic Rendering (4 output formats) - Markdown (navigation breadcrumbs) - HTML (with meta tags) - JSON (API access) - GitHub Issues (automated) ✅ Publishing Safety (Automatic Sanitization) - internal_only: true files excluded from dist/ - Sensitive metadata stripped - No manual review needed ✅ Version-Controlled (No Database) - Git as source of truth - Full audit trail - Change history preserved ================================================================================ IMPLEMENTATION TIMELINE ================================================================================ Phase 1: Foundation (2-3 hours) - Metadata resolver with cascading - Reference resolution (author, license, tags) - Validation framework - 90%+ test coverage Phase 2: Rendering (3-4 hours) - Markdown, HTML, JSON renderers - Metadata footer injection - Navigation generation - 85%+ test coverage Phase 3: Integration (2-3 hours) - Integrate into command pipeline - Template generation with metadata - Publishing respects metadata flags Phase 4: Commands (2-3 hours) - /validate-metadata - /render-content (formats: markdown, html, json) - /audit-metadata - /update-defaults Total: 10-15 hours spread over 2-3 weeks ================================================================================ SUCCESS METRICS ================================================================================ Metadata Duplication: 50-80% → <5% Author Name Consistency: Varies → 100% Copyright Updates: Manual 640 files → 1 file Publishing Safety: Manual review → Automatic Content Reusability: 1 format → 4+ formats Build Time (metadata): N/A → <2s Test Coverage: N/A → 90%+ ================================================================================ WHO SHOULD READ WHAT ================================================================================ Architects & PMs: → README.md (overview + roadmap) → SPECIFICATION.md (sections 1-3) → ARCHITECTURE-DIAGRAMS.md (all diagrams) Developers (Phase 1): → SPECIFICATION.md (sections 4-6) → ARCHITECTURE-DIAGRAMS.md (diagrams 1, 3, 7) → Test scenarios (section 10.2) Developers (Phase 2): → SPECIFICATION.md (section 7) → ARCHITECTURE-DIAGRAMS.md (diagrams 5, 12) → Examples (section 11) DevOps/Publishing: → SPECIFICATION.md (section 8) → ARCHITECTURE-DIAGRAMS.md (diagrams 4, 11) Quick Reference: → INDEX.md (all sections) ================================================================================ NEXT STEPS ================================================================================ 1. REVIEW - Read INDEX.md for orientation - Choose appropriate reading path - Review architecture diagrams 2. FEEDBACK - Any changes to approach? - Approve design direction? - Questions on implementation? 3. APPROVAL - Architecture review → approval - Prioritize Phase 1 in roadmap - Assign to development team 4. IMPLEMENTATION - Phase 1: Foundation (foundation for all) - Phase 2: Rendering (enables content reuse) - Phase 3: Integration (hooks into Roadcrew) - Phase 4: Commands (customer access) ================================================================================ DOCUMENT QUALITY ================================================================================ Specification Completeness: 100% (all sections covered) Code Examples: 15+ (pseudocode + YAML) Diagrams: 12 ASCII art diagrams Tables: 10+ reference tables Cross-References: All internal + external links Test Coverage Target: 90%+ (Phase 1-3) Estimated Read Time: 15 min (quick) → 90 min (deep) ================================================================================ NOTES FOR TEAM ================================================================================ This specification is: ✓ Engineering-ready (can implement immediately) ✓ Self-contained (all details in one folder) ✓ Backward-compatible (existing files still work) ✓ Non-breaking (additive implementation) ✓ Production-safe (validation prevents leaks) This specification is NOT: ✗ Implementation code (just design + requirements) ✗ Database schema (Git-backed, no DB needed) ✗ Customer-facing (internal architecture doc) ✗ Real-time system (build-time processing only) ================================================================================ CONTACT & QUESTIONS ================================================================================ Questions on specification? → See FAQ in README.md → Check INDEX.md (Questions While Reading section) Questions on implementation? → SPECIFICATION.md has pseudocode examples → ARCHITECTURE-DIAGRAMS.md shows data flow → Section 6 details resolver algorithm → Section 7 details rendering formats Ready to start Phase 1? → Contact development team → Schedule kickoff meeting → Review SPECIFICATION.md sections 4-6 ================================================================================ DOCUMENT STATUS ================================================================================ Version: 1.0 Status: DRAFT (ready for team review) Created: November 4, 2025 Last Updated: November 4, 2025 Author: Sam Henry Review Status: Pending architecture review Approval Gate: Architecture approval → Phase 1 kickoff Ready for: Team review → Architecture approval → Implementation ================================================================================