Documentation Skill
This skill helps write documentation by intelligently choosing the right format based on what's being documented.
Workflow
Step 1: Gather Context
Ask the user: "What do you want to document?"
Get a clear understanding of:
- •The topic or decision to document
- •Any related code or features
- •The intended audience
Step 2: Determine Documentation Type
Apply this ADR Detection Checklist. If 2+ of these are true, this is an ADR:
- • Making a choice between multiple technical approaches
- • Decision has long-term implications for the codebase
- • There are clear trade-offs to document
- • Decision affects external dependencies (libraries, tools, services)
- • Future developers might question why this choice was made
- • The decision cannot easily be reversed
If uncertain, ask clarifying questions:
- •"Are you choosing between multiple approaches?"
- •"Will this decision affect how we build things in the future?"
- •"Are there trade-offs or alternatives worth documenting?"
Step 3A: ADR Path (Architecture Decision Record)
If this IS an architectural decision:
- •
Auto-number: Scan
docs/decisions/to find the next sequential numberbashls docs/decisions/*.md | sort -r | head -1
- •
Gather information for each MADR section:
- •Context and Problem Statement (what problem are we solving?)
- •Decision Drivers (what factors matter most?)
- •Considered Options (what alternatives exist?)
- •Decision Outcome (what did we choose and why?)
- •Consequences (good, bad, and neutral impacts)
- •Confirmation (how will we verify this works?)
- •
Research if needed: Use WebFetch to gather information about options
- •
Generate ADR using the template at templates/adr.md
- •
Write file:
docs/decisions/NNNN-descriptive-title.md- •Use lowercase with hyphens
- •Title should be action-oriented (e.g., "use-redis-for-caching")
Step 3B: Non-ADR Path (Other Documentation)
If this is NOT an architectural decision, classify the documentation type.
See guides/doc-types.md for the full reference.
Quick classification:
| If documenting... | Then use... | Location |
|---|---|---|
| New feature/capability | README update | README.md |
| Architecture/data models | Technical spec | docs/technical-spec.md |
| Product vision/workflows | Product docs | docs/product-overview.md |
| How to do something | Guide | docs/<name>.md |
| Function/component API | Code comments | In the source file |
| Version changes | CHANGELOG | CHANGELOG.md |
For each type:
- •Read the existing document to understand its style
- •Find the appropriate section or create a new one
- •Match the existing formatting and tone
- •Use Edit tool to update (preferred) or Write for new files
Step 4: Review with User
After generating the documentation:
- •Show the draft to the user
- •Ask for feedback
- •Make revisions as requested
- •Confirm final placement
Key Principles
- •Match existing style: Always read existing docs first and follow their patterns
- •Be concise: Technical documentation should be scannable
- •Include examples: Code snippets and concrete examples help understanding
- •Link related docs: Reference other documentation when relevant
- •Audience awareness: Consider who will read this (developers, users, AI agents)
Project-Specific Conventions
This project uses:
- •
docs/decisions/for ADRs (MADR format without YAML frontmatter) - •
docs/for technical and product documentation - •
CLAUDE.mdfor AI-specific guidance - •
AGENTS.mdfor workflow instructions