troubleshooting-regression
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTroubleshooting Regression
回归问题排查
Use this skill when the framework appears stale, stuck, or regressed and you need deterministic diagnosis plus fix verification.
当框架出现停滞、卡顿或回归问题,且你需要确定性诊断及修复验证时,可使用此Skill。
When to Use
使用场景
- Claude debug sessions stall after spawning agents.
- Hooks block expected actions unexpectedly.
- Memory/search/token-saver enforcement appears inconsistent.
- A regression needs a repeatable reproduction and validation run.
- Claude调试会话在生成Agent后停滞。
- Hooks意外阻止预期操作。
- Memory/Search/Token-Saver的执行表现不一致。
- 需要可重复复现并验证修复的回归问题。
Iron Law
铁则
Do not declare a regression fixed without:
- reproducible trigger prompt,
- trace evidence from ,
pnpm trace:query - hook/tool evidence from debug logs,
- targeted test pass for touched scope.
在未满足以下条件前,不得宣称回归问题已修复:
- 可复现的触发提示词,
- 来自的追踪证据,
pnpm trace:query - 来自调试日志的Hook/工具证据,
- 针对受影响范围的定向测试通过。
Workflow
工作流
- Identify session and log source.
- Run trace query first ().
pnpm trace:query --trace-id <traceId> --compact --since <ISO-8601> --limit 200 - Extract high-signal errors (excluding known MCP auth/startup noise).
- Map each error to owning hook/module.
- Patch minimal code path and add/update regression test.
- Run targeted checks (tests + lint/format on changed files).
- Re-run debug prompt and verify error class no longer reproduces.
- Record learnings/issues in memory.
- 确定会话及日志来源。
- 先运行追踪查询()。
pnpm trace:query --trace-id <traceId> --compact --since <ISO-8601> --limit 200 - 提取高信号错误(排除已知的MCP认证/启动噪音)。
- 将每个错误映射到对应的Hook/模块。
- 修补最小代码路径并添加/更新回归测试。
- 运行定向检查(针对变更文件的测试+代码检查/格式化)。
- 重新运行调试提示词,验证错误类型不再复现。
- 在Memory中记录经验/问题。
Evidence Model
证据模型
- Source of truth:
C:\\Users\\<user>\\.claude\\debug\\*.txt - Trace source of truth: output for the same incident window
pnpm trace:query - Filter: ignore external MCP transport/auth noise; keep framework/runtime errors
- Error classes:
- routing/task lifecycle
- memory/search/token-saver guardrails
- hook contract/schema violations
- workflow phase/idempotency failures
- 可信来源:
C:\\Users\\<user>\\.claude\\debug\\*.txt - 追踪可信来源:同一事件窗口的输出
pnpm trace:query - 过滤规则:忽略外部MCP传输/认证噪音;保留框架/运行时错误
- 错误类型:
- 路由/任务生命周期
- Memory/Search/Token-Saver防护机制
- Hook契约/ schema违规
- 工作流阶段/幂等性失败
Command Surface
命令集
Primary wrapper:
bash
node .claude/skills/troubleshooting-regression/scripts/main.cjs --prompt "search the codebase for any issues or bugs"
pnpm trace:query --trace-id <traceId> --compact --since <ISO-8601> --limit 200Optional direct log analysis:
bash
node .claude/skills/troubleshooting-regression/scripts/main.cjs --log-path "C:\\Users\\<user>\\.claude\\debug\\<session>.txt"主包装器:
bash
node .claude/skills/troubleshooting-regression/scripts/main.cjs --prompt "search the codebase for any issues or bugs"
pnpm trace:query --trace-id <traceId> --compact --since <ISO-8601> --limit 200可选直接日志分析:
bash
node .claude/skills/troubleshooting-regression/scripts/main.cjs --log-path "C:\\Users\\<user>\\.claude\\debug\\<session>.txt"Output Contract
输出约定
- : boolean
ok - : analyzed log path
logPath - : normalized findings with severity and owner file hints
findings[] - : concrete fix/validation actions
nextActions[]
- :布尔值
ok - :已分析的日志路径
logPath - :标准化的排查结果,含严重程度及所属文件提示
findings[] - :具体的修复/验证操作
nextActions[]
Related Artifacts
相关工件
- Workflow:
.claude/workflows/troubleshooting-regression-skill-workflow.md - Tool:
.claude/tools/troubleshooting-regression/troubleshooting-regression.cjs - Command:
.claude/commands/troubleshooting-regression.md
- 工作流:
.claude/workflows/troubleshooting-regression-skill-workflow.md - 工具:
.claude/tools/troubleshooting-regression/troubleshooting-regression.cjs - 命令:
.claude/commands/troubleshooting-regression.md
Examples
示例
bash
undefinedbash
undefinedAnalyze latest log
分析最新日志
node .claude/skills/troubleshooting-regression/scripts/main.cjs --mode quick
node .claude/skills/troubleshooting-regression/scripts/main.cjs --mode quick
Analyze specific log and fail when critical findings exist
分析特定日志,若存在严重问题则终止
node .claude/skills/troubleshooting-regression/scripts/main.cjs --log-path "<path>" --strict
undefinednode .claude/skills/troubleshooting-regression/scripts/main.cjs --log-path "<path>" --strict
undefinedMemory Protocol
Memory协议
Before starting:
bash
cat .claude/context/memory/learnings.mdAfter completing:
- Regression pattern ->
.claude/context/memory/learnings.md - Open defect or risk ->
.claude/context/memory/issues.md - New enforcement decision ->
.claude/context/memory/decisions.md
ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.
开始前:
bash
cat .claude/context/memory/learnings.md完成后:
- 回归模式 ->
.claude/context/memory/learnings.md - 未解决缺陷或风险 ->
.claude/context/memory/issues.md - 新的执行决策 ->
.claude/context/memory/decisions.md
假设中断:你的上下文可能会重置。若未记录到Memory中,则视为未发生。