skills/documenting-projects/SKILL.md
Use when generating, improving, or auditing project documentation. Triggers: 'document this project', 'write docs', 'generate documentation', 'docs are outdated', 'need a README', 'create tutorials', 'API reference docs', 'doc audit', 'documentation review', '/document-project'. Standalone README: use /write-readme. NOT for: code changes (use develop), code review (use code-review), or research (use deep-research).
npx skillsauth add axiomantic/spellbook documenting-projectsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Announce: "Using documenting-projects skill for documentation generation."
<ROLE> Documentation Architect. Your reputation depends on documentation that readers cannot distinguish from the best human-authored OSS docs. Generated docs that "smell like AI" are a career-ending failure. </ROLE><BEHAVIORAL_MODE> ORCHESTRATOR: Dispatch subagents via Task tool for ALL documentation work. Each subagent invokes its phase command via the Skill tool (e.g., Skill("docs-audit")). Never write documentation directly. Never invoke phase commands directly from the orchestrator. Context should contain only Task dispatches, user communication, and phase transitions. </BEHAVIORAL_MODE>
<analysis> Before starting: What is the project? Does it have existing docs? What is the user's goal (new docs from scratch, improve existing, audit only)? Check for existing doc-state files to determine if this is a continuation or fresh run. </analysis> <reflection> After completing: Did all 4 phases execute? Did the quality gate pass? Are there unresolved iteration loops? Were any phases skipped with user consent? Is the doc-state directory clean? </reflection>| Phase | Command | Purpose | MVP |
|-------|---------|---------|-----|
| 1 | /docs-audit | Project analysis, gap identification | Yes |
| 2 | /docs-plan | TOC, tooling, tone assignment | Yes |
| 3 | /docs-write | Section generation with tone profiles | Yes |
| 4 | /docs-review | 8-criterion quality gate | Yes |
/docs-audit --> audit-result.json --> /docs-plan --> plan.json --> /docs-write --> written-manifest.json --> /docs-review
^ |
+---- sections-filter.json <-------------+
(iteration loop, max 2)
Execute: Dispatch subagent via Task tool. Subagent invokes Skill("docs-audit").
Outputs:
doc-state/audit-result.json (DocsAuditResult)Self-Check:
Execute: Dispatch subagent via Task tool. Subagent invokes Skill("docs-plan").
Outputs:
doc-state/plan.json (DocsPlan)Self-Check:
Execute: Dispatch subagent via Task tool. Subagent invokes Skill("docs-write").
When sections-filter.json exists (iteration from Phase 4), pass it to the subagent.
The writing phase regenerates only the specified sections and merges into the existing manifest.
Outputs:
doc-state/written-manifest.json (DocsWritten)Self-Check:
Execute: Dispatch subagent via Task tool. Subagent invokes Skill("docs-review").
Outputs:
doc-state/review-result.json (DocsReview)Self-Check:
overall_pass == true: announce completion, offer hosting configoverall_pass == false and iteration_count < 2: write sections-filter.json, re-dispatch Phase 3 (/docs-write), then re-dispatch Phase 4 (/docs-review)overall_pass == false and iteration_count >= 2: escalate to userWhen user says "write a README", "create README", "update README", or invokes /write-readme:
/write-readme command directlyThe /write-readme command performs its own lightweight project analysis and generates
a README with progressive disclosure structure. Use it for single-file README work.
All phase outputs are stored as JSON at ~/.local/spellbook/docs/{project-encoded}/doc-state/:
| Command | Reads | Writes |
|---------|-------|--------|
| /docs-audit | (none) | audit-result.json |
| /docs-plan | audit-result.json | plan.json |
| /docs-write | plan.json, sections-filter.json (optional) | written-manifest.json |
| /docs-review | written-manifest.json, plan.json | review-result.json |
Iteration state: When /docs-review identifies failing sections, it writes
sections-filter.json (a string[] of output paths to regenerate). The orchestrator then re-dispatches /docs-write, which reads sections-filter.json to regenerate only those sections.
Each phase checks whether its output file already exists at the doc-state path. If found, present to the user: "Previous [phase] results found at [path]. Reuse existing results or regenerate?"
| Gate | Threshold | Bypass | |------|-----------|--------| | Audit completeness | All fields populated | Never | | TOC user approval | Explicit confirmation | Never | | Build config validity | Config file parses without error | Never | | Section generation | All MVP sections written | Never | | Quality review (8 criteria) | All 8 pass | User consent after 2 iterations | | Fact-checking (claims) | No false claims in docs | Never |
The 8 quality criteria evaluated in Phase 4:
| # | Criterion | Pass Condition | |---|-----------|----------------| | 1 | Banned phrase detection | Zero matches against anti-ai-tone.md | | 2 | Code example validity | Language tags, non-empty, language matches project | | 3 | Build config validity | Zero errors from build tool | | 4 | Diataxis compliance | No type mixing, correct structure per type | | 5 | Narrative cohesion | Consistent tense, transitions, no orphan sections | | 6 | Tone consistency | Vocabulary density and code ratio match profile | | 7 | Coverage | All MVP sections generated or explicitly skipped | | 8 | Cross-reference validity | Zero broken references or unresolved placeholders |
Each Task dispatch MUST specify a strict JSON result schema.
Explore agent (audit phase):
{
"language": "string",
"framework": "string",
"build_tool_recommendation": "string",
"existing_docs": [{"path": "string", "type": "string", "quality": "string", "staleness": "string"}],
"api_surface": {"modules": ["string"], "coverage": "number"},
"gaps": ["string"]
}
Writing subagent:
{
"files_written": [{"path": "string", "diataxis_type": "string", "tone_profile": "string", "word_count": "number", "last_verified_date": "string"}]
}
Review subagent:
{
"results": [{"criterion": "string", "passed": "boolean", "details": "string", "file": "string"}],
"overall_pass": "boolean"
}
Fact-checking subagent:
{
"claims": [{"claim": "string", "verdict": "verified | unverified | false", "evidence": "string"}]
}
Phase 1: Dispatch subagent -> Skill("docs-audit") -> verify audit-result.json exists
Phase 2: Dispatch subagent -> Skill("docs-plan") -> verify plan.json exists
Phase 3: Dispatch subagent -> Skill("docs-write") -> verify written-manifest.json exists
Phase 4: Dispatch subagent -> Skill("docs-review") -> check overall_pass
If !overall_pass && iteration < 2:
docs-review writes sections-filter.json from failing_sections
Re-dispatch Phase 3 (docs-write reads sections-filter.json)
Re-dispatch Phase 4 (docs-review)
If !overall_pass && iteration >= 2:
Escalate to user with specific failures
User decides: accept with known issues OR manual fix
If overall_pass:
Announce completion
Offer hosting config (GitHub Pages, ReadTheDocs, Netlify)
Tier 1 (MVP): README + Tutorials + Reference + MkDocs build tool.
| Tier | Adds | Status | |------|------|--------| | 1 | README, Tutorials, Reference, MkDocs | Current | | 2 | How-to Guides, Explanation pages, Sphinx support | Future | | 3 | Docusaurus support, versioned docs, API auto-generation | Future | | 4 | i18n, develop skill integration, CI/CD doc validation | Future |
The orchestrator dispatches subagents via the Task tool. Each subagent prompt provides CONTEXT
(project path, state file paths, user preferences) but never duplicates command instructions.
The subagent loads the command via Skill("docs-audit") etc. and follows the command's own logic.
Subagent prompts should include:
Before declaring the documentation pipeline complete:
Sources that informed this skill's design:
testing
Use when creating new skills, editing existing skills, or verifying skills work before deployment. Triggers: 'write a skill', 'new skill', 'create a skill', 'skill doesn't work', 'skill isn't firing', 'edit skill', 'skill quality'. NOT for: general prompt improvement (use instruction-engineering) or command creation (use writing-commands).
development
Use when you have a spec, design doc, or requirements and need a detailed implementation plan before coding. Triggers: 'write a plan', 'create implementation plan', 'plan this out', 'break this down into steps', 'convert design to tasks', 'implementation order'. Also invoked by develop during planning. NOT for: reviewing existing plans (use reviewing-impl-plans).
testing
Use when creating new commands, editing existing commands, or reviewing command quality. Triggers: 'write command', 'new command', 'create a command', 'review command', 'fix command', 'command doesn't work', 'add a slash command'. NOT for: skill creation (use writing-skills).
development
Use when about to claim discovery during debugging. Triggers: "I found", "this is the issue", "I think I see", "looks like the problem", "that's why", "the bug is", "root cause", "culprit", "smoking gun", "aha", "got it", "here's what's happening", "the reason is", "causing the", "explains why", "mystery solved", "figured it out", "the fix is", "should fix", "this will fix". Also invoked by debugging, scientific-debugging, systematic-debugging before any root cause claim.