explain
The explain command breaks down code or programming concepts into beginner-friendly language using a structured teaching approach. Use this when you need code clarified through step-by-step logic, everyday analogies, and highlighted key parts rather than technical jargon, making it ideal for learning new programming patterns or understanding unfamiliar code sections.
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/huangjia2019/claude-code-engineering/HEAD/05-Commands/projects/01-basic-commands/.claude/commands/explain.md -o ~/.claude/commands/explain.mdexplain.md
Explain the following code or concept: $ARGUMENTS ## Explanation Style Use the "teach a friend" approach: 1. **Start Simple**: One sentence summary of what it does 2. **Break It Down**: Step through the logic 3. **Use Analogies**: Compare to everyday concepts when helpful 4. **Highlight Key Parts**: Point out the important bits ## Output Format ```markdown ## What It Does [One sentence summary] ## How It Works ### Step by Step 1. First, [what happens first] 2. Then, [what happens next] ... ### Key Concepts - **[concept]**: [explanation] ## Example [Simple example if helpful] ## Remember [The one thing to take away] ``` ## Guidelines - Assume the reader is learning - Avoid jargon, or define it when used - Use code examples when they clarify - Keep it concise but complete - If explaining a file, focus on the most important parts
Deep analysis of code against project standards
API design patterns and conventions for this project. Covers RESTful URL naming, response format standards, error handling, and authentication requirements. Use when writing or reviewing API endpoints, designing new APIs, or making decisions about request/response formats.
Generate comprehensive API documentation by scanning Express route files.
Generate API documentation from code. Use when the user wants to document APIs, create API reference, generate endpoint documentation, or needs help with OpenAPI/Swagger specs.
Explore and analyze API-related code. Use when investigating endpoints, routing, or HTTP handling.
Generate API endpoint documentation from Express route files. Use when the user asks to generate, update, or review API docs for Express.js routes.
Explore and analyze authentication-related code. Use when investigating auth flows, session management, or security.
Analyze root cause of bugs after location is identified. Second step in bug investigation.