gitnexus-debugging
它能做什么
这个技能指导你的智能体通过跟踪代码之间的调用和使用关系,找出缺陷的根源。适合希望快速找到故障根本原因的开发者。
适用场景
- ✓当某个函数失败,你想知道原因的时候。
- ✓当出现错误,需要找到它的来源时。
- ✓当某个接口返回错误,你想追踪其背后代码的时候。
技能链接
https://github.com/abhigyanpatwari/GitNexus/blob/main/.claude/skills/gitnexus-debugging/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我查一下,为什么购物车为空时结账函数会返回错误。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会确认代码仓库,刷新代码索引,并沿着出错代码的调用关系进行追踪。然后它会报告可能的根本原因,以及代码仓库和索引的新旧状态。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Debugging with GitNexus
When to Use
- "Why is this function failing?"
- "Trace where this error comes from"
- "Who calls this method?"
- "This endpoint returns 500"
- Investigating bugs, errors, or unexpected behavior
Bind the repository first
A root cause traced in the wrong repository is a wrong root cause.
Bind once using a confirmed registry name/path or configured MCP default. Call
list_repos {} if the target is not yet known; reuse that binding across calls. With one indexed repository,
use the examples below as written. With more than one, pass repo on every
call: an omitted repo normally errors, but under an MCP policy with a
configured default it resolves to that default silently. If you cannot tell
which repository is meant, stop and ask. This matters most for cypher, whose
statement carries no in-band hint of which database it ran against.
list_repos is paginated, so page with offset: pagination.nextOffset until
hasMore is false before concluding a repository is absent.
A stale index describes the code from before your bug, so refresh before trusting a trace, and state the repository and index freshness with the diagnosis.
Workflow
0. Bind the repo once (list_repos only if not already known)
1. If the suspect is unknown, query for the error/symptom with small result limits
2. context({name: "<suspect>"}) → See callers/callees/processes
3. Read a process resource only if its trace resolves an open question
4. cypher({statement: "MATCH path..."}) → Custom traces if needed
If "Index is stale" → run
node .gitnexus/run.cjs analyzein terminal. Hot-toolstalenessnames which index answered (branch/lastCommit) and how fresh it is (status). Re-analyze only forbehindordiverged—currentis identity,unknownis unmeasurable.
Checklist
- [ ] Once per session: bind repo; explicit repo when >1 indexed, ask if ambiguous
- [ ] 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
- [ ] State the repository and index freshness with the diagnosis
Keep investigations focused
Start with a known symbol's context, or a small query (limit: 3,
max_symbols: 3, include_content: false, chain_depth: 0) to discover one.
When the server advertises these single-repository filters, request only the
needed evidence:
context({uid: "<suspect id>", repo: "my-app", include_content: true,
response_sections: ["outgoing"], relationTypes: ["CALLS"]})
trace({from_uid: "<suspect id>", to_uid: "<failure id>", repo: "my-app"})
symbol and completeness/staleness diagnostics remain in a filtered context.
relationTypes filters the returned incoming/outgoing categories only; it does
not expand their existing bounded window or filter an explicitly requested chain.
For callback registration, include USES; for imports or inheritance, request
those relation types or omit the filter. Omitted references are not absent
references. Broaden when the hypothesis needs it, and preserve UNKNOWN/partial
warnings. Confirm source and tests before claiming a root cause. A useful 2–3
call investigation is a goal, not a reason to skip verification or pre-edit impact.
Debugging Patterns
| Symptom | GitNexus Approach |
|---|---|
| Error message | query for error text → context on throw sites |
| Wrong return value | context on the function → trace callees for data flow |
| Intermittent failure | context → look for external calls, async deps |
| Performance issue | context → find symbols with many callers (hot paths) |
| Recent regression | detect_changes to see what your changes affect — pass worktree for a linked worktree |
| "How does A reach B?" | trace between the two symbols — shortest call chain in one call |
Tools
query — find code related to error:
query({search_query: "payment validation error", repo: "my-app"})
→ Processes: CheckoutFlow, ErrorHandling
→ Symbols: validatePayment, handlePaymentError, PaymentEx
常见问题
为什么要先确认代码仓库?
该技能说明,如果在错误的仓库中追踪根本原因,结果就会有误,因此目标不明确时它会先询问。
它会刷新索引吗?
会。该技能说明,旧的索引描述的是旧代码,因此在信任追踪结果之前会先刷新索引。
它能找出谁调用了某个方法吗?
能。查找调用者是该技能处理的示例问题之一。
详情
作者的原始描述
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\"
repo: abhigyanpatwari/GitNexus
热度
- GitHub 星标
- 48k
- 排名
- #3606
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …