Debug Issue

tirth8205/code-review-graph/skills/debug-issue

作者 tirth82056b12d11625cbec3b6773e076cb3d136464fa90e5无许可证收录于 2026年10月9日更新于 2026年10月9日

Systematically debug issues using graph-powered code navigation

AI 生成的概览

在阅读源码前,通过代码知识图谱追踪缺陷,利用图谱查询工具缩小排查范围。

功能
该技能引导智能体采用系统化的调试流程,借助图谱驱动的代码导航工具开展工作。它要求先对与问题相关的代码进行语义搜索,追踪调用方与被调用方,沿执行流定位触发点,检查近期变更,并评估修复的影响范围。它还规定了令牌效率规则,包括先调用最小上下文工具、尽量使用最小详情级别,以及每个任务约五次工具调用和 800 个图谱输出令牌的预算。它会产出缩小后的缺陷范围,但明确指出图谱不能替代阅读实现代码及其测试。
适用场景
适用于在已建立知识图谱索引且相关图谱工具可用的代码库中调试已报告的问题。适合需要定位可疑代码、追踪执行路径如何到达该处,并在修改源码前了解修复可能影响范围的场景。
运行要求
需要访问图谱工具,例如 semantic_search_nodes_tool、query_graph_tool、get_flow_tool、detect_changes_tool、get_impact_radius_tool 和 get_minimal_context_tool,并需要在该图谱中建立索引的代码库。该技能不附带脚本,仅为指令。

Debug Issue

Trace a bug through the knowledge graph before reading source.

Steps

  1. Call semantic_search_nodes_tool to find code related to the issue.
  2. Call query_graph_tool with callers_of and callees_of to trace the call chain in both directions.
  3. Call get_flow_tool for the execution path that reaches the suspect code. Its entry point is where the bug is triggered.
  4. Call detect_changes_tool to check whether a recent change caused the issue.
  5. Call get_impact_radius_tool on the suspect files to see what a fix would affect.

Token Efficiency Rules

  • Call get_minimal_context_tool(task="<your task>") before any other graph tool.
  • Pass detail_level="minimal" wherever a tool accepts it. Use "standard" only when minimal is not enough.
  • Prefer a targeted query_graph_tool call over a broad listing call.
  • Budget: about five tool calls and 800 tokens of graph output per task.
  • Read the implementation and its tests before changing code. The graph narrows scope; it does not replace the source.

来源与署名

来源:tirth8205/code-review-graph位于skills/debug-issue提交6b12d11

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架