API Documentation Skill
Technical documentation, API references, user guides, and docs-as-code workflows.
Documentation Project Scaffolding
Recommended Folder Structure
docs-project/
├── .github/
│ ├── copilot-instructions.md # Docs-specific Alex context
│ └── prompts/
│ └── api-review.prompt.md
├── docs/
│ ├── index.md # Landing page / overview
│ ├── getting-started/
│ │ ├── installation.md
│ │ ├── quick-start.md
│ │ └── configuration.md
│ ├── guides/
│ │ ├── user-guide.md
│ │ └── admin-guide.md
│ ├── api/
│ │ ├── overview.md
│ │ ├── authentication.md
│ │ ├── endpoints/
│ │ │ └── [resource].md
│ │ └── errors.md
│ ├── reference/
│ │ ├── glossary.md
│ │ └── faq.md
│ └── contributing/
│ ├── style-guide.md
│ └── templates.md
├── examples/
│ ├── code-snippets/
│ └── sample-projects/
├── assets/
│ ├── images/
│ └── diagrams/
├── CHANGELOG.md
├── README.md
└── mkdocs.yml # Or docusaurus.config.js
DOCS-PLAN.md Template
# Documentation Plan: [Product/API Name]
## Scope
- **Product**: [What are we documenting?]
- **Audience**: [Developers / Admins / End Users]
- **Prerequisites**: [What readers should know]
## Documentation Types
| Type | Location | Status |
|------|----------|--------|
| Getting Started | docs/getting-started/ | ⬜ |
| User Guide | docs/guides/user-guide.md | ⬜ |
| API Reference | docs/api/ | ⬜ |
| Examples | examples/ | ⬜ |
## Style Guidelines
- **Tone**: [Technical but approachable]
- **Person**: [Second person - "you"]
- **Tense**: [Present tense]
- **Code style**: [Language-specific conventions]
## Quality Checklist
- [ ] All endpoints documented
- [ ] Code examples tested and working
- [ ] Screenshots current
- [ ] Links verified
- [ ] Spelling/grammar checked
API-ENDPOINT.md Template
# [Endpoint Name]
[One-line description of what this endpoint does]
## Request
\`\`\`http
[METHOD] /api/v1/[resource]
\`\`\`
### Headers
| Header | Required | Description |
|--------|----------|-------------|
| Authorization | Yes | Bearer token |
| Content-Type | Yes | application/json |
### Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| id | string | Yes | Resource identifier |
### Request Body
\`\`\`json
{
"field": "value"
}
\`\`\`
## Response
### Success (200 OK)
\`\`\`json
{
"data": {
"id": "123",
"field": "value"
}
}
\`\`\`
### Errors
| Code | Description |
|------|-------------|
| 400 | Invalid request body |
| 401 | Unauthorized |
| 404 | Resource not found |
## Example
\`\`\`bash
curl -X GET "https://api.example.com/v1/resource/123" \
-H "Authorization: Bearer $TOKEN"
\`\`\`
copilot-instructions.md Template (Documentation Projects)
# [Product Name] Documentation — Context
## Project Overview
[What product/API this documents, current status]
## Current Phase
- [x] Structure defined
- [ ] Getting started complete
- [ ] API reference complete
- [ ] Examples tested
## Key Files
- Docs plan: DOCS-PLAN.md
- Style guide: docs/contributing/style-guide.md
- API overview: docs/api/overview.md
## Alex Guidance
- **Audience**: [Developers with X experience level]
- **Tone**: Technical but approachable
- Use second person ("you") not third person
- Include working code examples for every endpoint
- Link to related endpoints/concepts
## Style Rules
- Headings: Sentence case
- Lists: No periods for fragments, periods for sentences
- Code: Include language identifier in fenced blocks
- Links: Use relative paths within docs/
## Don't
- Don't assume reader knows internal terminology
- Don't document deprecated features without clear warnings
- Don't include placeholder examples — all code must work
Documentation Project Audit Checklist
## Documentation Project Audit
### Structure Assessment
- [ ] Clear navigation hierarchy
- [ ] Getting started section exists
- [ ] API reference organized by resource
- [ ] Examples directory with working code
### Alex-Readiness Assessment
- [ ] copilot-instructions.md exists
- [ ] Audience clearly defined
- [ ] Style guide documented
- [ ] Key files linked
### Content Assessment
- [ ] All public endpoints documented
- [ ] Authentication explained
- [ ] Error codes listed
- [ ] Code examples in multiple languages (if applicable)
### Quality Assessment
- [ ] All links valid
- [ ] Code examples tested
- [ ] Screenshots current
- [ ] Consistent formatting
Documentation Types
API Reference Structure
| Section |
Purpose |
| Overview |
What the API does, base URL, versioning |
| Authentication |
How to get and use credentials |
| Rate Limits |
Throttling rules and headers |
| Endpoints |
Per-endpoint details |
| Errors |
Error format and common codes |
| Changelog |
API version history |
User Guide Structure
| Section |
Purpose |
| Introduction |
What, why, for whom |
| Installation |
How to set up |
| Quick Start |
First success in 5 minutes |
| Core Concepts |
Key ideas to understand |
| How-To Guides |
Task-oriented walkthroughs |
| Troubleshooting |
Common issues and fixes |
README Best Practices
| Section |
Required? |
| Project name + description |
✅ Yes |
| Badges (build, version) |
Recommended |
| Quick start / Installation |
✅ Yes |
| Usage examples |
✅ Yes |
| Configuration |
If applicable |
| Contributing |
Recommended |
| License |
✅ Yes |
Docs-as-Code Tools
Static Site Generators
| Tool |
Best For |
Config File |
| MkDocs |
Python projects, simple setup |
mkdocs.yml |
| Docusaurus |
React, versioning, i18n |
docusaurus.config.js |
| Sphinx |
Python autodocs |
conf.py |
| GitBook |
Beautiful docs, non-technical |
book.json |
| VitePress |
Vue projects, fast |
.vitepress/config.js |
API Documentation Tools
| Tool |
Format |
Output |
| OpenAPI/Swagger |
YAML/JSON spec |
Interactive docs |
| Redoc |
OpenAPI |
Static HTML |
| Stoplight |
Design-first |
Portal |
| Postman |
Collections |
Shareable docs |
Writing Patterns
The 4 Cs of Technical Writing
| Principle |
Meaning |
| Clear |
No ambiguity, simple words |
| Concise |
No filler, respect reader's time |
| Correct |
Accurate, tested, up-to-date |
| Complete |
All needed info present |
Code Example Guidelines
| Do |
Don't |
| Show complete, runnable examples |
Partial snippets without context |
| Include error handling |
Happy path only |
| Use realistic data |
foo, bar, test123 |
| Explain non-obvious parts |
Assume reader knows everything |
Common Pitfalls
| Pitfall |
Solution |
| Outdated screenshots |
Automate with Puppeteer/Playwright |
| Broken links |
CI link checking |
| Stale examples |
Tests for code samples |
| Jargon overload |
Glossary + define on first use |
1---2name: api-documentation3description: Technical documentation, API references, user guides, and docs-as-code workflows.4---56# API Documentation Skill78> Technical documentation, API references, user guides, and docs-as-code workflows.910---1112## Documentation Project Scaffolding1314### Recommended Folder Structure1516```text17docs-project/18├── .github/19│ ├── copilot-instructions.md # Docs-specific Alex context20│ └── prompts/21│ └── api-review.prompt.md22├── docs/23│ ├── index.md # Landing page / overview24│ ├── getting-started/25│ │ ├── installation.md26│ │ ├── quick-start.md27│ │ └── configuration.md28│ ├── guides/29│ │ ├── user-guide.md30│ │ └── admin-guide.md31│ ├── api/32│ │ ├── overview.md33│ │ ├── authentication.md34│ │ ├── endpoints/35│ │ │ └── [resource].md36│ │ └── errors.md37│ ├── reference/38│ │ ├── glossary.md39│ │ └── faq.md40│ └── contributing/41│ ├── style-guide.md42│ └── templates.md43├── examples/44│ ├── code-snippets/45│ └── sample-projects/46├── assets/47│ ├── images/48│ └── diagrams/49├── CHANGELOG.md50├── README.md51└── mkdocs.yml # Or docusaurus.config.js52```5354### DOCS-PLAN.md Template5556```markdown57# Documentation Plan: [Product/API Name]5859## Scope60- **Product**: [What are we documenting?]61- **Audience**: [Developers / Admins / End Users]62- **Prerequisites**: [What readers should know]6364## Documentation Types6566| Type | Location | Status |67|------|----------|--------|68| Getting Started | docs/getting-started/ | ⬜ |69| User Guide | docs/guides/user-guide.md | ⬜ |70| API Reference | docs/api/ | ⬜ |71| Examples | examples/ | ⬜ |7273## Style Guidelines74- **Tone**: [Technical but approachable]75- **Person**: [Second person - "you"]76- **Tense**: [Present tense]77- **Code style**: [Language-specific conventions]7879## Quality Checklist80- [ ] All endpoints documented81- [ ] Code examples tested and working82- [ ] Screenshots current83- [ ] Links verified84- [ ] Spelling/grammar checked85```8687### API-ENDPOINT.md Template8889```markdown90# [Endpoint Name]9192[One-line description of what this endpoint does]9394## Request9596\`\`\`http97[METHOD] /api/v1/[resource]98\`\`\`99100### Headers101102| Header | Required | Description |103|--------|----------|-------------|104| Authorization | Yes | Bearer token |105| Content-Type | Yes | application/json |106107### Parameters108109| Parameter | Type | Required | Description |110|-----------|------|----------|-------------|111| id | string | Yes | Resource identifier |112113### Request Body114115\`\`\`json116{117 "field": "value"118}119\`\`\`120121## Response122123### Success (200 OK)124125\`\`\`json126{127 "data": {128 "id": "123",129 "field": "value"130 }131}132\`\`\`133134### Errors135136| Code | Description |137|------|-------------|138| 400 | Invalid request body |139| 401 | Unauthorized |140| 404 | Resource not found |141142## Example143144\`\`\`bash145curl -X GET "https://api.example.com/v1/resource/123" \146 -H "Authorization: Bearer $TOKEN"147\`\`\`148```149150### copilot-instructions.md Template (Documentation Projects)151152```markdown153# [Product Name] Documentation — Context154155## Project Overview156[What product/API this documents, current status]157158## Current Phase159- [x] Structure defined160- [ ] Getting started complete161- [ ] API reference complete162- [ ] Examples tested163164## Key Files165- Docs plan: DOCS-PLAN.md166- Style guide: docs/contributing/style-guide.md167- API overview: docs/api/overview.md168169## Alex Guidance170- **Audience**: [Developers with X experience level]171- **Tone**: Technical but approachable172- Use second person ("you") not third person173- Include working code examples for every endpoint174- Link to related endpoints/concepts175176## Style Rules177- Headings: Sentence case178- Lists: No periods for fragments, periods for sentences179- Code: Include language identifier in fenced blocks180- Links: Use relative paths within docs/181182## Don't183- Don't assume reader knows internal terminology184- Don't document deprecated features without clear warnings185- Don't include placeholder examples — all code must work186```187188### Documentation Project Audit Checklist189190```markdown191## Documentation Project Audit192193### Structure Assessment194- [ ] Clear navigation hierarchy195- [ ] Getting started section exists196- [ ] API reference organized by resource197- [ ] Examples directory with working code198199### Alex-Readiness Assessment200- [ ] copilot-instructions.md exists201- [ ] Audience clearly defined202- [ ] Style guide documented203- [ ] Key files linked204205### Content Assessment206- [ ] All public endpoints documented207- [ ] Authentication explained208- [ ] Error codes listed209- [ ] Code examples in multiple languages (if applicable)210211### Quality Assessment212- [ ] All links valid213- [ ] Code examples tested214- [ ] Screenshots current215- [ ] Consistent formatting216```217218---219220## Documentation Types221222### API Reference Structure223224| Section | Purpose |225|---------|---------|226| **Overview** | What the API does, base URL, versioning |227| **Authentication** | How to get and use credentials |228| **Rate Limits** | Throttling rules and headers |229| **Endpoints** | Per-endpoint details |230| **Errors** | Error format and common codes |231| **Changelog** | API version history |232233### User Guide Structure234235| Section | Purpose |236|---------|---------|237| **Introduction** | What, why, for whom |238| **Installation** | How to set up |239| **Quick Start** | First success in 5 minutes |240| **Core Concepts** | Key ideas to understand |241| **How-To Guides** | Task-oriented walkthroughs |242| **Troubleshooting** | Common issues and fixes |243244### README Best Practices245246| Section | Required? |247|---------|-----------|248| Project name + description | ✅ Yes |249| Badges (build, version) | Recommended |250| Quick start / Installation | ✅ Yes |251| Usage examples | ✅ Yes |252| Configuration | If applicable |253| Contributing | Recommended |254| License | ✅ Yes |255256---257258## Docs-as-Code Tools259260### Static Site Generators261262| Tool | Best For | Config File |263|------|----------|-------------|264| **MkDocs** | Python projects, simple setup | mkdocs.yml |265| **Docusaurus** | React, versioning, i18n | docusaurus.config.js |266| **Sphinx** | Python autodocs | conf.py |267| **GitBook** | Beautiful docs, non-technical | book.json |268| **VitePress** | Vue projects, fast | .vitepress/config.js |269270### API Documentation Tools271272| Tool | Format | Output |273|------|--------|--------|274| **OpenAPI/Swagger** | YAML/JSON spec | Interactive docs |275| **Redoc** | OpenAPI | Static HTML |276| **Stoplight** | Design-first | Portal |277| **Postman** | Collections | Shareable docs |278279---280281## Writing Patterns282283### The 4 Cs of Technical Writing284285| Principle | Meaning |286|-----------|---------|287| **Clear** | No ambiguity, simple words |288| **Concise** | No filler, respect reader's time |289| **Correct** | Accurate, tested, up-to-date |290| **Complete** | All needed info present |291292### Code Example Guidelines293294| Do | Don't |295|----|-------|296| Show complete, runnable examples | Partial snippets without context |297| Include error handling | Happy path only |298| Use realistic data | `foo`, `bar`, `test123` |299| Explain non-obvious parts | Assume reader knows everything |300301### Common Pitfalls302303| Pitfall | Solution |304|---------|----------|305| Outdated screenshots | Automate with Puppeteer/Playwright |306| Broken links | CI link checking |307| Stale examples | Tests for code samples |308| Jargon overload | Glossary + define on first use |309310---