AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Self Refinement

skill-davidyichengwei-agentic-engineering-framework-self-refinement · by davidYichengWei

将纠错经验沉淀为持久化的 Rules/Skills 更新,构建反馈闭环。当被用户纠正且错误具有模式性时自动触发,或通过 /reflect 命令手动触发回顾。

No reviews yet
0 installs
27 views
0.0% view→install

Install

$ agentstack add skill-davidyichengwei-agentic-engineering-framework-self-refinement

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-davidyichengwei-agentic-engineering-framework-self-refinement)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
6mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Self Refinement? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

经验沉淀 (Self-Refinement)

核心定位

从错误中构建反馈闭环:将非结构化的错误经验转化为结构化的持久化上下文(Rules/Skills),防止同类错误在新会话中重复发生。

> 原理:LLM 没有跨会话的持久记忆——会话 A 中被纠正的错误,在会话 B 中会以相同概率再次发生。唯一的解法是将错误经验外化为持久化的上下文。


触发模式

模式一:自动触发

触发条件:AI 在协作过程中被用户纠正(用户否定了 AI 的输出并给出了正确方向)。

行为

  1. 先完成当前纠正——不打断用户当前的任务流
  2. 纠正完成后,在回复末尾简要评估是否需要沉淀经验
  3. 如果需要,输出轻量建议(不超过 3 条)

输出格式

---
💡 **经验沉淀建议**

刚才的纠正揭示了一个可沉淀的模式:

- **错误模式**:[简述 AI 犯的错]
- **根因**:[规范缺失 / 知识缺失 / 流程遗漏 / 模式错误]
- **建议**:[更新 Rule/Skill 的具体操作]

是否需要我执行?(回复"沉淀"执行,或忽略继续当前工作)

设计原则

  • 不打断:建议附在回复末尾,不影响正常工作流
  • 轻量化:仅简述,不展开长篇分析
  • 建议优先:不自主执行,等用户确认

模式二:手动触发(/reflect)

触发条件:用户通过 /reflect Command 主动发起。

行为

  1. 回顾当前对话历史
  2. 识别所有被纠正的错误模式
  3. 对每个错误执行完整的诊断闭环
  4. 输出结构化的沉淀建议

核心闭环

无论自动还是手动触发,共享同一个核心流程:

Step 1: 识别错误模式

回顾对话中 AI 被纠正的场景,提取:

  • 错误输出:AI 说了什么/做了什么
  • 正确方向:用户期望什么
  • 差距:AI 为什么偏离

Step 2: 诊断根因

| 根因类别 | 定义 | 典型表现 | |----------|------|----------| | 规范缺失 | 现有 Rules/Skills 中没有覆盖该场景 | AI 不知道项目的特定约定 | | 知识缺失 | AI 缺少项目特定的领域知识 | AI 对某个模块的行为/限制不了解 | | 流程遗漏 | Workflow Skill 中缺少关键步骤或检查点 | AI 跳过了应有的验证步骤 | | 模式错误 | AI 应用了错误的思维模式 | AI 用类比代替第一性原理推导 |

Step 3: 检索现有知识

搜索现有 Skills 和 Rules:

  • 是否已有相关规则?→ 需要补充/修改
  • 完全没有相关规则?→ 需要新建

Step 4: 生成建议

每条建议包含:

### 建议 N: [简短标题]

- **根因**:[规范缺失 / 知识缺失 / 流程遗漏 / 模式错误]
- **目标文件**:`[Rules/Skills 文件路径]`
- **操作**:[新建 / 在 X 位置添加 / 修改 Y 内容]
- **具体内容**:
  ```
  [要添加或修改的具体文本]
  ```

建议数量:≤ 3 条。多于 3 条时,按影响范围排序取 Top 3。

Step 5: 用户确认

以上是本次经验沉淀建议,请选择:
- **全部执行** → 我将依次执行所有建议
- **选择执行** → 告诉我执行哪几条(如"执行 1 和 3")
- **跳过** → 不执行任何建议

Step 6: 执行更新

用户确认后,更新现有文件或创建新文件,并写入对应的 Rules/Skills 更新内容。


强制规则

| 规则 | 说明 | |------|------| | 建议优先 | 不自主执行任何 Rules/Skills 修改,必须经用户确认 | | 不打断 | 自动触发时,建议附在回复末尾,不打断当前工作流 | | 轻量化 | 自动触发时,建议控制在 3 条以内,每条不超过 5 行 | | 可追溯 | 每条建议明确标注根因类别和目标文件 | | 不重复 | 执行前检索现有 Rules/Skills,避免重复添加相似规则 |


反模式

| ❌ 错误做法 | ✅ 正确做法 | |------------|-----------| | 被纠正后立即修改 Rules/Skills | 先完成当前任务,再提建议 | | 输出冗长分析 / 建议过于宽泛 | 每条建议 ≤ 5 行,具体到文件和内容 | | 自主执行变更 / 打断工作流 | 等用户确认;附在回复末尾 |


参考资料

  • [典型沉淀场景示例](reference/refinement-examples.md)

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.