Agent Skills
› tintinweb/pi-gitnexus
› gitnexus-impact-analysis
gitnexus-impact-analysis
GitHub用于代码修改前的安全分析,评估变更影响范围。通过上游依赖查询和Git差异检测,识别潜在破坏点并分级风险(低/中/高/关键),辅助用户决策是否提交或测试。
Trigger Scenarios
询问修改某功能是否安全
想知道修改X会导致什么后果
查看代码的爆炸半径
谁使用了这段代码
进行非平凡代码更改前
提交代码前检查影响
Install
npx skills add tintinweb/pi-gitnexus --skill gitnexus-impact-analysis -g -y
SKILL.md
Frontmatter
{
"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?\""
}
Impact Analysis with GitNexus
When to Use
- "Is it safe to change this function?"
- "What will break if I modify X?"
- "Show me the blast radius"
- "Who uses this code?"
- Before making non-trivial code changes
- Before committing — to understand what your changes affect
Workflow
1. gitnexus_impact({target: "X", direction: "upstream"}) → What depends on this
2. gitnexus_detect_changes() → Map current git changes to affected flows
3. Assess risk and report to user
If index is stale → run
/gitnexus analyzeto rebuild.
Understanding Output
| Depth | Risk Level | Meaning |
|---|---|---|
| d=1 | WILL BREAK | Direct callers/importers |
| d=2 | LIKELY AFFECTED | Indirect dependencies |
| d=3 | MAY NEED TESTING | Transitive effects |
Risk Assessment
| 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 |
Checklist
- [ ] gitnexus_impact({target, direction: "upstream"}) to find dependents
- [ ] Review d=1 items first (these WILL BREAK)
- [ ] Check high-confidence (>0.8) dependencies
- [ ] gitnexus_detect_changes() for pre-commit check
- [ ] Assess risk level and report to user
Tools
gitnexus_impact — primary tool for symbol blast radius:
gitnexus_impact({
target: "validateUser",
direction: "upstream",
minConfidence: 0.8,
maxDepth: 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({scope: "staged"})
→ Changed: 5 symbols in 3 files
→ Affected: LoginFlow, TokenRefresh, APIMiddlewarePipeline
→ Risk: MEDIUM
Example: "What breaks if I change validateUser?"
1. gitnexus_impact({target: "validateUser", direction: "upstream"})
→ d=1: loginHandler, apiMiddleware (WILL BREAK)
→ d=2: authRouter, sessionManager (LIKELY AFFECTED)
2. Risk: 2 direct callers, 2 processes = MEDIUM
→ Recommend: update loginHandler and apiMiddleware first, then run tests
Version History
- e81629e Current 2026-07-05 20:17


