debug-tools

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Debug Tools

调试工具

Iterative debugging workflow with targeted log injection and cleanup.
带有针对性日志注入和清理的迭代调试工作流。

Workflow

工作流

investigate --> inject logs --> propose fix --> verify --> cleanup
     ^_________________________________________|
The workflow loops back to investigation if the fix doesn't work.
investigate --> inject logs --> propose fix --> verify --> cleanup
     ^_________________________________________|
如果修复方案无效,工作流会循环回到调查阶段。

Context Loading Strategy

上下文加载策略

Load only the reference matching the current trigger. Multiple references may be loaded during a full debugging session (investigation often leads to log injection).
仅加载与当前触发词匹配的参考文档。在完整的调试会话期间可能会加载多个参考文档(调查阶段通常会引出日志注入操作)。

Triggers

触发词

Trigger PatternReference
Debug issue, investigate bug, fix buginvestigation.md
Add debug logs, inject logs, trace with logslog-injection.md
Remove debug logs, cleanup logslog-cleanup.md
Debug patterns, log format, common bugsdebugging-patterns.md
触发模式参考文档
调试问题、调查Bug、修复Buginvestigation.md
添加调试日志、注入日志、用日志追踪log-injection.md
移除调试日志、清理日志log-cleanup.md
调试模式、日志格式、常见Bugdebugging-patterns.md

Cross-References

交叉引用

investigation.md <---> log-injection.md (investigation may request logs)
investigation.md <---> log-cleanup.md (after fix verified)
log-injection.md ----> log-cleanup.md (cleanup removes injected logs)
investigation.md <---> log-injection.md (investigation may request logs)
investigation.md <---> log-cleanup.md (after fix verified)
log-injection.md ----> log-cleanup.md (cleanup removes injected logs)

Guidelines

指南

  • Confidence scoring: >= 70 report as probable cause, 50-69 suggest logs, < 50 don't report
  • Always use
    [DEBUG]
    prefix for injected logs (enables cleanup)
  • Never log sensitive data (passwords, tokens, PII)
  • Minimal fix: smallest change that resolves the issue
  • Cleanup is automatic after fix is verified
  • Uses whatever debugging tools are available in the environment
  • 置信度评分:≥70分则报告可能的原因,50-69分则建议注入日志,<50分则不报告
  • 注入的日志必须使用
    [DEBUG]
    前缀(便于清理)
  • 切勿记录敏感数据(密码、令牌、个人可识别信息PII)
  • 最小化修复:使用能解决问题的最小改动
  • 修复验证通过后自动清理日志
  • 使用环境中可用的任意调试工具

Error Handling

错误处理

  • No bug description provided: ask user to describe the issue
  • Cannot reproduce: suggest adding debug logs
  • Fix doesn't work: return to investigation phase
  • Logs left behind: user can request cleanup anytime
  • 未提供Bug描述:请用户描述问题
  • 无法复现问题:建议添加调试日志
  • 修复方案无效:返回调查阶段
  • 日志残留:用户可随时请求清理