paseo-loop
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLoop Skill
Loop Skill
You are setting up an autonomous loop. An agent runs repeatedly until an exit condition is met.
User's arguments: $ARGUMENTS
你正在设置一个自主循环。Agent会重复运行,直至满足退出条件。
用户参数: $ARGUMENTS
Prerequisites
前置要求
Load the Paseo skill first — it contains the CLI reference for all agent commands.
请先加载Paseo skill——它包含所有Agent命令的CLI参考文档。
What Is a Loop
什么是Loop
A loop runs an agent repeatedly until it's done. There are two modes:
循环会让Agent重复运行,直至任务完成。它有两种模式:
Self-terminating (no verifier)
自终止模式(无验证器)
A single worker agent runs each iteration. It returns via structured output. The loop exits when is true.
{ done: boolean, reason: string }done每次迭代由一个worker agent运行。它会通过结构化输出返回。当为true时,循环终止。
{ done: boolean, reason: string }doneWorker + Verifier
Worker+验证器模式
A worker agent runs each iteration (detached, no structured output). After the worker finishes, a separate verifier agent evaluates the verification prompt and returns . The loop exits when is true.
{ done: boolean, reason: string }done每次迭代由一个worker agent运行(独立执行,无结构化输出)。worker完成后,会由一个独立的verifier agent评估验证提示词,并返回。当为true时,循环终止。
{ done: boolean, reason: string }doneFeedback between iterations
迭代间的反馈
In both modes, the from the previous iteration is fed back to the next worker as . This gives the worker context about what happened last time.
reason<previous-iteration-result>在两种模式下,上一次迭代的会以的形式反馈给下一个worker。这能让worker了解上一次迭代的情况。
reason<previous-iteration-result>Live Steering
实时调控
Each loop run persists state in:
text
~/.paseo/loops/<loop-id>/
worker-prompt.md # worker prompt (live-editable)
verifier-prompt.md # verifier prompt (live-editable, only when verifier is used)
last_reason.md # latest iteration result
history.log # per-iteration recordsEdits to prompt files are picked up on the next iteration without restarting the loop.
每次循环运行的状态会持久化存储在以下路径:
text
~/.paseo/loops/<loop-id>/
worker-prompt.md # worker提示词(可实时编辑)
verifier-prompt.md # 验证器提示词(仅在使用验证器时可实时编辑)
last_reason.md # 最新迭代结果
history.log # 每次迭代的记录无需重启循环,对提示文件的修改会在下次迭代时生效。
Parsing Arguments
解析参数
Parse to determine:
$ARGUMENTS- Worker prompt — what the worker does each iteration
- Verifier prompt (optional) — what the verifier checks after each worker iteration
- Worker — which agent does the work (default: Codex)
- Verifier — which agent verifies (default: Claude sonnet)
- Sleep (optional) — delay between iterations
- Name — a short name for tracking
- Max iterations — safety cap (default: unlimited)
- Archive — whether to archive agents after each iteration
- Worktree — whether to run in an isolated git worktree
解析以确定以下内容:
$ARGUMENTS- Worker提示词 —— worker每次迭代需要执行的操作
- 验证器提示词(可选) —— 每次worker迭代后,验证器需要检查的内容
- Worker —— 执行任务的Agent(默认:Codex)
- Verifier —— 执行验证的Agent(默认:Claude sonnet)
- 休眠时长(可选) —— 两次迭代之间的延迟
- 名称 —— 用于追踪的简短名称
- 最大迭代次数 —— 安全上限(默认:无限制)
- 归档 —— 是否在每次迭代后归档Agent
- Worktree —— 是否在独立的git worktree中运行
Examples
示例
/loop babysit PR #42 until CI is green, check every 5 minutes
→ worker-prompt: "Check the CI status of PR #42 using `gh pr checks 42`. Report done when ALL checks
have passed (no pending, no failures). If any checks are still running or have failed, report not
done and list which checks are pending or failing."
No verifier (self-terminating: the worker inspects CI and reports done when green)
sleep: 5m
archive: yes
name: babysit-pr-42
/loop implement the auth refactor from the plan in /tmp/plan.md
→ worker-prompt-file: /tmp/plan.md
verifier-prompt: "Verify every step of the plan was implemented. Check file changes, types, and
run `npm run typecheck` and `npm test`. Report each criterion individually with evidence."
name: auth-refactor
worktree: auth-refactor
/loop run the test suite until it passes
→ worker-prompt: "Run `npm test`. If any tests fail, read the failure output, investigate the root
cause in the source code, and fix it. Report done when `npm test` exits with code 0 and all
tests pass. Report not done if any test still fails, and explain which tests failed and why."
No verifier (self-terminating: worker reports done when tests pass)
name: fix-tests
/loop watch error rates after deploy, check every 10 minutes
→ worker-prompt: "Check the error rate for the canary deployment by running `./scripts/check-canary.sh`.
Report done when the error rate has been below 0.1% for at least 2 consecutive checks. Report not
done with the current error rate and trend."
No verifier (self-terminating: worker reports done when error rate is stable)
sleep: 10m
max-iterations: 30
archive: yes
name: canary-watch/loop 持续监控PR #42直到CI变绿,每5分钟检查一次
→ worker-prompt: "使用`gh pr checks 42`检查PR #42的CI状态。当所有检查通过(无 pending、无失败)时报告任务完成。如果仍有检查在运行或失败,报告任务未完成并列出对应的检查项。"
无验证器(自终止模式:worker自行检查CI状态,变绿时报告完成)
sleep: 5m
archive: yes
name: babysit-pr-42
/loop 根据/tmp/plan.md中的方案实现认证重构
→ worker-prompt-file: /tmp/plan.md
verifier-prompt: "验证方案中的每一步都已实现。检查文件变更、类型定义,运行`npm run typecheck`和`npm test`。逐个报告每个验证标准并提供证据。"
name: auth-refactor
worktree: auth-refactor
/loop 运行测试套件直到全部通过
→ worker-prompt: "运行`npm test`。如果有测试失败,读取失败输出,在源码中排查根本原因并修复。当`npm test`返回码为0且所有测试通过时报告完成。如果仍有测试失败,报告任务未完成并说明失败的测试项及原因。"
无验证器(自终止模式:worker在测试通过时报告完成)
name: fix-tests
/loop 部署后监控错误率,每10分钟检查一次
→ worker-prompt: "运行`./scripts/check-canary.sh`检查金丝雀部署的错误率。当错误率连续两次检查都低于0.1%时报告完成。如果未达标,报告当前错误率及趋势。"
无验证器(自终止模式:worker在错误率稳定达标时报告完成)
sleep: 10m
max-iterations: 30
archive: yes
name: canary-watchUsing the Script
使用脚本
The loop is implemented as a bash script at .
~/.claude/skills/paseo-loop/bin/loop.shbash
undefined循环功能由这个bash脚本实现。
~/.claude/skills/paseo-loop/bin/loop.shbash
undefinedSelf-terminating: worker checks PR CI and reports done when all checks pass
自终止模式:worker检查PR的CI状态,全部通过时报告完成
~/.claude/skills/paseo-loop/bin/loop.sh
--worker-prompt "Check CI status of PR #42 using gh pr checks 42. Report done when ALL checks pass. Report not done with a list of pending/failing checks."
--name "babysit-pr"
--sleep 5m
--archive
--worker-prompt "Check CI status of PR #42 using gh pr checks 42. Report done when ALL checks pass. Report not done with a list of pending/failing checks."
--name "babysit-pr"
--sleep 5m
--archive
~/.claude/skills/paseo-loop/bin/loop.sh
--worker-prompt "使用gh pr checks 42检查PR #42的CI状态。所有检查通过时报告完成。若有pending或失败的检查,报告未完成并列出对应项。"
--name "babysit-pr"
--sleep 5m
--archive
--worker-prompt "使用gh pr checks 42检查PR #42的CI状态。所有检查通过时报告完成。若有pending或失败的检查,报告未完成并列出对应项。"
--name "babysit-pr"
--sleep 5m
--archive
Worker + verifier: worker implements, verifier independently checks
Worker+验证器模式:worker负责实现,验证器独立检查
~/.claude/skills/paseo-loop/bin/loop.sh
--worker-prompt "Implement the auth refactor: ..."
--verifier-prompt "Verify the auth refactor is complete. Run npm run typecheck and npm test. Check that all file changes match the plan. Report each criterion with evidence."
--name "auth-refactor"
--worktree "auth-refactor"
--worker-prompt "Implement the auth refactor: ..."
--verifier-prompt "Verify the auth refactor is complete. Run npm run typecheck and npm test. Check that all file changes match the plan. Report each criterion with evidence."
--name "auth-refactor"
--worktree "auth-refactor"
undefined~/.claude/skills/paseo-loop/bin/loop.sh
--worker-prompt "实现认证重构:..."
--verifier-prompt "验证认证重构已完成。运行npm run typecheck和npm test。检查所有文件变更是否符合方案要求。逐个报告每个验证标准并提供证据。"
--name "auth-refactor"
--worktree "auth-refactor"
--worker-prompt "实现认证重构:..."
--verifier-prompt "验证认证重构已完成。运行npm run typecheck和npm test。检查所有文件变更是否符合方案要求。逐个报告每个验证标准并提供证据。"
--name "auth-refactor"
--worktree "auth-refactor"
undefinedArguments
参数说明
| Flag | Required | Default | Description |
|---|---|---|---|
| Yes* | — | Prompt given to the worker each iteration |
| Yes* | — | Read the worker prompt from a file |
| No | | Worker agent ( |
| No* | — | Verification prompt for a separate verifier agent |
| No* | — | Read the verifier prompt from a file |
| No | | Verifier agent ( |
| Yes | — | Name prefix for agents |
| No | — | Delay between iterations (e.g. |
| No | unlimited | Safety cap on iterations |
| No | off | Archive agents after each iteration |
| No | — | Worktree name. Created on first use, reused after. |
| No | | Thinking level for worker |
* Provide exactly one of or . Provide at most one of or .
--worker-prompt--worker-prompt-file--verifier-prompt--verifier-prompt-file| 参数标识 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|
| 是* | — | 每次迭代给worker的提示词 |
| 是* | — | 从文件中读取worker提示词 |
| 否 | | Worker agent(格式为 |
| 否* | — | 给独立验证器agent的提示词 |
| 否* | — | 从文件中读取验证器提示词 |
| 否 | | 验证器agent(格式为 |
| 是 | — | Agent的名称前缀 |
| 否 | — | 两次迭代之间的延迟(例如 |
| 否 | unlimited | 迭代次数的安全上限 |
| 否 | off | 每次迭代后是否归档Agent |
| 否 | — | Worktree名称。首次使用时创建,后续复用。 |
| 否 | | Worker的思考深度 |
* 必须提供或其中之一。最多提供或其中之一。
--worker-prompt--worker-prompt-file--verifier-prompt--verifier-prompt-fileBehavior by parameters
按参数区分的行为
| Parameters | Mode | Use case |
|---|---|---|
| Self-terminating worker | Worker does work and decides when done |
| Worker + verifier | Worker implements, verifier independently checks |
| Polling with self-termination | Periodic check until a condition is met |
| Periodic work + verifier | Periodic work with independent verification |
| 参数组合 | 模式 | 使用场景 |
|---|---|---|
仅 | 自终止worker | Worker执行任务并自行判断完成时机 |
| Worker+验证器 | Worker负责实现,验证器独立检查 |
| 带自终止的轮询模式 | 定期检查直到满足条件 |
| 定期执行+验证模式 | 定期执行任务并进行独立验证 |
Agent Naming
Agent命名规则
Without verifier: agents are named :
{name}-{N}babysit-1 # First iteration
babysit-2 # Second iterationWith verifier: workers are , verifiers are :
{name}-{N}{name}-verify-{N}feat-1 # First worker
feat-verify-1 # First verifier
feat-2 # Second worker (with previous result context)
feat-verify-2 # Second verifier无验证器时:Agent命名为:
{name}-{N}babysit-1 # 第一次迭代
babysit-2 # 第二次迭代有验证器时:Worker命名为,验证器命名为:
{name}-{N}{name}-verify-{N}feat-1 # 第一个worker
feat-verify-1 # 第一个验证器
feat-2 # 第二个worker(带上一次迭代结果的上下文)
feat-verify-2 # 第二个验证器Worktree Support
Worktree支持
When is passed, all agents run in the same git worktree. The worktree is created on first launch and reused for all subsequent agents.
--worktreebash
~/.claude/skills/paseo-loop/bin/loop.sh \
--worker-prompt "Implement the feature..." \
--verifier-prompt "Verify the feature works and typecheck passes" \
--name "feature-x" \
--worktree "feature-x"当传入参数时,所有Agent都会在同一个git worktree中运行。Worktree会在首次使用时创建,后续迭代复用。
--worktreebash
~/.claude/skills/paseo-loop/bin/loop.sh \
--worker-prompt "实现该功能..." \
--verifier-prompt "验证功能可用且typecheck通过" \
--name "feature-x" \
--worktree "feature-x"Your Job
你的任务
- Understand the task from the conversation context and
$ARGUMENTS - Decide the mode — does this need a separate verifier, or can the worker self-terminate?
- Write the worker prompt — what the worker does each iteration. Must be self-contained (the agent has zero prior context).
- Write the verifier prompt (if needed) — what the verifier checks. Should be factual and verifiable.
- Choose sleep — if the task is polling/monitoring, add a sleep duration
- Choose archive — use for long-running or polling loops to keep the agent list clean
--archive - Choose agents — default: worker +
codexverifierclaude/sonnet - Choose a name — short, descriptive
- Run the script — call with all the arguments
loop.sh
- 理解任务:从对话上下文和中明确需求
$ARGUMENTS - 确定模式:判断是否需要独立验证器,还是使用worker自终止模式
- 编写worker提示词:定义worker每次迭代的操作。必须自包含(Agent无前置上下文)
- 编写验证器提示词(如需要):定义验证器的检查内容。需基于事实、可验证
- 选择休眠时长:如果是轮询/监控任务,添加延迟时长
- 选择归档设置:对于长期运行或轮询的循环,使用保持Agent列表整洁
--archive - 选择Agent:默认使用作为worker,
codex作为验证器claude/sonnet - 选择名称:简短、有描述性
- 运行脚本:调用并传入所有参数
loop.sh
When to use a verifier vs self-terminating
何时使用验证器 vs 自终止模式
Use a verifier () when:
--verifier-prompt- The worker's job is to implement something and you want independent verification
- You want the verification done by a different agent than the worker
- The worker should focus on doing work, not on judging its own work
Use self-terminating (no verifier) when:
- The worker is checking/polling an external condition (CI status, deployment health)
- The worker can objectively determine when it's done (tests pass, file exists)
- You want a single agent doing both the work and the evaluation
当以下情况时使用验证器():
--verifier-prompt- Worker的任务是实现功能,你需要独立验证
- 你希望由与worker不同的Agent执行验证
- Worker应专注于执行任务,而非自我评估
当以下情况时使用自终止模式(无验证器):
- Worker需要检查/轮询外部条件(CI状态、部署健康度)
- Worker可以客观判断任务完成时机(测试通过、文件存在)
- 你希望单个Agent同时执行任务和评估
Writing a Good Worker Prompt
编写优质Worker提示词
The worker prompt is what the agent receives each iteration. It must be:
- Self-contained — The agent starts with zero context. Everything needed is in the prompt.
- Specific — Name files, functions, types, URLs. Be concrete.
- Action-oriented — Tell the agent what to do, not what to think about.
Worker提示词是Agent每次迭代收到的指令,必须满足:
- 自包含:Agent无前置上下文,所有必要信息都需包含在提示词中
- 具体:指定文件、函数、类型、URL。内容要具体
- 动作导向:告诉Agent要做什么,而非思考什么
Writing a Good Verifier Prompt
编写优质验证器提示词
The verifier prompt defines what the verifier checks after each worker iteration. It can range from strict factual checks to qualitative code review:
Factual / objective checks:
- "Run and
npm test. Report done only if both pass with zero failures."npm run typecheck - "Check that PR #42 has all CI checks green and no unresolved review comments."
- "Verify the API responds to with status 200 within 500ms."
GET /health
Code quality / style checks:
- "Review the changes for DRY violations. Report done when there is no duplicated logic across files."
- "Check that the implementation does not over-engineer. No unnecessary abstractions, no premature generalization, no feature flags for single-use code."
- "Verify the code follows the project's conventions: functional style, no classes, explicit types, no ."
any
Performance / resource checks:
- "Run the benchmark suite. Report done when p99 latency is under 100ms."
- "Check bundle size. Report done when the production build is under 500KB gzipped."
Comprehensive verification:
- "Verify every step of the plan was implemented. Check file changes, types, test output. Run and
npm run typecheck. Report each criterion individually with evidence."npm test
The verifier should report facts with evidence, not suggest fixes.
验证器提示词定义了每次worker迭代后验证器的检查内容,范围可以从严格的事实检查到定性的代码审查:
事实/客观检查:
- "运行和
npm test。仅当两者都无失败时报告完成。"npm run typecheck - "检查PR #42的所有CI检查是否通过,且无未解决的评审意见。"
- "验证API对的响应状态为200,且响应时间在500ms内。"
GET /health
代码质量/风格检查:
- "审查变更是否存在DRY原则违反。当文件间无重复逻辑时报告完成。"
- "检查实现是否过度设计。无不必要的抽象、无过早的通用化、无仅单次使用的功能开关。"
- "验证代码符合项目规范:函数式风格、无类、显式类型、无。"
any
性能/资源检查:
- "运行基准测试套件。当p99延迟低于100ms时报告完成。"
- "检查包体积。当生产构建的gzip压缩后体积小于500KB时报告完成。"
全面验证:
- "验证方案中的每一步都已实现。检查文件变更、类型定义、测试输出。运行和
npm run typecheck。逐个报告每个验证标准并提供证据。"npm test
验证器应基于事实提供证据,而非建议修复方案。
Skill Stacking
技能叠加
You can instruct the worker to use other skills:
bash
~/.claude/skills/paseo-loop/bin/loop.sh \
--worker-prompt "Use /committee to plan, then fix the provider list bug. The bug is..." \
--verifier-prompt "The provider list renders correctly and npm run typecheck passes" \
--name "provider-fix"你可以指示worker使用其他技能:
bash
~/.claude/skills/paseo-loop/bin/loop.sh \
--worker-prompt "使用/committee进行规划,然后修复供应商列表的bug。bug详情为..." \
--verifier-prompt "供应商列表渲染正常且npm run typecheck通过" \
--name "provider-fix"Composing with Handoff
与Handoff组合使用
A handoff can launch a loop:
/handoff a loop in a worktree to babysit PR #42可以通过Handoff启动循环:
/handoff 在worktree中启动循环持续监控PR #42