Write Docs
This skill allows the agent to produce high-quality written knowledge artifacts — READMEs, guides, API specs, tutorials, runbooks, and wikis — that are clear, accurate, and audience-appropriate.
Steps
- Identify the document type. Determine what artifact is needed: README, runbook, API spec, tutorial, changelog, etc. Each has a different structural contract.
- Define the target audience. Who is reading this? (e.g., a new developer, an existing agent, a business stakeholder). Audience determines vocabulary, depth, and assumed knowledge.
- Read the source material fresh. Apply the Zero-Drift Audit Law — do NOT write documentation from memory. Read the actual current state of the system/code/process.
- Draft an outline. Define the sections before writing prose. Get the structure right first.
- Write section by section. Fill each section with accurate, concise content. Prefer examples over abstract descriptions.
- Apply format standards.
- Use semantic heading hierarchy (single H1, then H2/H3)
- Code blocks for all commands and code
- Tables for comparative or multi-field data
- Alerts/callouts for warnings and critical notes
- Self-review. Check: Is every statement accurate? Is anything ambiguous? Are examples runnable?
- Output the final document.
Document Type Templates
| Type | Key Sections |
|---|---|
| README | What It Does, Setup, Usage, Examples |
| Runbook | Objective, Prerequisites, Steps, Rollback |
| API Spec | Endpoint, Method, Auth, Request, Response, Errors |
| Tutorial | Goal, Prerequisites, Step-by-step, Expected Output |
| Changelog | Version, Date, Added / Changed / Fixed / Removed |
Notes
- Documentation written without reading source material is a liability, not an asset.
- For large codebases, use the
ragtoolbox (pyragify) to pre-chunk before documenting.