sync-docs
Check docs/ai/ spec files and ADRs for inconsistencies with the codebase, then fix all discrepancies.
SKILL.md.claude/skills/sync-docs/SKILL.md
GitHubSync Docs with Codebase
Scan all documentation in docs/ai/ for inconsistencies with the actual codebase, then fix all discrepancies so docs match the implementation.
Scope
Check and fix these doc files:
Root docs
README.md— project description, feature list, tech stack, project structure
AI / internal docs (docs/ai/)
CLAUDE.md— project description, build commands, conventions, key architecture notesdocs/ai/BACKLOG.md— check completed items against code, remove if donedocs/ai/architecture.md— ADR statuses, component list, directory structure, commandsdocs/ai/overview.md— current state, non-goalsdocs/ai/sequencer-spec.md— Pattern/Track/Trig interfaces, playback behaviordocs/ai/audio-interface.md— WorkletCommand, WorkletPattern, WorkletTrig, Engine APIdocs/ai/sound-design.md— voice params, paramDefs ranges/defaultsdocs/ai/ui-design.md— component descriptions, layout, mobile viewsdocs/ai/glossary.md— term accuracy, missing termsdocs/ai/DATA_MODEL.md— Song/Pattern/Cell/Track/Trig interfaces, relationships, mermaid ERD entity fields and classDiagram runtime state fieldsdocs/ai/MESSAGE_FLOW.md— WorkletCommand flow, message protocol, signaling, mermaid sequence diagram function namesdocs/ai/adr/INDEX.md— ADR statuses (Implemented vs actual state)- All ADR files marked as "Implemented" in INDEX.md — check against code
Site docs (site/src/content/docs/)
- All
.mdxfiles undersite/src/content/docs/docs/(EN) andsite/src/content/docs/ja/docs/(JA) — tutorials, feature guides, getting-started pages - Feature descriptions must match current implementation (e.g. number of FX slots, available parameters, signal flow)
- EN and JA versions must stay in sync with each other
App help (src/lib/components/SidebarHelp.svelte)
- Help card text — feature descriptions, parameter lists, workflow descriptions
Process
Phase 1: Discover inconsistencies
Read all doc files listed above.
Cross-reference with codebase by reading/grepping these key source files:
src/lib/types.ts— Song, Pattern, Cell, Trig, Track interfacessrc/lib/state.svelte.ts— reactive state shapesrc/lib/audio/engine.ts— Engine API, patternToWorklet serializationsrc/lib/audio/dsp/types.ts— WorkletCommand, WorkletPattern, WorkletTrig, WorkletInsertFxsrc/lib/audio/worklet-processor.ts— WorkletCommand handlingsrc/lib/paramDefs.ts— voice parameter definitions (names, ranges, defaults)src/lib/components/*.svelte— component names and existencesrc/lib/audio/dsp/voices.ts— voice registrysrc/lib/components/SidebarHelp.svelte— app help text
Check for these types of inconsistencies:
- Type/interface field mismatches (missing fields, wrong field names, wrong types)
- Mermaid diagrams: treat
erDiagramentity fields andclassDiagramclass fields as structured data — compare every field name, type, and description 1:1 against the source TypeScript interfaces (DATA_MODEL.md ERD vstypes.ts, classDiagram vsstate.svelte.ts, MESSAGE_FLOW.md sequence diagrams vs actual function names inscenePlayback.ts/engine.ts) - Wrong parameter ranges or defaults in docs vs paramDefs.ts
- Components mentioned in docs that don't exist, or existing components not documented
- ADR status mismatches (doc says PROPOSED but feature is implemented, or vice versa)
- Removed/renamed features still documented
- Missing documentation for implemented features
- Stale line-number references to source files
Phase 2: Fix all issues
Use TodoWrite to create a task list of all fixes needed.
Apply fixes using Edit tool for each doc file. Rules:
- Always update docs to match the code (code is the source of truth)
- Keep the existing doc style and structure
- Write docs in English (matching CLAUDE.md convention)
- Don't add unnecessary content — only fix what's wrong or missing
- For ADR status changes, also update
docs/ai/adr/INDEX.md
Output a summary of all changes made:
## Docs Sync Summary
### [filename]
- [description of fix applied]
### No changes needed
- [filename] — already consistent
Guidelines
- Use parallel Agent tools to speed up codebase exploration
- Be thorough — check every interface field, every param range, every component reference
- Code is always the source of truth; docs adapt to match code
- Preserve existing doc formatting and structure where possible