Documentation Skill
Core Philosophy
"Docs that stay in sync with code and intent."
Write documentation that is accurate, scannable, and updated when behavior changes. Prefer living docs over one-off writeups.
Protocol
1. Identify Type
| Type |
Use for |
Location / format |
| README |
Project overview, setup, usage |
Root README.md |
| API docs |
Endpoints, params, responses |
OpenAPI/Swagger, or docs/api.md |
| ADR |
Architecture decisions and rationale |
docs/adr/ or context/adr/ |
| Inline |
Public APIs, non-obvious logic |
Code comments, docstrings |
| Runbook |
Operational procedures |
docs/runbooks/ or docs/ops/ |
2. Conventions
- README: Quick start, prerequisites, install, run, test, contribute. Keep under ~200 lines; link to detailed docs.
- API docs: Method/path, request/response shape, errors, examples. Prefer OpenAPI when the project uses it.
- ADR: Context, decision, consequences. One file per decision; number and date in filename.
- Inline: Explain why, not what. Docstrings for public functions/classes; avoid noise on trivial code.
- Runbook: Steps, checks, rollback, contacts. Assume someone unfamiliar can follow.
3. Commands
No mandatory commands. Use project structure: if docs/ or CONTRIBUTING.md exists, follow existing layout and style.
4. MCP (Atlassian Confluence)
When documentation lives in Confluence or the user wants to sync with Confluence, use the Atlassian MCP (after /setup) to fetch pages, search with CQL, and create/update content. Key tools:
confluence_search - Search Confluence content using simple terms or CQL
confluence_get_page - Get content of a specific page by ID or title+space
confluence_create_page - Create a new page in a space (supports Markdown)
confluence_update_page - Update an existing page
confluence_get_page_children - Get child pages for navigation
confluence_get_comments - Get comments on a page
confluence_add_comment - Add a comment to a page
Ensure /setup has been run so Atlassian MCP is configured.
5. Output
When adding or updating docs, provide the content and say what was created/updated. If the project has a docs style guide, follow it.
6. ADR (Architecture Decision Record) Structure
When writing ADRs, follow this structure:
# ADR-NNN: [Decision Title]
**Date:** YYYY-MM-DD
**Status:** Proposed | Accepted | Deprecated | Superseded by ADR-NNN
## Context
[What is the issue or situation that motivates this decision?]
## Decision
[What is the decision that was made?]
## Consequences
**Positive:**
- [Benefits of this decision]
**Negative:**
- [Trade-offs and costs]
**Neutral:**
- [Other implications]
Number ADRs sequentially. Store in docs/adr/ or context/adr/. Reference from plans and summaries when relevant.
7. API Versioning Documentation
When documenting APIs with versioning:
- Document the versioning strategy (URL path
/v1/, header Accept-Version, query param).
- Mark deprecated endpoints clearly with sunset dates.
- Provide migration guides when upgrading between API versions.
- Include changelog per version showing what changed.
8. Documentation During Refactoring
When code is refactored, update affected documentation:
- README - Update if installation, usage, or API examples changed.
- API docs - Regenerate or update if endpoints/models changed.
- Inline comments - Remove or update stale comments; don't leave misleading docs.
- ADR - Write a new ADR if the refactoring represents an architectural decision.
9. Cross-Skill Integration
| Situation |
Skill to invoke |
| Documenting API changes |
architect skill (for tech spec) |
| Writing architectural decisions |
Use ADR format above |
| Syncing docs to Confluence |
Use Atlassian MCP tools (after /setup) |
| Code needs inline documentation |
code-reviewer can flag gaps |
Checklist
1---2name: documentation3description: Write and update documentation: README, API docs, ADRs, inline docs, and runbooks. Use when the user asks to document this, update README, write API docs, write ADR, or add inline documentation.4---56# Documentation Skill78## Core Philosophy910**"Docs that stay in sync with code and intent."**1112Write documentation that is accurate, scannable, and updated when behavior changes. Prefer living docs over one-off writeups.1314---1516## Protocol1718### 1. Identify Type1920| Type | Use for | Location / format |21| ------------ | ------------------------------------ | --------------------------------- |22| **README** | Project overview, setup, usage | Root `README.md` |23| **API docs** | Endpoints, params, responses | OpenAPI/Swagger, or `docs/api.md` |24| **ADR** | Architecture decisions and rationale | `docs/adr/` or `context/adr/` |25| **Inline** | Public APIs, non-obvious logic | Code comments, docstrings |26| **Runbook** | Operational procedures | `docs/runbooks/` or `docs/ops/` |2728### 2. Conventions2930- **README**: Quick start, prerequisites, install, run, test, contribute. Keep under ~200 lines; link to detailed docs.31- **API docs**: Method/path, request/response shape, errors, examples. Prefer OpenAPI when the project uses it.32- **ADR**: Context, decision, consequences. One file per decision; number and date in filename.33- **Inline**: Explain why, not what. Docstrings for public functions/classes; avoid noise on trivial code.34- **Runbook**: Steps, checks, rollback, contacts. Assume someone unfamiliar can follow.3536### 3. Commands3738No mandatory commands. Use project structure: if `docs/` or `CONTRIBUTING.md` exists, follow existing layout and style.3940### 4. MCP (Atlassian Confluence)4142When documentation lives in Confluence or the user wants to sync with Confluence, use the **Atlassian MCP** (after **/setup**) to fetch pages, search with CQL, and create/update content. Key tools:4344- `confluence_search` - Search Confluence content using simple terms or CQL45- `confluence_get_page` - Get content of a specific page by ID or title+space46- `confluence_create_page` - Create a new page in a space (supports Markdown)47- `confluence_update_page` - Update an existing page48- `confluence_get_page_children` - Get child pages for navigation49- `confluence_get_comments` - Get comments on a page50- `confluence_add_comment` - Add a comment to a page5152Ensure **/setup** has been run so Atlassian MCP is configured.5354### 5. Output5556When adding or updating docs, provide the content and say what was created/updated. If the project has a docs style guide, follow it.5758### 6. ADR (Architecture Decision Record) Structure5960When writing ADRs, follow this structure:6162```markdown63# ADR-NNN: [Decision Title]6465**Date:** YYYY-MM-DD66**Status:** Proposed | Accepted | Deprecated | Superseded by ADR-NNN6768## Context6970[What is the issue or situation that motivates this decision?]7172## Decision7374[What is the decision that was made?]7576## Consequences7778**Positive:**79- [Benefits of this decision]8081**Negative:**82- [Trade-offs and costs]8384**Neutral:**85- [Other implications]86```8788Number ADRs sequentially. Store in `docs/adr/` or `context/adr/`. Reference from plans and summaries when relevant.8990### 7. API Versioning Documentation9192When documenting APIs with versioning:9394- **Document the versioning strategy** (URL path `/v1/`, header `Accept-Version`, query param).95- **Mark deprecated endpoints** clearly with sunset dates.96- **Provide migration guides** when upgrading between API versions.97- **Include changelog per version** showing what changed.9899### 8. Documentation During Refactoring100101When code is refactored, update affected documentation:102103- **README** - Update if installation, usage, or API examples changed.104- **API docs** - Regenerate or update if endpoints/models changed.105- **Inline comments** - Remove or update stale comments; don't leave misleading docs.106- **ADR** - Write a new ADR if the refactoring represents an architectural decision.107108### 9. Cross-Skill Integration109110| Situation | Skill to invoke |111|-----------|----------------|112| Documenting API changes | **architect** skill (for tech spec) |113| Writing architectural decisions | Use ADR format above |114| Syncing docs to Confluence | Use **Atlassian MCP** tools (after `/setup`) |115| Code needs inline documentation | **code-reviewer** can flag gaps |116117---118119## Checklist120121- [ ] Matches current behavior (no outdated steps or APIs).122- [ ] Scannable (headings, lists, code blocks where useful).123- [ ] Links to related docs or code when helpful.124- [ ] No duplicate info across README and other docs; cross-reference instead.125- [ ] ADRs follow standard structure (Context, Decision, Consequences).126- [ ] Deprecated APIs marked with sunset dates and migration guides.127- [ ] Documentation updated alongside code refactoring.