From understand-anything
Generate an architecture summary from the knowledge graph and inject it into CLAUDE.md, AGENTS.md, or .github/copilot-instructions.md so every agent session starts with codebase context
How this skill is triggered — by the user, by Claude, or both
Slash command
/understand-anything:understand-contextThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Reads `.understand-anything/knowledge-graph.json` (and `domain-graph.json` if present) and writes a structured architecture summary into the platform-appropriate context file. Run once after `/understand` — every subsequent agent session will have ambient architectural context without needing to query the graph.
Reads .understand-anything/knowledge-graph.json (and domain-graph.json if present) and writes a structured architecture summary into the platform-appropriate context file. Run once after /understand — every subsequent agent session will have ambient architectural context without needing to query the graph.
Check the graph exists.
[ -f .understand-anything/knowledge-graph.json ] || { echo "No knowledge graph found. Run /understand first."; exit 1; }
Read the graph data. Use grep/jq to extract:
project section: name, description, languages, frameworks, analyzedAt, gitCommitHash (first 8 chars)layers array: id, name, description, nodeIds length per layertour array: order, title, first sentence of description"complexity": "complex" — complexity hotspots"entry-point" — key entry pointsDetect the target context file (check in this order):
[ -f CLAUDE.md ] → target is CLAUDE.md[ -f AGENTS.md ] → target is AGENTS.md[ -f .github/copilot-instructions.md ] → target is .github/copilot-instructions.mdAGENTS.md (create it)Check for existing markers in the target file:
<!-- understand-anything:start --> and <!-- understand-anything:end --> are both present: replace only the content between them (inclusive of the marker lines)Write the summary block with this exact format:
<!-- understand-anything:start -->
## Codebase Architecture (understand-anything)
**Project:** {name} — {description}
**Languages:** {languages joined by ", "} **Frameworks:** {frameworks joined by ", " or "none detected"}
**Last analyzed:** {analyzedAt formatted as YYYY-MM-DD} (commit {first 8 chars of gitCommitHash})
**Graph:** `.understand-anything/knowledge-graph.json`
### Architectural layers
| Layer | Files | Purpose |
|---|---|---|
{one row per layer: | {layer.name} | {nodeIds.length} | {layer.description} |}
### Key entry points
{For each file node tagged "entry-point": - `{filePath}` — {summary}}
{If no entry-point tagged nodes: list the first 3 file nodes from the first tour step}
### Complexity hotspots (approach with care)
{For each file node with complexity "complex": - `{filePath}` — {summary}}
{If no complex nodes: write "No files currently marked complex."}
### Learning path ({tour.length} steps)
{For each tour step: {order}. **{title}** — {first sentence of description}}
<!-- understand-anything:end -->
If domain-graph.json exists, insert a "### Business Domains" section before the closing marker:
### Business Domains
{For each node with type "domain": - **{name}**: {summary}}
Report to the user:
✓ Architecture summary written to {target file}
Layers: {N} Entry points: {N} Hotspots: {N} Tour steps: {N}
Every agent session in this project will now start with codebase context.
Re-run /understand-context after /understand to keep it fresh.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub az9713/understand-anything-tutorial --plugin understand-anything