npm.io
0.1.5 • Published 2d ago

pi-blast-radius

Licence
MIT
Version
0.1.5
Deps
0
Size
483 kB
Vulns
0
Weekly
0

pi-blast-radius

Predict what a code change might break — before it ships.

A pi package. Type /blast-radius in any git repository and the agent traces references, gathers fragility signals, scores risk, and prints a single markdown impact report. No dashboards, no graphs — just answers.

pi-blast-radius demo

Documentation and demo · npm


Why

Every change raises one question: what is the blast radius? This package turns your pi agent into an impact analyst. It runs git diff, greps for every caller, import, and string reference, follows the dependency chain to closure, and tells you what is likely to break and which tests to run.

Install

Use pi's installer — not npm i — so the extension registers with pi.

# from npm
pi install npm:pi-blast-radius

# or from git
pi install git:github.com/abrahamjeron/pi_blast_radius

# try without installing
pi -e ./extensions/index.ts

Verify with pi list, then run /blast-radius inside a pi session.

Usage

/blast-radius                 analyze uncommitted and staged changes
/blast-radius HEAD~3          analyze the last 3 commits
/blast-radius <sha>           analyze a specific commit
/blast-radius <branch>        diff a branch against its base

What you get

A single markdown report — impacted symbols ranked by risk, downstream and cross-service risks, the exact tests to run, and an overall risk score.

## Blast Radius Report
### Change Summary
### Impacted (ranked by risk)
| Symbol | File:Line | Type | Risk | Why |
### Downstream / Cross-service risks
### Tests to run
### Risk score: X/10

Node types: direct, transitive, test, public-export, config, cross-service. Risk factors: fan-in, depth, exported or public surface, test coverage, and churn history.

How it works

The /blast-radius command sends a short task as the user turn and injects the full analysis workflow into the system prompt for that turn. pi's agent loop then runs it with the built-in bash, grep, and read tools and emits the report. All the intelligence lives in the workflow prompt (src/prompt.ts); there are no custom tools.

The analysis is read-only. The workflow forbids any mutation or network command — no writes, no rm, mv, or redirects, no git push or commit, no curl. It only inspects with git diff, show, log, blame, and grep.

Development

git clone https://github.com/abrahamjeron/pi_blast_radius
cd pi_blast_radius
pi -e ./extensions/index.ts

Publishing is automated: merge to main with a bumped version in package.json and the GitHub Actions workflow publishes to npm. Requires an NPM_TOKEN repository secret.

License

MIT

Keywords