Two workflows: docs sync (keep written docs up to date with source) and codemaps (generate token-lean architecture snapshots for AI context).
Docs sync
See docs-sync.md for full steps.
Summary:
- Identify sources of truth (
package.json,.env.example, route files, Dockerfile) - Generate script reference, env variable table, contributing guide, and runbook from those sources
- Flag docs not modified in 90+ days for review
- Report what was updated, created, or skipped
Rules:
- Always generate from code, never manually edit generated sections
- Wrap generated sections with
<!-- AUTO-GENERATED -->markers - Preserve hand-written prose — only update generated sections
- Don't create new doc files unless explicitly requested
Codemaps
See codemaps.md for full steps.
Summary:
- Scan project structure and entry points
- Create/update
docs/CODEMAPS/witharchitecture.md,backend.md,frontend.md,data.md,dependencies.md - If changes > 30% from previous codemaps, show diff and request approval before overwriting
- Add freshness header to each file; save a diff report to
.reports/codemap-diff.txt
Tips:
- Focus on high-level structure, not implementation details
- Keep each codemap under 1000 tokens
- Use ASCII diagrams for data flow