/sprang:sprang-why <file | path:function>from sprang
Understand why a file or function exists — git history, decision context, team annotations. Use when the user says "/sprang-why", "why does this exist", "who wrote this", "history of this file", or "what decisions led to this".
Ships in sprang. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Explain why a specific file or function exists, who built it, and what decisions shaped it.
Arguments: <file path or path:functionName>
Check .sprang/knowledge-graph.json exists. If not, run the sprang-analyze
skill first.
Call sprang_query with the argument to find the matching node ID.
Call sprang_why with the resolved node_id to retrieve decision_context:
commits[]: sha, date, message, authorprimary_authors[], last_changed, change_frequencyrationale_snippets[] (extracted from commit messages)pr_references[], changelog_entries[]Call sprang_node with the same node_id to get:
layer (name + id) and layer_mate_count — where it fits in the architecturein_degree / out_degree — how coupled it ishas_annotation / annotation_path — whether team knowledge existsIf decision context is sparse (skeleton graph), fetch it directly from git:
git -C "$PROJECT_ROOT" log --follow --format="%H|%ae|%as|%s|%b" -- "$filePath" | head -30
git -C "$PROJECT_ROOT" blame --line-porcelain "$filePath" 2>/dev/null \
| grep "^author " | sort | uniq -c | sort -rn | head -5
git -C "$PROJECT_ROOT" log --follow -5 -p -- "$filePath" 2>/dev/null
If has_annotation is true, display the full annotation content prominently.
Read the actual source file to understand its current state.
Explain:
change_frequency >= 10, flag as frequently-churning — extra care requiredrisk_score > 0.7Cross-reference pr_references with related notes or changelog entries.
Offer to add an annotation with sprang_annotate — it writes
.sprang/annotations/<node-id>.md and shows up in future runs of this skill.
$ARGUMENTS
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub faviovazquez/sprang --plugin sprang11 skills in this plugin
/sprangBuild or refresh the Sprang knowledge graph for this workspace. Use when the user says "/sprang", "build the knowledge graph", "scan the codebase", "index this project", or "run sprang"./sprang-analyzeAnalyze a codebase to produce a rich semantic knowledge graph — file summaries, architecture layers, guided tour, domain map, risk scores. Use when the user says "/sprang-analyze", "analyze the codebase", "full analysis", or "run sprang-analyze"./sprang-chatAsk any question about the codebase using the knowledge graph. Use when the user says "/sprang-chat", "ask about the codebase", "what does X do", or any question about code that should be answered from the knowledge graph./sprang-diffBlast radius analysis for changed files — shows what will break if you change something. Use when the user says "/sprang-diff", "what will break", "blast radius", "impact analysis", or "what depends on this"./sprang-domainMap code to business processes and domain hierarchy. Use when the user says "/sprang-domain", "business domains", "domain map", "what business process does X implement", or "show me the domain structure"./sprang-explainDeep-dive explanation of a specific file, function, or module. Use when the user says "/sprang-explain", "explain this file", "what does this function do", or "deep dive on X".