Documentation
Generate, update, and maintain documentation from code — READMEs, API docs, guides, changelogs, and inline documentation. Good documentation bridges the gap between code and understanding.
Execution Model
This is an agent-handled skill (handler: type: agent). When document is invoked, you (the agent) apply the methodology below using your reasoning capabilities. There is no backing code — you follow these instructions directly. The tool schema in tool.yaml defines the external contract; this document guides how you fulfill it.
When to Use
- Creating or updating README files
- Generating API documentation from code
- Writing setup/installation guides
- Documenting architectural decisions
- Creating changelog entries
- Adding inline documentation to complex code
- Writing user guides or tutorials
Methodology
1. Determine Documentation Type
| Type |
Purpose |
Audience |
| README |
Project overview, quick start |
New developers, users |
| API docs |
Endpoint/function reference |
Developers integrating |
| Setup guide |
Installation, configuration |
New team members |
| Architecture doc |
System design, decisions |
Maintainers, architects |
| Changelog |
Version history, changes |
Users, developers |
| Inline docs |
Code-level explanation |
Maintainers |
| Tutorial |
Step-by-step learning |
New users |
2. Analyze the Source
Read the code/system being documented:
- What does it do? (purpose)
- How is it structured? (architecture)
- What are the key interfaces? (API)
- What are the prerequisites? (dependencies, setup)
- What are the gotchas? (common mistakes, known issues)
3. Write for the Audience
Calibrate content to who will read it:
- New users: Start with what it does, then how to get started
- Developers integrating: Focus on API contracts, examples, error codes
- Maintainers: Focus on architecture, decisions, patterns
- All audiences: Be concise, use examples, structure with headers
4. Structure the Document
Follow established conventions:
README structure:
- Title and one-line description
- What it does (2-3 sentences)
- Quick start (minimal steps to get running)
- Installation (detailed setup)
- Usage (key features with examples)
- API reference (if small enough)
- Contributing
- License
API doc structure (per endpoint/function):
- Description
- Parameters (name, type, required, description)
- Return value
- Errors
- Example
5. Include Examples
Every piece of documentation should include:
- Working examples: Code that can be copied and run
- Expected output: What the example produces
- Edge cases: Examples of error handling
6. Verify Accuracy
Documentation must match the current code:
- Run examples to confirm they work
- Check parameter names and types against the implementation
- Verify setup steps produce a working environment
- Cross-reference with tests (tests are executable documentation)
Output Format
## Documentation: [Target]
### Type
- Document type: [README/API/guide/changelog/inline]
- Audience: [who will read this]
### Source Analysis
- Files read: [list]
- Key interfaces: [list]
- Prerequisites: [list]
### Document Created/Updated
- Path: [file path]
- Sections: [list of sections]
- Examples: [count]
### Verification
- Examples tested: [yes/no]
- Matches code: [yes/no]
- Reviewed for accuracy: [yes/no]
Quality Criteria
- Documentation is accurate (matches the current code)
- Documentation is complete (covers all public interfaces)
- Documentation is concise (no unnecessary verbosity)
- Examples are working and can be copied directly
- Structure follows conventions for the document type
- Audience is considered (appropriate detail level)
- Prerequisites and setup steps are explicit
- Common mistakes and gotchas are documented
Common Mistakes
- Documenting the obvious: Comments like
# increment counter on counter += 1 add noise, not value. Document WHY, not WHAT.
- Stale documentation: Updating code without updating docs. Documentation that's wrong is worse than no documentation.
- No examples: API reference without examples forces the reader to guess how to use it. Every function/endpoint needs at least one example.
- Assuming knowledge: Not listing prerequisites, assuming the reader knows the setup steps or background context. Be explicit.
- Wall of text: Long paragraphs without structure, headers, or formatting. Use headers, lists, tables, and code blocks.
- Documenting implementation details: Public documentation should describe behavior and interfaces, not internal implementation. Internal docs go in code comments.
- Not testing examples: Including code examples that don't actually work. Always run examples before publishing.
Completion
Documentation is complete when:
- Document type and audience are identified
- Source code is analyzed for accurate information
- Document is written with proper structure and examples
- Examples are verified to work
- Documentation matches the current code
- Document is in the correct location and format
Source: mkalkere/agent-coordinator — distributed by TomeVault.
1---2name: documentation-753description: Generate and update documentation, READMEs, and API docs from code Use when this capability is needed.4---56# Documentation78Generate, update, and maintain documentation from code — READMEs, API docs, guides, changelogs, and inline documentation. Good documentation bridges the gap between code and understanding.910## Execution Model1112This is an **agent-handled skill** (`handler: type: agent`). When `document` is invoked, you (the agent) apply the methodology below using your reasoning capabilities. There is no backing code — you follow these instructions directly. The tool schema in tool.yaml defines the external contract; this document guides how you fulfill it.1314## When to Use1516- Creating or updating README files17- Generating API documentation from code18- Writing setup/installation guides19- Documenting architectural decisions20- Creating changelog entries21- Adding inline documentation to complex code22- Writing user guides or tutorials2324## Methodology2526### 1. Determine Documentation Type2728| Type | Purpose | Audience |29|------|---------|----------|30| **README** | Project overview, quick start | New developers, users |31| **API docs** | Endpoint/function reference | Developers integrating |32| **Setup guide** | Installation, configuration | New team members |33| **Architecture doc** | System design, decisions | Maintainers, architects |34| **Changelog** | Version history, changes | Users, developers |35| **Inline docs** | Code-level explanation | Maintainers |36| **Tutorial** | Step-by-step learning | New users |3738### 2. Analyze the Source3940Read the code/system being documented:41- What does it do? (purpose)42- How is it structured? (architecture)43- What are the key interfaces? (API)44- What are the prerequisites? (dependencies, setup)45- What are the gotchas? (common mistakes, known issues)4647### 3. Write for the Audience4849Calibrate content to who will read it:50- **New users**: Start with what it does, then how to get started51- **Developers integrating**: Focus on API contracts, examples, error codes52- **Maintainers**: Focus on architecture, decisions, patterns53- **All audiences**: Be concise, use examples, structure with headers5455### 4. Structure the Document5657Follow established conventions:5859**README structure:**601. Title and one-line description612. What it does (2-3 sentences)623. Quick start (minimal steps to get running)634. Installation (detailed setup)645. Usage (key features with examples)656. API reference (if small enough)667. Contributing678. License6869**API doc structure (per endpoint/function):**701. Description712. Parameters (name, type, required, description)723. Return value734. Errors745. Example7576### 5. Include Examples7778Every piece of documentation should include:79- **Working examples**: Code that can be copied and run80- **Expected output**: What the example produces81- **Edge cases**: Examples of error handling8283### 6. Verify Accuracy8485Documentation must match the current code:86- Run examples to confirm they work87- Check parameter names and types against the implementation88- Verify setup steps produce a working environment89- Cross-reference with tests (tests are executable documentation)9091## Output Format9293```94## Documentation: [Target]9596### Type97- Document type: [README/API/guide/changelog/inline]98- Audience: [who will read this]99100### Source Analysis101- Files read: [list]102- Key interfaces: [list]103- Prerequisites: [list]104105### Document Created/Updated106- Path: [file path]107- Sections: [list of sections]108- Examples: [count]109110### Verification111- Examples tested: [yes/no]112- Matches code: [yes/no]113- Reviewed for accuracy: [yes/no]114```115116## Quality Criteria117118- Documentation is accurate (matches the current code)119- Documentation is complete (covers all public interfaces)120- Documentation is concise (no unnecessary verbosity)121- Examples are working and can be copied directly122- Structure follows conventions for the document type123- Audience is considered (appropriate detail level)124- Prerequisites and setup steps are explicit125- Common mistakes and gotchas are documented126127## Common Mistakes128129- **Documenting the obvious**: Comments like `# increment counter` on `counter += 1` add noise, not value. Document WHY, not WHAT.130- **Stale documentation**: Updating code without updating docs. Documentation that's wrong is worse than no documentation.131- **No examples**: API reference without examples forces the reader to guess how to use it. Every function/endpoint needs at least one example.132- **Assuming knowledge**: Not listing prerequisites, assuming the reader knows the setup steps or background context. Be explicit.133- **Wall of text**: Long paragraphs without structure, headers, or formatting. Use headers, lists, tables, and code blocks.134- **Documenting implementation details**: Public documentation should describe behavior and interfaces, not internal implementation. Internal docs go in code comments.135- **Not testing examples**: Including code examples that don't actually work. Always run examples before publishing.136137## Completion138139Documentation is complete when:140- Document type and audience are identified141- Source code is analyzed for accurate information142- Document is written with proper structure and examples143- Examples are verified to work144- Documentation matches the current code145- Document is in the correct location and format146147---148> Source: [mkalkere/agent-coordinator](https://github.com/mkalkere/agent-coordinator) — distributed by [TomeVault](https://tomevault.io).149<!-- tomevault:4.0:skill_md:2026-06-16 -->