Skip to content
Agentmart
Submit a tool

failure-learning

失败学习回写 Skill。当模型反复失败时,分析根因、检索外部方案、 回写到需求/方案/模型执行规约文档,形成闭环纠偏。 核心约束:失败学习触发后,一定要与人沟通,不允许 AI 自行闷头解决。

Skill by XX-Trader

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/xx-trader-failure-learning

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

失败学习回写 Skill。当模型反复失败时,分析根因、检索外部方案、 回写到需求/方案/模型执行规约文档,形成闭环纠偏。 核心约束:失败学习触发后,一定要与人沟通,不允许 AI 自行闷头解决。

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/failure-learning

What's inside

Skill name
failure-learning
Description
失败学习回写 Skill。当模型反复失败时,分析根因、检索外部方案、 回写到需求/方案/模型执行规约文档,形成闭环纠偏。 核心约束:失败学习触发后,一定要与人沟通,不允许 AI 自行闷头解决。
License
MIT
Instructions
89 lines in SKILL.md · view on GitHub

Files (2)

  • SKILL.md
  • failure_analysis.md · templates/

SKILL.md (first lines)

# 失败学习回写 — 操作手册

## 1. 何时使用

- 同一类任务连续 2 次未通过代码审查
- 双 AI 审查中 B 指出"这个模型/流程历史上多次在此类任务上失败"
- 用户主动反馈"这块总是做不好"

## 2. 核心原则

### 2.1 一定要与人沟通

**铁律**:失败学习流程触发后,**必须与人沟通**,不允许 AI 自行闷头解决。

- 分析完根因后 → 向用户汇报根因分类和拟采取的纠偏措施 → 等用户确认
- 如果根因是"不知道怎么做" → 先向用户说明准备去网上查什么、查哪些来源
- 如果根因是"需求描述不清" → 向用户追问具体的业务边界和约束
- 如果根因是"模型能力不足" → 向用户提议更换方案,说明替代方案的利弊
- **绝不允许 AI 在用户不知情的情况下擅自修改需求文档或更换执行策略**

### 2.2 检索是第一反应

分析根因后,如果发现模型做不好,第一反应应该是**去网上查找成熟方案**,而不是让模型继续尝试浪费 token。

### 2.3 回写必须精准

回写不是"把错误记一下",而是要**修改具体的规则**让下次执行时不再犯同样的错。

## 3. 执行流程

```text
触发条件检测(failure_tracker.py check)
    │
    ▼
Step 1: 根因分析 — 分类到 4 种根因之一
    │
    ▼
Step 2: 向用户汇报 — 展示根因 + 拟定纠偏方案(人工沟通硬约束)
    │
    ▼
Step 3: 用户确认 — 用户同意后才能继续
    │
    ▼
Step 4: 执行纠偏 — 按根因类型执行对应操作
    │   ├─ 不知道怎么做 → 网上搜索 → 修改方案文档
    │   ├─ 需求描述不清 → 追问用户 → 修改需求文档
    │   ├─ 模型能力不足 → 更换模型/路径 → 修改模型执行规约
    │   └─ 外部 API 变更 → 更新 API 注册表 → 修改实施计划
    │
    ▼
Step 5: 回写文档 — 产出 failure_analysis.md + 修改目标文档
    │
    ▼
Step 6: 验证 — 下次同类任务是否通过
```

## 4. 根因分类

| 根因类型 | 回写目标 | 示例 |
|---------|---------|------|
| 不知道怎么做 | 方案文档 + 新增检索报告 | "grid_engine 接口不会用" → 查官方文档补充到方案 |
| 需求描述不清 | 需求文档(README.md) | "验收标准模糊" → 向用户追问后补充边界 |
| 模型能力不足 | 模型执行规约 | "GPT 做这个总出错" → 切换到 Claude 并记录 |
| 外部 API 变更 | API_REGISTRY.json + 实施计划 | "GitHub API 版本变了" → 更新注册表 |

## 5. 输出产物

使用模板:`templates/failure_analysis.md`

产物存放路径:
```
.workflow/reviews/<task_id>/failure_analysis.md
```

## 6. 与双 AI 审查的集成

1. 在 `dual-ai-review` SKILL 的审查产物中增加 `failure_learning_triggered: true` 标记
2. Reviewer-B 在审查时**必须查询 failure_tracker 历史记录**
3. 失败学习完成后的回写文档,作为下一轮审查的输入

## 7. 评分指标

| 指标 | 计算方式 |
|------|----------|
| 纠偏成功率 | 回写后同类任务通过率提升幅度 |
| 人工沟通完成率 | 触发后实际与用户沟通次数 / 触发次数 |
| 回写覆盖率 | 实际修改的文档数 / 应修改的文档数 |

From XX-Trader/openclaw-hardflow-backup-20260302, MIT.

More from XX-Trader/openclaw-hardflow-backup-20260302

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Aug 13, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from XX-Trader

Cite this page

failure-learning skill. Agent Mart. https://agentmart.dev/skills/xx-trader-failure-learning (last updated 2026-10-24)