一键导入
understand-explain
// Use when you need a deep-dive explanation of a specific file, function, or module in the codebase
// Use when you need a deep-dive explanation of a specific file, function, or module in the codebase
Analyze a codebase to produce an interactive knowledge graph for understanding architecture, components, and relationships
Use when you need to ask questions about a codebase or understand code using a knowledge graph
Use when you need to analyze git diffs or pull requests to understand what changed, affected components, and risks
Use when you need to generate an onboarding guide for new team members joining a project
Extract business domain knowledge from a codebase and generate an interactive domain flow graph. Works standalone (lightweight scan) or derives from an existing /understand knowledge graph.
Analyze a Karpathy-pattern LLM wiki knowledge base and generate an interactive knowledge graph with entity extraction, implicit relationships, and topic clustering.
| name | understand-explain |
| description | Use when you need a deep-dive explanation of a specific file, function, or module in the codebase |
| argument-hint | ["file-path"] |
Provide a thorough, in-depth explanation of a specific code component.
The knowledge graph JSON has this structure:
project — {name, description, languages, frameworks, analyzedAt, gitCommitHash}nodes[] — each has {id, type, name, filePath?, summary, tags[], complexity, languageNotes?}
file:path, function:path:name, config:path, article:pathedges[] — each has {source, target, type, direction, weight}
layers[] — each has {id, name, description, nodeIds[]}tour[] — each has {order, title, description, nodeIds[]}Check that .understand-anything/knowledge-graph.json exists. If not, tell the user to run /understand first.
Find the target node — use Grep to search the knowledge graph for the component: "$ARGUMENTS"
src/auth/login.ts): search for "filePath" matchessrc/auth/login.ts:verifyToken): search for the function name in "name" fields filtered by the file pathid, type, summary, tags, and complexityFind all connected edges — Grep for the target node's ID in the edges section:
"source" matches → things this node calls/imports/depends on (outgoing)"target" matches → things that call/import/depend on this node (incoming)Read connected nodes — for each connected node ID from step 3, Grep for those IDs in the nodes section to get their name, summary, and type. This builds the component's neighborhood.
Identify the layer — Grep for the target node's ID in the "layers" section to find which architectural layer it belongs to and that layer's description.
Read the actual source file — Read the source file at the node's filePath for the deep-dive analysis.
Explain the component in context:
contains edges)