3.5 KiB
3.5 KiB
allowed-tools, description, wave-enabled, complexity-threshold
| allowed-tools | description | wave-enabled | complexity-threshold | ||||||
|---|---|---|---|---|---|---|---|---|---|
|
Create clear, accurate technical documentation following project patterns | true | 0.5 |
/hc:document - Technical Documentation
Purpose
Create clear, accurate technical documentation that follows existing project patterns and helps users succeed with the software.
Usage
/hc:document [target] [--type readme|api|guide|inline|reference] [--scope focused|comprehensive] [--framework nextra|docusaurus|vitepress|none]
Arguments
target- File, directory, function, or feature to document--type- Documentation type:readme- Project or module README filesapi- API reference documentationguide- User guides and tutorialsinline- Code comments and annotationsreference- Technical specifications and configurations
--scope- Documentation depth (focused for specific items, comprehensive for full coverage)--framework- Documentation framework to use (optional, defaults to existing or none)
Execution
-
Pattern Analysis Phase
- Use @agent-tech-writer to analyze existing documentation patterns
- Identify project's documentation style and conventions
- Understand the codebase structure and implementation
- Determine target audience and their needs
-
Content Generation Phase
- @agent-tech-writer creates documentation following identified patterns
- For API docs: Extract from actual implementation and annotations
- For guides: Focus on real user tasks and common scenarios
- For README: Follow project's existing structure or best practices
- Ensure technical accuracy over comprehensive coverage
-
Quality Assurance Phase
- Validate accuracy against actual code implementation
- Check consistency with existing documentation
- Ensure examples work and are practical
- Verify accessibility and readability
-
Integration Phase
- Place documentation in appropriate locations
- Update cross-references and navigation
- Ensure documentation fits naturally in project
Claude Code Integration
- Primary Agent: @agent-tech-writer for all documentation tasks
- Supporting Agents:
- @agent-architect: When needing system design context
- @agent-coder: For extracting implementation details
- @agent-designer: For UI component documentation
- MCP Servers:
- Tree-Sitter: Analyze code structure and extract signatures
- Context7: Research best practices when patterns unclear
- Memory: Store and retrieve documentation patterns
- Search Priority: WebSearch > WebFetch for documentation standards
- Tools:
- Read/Grep: Analyze existing documentation
- Task: Create, update, and manage documentation files
- Task: Coordinate with other agents when needed
Examples
# Document a specific API endpoint
/hc:document src/api/users.js --type api --scope focused
# Create comprehensive project README
/hc:document . --type readme --scope comprehensive
# Generate user guide for a feature
/hc:document src/features/auth --type guide
# Add inline documentation to code
/hc:document src/utils/validators.js --type inline
# Build documentation site with Nextra
/hc:document . --type guide --scope comprehensive --framework nextra
Best Practices
- Always analyze existing patterns first
- Focus on what users need to accomplish
- Write from the user's perspective
- Provide working, practical examples
- Maintain technical accuracy
- Let content drive structure, not framework features