---
name: documentation
description: >
Generate READMEs, API docs, changelogs, and knowledge base articles. Covers
README structure with personality, OpenAPI-based API documentation, changelogs
from conventional commits, typedoc patterns, and support KB articles.
triggers:
- "write documentation"
- "write README"
- "API documentation"
- "API docs"
- "changelog"
- "release notes"
- "knowledge base"
- "setup guide"
- "getting started"
- "project docs"
negatives:
- "API design"
- "code comments"
- "blog post"
- "technical writing prose"
license: MIT
compatibility: opencode
metadata:
version: "4.0.0"
workflow: documentation
audience: developers
allowed-tools: [read, write, edit, glob, grep, bash, webfetch]
Documentation
Write docs that developers actually read. Based on Stripe API docs, Standard Readme, Keep a Changelog, and OpenAPI.
Sub-Commands
| Command |
Description |
readme |
Generate a README from project files |
api |
Generate API docs from OpenAPI spec or route handlers |
changelog |
Generate changelog from conventional commits |
kb |
Write a knowledge base article |
README Structure
# Project Name [Badges]
> One-line description
## Features (3-6 quantified benefits)
## Quick Start — copy-paste runnable (no placeholders, no omitted imports)
## API Reference — every export in table format
## Examples — 2-3 real-world scenarios
## Configuration — env vars, config file, CLI flags
## Contributing — dev setup commands
## License — SPDX identifier
The Hook (first paragraph)
Answers: what (5 words), who, why.
Bad: "A React component library for building modern user interfaces."
Good: "Buttons, modals, forms, done right. No design debt. Zero dependencies."
Quick Start Rules
Copy-paste runnable. No omitted imports. No placeholders. No "coming soon". Include expected output.
Badge Requirements
| Badge |
Required? |
| CI (build status) |
Yes |
| Package version |
Yes |
| License |
Yes |
| Coverage |
Recommended |
API Documentation
Structure per Endpoint
### [METHOD] [Path]
**Description**: one sentence
**Auth required**: Yes/No [type]
**Request**: Headers, Parameters (path/query/body)
**Response 200**: Body with example
**Error responses**: 400, 401, 404, 500 with descriptions
Rules per Endpoint
Changelog Format
## [2.1.0] - 2026-05-16
### Added
- New feature (#PR)
### Changed
- Behavior change with migration note (#PR)
### Fixed
- Bug fix (#PR)
### Deprecated / Removed / Security
Rules: Keep a Changelog format. Every entry links to PR. Migration notes for breaking changes. Unreleased section at top. Semantic versioning. Explain WHY not just WHAT.
Knowledge Base
Article Format
Title: as a question user would search for
Context: 1-2 sentences — who, what product/feature
Steps: numbered, one action per step, action verb first
Expected result: after last step
Escalation: if it still doesn't work
Rules: One action per step. Bold UI labels exactly as they appear. Max 15 words per step. No jargon.
Production Checklist
Workflow
- Identify document type — README, API docs, changelog, or knowledge base article. Each has a distinct structure and rule set.
- Gather source material — for README: project files, package.json, build system. For API: OpenAPI spec or route handlers. For changelog: git log. For KB: product expertise.
- Apply the template — README: hook → features → quick start → API → examples → config → contributing → license. API: method → path → description → auth → request → response → errors.
- Fill every section with real data — no "TODO", "coming soon", "TBD", placeholder text. Quick start must be copy-paste runnable. API docs need curl + SDK examples.
- Verify everything — test quick start from clean environment. Check every link resolves. Confirm license badge matches LICENSE file. KB: test steps as an unfamiliar user.
- Cut the generic — remove default template comments. Strip "write unit tests" style advice. Every sentence must convey a specific convention or fact about this project.
Error Handling
| Cause |
Fix |
| Quick start commands fail from a clean environment |
Test every command from scratch. Ensure no omitted imports, no assumed global state, no missing env vars. |
| API docs missing error response codes |
Document all possible status codes for every endpoint: 400 (validation), 401 (auth), 403 (forbidden), 404 (not found), 500 (server error). |
| Changelog entry lacks migration notes for breaking changes |
Every breaking change must include: what changed, why, and the exact migration path. Link to the PR. |
| KB article steps don't produce expected result when followed |
Have someone unfamiliar with the product walk through the steps. Fix any ambiguity or missing context. |
| Links in documentation resolve to 404 or redirect |
Check every link. Prefer permalinks. Verify external links haven't moved. Use web archive as fallback for critical references. |
| README badges show incorrect or outdated status |
Verify CI badge matches current pipeline. Version badge matches latest release. Coverage badge matches current report. |
| API docs example response doesn't match actual API output |
Generate response examples from actual API output, not from spec definitions. Update when the API changes. |
| Default README template published with unfilled sections |
Remove all template comments and TODO markers before publishing. If a section has no content, omit it rather than leaving a placeholder. |
Anti-Patterns
| Anti-Pattern |
Correct |
| Default README (template unfilled) |
Remove all template comments. Fill every section. |
| "Coming soon" features |
Ship or hide. Never show unfinished. |
| Untested install instructions |
Test from scratch in clean environment. |
| API docs without examples |
Every function needs a runnable example. |
| Changelog without migration notes |
Always include migration path for breaking changes. |
| KB with no expected result |
End every step with "You should see..." |
| Example code with secrets |
Use placeholder env vars. Never real values. |
API Documentation Patterns
OpenAPI → Docs
npx @redocly/cli build-docs openapi.yaml -o docs.html
npx @scalar/api-reference openapi.yaml
README Template
- Title + one-liner, 2. Quick start (install + first command), 3. Features (bullets), 4. Architecture (diagram), 5. API (link), 6. Contributing (link), 7. License
Changelog Automation
# Generate from conventional commits
npx standard-version
npx changelogen --from v1.0.0 --to HEAD
# Keep a Changelog format
## [version] - YYYY-MM-DD
### Added | Changed | Deprecated | Removed | Fixed | Security
Sources
- Standard Readme specification
- Stripe API documentation standards
- Keep a Changelog (keepachangelog.com)
- Conventional Commits (conventionalcommits.org)
- OpenAPI Specification (openapis.org)
- Zendesk / Intercom — KB standards
Checklist
1---2name: documentation3description: ---4---5---6name: documentation7description: >8 Generate READMEs, API docs, changelogs, and knowledge base articles. Covers9 README structure with personality, OpenAPI-based API documentation, changelogs10 from conventional commits, typedoc patterns, and support KB articles.11triggers:12 - "write documentation"13 - "write README"14 - "API documentation"15 - "API docs"16 - "changelog"17 - "release notes"18 - "knowledge base"19 - "setup guide"20 - "getting started"21 - "project docs"22negatives:23 - "API design"24 - "code comments"25 - "blog post"26 - "technical writing prose"27license: MIT28compatibility: opencode29metadata:30 version: "4.0.0"31 workflow: documentation32 audience: developers33allowed-tools: [read, write, edit, glob, grep, bash, webfetch]34---353637# Documentation3839Write docs that developers actually read. Based on Stripe API docs, Standard Readme, Keep a Changelog, and OpenAPI.4041## Sub-Commands4243| Command | Description |44|---------|-------------|45| `readme` | Generate a README from project files |46| `api` | Generate API docs from OpenAPI spec or route handlers |47| `changelog` | Generate changelog from conventional commits |48| `kb` | Write a knowledge base article |4950## README Structure5152```53# Project Name [Badges]5455> One-line description5657## Features (3-6 quantified benefits)58## Quick Start — copy-paste runnable (no placeholders, no omitted imports)59## API Reference — every export in table format60## Examples — 2-3 real-world scenarios61## Configuration — env vars, config file, CLI flags62## Contributing — dev setup commands63## License — SPDX identifier64```6566### The Hook (first paragraph)6768Answers: what (5 words), who, why.6970Bad: "A React component library for building modern user interfaces."71Good: "Buttons, modals, forms, done right. No design debt. Zero dependencies."7273### Quick Start Rules7475Copy-paste runnable. No omitted imports. No placeholders. No "coming soon". Include expected output.7677### Badge Requirements7879| Badge | Required? |80|-------|-----------|81| CI (build status) | Yes |82| Package version | Yes |83| License | Yes |84| Coverage | Recommended |8586## API Documentation8788### Structure per Endpoint89```90### [METHOD] [Path]91**Description**: one sentence92**Auth required**: Yes/No [type]93**Request**: Headers, Parameters (path/query/body)94**Response 200**: Body with example95**Error responses**: 400, 401, 404, 500 with descriptions96```9798### Rules per Endpoint99- [ ] Request example (curl + one SDK)100- [ ] Response example with ALL fields101- [ ] Error responses for ALL possible status codes102- [ ] Pagination docs (if applicable)103- [ ] Rate limit headers documented104105## Changelog Format106107```108## [2.1.0] - 2026-05-16109110### Added111- New feature (#PR)112113### Changed114- Behavior change with migration note (#PR)115116### Fixed117- Bug fix (#PR)118119### Deprecated / Removed / Security120```121122Rules: Keep a Changelog format. Every entry links to PR. Migration notes for breaking changes. Unreleased section at top. Semantic versioning. Explain WHY not just WHAT.123124## Knowledge Base125126### Article Format127```128Title: as a question user would search for129Context: 1-2 sentences — who, what product/feature130Steps: numbered, one action per step, action verb first131Expected result: after last step132Escalation: if it still doesn't work133```134135Rules: One action per step. Bold UI labels exactly as they appear. Max 15 words per step. No jargon.136137## Production Checklist138139- [ ] All examples tested from clean environment140- [ ] No "TODO", "coming soon", "TBD", placeholder text141- [ ] Consistent tone across all sections142- [ ] Every link resolves143- [ ] License badge matches LICENSE file144- [ ] API docs: curl + SDK example per endpoint145- [ ] Changelog: unreleased section present, versions correct146- [ ] KB: tested by someone unfamiliar with the product147148## Workflow1491501. **Identify document type** — README, API docs, changelog, or knowledge base article. Each has a distinct structure and rule set.1512. **Gather source material** — for README: project files, package.json, build system. For API: OpenAPI spec or route handlers. For changelog: git log. For KB: product expertise.1523. **Apply the template** — README: hook → features → quick start → API → examples → config → contributing → license. API: method → path → description → auth → request → response → errors.1534. **Fill every section with real data** — no "TODO", "coming soon", "TBD", placeholder text. Quick start must be copy-paste runnable. API docs need curl + SDK examples.1545. **Verify everything** — test quick start from clean environment. Check every link resolves. Confirm license badge matches LICENSE file. KB: test steps as an unfamiliar user.1556. **Cut the generic** — remove default template comments. Strip "write unit tests" style advice. Every sentence must convey a specific convention or fact about this project.156157## Error Handling158159| Cause | Fix |160|-------|-----|161| Quick start commands fail from a clean environment | Test every command from scratch. Ensure no omitted imports, no assumed global state, no missing env vars. |162| API docs missing error response codes | Document all possible status codes for every endpoint: 400 (validation), 401 (auth), 403 (forbidden), 404 (not found), 500 (server error). |163| Changelog entry lacks migration notes for breaking changes | Every breaking change must include: what changed, why, and the exact migration path. Link to the PR. |164| KB article steps don't produce expected result when followed | Have someone unfamiliar with the product walk through the steps. Fix any ambiguity or missing context. |165| Links in documentation resolve to 404 or redirect | Check every link. Prefer permalinks. Verify external links haven't moved. Use web archive as fallback for critical references. |166| README badges show incorrect or outdated status | Verify CI badge matches current pipeline. Version badge matches latest release. Coverage badge matches current report. |167| API docs example response doesn't match actual API output | Generate response examples from actual API output, not from spec definitions. Update when the API changes. |168| Default README template published with unfilled sections | Remove all template comments and TODO markers before publishing. If a section has no content, omit it rather than leaving a placeholder. |169170## Anti-Patterns171172| Anti-Pattern | Correct |173|--------------|---------|174| Default README (template unfilled) | Remove all template comments. Fill every section. |175| "Coming soon" features | Ship or hide. Never show unfinished. |176| Untested install instructions | Test from scratch in clean environment. |177| API docs without examples | Every function needs a runnable example. |178| Changelog without migration notes | Always include migration path for breaking changes. |179| KB with no expected result | End every step with "You should see..." |180| Example code with secrets | Use placeholder env vars. Never real values. |181182## API Documentation Patterns183184### OpenAPI → Docs185```bash186npx @redocly/cli build-docs openapi.yaml -o docs.html187npx @scalar/api-reference openapi.yaml188```189190### README Template1911. Title + one-liner, 2. Quick start (install + first command), 3. Features (bullets), 4. Architecture (diagram), 5. API (link), 6. Contributing (link), 7. License192193## Changelog Automation194195```bash196# Generate from conventional commits197npx standard-version198npx changelogen --from v1.0.0 --to HEAD199200# Keep a Changelog format201## [version] - YYYY-MM-DD202### Added | Changed | Deprecated | Removed | Fixed | Security203```204205## Sources206207- Standard Readme specification208- Stripe API documentation standards209- Keep a Changelog (keepachangelog.com)210- Conventional Commits (conventionalcommits.org)211- OpenAPI Specification (openapis.org)212- Zendesk / Intercom — KB standards213214## Checklist215216- [ ] Skill loads without errors in the AI agent217- [ ] YAML frontmatter is valid (description, compatibility, audience)218- [ ] Workflow section provides clear step-by-step instructions219- [ ] Error handling section covers common failure modes220- [ ] All referenced files (references/, scripts/, assets/) exist221- [ ] Skill triggers correctly for intended use cases222- [ ] No broken links or missing resources