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 |
Synapses
High-Strength Connections
- [project-scaffolding] (High, Extends, Bidirectional) — "Documentation project structure"
- [code-quality] (High, Complements, Bidirectional) — "Documented code is quality code"
Medium-Strength Connections
- [creative-writing] (Medium, Complements, Forward) — "Clear writing techniques"
- [git-workflow] (Medium, Uses, Forward) — "Docs-as-code versioning"
Supporting Connections
- [markdown-mastery] (Medium, Uses, Forward) — "Core formatting"
- [appropriate-reliance] (Low, Applies, Forward) — "AI assistance in docs"
1---2name: api-documentation-skill3description: Technical documentation, API references, user guides, and docs-as-code workflows.4---5
6# API Documentation Skill
7
8> Technical documentation, API references, user guides, and docs-as-code workflows.
9
10---
11
12## Documentation Project Scaffolding
13
14### Recommended Folder Structure
15
16```text
17docs-project/
18├── .github/
19│ ├── copilot-instructions.md # Docs-specific Alex context
20│ └── prompts/
21│ └── api-review.prompt.md
22├── docs/
23│ ├── index.md # Landing page / overview
24│ ├── getting-started/
25│ │ ├── installation.md
26│ │ ├── quick-start.md
27│ │ └── configuration.md
28│ ├── guides/
29│ │ ├── user-guide.md
30│ │ └── admin-guide.md
31│ ├── api/
32│ │ ├── overview.md
33│ │ ├── authentication.md
34│ │ ├── endpoints/
35│ │ │ └── [resource].md
36│ │ └── errors.md
37│ ├── reference/
38│ │ ├── glossary.md
39│ │ └── faq.md
40│ └── contributing/
41│ ├── style-guide.md
42│ └── templates.md
43├── examples/
44│ ├── code-snippets/
45│ └── sample-projects/
46├── assets/
47│ ├── images/
48│ └── diagrams/
49├── CHANGELOG.md
50├── README.md
51└── mkdocs.yml # Or docusaurus.config.js
52```
53
54### DOCS-PLAN.md Template
55
56```markdown
57# Documentation Plan: [Product/API Name]
58
59## Scope
60- **Product**: [What are we documenting?]
61- **Audience**: [Developers / Admins / End Users]
62- **Prerequisites**: [What readers should know]
63
64## Documentation Types
65
66| 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/ | ⬜ |
72
73## Style Guidelines
74- **Tone**: [Technical but approachable]
75- **Person**: [Second person - "you"]
76- **Tense**: [Present tense]
77- **Code style**: [Language-specific conventions]
78
79## Quality Checklist
80- [ ] All endpoints documented
81- [ ] Code examples tested and working
82- [ ] Screenshots current
83- [ ] Links verified
84- [ ] Spelling/grammar checked
85```
86
87### API-ENDPOINT.md Template
88
89```markdown
90# [Endpoint Name]
91
92[One-line description of what this endpoint does]
93
94## Request
95
96\`\`\`http
97[METHOD] /api/v1/[resource]
98\`\`\`
99
100### Headers
101
102| Header | Required | Description |
103|--------|----------|-------------|
104| Authorization | Yes | Bearer token |
105| Content-Type | Yes | application/json |
106
107### Parameters
108
109| Parameter | Type | Required | Description |
110|-----------|------|----------|-------------|
111| id | string | Yes | Resource identifier |
112
113### Request Body
114
115\`\`\`json
116{
117 "field": "value"
118}
119\`\`\`
120
121## Response
122
123### Success (200 OK)
124
125\`\`\`json
126{
127 "data": {
128 "id": "123",
129 "field": "value"
130 }
131}
132\`\`\`
133
134### Errors
135
136| Code | Description |
137|------|-------------|
138| 400 | Invalid request body |
139| 401 | Unauthorized |
140| 404 | Resource not found |
141
142## Example
143
144\`\`\`bash
145curl -X GET "https://api.example.com/v1/resource/123" \
146 -H "Authorization: Bearer $TOKEN"
147\`\`\`
148```
149
150### copilot-instructions.md Template (Documentation Projects)
151
152```markdown
153# [Product Name] Documentation — Context
154
155## Project Overview
156[What product/API this documents, current status]
157
158## Current Phase
159- [x] Structure defined
160- [ ] Getting started complete
161- [ ] API reference complete
162- [ ] Examples tested
163
164## Key Files
165- Docs plan: DOCS-PLAN.md
166- Style guide: docs/contributing/style-guide.md
167- API overview: docs/api/overview.md
168
169## Alex Guidance
170- **Audience**: [Developers with X experience level]
171- **Tone**: Technical but approachable
172- Use second person ("you") not third person
173- Include working code examples for every endpoint
174- Link to related endpoints/concepts
175
176## Style Rules
177- Headings: Sentence case
178- Lists: No periods for fragments, periods for sentences
179- Code: Include language identifier in fenced blocks
180- Links: Use relative paths within docs/
181
182## Don't
183- Don't assume reader knows internal terminology
184- Don't document deprecated features without clear warnings
185- Don't include placeholder examples — all code must work
186```
187
188### Documentation Project Audit Checklist
189
190```markdown
191## Documentation Project Audit
192
193### Structure Assessment
194- [ ] Clear navigation hierarchy
195- [ ] Getting started section exists
196- [ ] API reference organized by resource
197- [ ] Examples directory with working code
198
199### Alex-Readiness Assessment
200- [ ] copilot-instructions.md exists
201- [ ] Audience clearly defined
202- [ ] Style guide documented
203- [ ] Key files linked
204
205### Content Assessment
206- [ ] All public endpoints documented
207- [ ] Authentication explained
208- [ ] Error codes listed
209- [ ] Code examples in multiple languages (if applicable)
210
211### Quality Assessment
212- [ ] All links valid
213- [ ] Code examples tested
214- [ ] Screenshots current
215- [ ] Consistent formatting
216```
217
218---
219
220## Documentation Types
221
222### API Reference Structure
223
224| 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 |
232
233### User Guide Structure
234
235| 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 |
243
244### README Best Practices
245
246| 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 |
255
256---
257
258## Docs-as-Code Tools
259
260### Static Site Generators
261
262| 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 |
269
270### API Documentation Tools
271
272| 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 |
278
279---
280
281## Writing Patterns
282
283### The 4 Cs of Technical Writing
284
285| 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 |
291
292### Code Example Guidelines
293
294| 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 |
300
301### Common Pitfalls
302
303| 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 |
309
310---
311
312## Synapses
313
314### High-Strength Connections
315
316- [project-scaffolding] (High, Extends, Bidirectional) — "Documentation project structure"
317- [code-quality] (High, Complements, Bidirectional) — "Documented code is quality code"
318
319### Medium-Strength Connections
320
321- [creative-writing] (Medium, Complements, Forward) — "Clear writing techniques"
322- [git-workflow] (Medium, Uses, Forward) — "Docs-as-code versioning"
323
324### Supporting Connections
325
326- [markdown-mastery] (Medium, Uses, Forward) — "Core formatting"
327- [appropriate-reliance] (Low, Applies, Forward) — "AI assistance in docs"