원클릭으로
gitnexus-impact-analysis
// Use when the user wants to know what will break if they change something, or needs safety analysis before editing code. Examples: "Is it safe to change X?", "What depends on this?", "What will break?"
// Use when the user wants to know what will break if they change something, or needs safety analysis before editing code. Examples: "Is it safe to change X?", "What depends on this?", "What will break?"
| name | gitnexus-impact-analysis |
| description | Use when the user wants to know what will break if they change something, or needs safety analysis before editing code. Examples: "Is it safe to change X?", "What depends on this?", "What will break?" |
IMPORTANT — How to use GitNexus: GitNexus is a standalone CLI tool. Run it directly via
gitnexus <command>in the Bash tool. Do NOT usemcpl call gitnexus ....
Multi-repo note: Always pass
--repo <name>to every command to avoid "multiple repositories" errors.
1. gitnexus impact "X" --direction upstream --repo <name> → What depends on this
2. gitnexus context "X" --repo <name> → See affected execution flows
3. gitnexus detect-changes --repo <name> → Map current git changes to affected flows
4. Assess risk and report to user
If "Index is stale" → run
gitnexus analyzein terminal.
- [ ] gitnexus impact "X" --direction upstream to find dependents
- [ ] Review d=1 items first (these WILL BREAK)
- [ ] Check high-confidence (>0.8) dependencies
- [ ] gitnexus context to see affected execution flows
- [ ] gitnexus detect-changes for pre-commit check
- [ ] Assess risk level and report to user
| Depth | Risk Level | Meaning |
|---|---|---|
| d=1 | WILL BREAK | Direct callers/importers |
| d=2 | LIKELY AFFECTED | Indirect dependencies |
| d=3 | MAY NEED TESTING | Transitive effects |
| Affected | Risk |
|---|---|
| <5 symbols, few processes | LOW |
| 5-15 symbols, 2-5 processes | MEDIUM |
| >15 symbols or many processes | HIGH |
| Critical path (auth, payments) | CRITICAL |
gitnexus impact — the primary tool for symbol blast radius:
gitnexus impact "validateUser" --direction upstream --repo my-app
# Optional flags: --min-confidence 0.8 --max-depth 3
#
# → d=1 (WILL BREAK):
# - loginHandler (src/auth/login.ts:42) [CALLS, 100%]
# - apiMiddleware (src/api/middleware.ts:15) [CALLS, 100%]
#
# → d=2 (LIKELY AFFECTED):
# - authRouter (src/routes/auth.ts:22) [CALLS, 95%]
gitnexus detect-changes — git-diff based impact analysis:
gitnexus detect-changes --repo my-app
# → Changed: 5 symbols in 3 files
# → Affected: LoginFlow, TokenRefresh, APIMiddlewarePipeline
# → Risk: MEDIUM
# 1. Upstream blast radius
gitnexus impact "validateUser" --direction upstream --repo my-app
# → d=1: loginHandler, apiMiddleware (WILL BREAK)
# → d=2: authRouter, sessionManager (LIKELY AFFECTED)
# 2. Confirm affected execution flows
gitnexus context "validateUser" --repo my-app
# → Processes: LoginFlow, TokenRefresh
# 3. Risk: 2 direct callers, 2 processes = MEDIUM
Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate a wiki, or list indexed repos. Examples: "Index this repo", "Reanalyze the codebase", "Generate a wiki"
Use when the user is debugging a bug, tracing an error, or asking why something fails. Examples: "Why is X failing?", "Where does this error come from?", "Trace this bug"
Use when the user asks how code works, wants to understand architecture, trace execution flows, or explore unfamiliar parts of the codebase. Examples: "How does X work?", "What calls this function?", "Show me the auth flow"
Use when the user wants to rename, extract, split, move, or restructure code safely. Examples: "Rename this function", "Extract this into a module", "Refactor this class", "Move this to a separate file"
Use when the user asks about GitNexus itself — available tools, how to query the knowledge graph, graph schema, or workflow reference.
Trace bugs through call chains using knowledge graph