← 返回 Skills 市场
195
总下载
1
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install iteration-pattern
功能描述
应用拉尔夫循环(Ralph loop)解决ai执行不到位,说执行了,实际没执行或执行不完全的问题。 迭代优化工作流模式。当任务复杂、一次完成质量可能不高时使用,通过循环检查和优化提升输出质量。 触发条件:(1) 用户说"迭代模式"、"用迭代方式"、"循环优化",(2) 复杂任务需要多轮改进,(3) 创建 Skil...
使用说明 (SKILL.md)
迭代模式 (Iteration Pattern)
循环检查优化 → 达到标准 → 输出完成
什么是迭代模式
一种迭代优化的工作流,通过循环检查和改进直到达到质量标准。
执行 → 检查 → 优化 → 检查 → 优化 → ... → 达标 → 完成
适用场景
简单任务(可一次完成)
- 产出物单一明确
- 完成标准容易定义(1-3条)
- 测试方法简单(目视检查即可)
- 不需要运行验证
复杂任务(建议用迭代模式)
- 产出物多个或复杂
- 完成标准需要多条(4条以上)
- 需要运行测试验证
- 可能需要多轮优化
- 代码/Skill等需要实际可运行
不适用场景
| 场景 | 原因 |
|---|---|
| 简单任务 | 一次就能做好,不需要迭代 |
| 需要快速出结果 | 迭代耗时 |
| 任务无法判断是否达标 | 没有明确标准 |
工作流步骤
1. 明确任务目标
必须先定义:
- 任务要产出什么?
- 交付物是什么?(文件?代码?文档?)
2. 设定完成标准
在开始前,定义可衡量的标准:
## 完成标准(必须明确)
### 交付物
- [ ] 产出:SKILL.md 文件
- [ ] 路径:skills/xxx/SKILL.md
### 质量标准
- [ ] name 字段非空
- [ ] description 字段非空
- [ ] 文档语法正确
- [ ] 示例代码可执行
### 功能标准
- [ ] Skill 可以正常加载
- [ ] 触发条件正确
3. 设定测试方法
关键:用什么方法验证每个标准?
## 测试方法
| 标准 | 测试方法 |
|------|---------|
| name 字段非空 | grep 检查非空 |
| 文档语法正确 | 读取文件检查 YAML 格式 |
| 示例可执行 | 运行示例代码 |
| Skill 可加载 | 执行 skillhub list 检查 |
4. 执行第一版
按照任务要求完成初始版本。
5. 逐项测试
对照完成标准,用测试方法逐项验证:
- 哪些达标了?✅
- 哪些没达标?❌ + 原因
6. 优化改进
针对没达标的部分进行优化。
7. 重复测试
回到步骤 5,直到:
- 所有标准都达标,或
- 达到最大迭代次数
8. 输出完成
输出明确的完成报告:
## 完成报告
### 迭代次数:N次
### 交付物
- 文件路径:xxx
### 最终状态
- ✅ 标准1
- ✅ 标准2
- ❌ 标准3(原因:xxx)
### 结论
任务完成 / 部分完成 / 无法完成
完成标准模板
## 完成标准模板
### 1. 交付物定义
明确要产出什么:
- [ ] 文件:xxx
- [ ] 代码:xxx
- [ ] 文档:xxx
### 2. 质量标准
**必须可验证**:
- [ ] 标准A:具体描述
- [ ] 标准B:具体描述
- [ ] 标准C:具体描述
### 3. 测试方法
**每项标准都要有验证方式**:
| 标准 | 测试命令/方法 |
|------|-------------|
| 标准A | 命令/检查方式 |
| 标准B | 命令/检查方式 |
### 4. 迭代上限
建议 3-5 次
结构化需求说明
每次使用迭代模式前,必须先填写以下结构化需求:
# 任务需求说明
## 1. 任务目标
- 产出物:\x3C明确要产出什么>
- 存放位置:\x3C文件路径>
- 格式要求:\x3C如:Markdown/YAML/代码>
## 2. 完成标准(必须可验证)
- [ ] 标准1:\x3C具体、可衡量的标准>
- [ ] 标准2:\x3C具体、可衡量的标准>
- [ ] 标准3:\x3C具体、可衡量的标准>
## 3. 测试方法
| 标准 | 验证方式 |
|------|---------|
| 标准1 | \x3C具体的验证命令或检查方法> |
| 标准2 | \x3C具体的验证命令或检查方法> |
| 标准3 | \x3C具体的验证命令或检查方法> |
## 4. 约束条件
- 技术限制:\x3C如:只能用开源方案>
- 环境要求:\x3C如:需要Node.js环境>
- 时间限制:\x3C如:3天内>
## 5. 迭代上限
\x3C建议3-5次>
重要:不填写结构化需求说明,就不能开始迭代!
快速判断:要不要用迭代模式?
回答以下问题:
| 问题 | 答案=简单 | 答案=复杂 |
|---|---|---|
| 产出物有几个? | 1个 | 2个以上 |
| 完成标准有几条? | 1-3条 | 4条以上 |
| 需要运行测试吗? | 否 | 是 |
| 代码需要实际可运行吗? | 否 | 是 |
| 之前做过类似任务吗? | 做过多次 | 第一次/不熟练 |
判断标准:如果3个以上回答"复杂",就用迭代模式。
提示词模板
基础模板
# 迭代模式
请用迭代模式完成以下任务。
## 任务目标
\x3C描述要产出什么>
## 完成标准
- [ ] 标准1:具体、可验证
- [ ] 标准2:具体、可验证
- [ ] 标准3:具体、可验证
## 测试方法
| 标准 | 测试方式 |
|------|---------|
| 标准1 | 命令/检查 |
| 标准2 | 命令/检查 |
## 最大迭代次数
3次
请开始执行,每轮完成后报告测试结果。
Skill 创建模板
# 迭代模式 - Skill 创建
请用迭代模式创建一个 Skill。
## Skill 需求
\x3C描述 Skill 要做什么>
## 完成标准
### 交付物
- [ ] SKILL.md 文件存在于 skills/\x3Cname>/ 目录
### 结构标准(必须满足)
- [ ] name 字段:非空,符合规范
- [ ] description 字段:非空,清晰描述功能
- [ ] body:包含使用说明
### 质量标准
- [ ] YAML 语法正确(无格式错误)
- [ ] 触发条件明确
- [ ] 示例代码存在且可参考
### 可运行标准
- [ ] Skill 可被 skillhub 识别
- [ ] 依赖已安装(如有)
## 测试方法
| 标准 | 测试方式 |
|------|---------|
| name 字段 | grep 检查非空 |
| YAML 语法 | python -c "import yaml; yaml.safe_load(...)" |
| 文件存在 | ls 检查文件路径 |
| Skill 识别 | skillhub list |
## 最大迭代次数
3次
请开始创建,每轮完成后报告各项测试结果。
迭代 vs 一次完成
| 模式 | 流程 | 适用 |
|---|---|---|
| 一次完成 | 做完交稿 | 简单任务 |
| 迭代模式 | 做→检查→改→检查→改→...→完成 | 复杂任务 |
关键原则
- 标准必须可验证 — 避免"做得好"这种模糊标准
- 测试方法必须具体 — 用命令/检查方式,不是"检查一下"
- 每轮都要有测试结果 — 不能跳过验证
- 迭代次数要有限制 — 防止无限循环
- 最终要有明确结论 — 完成/部分完成/无法完成
安全使用建议
This skill appears coherent and safe in its scope, but note it instructs the agent to run local validation commands and read/write files under skills/<name>/. Before enabling: (1) ensure the agent's runtime is sandboxed or only has access to intended project files (to avoid accidental edits of unrelated files), (2) be aware tests assume tools like Python/grep or a 'skillhub' CLI may exist—these are examples and may need to be adapted, (3) set a clear iteration limit to avoid long/infinite loops, and (4) review any produced code or SKILL.md outputs before deploying or publishing them.
功能分析
Type: OpenClaw Skill
Name: iteration-pattern
Version: 1.0.3
The 'iteration-pattern' skill is a workflow framework designed to improve AI agent output quality through iterative loops (Ralph loop). It provides structured templates (SKILL.md) for defining task goals, completion standards, and verification methods using standard system commands like grep, ls, and python for YAML validation, all of which are consistent with its stated purpose of quality assurance.
能力评估
Purpose & Capability
The name/description describe an iterative workflow for improving outputs; the SKILL.md provides templates, tests, and step-by-step instructions that directly implement that purpose. There are no unrelated credentials, installs, or capabilities requested.
Instruction Scope
SKILL.md instructs the agent to run local checks and commands (grep, ls, python -c 'import yaml', run example code, 'skillhub list' as an example) and to read/write files under skills/<name>/. This is in-scope for a skill that creates and validates Skills, but it does grant the agent the ability to read and modify workspace files — ensure the agent is allowed to access those paths. The mention of 'skillhub' and running example code are examples that may fail if those tools/environments are not present.
Install Mechanism
Instruction-only skill with no install spec and no code files. Nothing will be downloaded or written to disk by an installer as part of the skill package.
Credentials
No environment variables or credentials are required, which is appropriate. The instructions do assume a runtime environment with common CLI tools (grep, ls) and optionally Python or 'skillhub' for certain tests; those runtime dependencies are not declared but are reasonable expectations for the stated validation tasks.
Persistence & Privilege
always:false and no install means the skill does not request permanent/system-level presence. It does not ask to modify other skills or global agent settings.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install iteration-pattern - 安装完成后,直接呼叫该 Skill 的名称或使用
/iteration-pattern触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
- 新增 _meta.json 文件,增加元数据支持
- SKILL.md 文档在描述中补充“拉尔夫循环(Ralph loop)”相关内容
- 其他内容未变,保持原有工作流/模板结构
v1.0.2
- 增加了“解决ai执行不到位,说执行了,实际没执行或执行不完全的问题”的描述,说明模式适用的核心需求。
- 其他内容保持不变,无新增功能和结构变更。
v1.0.1
No file changes detected in this version.
- Version bumped from 1.0.0 to 1.0.1.
- No new features, fixes, or documentation updates in this release.
v1.0.0
Initial release: introduces an iteration-based workflow pattern for complex tasks.
- Provides step-by-step guidance on iterative execution, testing, and optimization.
- Includes templates for defining deliverables, quality standards, and test methods.
- Outlines structured requirements and quick assessment tools for when to use the iteration pattern.
- Offers ready-to-use prompts for various scenarios, including Skill creation.
- Emphasizes verifiable standards, concrete testing, capped iterations, and clear final reports.
元数据
常见问题
Iteration Pattern 是什么?
应用拉尔夫循环(Ralph loop)解决ai执行不到位,说执行了,实际没执行或执行不完全的问题。 迭代优化工作流模式。当任务复杂、一次完成质量可能不高时使用,通过循环检查和优化提升输出质量。 触发条件:(1) 用户说"迭代模式"、"用迭代方式"、"循环优化",(2) 复杂任务需要多轮改进,(3) 创建 Skil... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 195 次。
如何安装 Iteration Pattern?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install iteration-pattern」即可一键安装,无需额外配置。
Iteration Pattern 是免费的吗?
是的,Iteration Pattern 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Iteration Pattern 支持哪些平台?
Iteration Pattern 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Iteration Pattern?
由 cloudyli(@cloudyli)开发并维护,当前版本 v1.0.3。
推荐 Skills