AgentSkillsCN

debug-tools

采用信心评分与策略性日志注入的迭代式调试工作流。包含五个阶段:调查、注入日志、提出修复方案、验证、清理。适用于调试意外行为、无声错误、间歇性故障,或需要运行时数据支持的问题。触发词包括:“调试”、“修复 bug”、“调查”、“追踪问题”、“添加调试日志”、“清理调试日志”。

SKILL.md
--- frontmatter
name: debug-tools
description: >-
  Iterative debugging workflow with confidence scoring and strategic log injection.
  Five phases: investigate, inject logs, propose fix, verify, cleanup.
  Use when: debugging unexpected behavior, silent errors, intermittent failures,
  or issues requiring runtime data. Triggers on "debug", "fix bug", "investigate",
  "trace issue", "add debug logs", "cleanup debug logs".
metadata:
  author: github.com/adeonir
  version: "1.0.0"

Debug Tools

Iterative debugging workflow with targeted log injection and cleanup.

Workflow

code
investigate --> inject logs --> propose fix --> verify --> cleanup
     ^_________________________________________|

The workflow loops back to investigation if the fix doesn't work.

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

Cross-References

code
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

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