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 the AI assistant 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
## the AI assistant 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
### the AI assistant-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-documentation-23description: Technical documentation, API references, user guides, and docs-as-code workflows.4---56# API Documentation Skill789> Technical documentation, API references, user guides, and docs-as-code workflows.1011---1213## Documentation Project Scaffolding1415### Recommended Folder Structure1617```text18docs-project/19├── .github/20│ ├── copilot-instructions.md # Docs-specific the AI assistant context21│ └── prompts/22│ └── api-review.prompt.md23├── docs/24│ ├── index.md # Landing page / overview25│ ├── getting-started/26│ │ ├── installation.md27│ │ ├── quick-start.md28│ │ └── configuration.md29│ ├── guides/30│ │ ├── user-guide.md31│ │ └── admin-guide.md32│ ├── api/33│ │ ├── overview.md34│ │ ├── authentication.md35│ │ ├── endpoints/36│ │ │ └── [resource].md37│ │ └── errors.md38│ ├── reference/39│ │ ├── glossary.md40│ │ └── faq.md41│ └── contributing/42│ ├── style-guide.md43│ └── templates.md44├── examples/45│ ├── code-snippets/46│ └── sample-projects/47├── assets/48│ ├── images/49│ └── diagrams/50├── CHANGELOG.md51├── README.md52└── mkdocs.yml # Or docusaurus.config.js53```5455### DOCS-PLAN.md Template5657```markdown58# Documentation Plan: [Product/API Name]5960## Scope61- **Product**: [What are we documenting?]62- **Audience**: [Developers / Admins / End Users]63- **Prerequisites**: [What readers should know]6465## Documentation Types6667| Type | Location | Status |68|------|----------|--------|69| Getting Started | docs/getting-started/ | ⬜ |70| User Guide | docs/guides/user-guide.md | ⬜ |71| API Reference | docs/api/ | ⬜ |72| Examples | examples/ | ⬜ |7374## Style Guidelines75- **Tone**: [Technical but approachable]76- **Person**: [Second person - "you"]77- **Tense**: [Present tense]78- **Code style**: [Language-specific conventions]7980## Quality Checklist81- [ ] All endpoints documented82- [ ] Code examples tested and working83- [ ] Screenshots current84- [ ] Links verified85- [ ] Spelling/grammar checked86```8788### API-ENDPOINT.md Template8990```markdown91# [Endpoint Name]9293[One-line description of what this endpoint does]9495## Request9697\`\`\`http98[METHOD] /api/v1/[resource]99\`\`\`100101### Headers102103| Header | Required | Description |104|--------|----------|-------------|105| Authorization | Yes | Bearer token |106| Content-Type | Yes | application/json |107108### Parameters109110| Parameter | Type | Required | Description |111|-----------|------|----------|-------------|112| id | string | Yes | Resource identifier |113114### Request Body115116\`\`\`json117{118 "field": "value"119}120\`\`\`121122## Response123124### Success (200 OK)125126\`\`\`json127{128 "data": {129 "id": "123",130 "field": "value"131 }132}133\`\`\`134135### Errors136137| Code | Description |138|------|-------------|139| 400 | Invalid request body |140| 401 | Unauthorized |141| 404 | Resource not found |142143## Example144145\`\`\`bash146curl -X GET "https://api.example.com/v1/resource/123" \147 -H "Authorization: Bearer $TOKEN"148\`\`\`149```150151### copilot-instructions.md Template (Documentation Projects)152153```markdown154# [Product Name] Documentation — Context155156## Project Overview157[What product/API this documents, current status]158159## Current Phase160- [x] Structure defined161- [ ] Getting started complete162- [ ] API reference complete163- [ ] Examples tested164165## Key Files166- Docs plan: DOCS-PLAN.md167- Style guide: docs/contributing/style-guide.md168- API overview: docs/api/overview.md169170## the AI assistant Guidance171- **Audience**: [Developers with X experience level]172- **Tone**: Technical but approachable173- Use second person ("you") not third person174- Include working code examples for every endpoint175- Link to related endpoints/concepts176177## Style Rules178- Headings: Sentence case179- Lists: No periods for fragments, periods for sentences180- Code: Include language identifier in fenced blocks181- Links: Use relative paths within docs/182183## Don't184- Don't assume reader knows internal terminology185- Don't document deprecated features without clear warnings186- Don't include placeholder examples — all code must work187```188189### Documentation Project Audit Checklist190191```markdown192## Documentation Project Audit193194### Structure Assessment195- [ ] Clear navigation hierarchy196- [ ] Getting started section exists197- [ ] API reference organized by resource198- [ ] Examples directory with working code199200### the AI assistant-Readiness Assessment201- [ ] copilot-instructions.md exists202- [ ] Audience clearly defined203- [ ] Style guide documented204- [ ] Key files linked205206### Content Assessment207- [ ] All public endpoints documented208- [ ] Authentication explained209- [ ] Error codes listed210- [ ] Code examples in multiple languages (if applicable)211212### Quality Assessment213- [ ] All links valid214- [ ] Code examples tested215- [ ] Screenshots current216- [ ] Consistent formatting217```218219---220221## Documentation Types222223### API Reference Structure224225| Section | Purpose |226|---------|---------|227| **Overview** | What the API does, base URL, versioning |228| **Authentication** | How to get and use credentials |229| **Rate Limits** | Throttling rules and headers |230| **Endpoints** | Per-endpoint details |231| **Errors** | Error format and common codes |232| **Changelog** | API version history |233234### User Guide Structure235236| Section | Purpose |237|---------|---------|238| **Introduction** | What, why, for whom |239| **Installation** | How to set up |240| **Quick Start** | First success in 5 minutes |241| **Core Concepts** | Key ideas to understand |242| **How-To Guides** | Task-oriented walkthroughs |243| **Troubleshooting** | Common issues and fixes |244245### README Best Practices246247| Section | Required? |248|---------|-----------|249| Project name + description | ✅ Yes |250| Badges (build, version) | Recommended |251| Quick start / Installation | ✅ Yes |252| Usage examples | ✅ Yes |253| Configuration | If applicable |254| Contributing | Recommended |255| License | ✅ Yes |256257---258259## Docs-as-Code Tools260261### Static Site Generators262263| Tool | Best For | Config File |264|------|----------|-------------|265| **MkDocs** | Python projects, simple setup | mkdocs.yml |266| **Docusaurus** | React, versioning, i18n | docusaurus.config.js |267| **Sphinx** | Python autodocs | conf.py |268| **GitBook** | Beautiful docs, non-technical | book.json |269| **VitePress** | Vue projects, fast | .vitepress/config.js |270271### API Documentation Tools272273| Tool | Format | Output |274|------|--------|--------|275| **OpenAPI/Swagger** | YAML/JSON spec | Interactive docs |276| **Redoc** | OpenAPI | Static HTML |277| **Stoplight** | Design-first | Portal |278| **Postman** | Collections | Shareable docs |279280---281282## Writing Patterns283284### The 4 Cs of Technical Writing285286| Principle | Meaning |287|-----------|---------|288| **Clear** | No ambiguity, simple words |289| **Concise** | No filler, respect reader's time |290| **Correct** | Accurate, tested, up-to-date |291| **Complete** | All needed info present |292293### Code Example Guidelines294295| Do | Don't |296|----|-------|297| Show complete, runnable examples | Partial snippets without context |298| Include error handling | Happy path only |299| Use realistic data | `foo`, `bar`, `test123` |300| Explain non-obvious parts | Assume reader knows everything |301302### Common Pitfalls303304| Pitfall | Solution |305|---------|----------|306| Outdated screenshots | Automate with Puppeteer/Playwright |307| Broken links | CI link checking |308| Stale examples | Tests for code samples |309| Jargon overload | Glossary + define on first use |310311---