Generate documentation for functions and modules.
## Claude Code Custom Command: /doc A reusable slash command for Claude Code. ### .claude/commands/doc.md ```markdown --- description: Generate documentation for functions and modules. --- Analyze the provided code and doc it. ## Instructions 1. Read the file or selection provided 2. Generate documentation for functions and modules. 3. Provide structured output with: - Summary of findings - Specific recommendations (numbered) - Code changes (if applicable) - Next steps ## Rules - Be thorough but concise - Prioritize findings by severity - Always explain WHY, not just WHAT - Reference line numbers when possible - Consider edge cases and error handling - Follow the project's CLAUDE.md conventions ## Output Format ### Summary [Brief overview of findings] ### Findings 1. [HIGH] Finding description 2. [MEDIUM] Finding description 3. [LOW] Finding description ### Suggested Changes [Code diff or implementation] ### Next Steps - [Action item 1] - [Action item 2] ``` ### Usage Type `/doc` in Claude Code to invoke this command on any file or selection.
Free to copy and use. Compatible with Claude Code, Claude 4 Opus.
Copy this prompt into your Claude Code project. Customize bracketed variables for your specific setup.
Initial release
Sign in and download this prompt to leave a review.