为 AI 智能体失败提供结构化自检、诊断与恢复流程
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "agent-introspection-debugging" 技能: 1. 下载 https://raw.githubusercontent.com/affaan-m/ECC/main/skills/agent-introspection-debugging/SKILL.md 2. 保存为 ~/.claude/skills/agent-introspection-debugging/SKILL.md 3. 装好后重载技能,告诉我可以用了
请使用 agent-introspection-debugging 工作流分析这个失败任务:智能体连续重复调用同一个工具且没有进展。请按“失败捕获→根因诊断→受控恢复→调试报告”输出,并重点检查最近 N 次工具调用是否重复、目标是否漂移。
一份结构化调试结果,说明循环模式、可能原因、最小可逆恢复动作,以及给人的可读报告。
请用 agent-introspection-debugging 检查当前智能体运行:上下文越来越长,输出质量下降,计划内容反复出现。先记录失败状态,再判断是否存在重复笔记、超长日志或任务目标偏移,并给出缩小上下文后的恢复建议。
包含上下文压力分析、问题分类、精简恢复方案和后续处理建议的调试报告。
请按 agent-introspection-debugging 流程分析这个错误:写入文件后系统提示文件不存在。请捕获错误、核对 cwd、分支、文件路径和实际文件状态,判断是路径错误、分支漂移还是环境状态不一致,并提出受控修复动作。
一份针对环境与文件状态的诊断结论,附最小修复步骤和结构化报告。
开发者或研究人员在智能体多次重试仍无进展时,可用该技能先记录失败现场、识别失败模式,再决定是否继续恢复或升级给人工处理。
当智能体因重复计划、超长日志或提示漂移导致推理变差时,这个技能可帮助检查上下文压力,并给出更小、更可控的恢复动作。
遇到连接拒绝、超时、配额耗尽或文件状态不一致等问题时,可先做结构化诊断,验证服务、端口、路径和环境假设,再执行受控修复。
文档介绍了一个用于 AI 智能体失败排查的工作流技能,适用于循环调用、反复重试无进展、上下文膨胀、提示漂移、环境状态不一致以及部分可恢复的工具故障。内容重点说明何时启用、何时不该使用,并给出四阶段循环中的前两部分:先完整捕获失败现场,再按常见模式做根因诊断,为后续受控恢复和生成结构化调试报告做准备。
Use this skill when an agent run is failing repeatedly, consuming tokens without progress, looping on the same tools, or drifting away from the intended task.
This is a workflow skill, not a hidden runtime. It teaches the agent to debug itself systematically before escalating to a human.
Activate this skill for:
Do not use this skill as the primary source for:
verification-loopBefore trying to recover, record the failure precisely.
Capture:
Minimum capture template:
## Failure Capture
- Session / task:
- Goal in progress:
- Error:
- Last successful step:
- Last failed tool / command:
- Repeated pattern seen:
- Environment assumptions to verify:
Match the failure to a known pattern before changing anything.
| Pattern | Likely Cause | Check |
|---|---|---|
| Maximum tool calls / repeated same command | loop or no-exit observer path | inspect the last N tool calls for repetition |
| Context overflow / degraded reasoning | unbounded notes, repeated plans, oversized logs | inspect recent context for duplication and low-signal bulk |
ECONNREFUSED / timeout | service unavailable or wrong port | verify service health, URL, and port assumptions |
429 / quota exhaustion | retry storm or missing backoff | count repeated calls and inspect retry spacing |
| file missing after write / stale diff | race, wrong cwd, or branch drift | re-check path, cwd, git status, and actual file existence |
| tests still failing after “fix” | wrong hypothesis | isolate the exact failing test and re-derive the bug |
Diagnosis questions:
Recover with the smallest action that changes the diagnosis surface.
Safe recovery actions:
Do not claim unsupported auto-healing actions like “reset agent state” or “update harness config” unless you are actually doing them through real tools in the current environment.
Contained recovery checklist:
## Recovery Action
- Diagnosis chosen:
- Smallest action taken:
- Why this is safe:
- What evidence would prove the fix worked:
…
这是一个面向 AI 智能体失败场景的结构化自调试工作流,不是隐藏运行时。它强调先捕获失败、再诊断根因、执行受控恢复,并输出人类可读的调试报告。
当智能体出现最大工具调用/循环限制、重复重试无进展、上下文膨胀或提示漂移、环境状态不一致,以及可能可恢复的工具失败时,可以启用它。
它主要用于智能体自身失败的排查与恢复,不是代码改动后的功能验证工具。文档还说明,功能验证应使用 verification-loop;更窄的框架调试应优先使用对应技能。
帮助用户编写、配置与优化 Hookify 规则及语法模式。
基于多源网页检索与综合分析,生成带引用和来源标注的深度研究报告
调用 Nutrient DWS API 处理文档转换、OCR提取、脱敏签署与表单填写
帮助开发者掌握 SwiftUI 架构模式、状态管理与性能优化实践
帮助你为自适应智能体设计任务编排、评测门控与可复用技能提炼方案
帮助用户核查短信与私信、找回近期验证码并明确已检查的消息来源。
分析 AI 代理执行链路,诊断失败原因、评估表现并给出可执行修复建议
基于认知视角生成自我反思问题,帮助智能体检查思路盲点与推理质量
通过分析 JSONL 调试日志,快速定位聊天代理异常、耗时与调用原因
为 AI 代理校验行为契约并对比回归,发现关键规则退化
在接口或智能体执行失败后,提供确定性的安全下一步决策建议。
分析 AI 代理本地性能与成本归因,定位异常行为并提供配置修复建议