Generate documentation with Diátaxis framework. Public APIs must have JSDoc. Every doc lives in one quadrant.
Generate documentation with Diátaxis quadrant enforcement. Public APIs MUST be documented. Every document MUST live in exactly one quadrant.
No arguments? Describe this skill and stop. Do not execute.
mkdir -p .claude && echo '{"skill":"doc-code","started":"'$(date -Iseconds)'"}' > .claude/active-workflow.json
Write documentation a master craftsperson would be proud of.
Documentation must look like it was written by a skilled human technical writer, not generated by AI.
@param name - the name)Test: Would someone learn something from this doc they couldn't infer from the code? If not, cut it.
Every document you write or update MUST belong to exactly one quadrant:
PRACTICAL THEORETICAL
┌──────────────────────┬──────────────────────┐
LEARNING │ TUTORIALS │ EXPLANATION │
│ "Follow me as I │ "Here's why this │
│ show you how" │ works this way" │
├──────────────────────┼──────────────────────┤
WORKING │ HOW-TO │ REFERENCE │
│ "Here's how to │ "Here's the │
│ accomplish X" │ specification" │
└──────────────────────┴──────────────────────┘
| Output Type | Quadrant | Rules |
|---|---|---|
| JSDoc/TSDoc | Reference | Complete, consistent, example for every public item |
| README usage sections | How-To | Task-oriented, assumes competence, starts with the goal |
docs/tutorials/ | Tutorial | Step-by-step, no choices, no theory digressions |
| Architecture/design docs | Explanation | Discusses why, alternatives, trade-offs |
Reference (JSDoc, API docs):
How-To (README usage, guides):
Tutorial (getting-started, walkthroughs):
Explanation (architecture, design docs):
You MUST do these documentation tasks. Not "consider" - DO:
.claude/canon/docs/SKILL.md to internalize the full canon (quadrants, anti-patterns, quality checklist)## Documentation: [target]
DOCUMENTED:
- src/service.ts: 5 functions with JSDoc (Reference)
- src/types.ts: 3 types with field comments (Reference)
- README.md: Added "Usage" section (How-To)
PUBLIC_APIS_DOCUMENTED: N
README_UPDATED: yes/no
COMMENTS_ADDED: N
DIATAXIS_QUADRANTS_CLEAN: yes/no
MIXED_QUADRANT_VIOLATIONS: N
APPLIED:
- [expert]: [decision]
DOC_COMPLETE
After documenting:
Your turn ends here. Output DOC_COMPLETE and STOP.