documentation
Documentation
Route documentation tasks to the right reference and execution path.
Routing
Determine the task type from arguments and context, then load the matching reference:
| Signal | Task type | Load | Execute with |
|---|---|---|---|
Source file path (.ts, .js, .py, .go, .rs, etc.) |
Code comments | references/code-comments.md | @ce:haiku agent |
| Mentions "comments", "inline docs", "code comments" | Code comments | references/code-comments.md | @ce:haiku agent |
| "Clean up comments" in a folder or unstaged changes | Code comments | references/code-comments.md | @ce:haiku agent |
Markdown file path (.md) |
System docs | references/systems.md | General subagent |
Mentions README, API docs, architecture, /docs/ |
System docs | references/systems.md | General subagent |
| Multi-file scope or new documentation | System docs | references/systems.md | General subagent |
| Ambiguous | - | Ask user to clarify scope | - |
Execution
Code comments (delegate to @ce:haiku)
Pass these instructions when delegating:
- Read target file(s) completely, identify language and patterns
- Audit comments using the code-comments reference checklist
- Apply fixes: remove unnecessary comments, rewrite unclear ones
- Report changes: summarize removals, rewrites, and suggested refactors
- For multi-file requests, find changed files via
git status -sor scope to the folder specified
Scope: only inline code comments. If asked about markdown/README/docs content, switch to system docs path.
System docs (spawn general subagent)
Pass these instructions when delegating:
API Documentation:
- Read source files, types, route definitions, error handling paths
- Plan structure using progressive disclosure layers from the systems reference
- Write
{resource-name}.mdin/docs/api/ - Cross-reference related endpoints and guides
README Updates:
- Audit existing README.md, package.json, configs, entry points
- Update: quick start within first 30 lines, installation, config, links to
/docs - Verify all code examples are runnable
Architecture Documentation:
- Read core modules, trace dependencies, identify design decisions
- Document decisions focusing on WHY, not just WHAT
- Add diagrams using
Skill(ce:visualizing-with-mermaid)for flows - Write docs in
/docs/architecture/
For writing style and tone, use Skill(ce:writer) with The Engineer persona.
Location standards
| Doc Type | Location | Filename Pattern |
|---|---|---|
| Project overview | Root | README.md |
| API reference | /docs/api/ |
{resource-name}.md |
| Architecture | /docs/architecture/ |
{topic}.md |
| Guides/How-to | /docs/guides/ |
{topic}.md |
Examples
| Input | Routes to |
|---|---|
/documentation src/utils/auth.ts |
Code comments |
/documentation clean up comments in unstaged changes |
Code comments |
/documentation README |
System docs |
/documentation API docs for /users endpoint |
System docs |
/documentation architecture overview |
System docs |
More from rileyhilliard/claude-essentials
design
Enforces precise, minimal design for dashboards and admin interfaces. Use when building SaaS UIs, data-heavy interfaces, or any product needing Jony Ive-level craft.
18strategy-writer
Produces executive-quality strategic documents in The Economist/HBR style. Use when writing strategy memos, market analysis, business cases, customer research reports, or any document for Product, Design, and Business leaders. Customer-led, evidence-based, narrative-driven.
13handling-errors
Prevents silent failures and context loss in error handling. Use when writing try-catch blocks, designing error propagation, reviewing catch blocks, or implementing Result patterns.
12optimizing-performance
Measure-first performance optimization that balances gains against complexity. Use when addressing slow code, profiling issues, or evaluating optimization trade-offs.
12migrating-code
Safe code migrations with backward compatibility and reversibility. Use when upgrading dependencies, changing database schemas, API versioning, or transitioning between technologies.
11fixing-flaky-tests
Diagnose and fix tests that pass in isolation but fail when run concurrently. Covers shared state isolation and resource conflicts. References condition-based-waiting for timing issues.
10