mcpField
G
gitnexus-debugging

gitnexus-debugging

github.com/mindfold-ai开发15.1k86 次安装6 周前更新
代码仓库

关于 gitnexus-debugging

gitnexus-debugging 是面向开发者的 GitNexus 调试技能,用于调查错误和异常行为。它引导用户搜索代码、检查调用关系并追踪执行流程,以定位可能的原因。

主要功能

  1. 01搜索与错误相关的代码
  2. 02检查调用方和被调用方
  3. 03追踪执行流程
  4. 04编写自定义调用链查询
  5. 05检查变更是否引发回归

适用场景

  1. 01追踪错误消息的来源
  2. 02调查返回 500 的端点
  3. 03跟进错误结果背后的数据流
  4. 04检查近期变更影响的流程

MCP 相关

该技能使用 GitNexus 的 query、context、cypher 和 detect_changes 等工具,并读取 GitNexus 仓库流程资源。

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/mindfold-ai/trellis --skill gitnexus-debugging

安装后在 Claude Code 中输入/gitnexus-debugging确认已加载。

详细介绍

使用 GitNexus 调试

适用场景

  • “为什么这个函数会失败?”
  • “追踪这个错误的来源”
  • “谁调用了这个方法?”
  • “这个端点返回 500”
  • 调查 Bug、错误或意外行为

工作流

1. query({query: "<error or symptom>"})            → Find related execution flows
2. context({name: "<suspect>"})                    → See callers/callees/processes
3. READ gitnexus://repo/{name}/process/{name}                → Trace execution flow
4. cypher({query: "MATCH path..."})                 → Custom traces if needed

如果提示“索引已过期”,请在终端运行 node .gitnexus/run.cjs analyze。

检查清单

- [ ] Understand the symptom (error message, unexpected behavior)
- [ ] query for error text or related code
- [ ] Identify the suspect function from returned processes
- [ ] context to see callers and callees
- [ ] Trace execution flow via process resource if applicable
- [ ] cypher for custom call chain traces if needed
- [ ] Read source files to confirm root cause

调试模式

症状GitNexus 方法
错误消息使用 query 搜索错误文本 → 在抛出错误的位置使用 context
返回值错误在函数上使用 context → 追踪被调用函数的数据流
间歇性故障使用 context → 查找外部调用、异步依赖
性能问题使用 context → 查找调用者较多的符号(热点路径)
最近出现回归使用 detect_changes 查看更改的影响范围

工具

query — 查找与错误相关的代码:

query({query: "payment validation error"})
→ Processes: CheckoutFlow, ErrorHandling
→ Symbols: validatePayment, handlePaymentError, PaymentException

context — 获取可疑代码的完整上下文:

context({name: "validatePayment"})
→ Incoming calls: processCheckout, webhookHandler
→ Outgoing calls: verifyCard, fetchRates (external API!)
→ Processes: CheckoutFlow (step 3/7)

cypher — 自定义调用链追踪:

MATCH path = (a)-[:CodeRelation {type: 'CALLS'}*1..2]->(b:Function {name: "validatePayment"})
RETURN [n IN nodes(path) | n.name] AS chain

示例:“支付端点间歇性返回 500”

1. query({query: "payment error handling"})
   → Processes: CheckoutFlow, ErrorHandling
   → Symbols: validatePayment, handlePaymentError

2. context({name: "validatePayment"})
   → Outgoing calls: verifyCard, fetchRates (external API!)

3. READ gitnexus://repo/my-app/process/CheckoutFlow
   → Step 3: validatePayment → calls fetchRates (external)

4. Root cause: fetchRates calls external API without proper timeout

评论

支持 Markdown