Skip to main content

Overview

The detect_impact prompt guides AI agents through a comprehensive pre-commit impact analysis workflow. It analyzes your current code changes, identifies affected execution flows, and provides a risk assessment. Use this before committing to understand the blast radius of your changes.

Parameters

string
default:"all"
What changes to analyze:
  • unstaged — Only unstaged changes
  • staged — Only staged changes
  • all — All uncommitted changes (staged + unstaged)
  • compare — Compare against a specific branch/commit (requires base_ref)
string
Branch or commit to compare against (required if scope is compare)Examples: main, develop, HEAD~1, a1b2c3d

What It Does

The prompt instructs the agent to:
  1. Run detect_changes with the specified scope to find changed symbols and affected processes
  2. Analyze critical symbols using context tool to see full reference graph
  3. Check blast radius using impact tool for high-risk items
  4. Generate risk report with changes, affected processes, risk level, and recommendations

Usage

In Claude Desktop

Agent will ask for parameters or use defaults.

In Cursor/OpenCode

Invoke the prompt from the MCP prompts menu, or reference it directly:

With Parameters

Example Workflow

Here’s what the agent does when you invoke this prompt:
1

Detect Changes

Runs detect_changes({scope: "all"}) to find modified symbols and affected processes
2

Analyze Critical Symbols

For each symbol in critical processes, runs context({name: "validateUser"}) to see:
  • All callers
  • All callees
  • Process participation
  • Related symbols
3

Check Blast Radius

For high-risk symbols (many callers or cross-process usage), runs:
To see what breaks at depth 1, 2, and 3.
4

Generate Report

Summarizes findings:

Example Output

The agent presents a structured risk report:

When to Use

Before Committing

Run this before every commit to catch breaking changes

Before PR

Include the report in your PR description

During Code Review

Use to understand reviewer’s concerns about blast radius

Before Deploy

Final check before merging to production

Comparison with Tools

This prompt orchestrates multiple tools: The prompt provides the workflow logic while tools provide the data.

Next Steps

Detect Changes Tool

Learn about the underlying tool used by this prompt