with one click
failure-reflection
失败反思技能。Use when 已积累失败信号、连续重试无效、或需要区分参数错误、环境缺失、前提不满足与策略错误。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
失败反思技能。Use when 已积累失败信号、连续重试无效、或需要区分参数错误、环境缺失、前提不满足与策略错误。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | failure-reflection |
| description | 失败反思技能。Use when 已积累失败信号、连续重试无效、或需要区分参数错误、环境缺失、前提不满足与策略错误。 |
| compatibility | Designed for Lingzhou failure handling and recovery loops. |
| tags | failure, reflection |
| triggers | 失败, 报错, 根因, 重试 |
| state_rules | failure_signal_ratio >= 0.1 => 1.4 |
| 类型 | 特征信号 | 正确行动 |
|---|---|---|
| 参数错误 | 400 / 参数名不匹配 / 类型错误 / missing required field | 对照工具描述修正参数,重试 1 次;仍失败 → 查工具 description |
| 前提不满足 | ENOENT / 资源未初始化 / 依赖未创建 | 先满足前提再重试;无新写入时不重复尝试同路径 |
| 环境缺失 | 命令不存在 / 权限不足 / 网络断开 | shell.run 确认;无法解决 → reply_to_user 说明,task.wait(wait_kind=external) |
| 策略错误 | 步骤正确但目标无推进 / 同类失败连续 ≥ 2 次 | 换工具 / 换路径 / 换策略;memory.add_semantic 记录教训 |
failure_signal_ratio、durable_failure_section、WM 中 [FAIL] 条目shell.run(ps / lsof / ls / cat log)file.read 确认内容;file.list 确认目录durable_failure 静默窗口内 → 换动作 / 等外部状态变化task.wait| 反模式 | 正确做法 |
|---|---|
| 失败后立刻用相同参数重试 | 先分类,再修正参数 |
| 每次 reflection 写"暂未找到根因" | 找不到根因 → pause + 补证据,不写空结论 |
ENOENT 后继续尝试同路径 | 确认无新写入 → 换路径 / 换策略 |
| 把所有失败归为临时故障 | 同类连续 ≥ 2 次 = 需要结构性分析 |
交付物是可靠根因结论,不是快速回复。在证据链尚未支撑结论前,不在 reply_to_user 里给定论。
三维证据原则(缺一不可):
| 维度 | 取证工具 |
|---|---|
| 配置文件 | file.read 读取配置 |
| 代码逻辑 | file.read 读取相关源码 |
| 运行时状态(进程/连接/日志) | shell.run(lsof/ss/ps/grep/tail) |
只读配置不看运行时 = 证据不足;只读代码不检查实际连接 = 证据不足。
工具选择:
shell.run(lsof/ss/netstat/ps/grep/tail)browser.*;不要因为一次 navigate 失败就切到 shell.run结论标准:能明确回答"根因是 X,证据是 Y"才能在 reply_to_user 给出结论;证据链有缺口时说明"尚未确认的部分"。
Use when Codex needs to implement, debug, refactor, or review code in a repository, especially tasks involving source files, failing tests, logs, runtime behavior, API wiring, or multi-file changes that require evidence-driven edits and verification.
通用问题解决技能。Use when 任务需要像 Codex 一样跨多轮定位问题、实现修复、处理失败、验证结果,尤其是用户纠正你误解、同类失败重复、任务涉及未知系统能力或需要先发现环境能力时。
反循环感知技能。Use when 检测到重复工具调用、WM 出现循环信号、durable_failure 窗口内、或需要判断是否继续重试时,用于识别证据是否停滞、哪些选择可能打破循环。
Skill质量评估优化器(达尔文循环)。Use when 需要系统评估指定/全部 skill 的质量打分、找最弱维度并迭代改进、用棘轮原则保留有净收益的改动时。触发词:优化skill / 评估skill / darwin / skill质量 / skill评分 / skill review / skill改进。
灵舟自进化稳态技能。Use when 进行 code/tool/prompt/skill 自进化,或出现‘进化后崩溃/可用性下降/回归’信号时。
记忆与知识管理技能。Use when 任务完成后、空闲整理时、遇到新事实/经验/可复用流程时,决定用 memory.set_fact / memory.add_semantic / skill.synthesize 哪种方式存储。防止知识浪费和重复探索。