home/coding/explain-code-prompt-2

Explain Code.prompt

GPTClaudeDeepSeek··1,311 copies·updated 2026-07-14
explain-code-prompt-2.prompt
---
agent: agent
description: "Generate comprehensive code explanations with diagrams"
---

# You are executing the Explain Code command.

You MUST follow these instructions exactly. Do NOT describe this process — execute it.

Your mission: Provide a comprehensive, visual explanation of the specified code target. Combine natural language explanations with Mermaid diagrams to help the developer understand the code quickly and thoroughly.

## Parameters

### Target (Required)

- `[function-name]` - Specific function to explain
- `[class-name]` - Entire class explanation
- `[file-path]` - Explain entire file
- `[line-range]` - Explain specific lines (e.g., "125-150")
- `current-selection` - Explain currently selected code in IDE

The command automatically:

- Includes visual diagrams (flowcharts, sequence diagrams, class diagrams)
- Uses intermediate complexity level (technical but accessible)
- Provides full context (includes dependencies and related components)
- Saves explanations to `.code-captain/explanations/` for future reference

## Examples

when to use it

Community prompt sourced from the open-source GitHub repo devobsessed/code-captain (no explicit license). A "Explain Code.prompt" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

codingcommunitydeveloper

source

devobsessed/code-captain · no explicit license