skills/duc01226/easyplatform/graph-blast-radius

graph-blast-radius

Installation
SKILL.md

Blast Radius

Analyze the structural impact of current code changes using the knowledge graph.

Prerequisites

  • Graph must be built first: run /graph-build if .code-graph/graph.db doesn't exist
  • Requires Python 3.10+ with tree-sitter, tree-sitter-language-pack, networkx

Steps

  1. Check graph exists — Verify .code-graph/graph.db exists. If not, suggest /graph-build.

  2. Run blast-radius analysis via Bash:

    python .claude/scripts/code_graph blast-radius --json
    
  3. Parse JSON output and present:

    • Changed files: List of modified files (auto-detected from git)
    • Changed nodes: Functions/classes directly modified
    • Impacted nodes: Functions/classes affected within 2 hops (callers, dependents, tests)
    • Impacted files: Additional files that may need attention
    • Truncation: If results were truncated, note total vs shown
  4. Risk assessment based on blast radius size:

    • Low risk: <5 impacted nodes, changes well-contained
    • Medium risk: 5-20 impacted nodes, review callers carefully
    • High risk: >20 impacted nodes, consider splitting PR
  5. Recommendations:

    • Flag untested changed functions
    • Suggest files to prioritize in review
    • Warn about inheritance/implementation relationship changes

Trace for Deep Impact Analysis

For impact beyond direct callers/importers, use the trace command to follow the full chain through implicit connections:

python .claude/scripts/code_graph trace <changed-file> --direction downstream --depth 3 --json

# File-level overview first (10-30x less noise), then drill into functions:
python .claude/scripts/code_graph trace <changed-file> --direction downstream --node-mode file --json

This reveals downstream impact through MESSAGE_BUS edges (cross-service event consumers), TRIGGERS_EVENT (entity event handlers), and other implicit relationships that blast-radius may not surface directly.

Additional Queries

For deeper investigation, run via Bash:

  • python ... query callers_of <function> --json — who calls this function?
  • python ... query tests_for <function> --json — what tests cover this?
  • python ... query inheritors_of <class> --json — what inherits from this?
  • python ... query importers_of <file> --json — who imports this file?
Weekly Installs
2
GitHub Stars
6
First Seen
12 days ago
Installed on
amp2
cline2
opencode2
cursor2
kimi-cli2
warp2