Generate documentation for specific feature or component
Generates specialized documentation for features, components, or modules using domain-specific agents.
/plugin marketplace add hculap/better-code/plugin install doc-master@better-code<feature> [--type tutorial|howto|reference|explanation] [--output path]Generate documentation for a specific feature, component, or module using the appropriate specialized agent.
feature (required): What to document
--type (optional): Document type to generate
tutorial: Learning-oriented walkthroughhowto: Task-oriented guidereference: Technical reference documentationexplanation: Conceptual explanation--output (optional): Output path for generated documentation
Read .claude/doc-master.local.md for:
Locate feature code:
Understand feature:
Identify domain:
If --type not specified, determine based on:
Collect all information needed for documentation:
CRITICAL: You MUST use the Task tool to spawn the appropriate specialized agent. Do NOT generate documentation yourself - delegate to the domain-specific agent.
Use the Task tool with the appropriate subagent_type:
doc-master:backend-docs - For backend/service documentationdoc-master:frontend-docs - For frontend/component documentationdoc-master:api-docs - For API/endpoint documentationdoc-master:database-docs - For database/schema documentationdoc-master:architecture-docs - For architecture/design documentationdoc-master:test-docs - For test strategy documentationdoc-master:user-guide-docs - For end-user documentationdoc-master:compliance-docs - For compliance/security documentationdoc-master:mobile-docs - For mobile app documentationExample Task tool call:
Task(
subagent_type="doc-master:backend-docs",
description="Document user service",
prompt="Generate reference documentation for the user service at src/services/user.ts. Include all public methods, parameters, return types, and examples. Return the complete documentation as your response - do NOT write files."
)
IMPORTANT: The agent will return documentation as text output. Capture the task_id from the Task tool response.
Use TaskOutput to wait for the agent to complete and capture the generated documentation:
TaskOutput(task_id: [task-id-from-step-5], block: true, timeout: 300000)
The agent will return the complete documentation content as text. This content will be used in Step 8 to write the file.
The spawned agent will generate documentation following these guidelines:
For Reference Documentation:
For Tutorial:
For How-To Guide:
For Explanation:
Review the documentation returned by the agent and verify it follows the configured standard:
Diátaxis:
Traditional:
Custom:
CRITICAL: You MUST write the documentation to a file. Do NOT just display it.
Determine output path:
--output path if providedWrite the documentation:
Confirm to user:
Generate API reference:
/doc-master:generate "users API" --type reference
Analyzing users API...
Found: src/api/users.ts (245 lines)
Domain: API documentation
Type: Reference
Generating documentation...
# Users API Reference
## Overview
The Users API provides endpoints for managing user accounts...
## Endpoints
### GET /users
List all users with pagination support.
#### Parameters
| Name | Type | Required | Description |
...
[Full reference documentation]
Save to docs/reference/api/users.md? [Y/n]
Generate tutorial:
/doc-master:generate "authentication" --type tutorial
Analyzing authentication feature...
Found: src/auth/ (12 files)
Domain: Backend
Type: Tutorial
Generating documentation...
# Implementing User Authentication
In this tutorial, you'll add complete user authentication
to your application...
## What You'll Build
- User registration
- Login/logout flow
- Protected routes
## Prerequisites
- Node.js 18+
- Completed Getting Started guide
## Step 1: Install Dependencies
...
Save to docs/tutorials/authentication.md? [Y/n]
Auto-detect type:
/doc-master:generate "Button component"
Analyzing Button component...
Found: src/components/Button/Button.tsx
Domain: Frontend
Detected type: Reference (component API)
Generating documentation...
# Button Component
A customizable button component for user interactions.
## Props
| Prop | Type | Default | Description |
...
## Variants
...
## Examples
...
Each domain agent brings specialized knowledge:
| Domain | Agent | Specialization |
|---|---|---|
| Backend | backend-docs | Services, data flows, deployment |
| Frontend | frontend-docs | Components, state, accessibility |
| API | api-docs | Endpoints, schemas, auth |
| Database | database-docs | Schema, migrations, queries |
| Architecture | architecture-docs | Design, ADRs, diagrams |
| Tests | test-docs | Strategy, coverage, plans |
| User Guides | user-guide-docs | Workflows, tutorials, UX |
| Compliance | compliance-docs | Security, audit, regulatory |
| Mobile | mobile-docs | Platform-specific, stores |
--type to override auto-detection/generateGenerate ready-to-execute hypershift cluster creation commands from natural language descriptions
/generateGenerate documentation from TypeScript/JavaScript code, OpenAPI specs, GraphQL schemas, and SpecWeave specifications.