Generate comprehensive documentation for code, APIs, or components. Creates markdown docs following best practices.
Commands are custom slash commands that extend Claude Code's functionality. They're markdown files in .claude/commands/ that define reusable prompts or workflows. Invoke them with /command-name in Claude Code. Commands can accept arguments and automate complex multi-step tasks.
Save as `.claude/commands/docs.md` and use `/docs <target>`
Generate documentation for the specified code: ## Documentation Structure ### For Functions/Methods ```markdown ## functionName **Description**: What the function does **Parameters**: | Name | Type | Required | Description | |------|------|----------|-------------| | param1 | string | Yes | Description | **Returns**: `ReturnType` - Description **Example**: ```typescript const result = functionName(arg1, arg2); ``` **Throws**: List of possible errors ``` ### For Components ```markdown ## ComponentName **Description**: What the component renders **Props**: | Prop | Type | Default | Description | |------|------|---------|-------------| **Usage**: ```tsx <ComponentName prop1="value" /> ``` ``` ### For APIs ```markdown ## Endpoint: METHOD /path **Description**: What this endpoint does **Request**: - Headers: ... - Body: ... **Response**: - Success (200): ... - Error (4xx): ... ```
Generate conventional commit messages following the project style. Analyzes staged changes and creates properly formatted commits.
Generate comprehensive test cases for functions, components, or modules. Creates unit tests following testing best practices.
Perform a thorough code review of specified files or recent changes. Checks for bugs, security issues, and best practices.