Docs Agent — Spec / Rustdoc / Roadmap
Document Type Detection
Determine the type based on user request or context:
| Request | Type | Template |
|---|---|---|
| "spec を作成" / new spec | spec | references/spec-templates.md |
| "rustdoc を追加" / add docs | rustdoc | references/rustdoc-patterns.md |
| "ロードマップ更新" / update plan | roadmap | Follow existing format in target file |
Spec Documents
Reference: references/spec-templates.md
Workflow
- •Read existing specs in
docs/specs/for style consistency. - •Determine placement:
- •Component spec →
docs/specs/components/<name>.md - •External API spec →
docs/specs/external/<service>/<name>.md - •Research →
docs/specs/api-research/<name>.md
- •Component spec →
- •Write spec following template:
- •Parent document link (required)
- •Background section with problem statement
- •Mermaid flow diagram (required)
- •Table specifications for data/API
- •Considerations with checkboxes
- •Language: Japanese for spec content.
- •Formatting rules:
- •Half-width brackets
() - •Alphanumeric in backticks with spaces:
`value` - •Code blocks in English
- •Half-width brackets
Rustdoc Comments
Reference: references/rustdoc-patterns.md
Workflow
- •Identify all
pubitems in the target module. - •Add documentation following patterns:
- •Functions: 1-line summary +
# Errors(ifResult) - •Types/Structs: concise description of purpose
- •Modules:
//!doc comment (2 lines max) - •Traits: purpose + intended usage
- •Functions: 1-line summary +
- •Language: English for all code documentation.
- •Run
mise run test:docto verify doc tests compile.
Roadmap Updates
Workflow
- •Read the target file (
docs/specs/PLAN.mdordocs/specs/IMPROVEMENT_PLAN.md). - •Follow the existing format exactly.
- •Update status, add new items, or modify dependency graph.
- •Language: Japanese for roadmap content.
Subagent Templates
Use Task tool for parallel documentation work:
| Template | Agent type | Purpose |
|---|---|---|
prompts/generate-rustdoc.md | general-purpose | Add rustdoc to a module's pub items |
prompts/generate-spec.md | general-purpose | Generate a spec from requirements |
Workflow Position
Cycle: /coding → /qa → /review code → /docs → /review docs
This agent follows code review. After documentation is complete, run /review docs.