重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
gitnexus-pr-review by abhigyanpatwari/gitnexus
npx skills add https://github.com/abhigyanpatwari/gitnexus --skill gitnexus-pr-review1. gh pr diff <number> → 获取原始差异
2. gitnexus_detect_changes({scope: "compare", base_ref: "main"}) → 将差异映射到受影响的流程
3. 对于每个变更的符号:
gitnexus_impact({target: "<symbol>", direction: "upstream"}) → 每个变更的影响范围
4. gitnexus_context({name: "<key symbol>"}) → 理解调用者/被调用者
5. READ gitnexus://repo/{name}/processes → 检查受影响的执行流程
6. 总结发现并进行风险评估
如果出现"索引已过时" → 在审查前在终端运行
npx gitnexus analyze。
- [ ] 获取 PR 差异 (gh pr diff 或 git diff base...head)
- [ ] 使用 gitnexus_detect_changes 将变更映射到受影响的执行流程
- [ ] 对每个非平凡的变更符号使用 gitnexus_impact
- [ ] 审查 d=1 的项目(将会破坏)— 调用者是否已更新?
- [ ] 对关键变更符号使用 gitnexus_context 以理解完整情况
- [ ] 检查受影响的流程是否有测试覆盖
- [ ] 评估总体风险等级
- [ ] 撰写包含发现的审查总结
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 维度 | GitNexus 如何提供帮助 |
|---|---|
| 正确性 | context 显示调用者 — 它们是否都与变更兼容? |
| 影响范围 | impact 显示 d=1/d=2/d=3 的依赖项 — 是否有遗漏? |
| 完整性 | detect_changes 显示所有受影响的流程 — 它们是否都得到了处理? |
| 测试覆盖率 | impact({includeTests: true}) 显示哪些测试触及了变更的代码 |
| 破坏性变更 | 未在 PR 中更新的 d=1 上游项目 = 潜在的破坏 |
| 信号 | 风险 |
|---|---|
| 变更触及 <3 个符号,0-1 个流程 | 低 |
| 变更触及 3-10 个符号,2-5 个流程 | 中 |
| 变更触及 >10 个符号或多个流程 | 高 |
| 变更触及认证、支付或数据完整性代码 | 关键 |
| PR 差异之外存在 d=1 的调用者 | 潜在的破坏 — 标记它 |
gitnexus_detect_changes — 将 PR 差异映射到受影响的执行流程:
gitnexus_detect_changes({scope: "compare", base_ref: "main"})
→ 变更:4 个文件中的 8 个符号
→ 受影响的流程:CheckoutFlow, RefundFlow, WebhookHandler
→ 风险:中
gitnexus_impact — 每个变更符号的影响范围:
gitnexus_impact({target: "validatePayment", direction: "upstream"})
→ d=1 (将会破坏):
- processCheckout (src/checkout.ts:42) [CALLS, 100%]
- webhookHandler (src/webhooks.ts:15) [CALLS, 100%]
→ d=2 (可能受影响):
- checkoutRouter (src/routes/checkout.ts:22) [CALLS, 95%]
gitnexus_impact with tests — 检查测试覆盖率:
gitnexus_impact({target: "validatePayment", direction: "upstream", includeTests: true})
→ 覆盖此符号的测试:
- validatePayment.test.ts [直接]
- checkout.integration.test.ts [通过 processCheckout]
gitnexus_context — 理解变更符号的角色:
gitnexus_context({name: "validatePayment"})
→ 传入调用:processCheckout, webhookHandler
→ 传出调用:verifyCard, fetchRates
→ 流程:CheckoutFlow (步骤 3/7), RefundFlow (步骤 1/5)
1. gh pr diff 42 > /tmp/pr42.diff
→ 4 个文件变更:payments.ts, checkout.ts, types.ts, utils.ts
2. gitnexus_detect_changes({scope: "compare", base_ref: "main"})
→ 变更的符号:validatePayment, PaymentInput, formatAmount
→ 受影响的流程:CheckoutFlow, RefundFlow
→ 风险:中
3. gitnexus_impact({target: "validatePayment", direction: "upstream"})
→ d=1: processCheckout, webhookHandler (将会破坏)
→ webhookHandler 不在 PR 差异中 — 潜在的破坏!
4. gitnexus_impact({target: "PaymentInput", direction: "upstream"})
→ d=1: validatePayment (在 PR 中), createPayment (不在 PR 中)
→ createPayment 使用了旧的 PaymentInput 结构 — 破坏性变更!
5. gitnexus_context({name: "formatAmount"})
→ 被 12 个函数调用 — 但变更是向后兼容的(添加了可选参数)
6. 审查总结:
- 中风险 — 3 个变更的符号影响了 2 个执行流程
- BUG: webhookHandler 调用了 validatePayment 但未针对新签名进行更新
- BUG: createPayment 依赖的 PaymentInput 类型已变更
- OK: formatAmount 变更是向后兼容的
- 测试:checkout.test.ts 覆盖了 processCheckout 路径,但没有 webhook 测试
将您的审查结构化为:
## PR 审查:<标题>
**风险:低 / 中 / 高 / 关键**
### 变更摘要
- <N> 个符号在 <M> 个文件中变更
- <P> 个执行流程受影响
### 发现
1. **[严重程度]** 发现描述
- 来自 GitNexus 工具的证据
- 受影响的调用者/流程
### 缺失的覆盖
- PR 中未更新的调用者:...
- 未测试的流程:...
### 建议
批准 / 请求变更 / 需要讨论
每周安装量
17
仓库
GitHub 星标数
11.6K
首次出现
9 天前
安全审计
安装于
opencode16
claude-code16
github-copilot16
codex16
kimi-cli16
gemini-cli16
1. gh pr diff <number> → Get the raw diff
2. gitnexus_detect_changes({scope: "compare", base_ref: "main"}) → Map diff to affected flows
3. For each changed symbol:
gitnexus_impact({target: "<symbol>", direction: "upstream"}) → Blast radius per change
4. gitnexus_context({name: "<key symbol>"}) → Understand callers/callees
5. READ gitnexus://repo/{name}/processes → Check affected execution flows
6. Summarize findings with risk assessment
If "Index is stale" → run
npx gitnexus analyzein terminal before reviewing.
- [ ] Fetch PR diff (gh pr diff or git diff base...head)
- [ ] gitnexus_detect_changes to map changes to affected execution flows
- [ ] gitnexus_impact on each non-trivial changed symbol
- [ ] Review d=1 items (WILL BREAK) — are callers updated?
- [ ] gitnexus_context on key changed symbols to understand full picture
- [ ] Check if affected processes have test coverage
- [ ] Assess overall risk level
- [ ] Write review summary with findings
| Dimension | How GitNexus Helps |
|---|---|
| Correctness | context shows callers — are they all compatible with the change? |
| Blast radius | impact shows d=1/d=2/d=3 dependents — anything missed? |
| Completeness | detect_changes shows all affected flows — are they all handled? |
| Test coverage | impact({includeTests: true}) shows which tests touch changed code |
| Breaking changes | d=1 upstream items that aren't updated in the PR = potential breakage |
| Signal | Risk |
|---|---|
| Changes touch <3 symbols, 0-1 processes | LOW |
| Changes touch 3-10 symbols, 2-5 processes | MEDIUM |
| Changes touch >10 symbols or many processes | HIGH |
| Changes touch auth, payments, or data integrity code | CRITICAL |
| d=1 callers exist outside the PR diff | Potential breakage — flag it |
gitnexus_detect_changes — map PR diff to affected execution flows:
gitnexus_detect_changes({scope: "compare", base_ref: "main"})
→ Changed: 8 symbols in 4 files
→ Affected processes: CheckoutFlow, RefundFlow, WebhookHandler
→ Risk: MEDIUM
gitnexus_impact — blast radius per changed symbol:
gitnexus_impact({target: "validatePayment", direction: "upstream"})
→ d=1 (WILL BREAK):
- processCheckout (src/checkout.ts:42) [CALLS, 100%]
- webhookHandler (src/webhooks.ts:15) [CALLS, 100%]
→ d=2 (LIKELY AFFECTED):
- checkoutRouter (src/routes/checkout.ts:22) [CALLS, 95%]
gitnexus_impact with tests — check test coverage:
gitnexus_impact({target: "validatePayment", direction: "upstream", includeTests: true})
→ Tests that cover this symbol:
- validatePayment.test.ts [direct]
- checkout.integration.test.ts [via processCheckout]
gitnexus_context — understand a changed symbol's role:
gitnexus_context({name: "validatePayment"})
→ Incoming calls: processCheckout, webhookHandler
→ Outgoing calls: verifyCard, fetchRates
→ Processes: CheckoutFlow (step 3/7), RefundFlow (step 1/5)
1. gh pr diff 42 > /tmp/pr42.diff
→ 4 files changed: payments.ts, checkout.ts, types.ts, utils.ts
2. gitnexus_detect_changes({scope: "compare", base_ref: "main"})
→ Changed symbols: validatePayment, PaymentInput, formatAmount
→ Affected processes: CheckoutFlow, RefundFlow
→ Risk: MEDIUM
3. gitnexus_impact({target: "validatePayment", direction: "upstream"})
→ d=1: processCheckout, webhookHandler (WILL BREAK)
→ webhookHandler is NOT in the PR diff — potential breakage!
4. gitnexus_impact({target: "PaymentInput", direction: "upstream"})
→ d=1: validatePayment (in PR), createPayment (NOT in PR)
→ createPayment uses the old PaymentInput shape — breaking change!
5. gitnexus_context({name: "formatAmount"})
→ Called by 12 functions — but change is backwards-compatible (added optional param)
6. Review summary:
- MEDIUM risk — 3 changed symbols affect 2 execution flows
- BUG: webhookHandler calls validatePayment but isn't updated for new signature
- BUG: createPayment depends on PaymentInput type which changed
- OK: formatAmount change is backwards-compatible
- Tests: checkout.test.ts covers processCheckout path, but no webhook test
Structure your review as:
## PR Review: <title>
**Risk: LOW / MEDIUM / HIGH / CRITICAL**
### Changes Summary
- <N> symbols changed across <M> files
- <P> execution flows affected
### Findings
1. **[severity]** Description of finding
- Evidence from GitNexus tools
- Affected callers/flows
### Missing Coverage
- Callers not updated in PR: ...
- Untested flows: ...
### Recommendation
APPROVE / REQUEST CHANGES / NEEDS DISCUSSION
Weekly Installs
17
Repository
GitHub Stars
11.6K
First Seen
9 days ago
Security Audits
Gen Agent Trust HubPassSocketWarnSnykWarn
Installed on
opencode16
claude-code16
github-copilot16
codex16
kimi-cli16
gemini-cli16
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
152,400 周安装
代码结构搜索工具 - 基于AST的代码模式匹配与重构 | ast-grep应用
57 周安装
Recharts:React图表库,基于D3的声明式数据可视化组件
293 周安装
OpenWork-Core:基于Tauri与SolidJS的跨平台AI开发框架,集成OpenCode智能代理
289 周安装
阿里云通义千问TTS语音设计:AI语音合成与定制化声音生成指南
284 周安装
阿里云DataAnalysisGBI API管理技能:使用OpenAPI和SDK进行数据分析资源操作
284 周安装
lesson经验提取存储工具 - 从对话中自动捕获技术陷阱与决策原则
286 周安装