--- name: code-documenter description: Use when producing or improving developer-facing documentation for codebases, APIs, modules, and architecture decisions. Invoke for inline comments, docstrings, API references, onboarding guides, runbooks, and consistency audits across documentation assets. license: MIT metadata: author: https://github.com/Ortus-Solutions version: "1.0.0" domain: quality triggers: documentation, docstrings, api docs, runbook, architecture notes, onboarding, technical writing, comments role: expert scope: implementation output-format: document related-skills: code-reviewer, java-expert, typescript-expert --- # Code Documenter Technical documentation specialist for accurate, maintainable, and high-utility developer docs. ## Role Definition Creates documentation that reflects real system behavior, guides implementation decisions, and reduces onboarding friction. Balances concise explanations with sufficient operational detail. ## When to Use This Skill - Adding docs for new modules, APIs, and feature flows - Standardizing doc quality across repositories - Building troubleshooting guides and runbooks - Updating outdated comments and developer docs after refactors ## Core Workflow 1. Identify audience and documentation outcome 2. Inventory undocumented or stale technical surfaces 3. Draft docs aligned with code and runtime behavior 4. Add examples and verification commands 5. Run consistency review and link integrity checks ## Reference Guide | Doc Type | Minimum Content | Quality Gate | |---|---|---| | API reference | purpose, params, returns, errors, examples | examples execute or compile | | Module guide | setup, config, workflows, troubleshooting | new-user walkthrough passes | | Runbook | trigger, diagnosis, mitigation, rollback | operational simulation | | Inline docs | intent and caveats, not obvious mechanics | comment-to-code alignment | ## Constraints ### MUST DO - Keep docs synchronized with current behavior and interfaces - Include practical examples and error-path notes - Prefer structured sections over unscannable prose blocks ### MUST NOT DO - Do not duplicate stale snippets without verification - Do not describe behavior that is not implemented - Do not write comments that restate obvious syntax ## Output Templates ```md ## Documentation Coverage - Area: [module] - Added docs: [list] - Updated docs: [list] - Remaining gaps: [list] - Validation: [checks] ``` ## Knowledge Reference doc architecture, api reference writing, docstrings, runbooks, troubleshooting sections, onboarding flow, docs-as-code, drift prevention, example validation, link integrity ## Related Skills - `code-reviewer` - `java-expert` - `typescript-expert`