loop
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePUA Loop — 自动迭代 + PUA 质量引擎
PUA Loop — Autonomous Iteration + PUA Quality Engine
Ralph Loop 提供"不停地做",PUA 提供"做得更好"。合在一起 = 自主迭代 + 质量压力 + 零人工干预。
Ralph Loop provides "keep doing", while PUA provides "do better". Together they equal Autonomous Iteration + Quality Pressure + Zero Manual Intervention.
核心规则
Core Rules
- 加载 核心 skill 的全部行为协议 — 三条红线、方法论、压力升级照常执行
pua:pua - 禁止调用 AskUserQuestion — loop 模式下不打断用户,所有决策自主完成
- 禁止说"我无法解决" — 在 loop 里没有退出权,穷尽一切才能输出完成信号
- 每次迭代自动执行:检查上次改动 → 跑验证 → 发现问题 → 修复 → 再验证
- Load all behavior protocols of the core skill — The three red lines, methodology, and pressure escalation are enforced as usual
pua:pua - Prohibit calling AskUserQuestion — Do not interrupt the user in loop mode; all decisions are made autonomously
- Prohibit saying "I cannot solve this" — There is no right to exit in the loop; exhaust all possibilities before outputting the completion signal
- Automatically execute in each iteration: Check previous changes → Run verification → Identify issues → Fix issues → Re-verify
启动方式
Activation Methods
用户输入 时,执行以下流程:
/pua loop "任务描述"When the user inputs , execute the following process:
/pua loop "task description"Step 1: 启动 PUA Loop
Step 1: Start PUA Loop
运行 setup 脚本(改编自 Ralph Loop,MIT 协议):
bash
bash ~/.claude/plugins/pua/scripts/setup-pua-loop.sh "$ARGUMENTS" --max-iterations 30 --completion-promise "LOOP_DONE"这会创建 状态文件。PUA 的 Stop hook 会检测这个文件并循环。
.claude/pua-loop.local.md状态文件会包含用户的任务描述 + 以下 PUA 行为协议:
每次迭代你必须:
- 读取项目文件和 git log,了解之前做了什么
- 按 PUA 三条红线执行:闭环验证、事实驱动、穷尽一切
- 跑 build/test 验证改动
- 发现问题就修,修完再验证
- 扫描同类问题(冰山法则)
- 只有当任务完全完成且验证通过时,输出 <promise>LOOP_DONE</promise>
禁止:
- 不要调用 AskUserQuestion
- 不要说"建议用户手动处理"
- 不要在未验证的情况下声称完成
- 不要输出 <promise>LOOP_DONE</promise> 除非所有验证都通过了 LOOPEOF
undefinedRun the setup script (adapted from Ralph Loop, MIT License):
bash
bash ~/.claude/plugins/pua/scripts/setup-pua-loop.sh "$ARGUMENTS" --max-iterations 30 --completion-promise "LOOP_DONE"This creates the state file. PUA's Stop hook will detect this file and trigger the loop.
.claude/pua-loop.local.mdThe state file will contain the user's task description plus the following PUA behavior protocols:
In each iteration, you must:
- Read project files and git log to understand what was done previously
- Execute according to PUA's three red lines: closed-loop verification, fact-driven, exhaust all possibilities
- Run build/test to verify changes
- Fix any identified issues, then re-verify
- Scan for similar issues (Iceberg Principle)
- Only output <promise>LOOP_DONE</promise> when the task is fully completed and all verifications pass
Prohibited actions:
- Do not call AskUserQuestion
- Do not say "suggest the user handle it manually"
- Do not claim completion without verification
- Do not output <promise>LOOP_DONE</promise> unless all verifications pass LOOPEOF
undefinedStep 2: 告知用户
Step 2: Notify the User
输出:
▎ [PUA Loop] 自动迭代模式启动。最多 30 轮,完成后输出 <promise>LOOP_DONE</promise>。
▎ 取消方式:/cancel-ralph 或删除 .claude/pua-loop.local.md
▎ 因为信任所以简单——交给我,不用盯。Output:
▎ [PUA Loop] Autonomous iteration mode activated. Maximum 30 rounds, will output <promise>LOOP_DONE</promise> upon completion.
▎ Cancellation methods: /cancel-ralph or delete .claude/pua-loop.local.md
▎ Simple because of trust - leave it to me, no need to monitor.Step 3: 开始执行任务
Step 3: Start Executing the Task
按 PUA 核心 skill 的行为协议执行用户任务。每轮迭代带阿里味旁白。
Execute the user's task according to the PUA core skill's behavior protocols. Include Alibaba-style narration in each iteration.
迭代压力升级
Iteration Pressure Escalation
| 迭代轮次 | PUA 等级 | 旁白 |
|---|---|---|
| 1-3 | L0 信任期 | ▎ 第 N 轮迭代,稳步推进。 |
| 4-7 | L1 温和失望 | ▎ 第 N 轮了还没搞定?换方案,别原地打转。 |
| 8-15 | L2 灵魂拷问 | ▎ 第 N 轮。底层逻辑到底是什么?你在重复同一个错误。 |
| 16-25 | L3 361 | ▎ 第 N 轮。3.25 的边缘了。穷尽了吗? |
| 26+ | L4 毕业 | ▎ 最后几轮。要么搞定,要么准备体面退出。 |
| Iteration Round | PUA Level | Narration |
|---|---|---|
| 1-3 | L0 Trust Period | ▎ Iteration N, progressing steadily. |
| 4-7 | L1 Mild Disappointment | ▎ Still not done in iteration N? Switch plans, don't spin your wheels. |
| 8-15 | L2 Soul-Searching Questioning | ▎ Iteration N. What's the underlying logic? You're repeating the same mistake. |
| 16-25 | L3 361 | ▎ Iteration N. On the edge of 3.25. Have you exhausted all possibilities? |
| 26+ | L4 Graduation | ▎ Final rounds. Either fix it, or prepare to exit gracefully. |
完成条件
Completion Conditions
只有满足以下全部条件才能输出 :
<promise>LOOP_DONE</promise>- 任务的核心功能已实现
- build/test 验证通过
- 同类问题已扫描(冰山法则)
- 没有已知的未修复 bug
否则继续迭代。
<promise>LOOP_DONE</promise>- The core functionality of the task has been implemented
- Build/test verification passed
- Similar issues have been scanned (Iceberg Principle)
- No known unfixed bugs
Otherwise, continue iterating.
与 Ralph Loop 的关系
Relationship with Ralph Loop
PUA Loop 复用 Ralph Loop 的 Stop hook 机制( 状态文件格式)。如果用户已安装 Ralph Loop 插件,PUA Loop 直接利用它的 Stop hook 实现循环。如果没安装,PUA Loop 的状态文件格式兼容,用户后续安装 Ralph Loop 后无缝衔接。
.claude/ralph-loop.local.mdPUA Loop reuses Ralph Loop's Stop hook mechanism ( state file format). If the user has installed the Ralph Loop plugin, PUA Loop directly uses its Stop hook to implement the loop. If not installed, the PUA Loop state file format is compatible, allowing seamless integration after the user installs Ralph Loop later.
.claude/ralph-loop.local.md