Comprehensive documentation workflow for creating, generating, and maintaining technical documentation. This skill activates when users want to analyze documentation needs, generate module quickstart guides, sync docs with code changes, or consolidate scattered docs. Supports four modes - analyze (plan docs), quickstart (generate onboarding docs), update (sync with code changes), and consolidate (inventory and tidy existing docs).
A complete documentation lifecycle skill covering analysis, generation, and maintenance.
This skill activates when users:
| Mode | Purpose | When to Use |
|---|---|---|
| analyze | Plan documentation strategy | Starting fresh, auditing existing docs |
| quickstart | Generate module onboarding docs | New module needs docs, comprehensive coverage |
| update | Sync docs with code changes |
| After code changes, maintenance |
| consolidate | Inventory and tidy existing docs | Scattered, stale, or misplaced docs across the repo |
All modes end with a deterministic verification step. See the Verification section below.
If the user doesn't specify a mode, infer from context:
Intent-based classification: When selecting a mode or classifying content, use the intent classification to identify what type of documentation is needed (tutorial, how-to, explanation, reference). See references/docs-structure.md for the classification and references/principles.md P1 for the intent-first taxonomy principle.
All modes end with deterministic verification. The verification script is bundled with this skill at scripts/docs_verify.py (relative to the skill directory, NOT the target repo). Run it by reading the script content and executing it against the target repo root:
python <skill-dir>/scripts/docs_verify.py <target-repo-root>
If the script is not directly executable (e.g., the agent cannot resolve the skill directory), replicate its checks manually:
docs/AGENTS.md index is complete (references all docs/ files)docs/README.md links are validThis implements references/principles.md P3 (deterministic verification over subjective quality).
See references/deterministic-doc-tests.md for pytest-based test patterns that repos can adopt.
Purpose: Audit existing documentation and create a documentation plan.
Use when: Starting fresh, assessing documentation needs, planning what to write.
Process:
/docs directory)Output: For each proposed document:
Validation checklist (verify before finishing):
references/analyze.mdDetailed instructions: Load references/analyze.md
Purpose: Generate one-screen, high-signal onboarding docs for a module.
Use when: A module needs documentation from scratch or comprehensive refresh.
Inputs (gather from user or infer):
feature_dir: Repo-relative path to the moduletech_stack: Languages, frameworks, servicesscope: What modules are coveredknown_docs: Any existing related docsOutput location: <feature_dir>/docs/
Generated files (reading order set by tour.md reading guide):
tour.md # Quickstart + module overview (≤500 words + 1 diagram)
architecture.md # Structure with diagrams (≤5 diagrams total)
interfaces.md # Public API, events, types
data.md # Tables, cache keys, invariants (only if applicable)
exercises.md # Up to 5 learning tasks
tests.md # Only if tests exist
Diagram rules:
flowchart LR() in node textUpdated: YYYY-MM-DD below eachDetailed instructions: Load references/quickstart.md
Purpose: Sync documentation with code changes.
Use when: Code has changed and docs may be stale.
Auto-detection (in order):
Change categories:
Sub-modes:
PLAN (default): Present update report, ask which to proceed withAUTO: Execute critical and important updates automaticallyOutput format:
## Documentation Update Report
### Summary
- X files need updates
- Y new documents recommended
- Z deprecated sections to remove
### Priority Actions
#### 🔴 Critical Updates
#### 🟡 Important Updates
#### 🟢 Minor Updates
### Detailed Changes
[File-by-file instructions]
Detailed instructions: Load references/update.md
Purpose: Inventory all docs in a repo, classify each file, and produce a manifest to clean up stale, scattered, or misplaced content.
Use when: Docs have accumulated over time and need triage — finished migration plans, redundant references, human-facing content in AGENTS.md, or gaps with no doc.
Sub-modes:
PLAN (default): Produce inventory report and manifest; present before touching any filesAUTO: Execute manifest after showing itClassification: First classify each file by doc type (tutorial/how-to/explanation/reference) and audience (agent/human). Then derive the action:
docs/_archive/: Completed migration plans, one-time runbooks for finished work, superseded contentdocs/{topic}-reference.md; misplaced docsOutput format:
## Consolidation Report
### Inventory
- X files in docs/
- Y nested AGENTS.md files reviewed for misplaced content
- Z root .md files
### Manifest
#### Keep
- docs/architecture.md — accurate architecture reference
#### Archive → docs/_archive/
- docs/migration-plan-2024.md — migration complete, superseded
#### Move
- config/editor/AGENTS.md (keybindings section) → docs/editor-reference.md
#### Create
- docs/AGENTS.md — routing index for docs/
### Actions pending: N
Detailed instructions: Load references/consolidate.md
See references/principles.md for the full set of documentation principles that guide all modes.
Writing style:
Frontmatter: All generated docs/*.md content files get simplified YAML frontmatter. AGENTS.md files are routing indexes and do not require frontmatter -- agents auto-discover them by convention.
---