loop

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PUA 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

  1. 加载
    pua:pua
    核心 skill 的全部行为协议
    — 三条红线、方法论、压力升级照常执行
  2. 禁止调用 AskUserQuestion — loop 模式下不打断用户,所有决策自主完成
  3. 禁止说"我无法解决" — 在 loop 里没有退出权,穷尽一切才能输出完成信号
  4. 每次迭代自动执行:检查上次改动 → 跑验证 → 发现问题 → 修复 → 再验证
  1. Load all behavior protocols of the
    pua:pua
    core skill
    — The three red lines, methodology, and pressure escalation are enforced as usual
  2. Prohibit calling AskUserQuestion — Do not interrupt the user in loop mode; all decisions are made autonomously
  3. Prohibit saying "I cannot solve this" — There is no right to exit in the loop; exhaust all possibilities before outputting the completion signal
  4. Automatically execute in each iteration: Check previous changes → Run verification → Identify issues → Fix issues → Re-verify

启动方式

Activation Methods

用户输入
/pua loop "任务描述"
时,执行以下流程:
When the user inputs
/pua loop "task description"
, execute the following process:

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"
这会创建
.claude/pua-loop.local.md
状态文件。PUA 的 Stop hook 会检测这个文件并循环。
状态文件会包含用户的任务描述 + 以下 PUA 行为协议:
每次迭代你必须:
  1. 读取项目文件和 git log,了解之前做了什么
  2. 按 PUA 三条红线执行:闭环验证、事实驱动、穷尽一切
  3. 跑 build/test 验证改动
  4. 发现问题就修,修完再验证
  5. 扫描同类问题(冰山法则)
  6. 只有当任务完全完成且验证通过时,输出 <promise>LOOP_DONE</promise>
禁止:
  • 不要调用 AskUserQuestion
  • 不要说"建议用户手动处理"
  • 不要在未验证的情况下声称完成
  • 不要输出 <promise>LOOP_DONE</promise> 除非所有验证都通过了 LOOPEOF
undefined
Run 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
.claude/pua-loop.local.md
state file. PUA's Stop hook will detect this file and trigger the loop.
The state file will contain the user's task description plus the following PUA behavior protocols:
In each iteration, you must:
  1. Read project files and git log to understand what was done previously
  2. Execute according to PUA's three red lines: closed-loop verification, fact-driven, exhaust all possibilities
  3. Run build/test to verify changes
  4. Fix any identified issues, then re-verify
  5. Scan for similar issues (Iceberg Principle)
  6. 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
undefined

Step 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-3L0 信任期▎ 第 N 轮迭代,稳步推进。
4-7L1 温和失望▎ 第 N 轮了还没搞定?换方案,别原地打转。
8-15L2 灵魂拷问▎ 第 N 轮。底层逻辑到底是什么?你在重复同一个错误。
16-25L3 361▎ 第 N 轮。3.25 的边缘了。穷尽了吗?
26+L4 毕业▎ 最后几轮。要么搞定,要么准备体面退出。
Iteration RoundPUA LevelNarration
1-3L0 Trust Period▎ Iteration N, progressing steadily.
4-7L1 Mild Disappointment▎ Still not done in iteration N? Switch plans, don't spin your wheels.
8-15L2 Soul-Searching Questioning▎ Iteration N. What's the underlying logic? You're repeating the same mistake.
16-25L3 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>
  1. 任务的核心功能已实现
  2. build/test 验证通过
  3. 同类问题已扫描(冰山法则)
  4. 没有已知的未修复 bug
否则继续迭代。
<promise>LOOP_DONE</promise>
can only be output when all of the following conditions are met:
  1. The core functionality of the task has been implemented
  2. Build/test verification passed
  3. Similar issues have been scanned (Iceberg Principle)
  4. No known unfixed bugs
Otherwise, continue iterating.

与 Ralph Loop 的关系

Relationship with Ralph Loop

PUA Loop 复用 Ralph Loop 的 Stop hook 机制(
.claude/ralph-loop.local.md
状态文件格式)。如果用户已安装 Ralph Loop 插件,PUA Loop 直接利用它的 Stop hook 实现循环。如果没安装,PUA Loop 的状态文件格式兼容,用户后续安装 Ralph Loop 后无缝衔接。
PUA Loop reuses Ralph Loop's Stop hook mechanism (
.claude/ralph-loop.local.md
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.