Back to Skills

pua-loop

PUA Loop — guided iterative development with recurring checks, completion evidence, and pause/abort markers. Use only when the user explicitly asks for loop/自动迭代 mode.

19,144stars1,163forksUpdated 8/1/2026

Security Assessment

Low Risk(88/100)

Detected risks:

Unattended Autonomous Loop(The skill runs as an unbounded loop that by default never stops until an independent verify command passes, an abort/pause marker is emitted, or the user interrupts., It disables the ability to ask the user questions and instructs the agent not to say it cannot solve the problem, making all decisions autonomously without pausing for confirmation., It runs a setup shell script and auto-appended verification commands inferred from the task description without an explicit user approval step for each command.)
Security Score88/100

About pua-loop

PUA Loop is an autonomous iterative-development mode that borrows a gated "Oracle" verification design from the autoresearch project. It solves the problem of an AI agent falsely declaring a task done: the agent may output a `<promise>LOOP_DONE</promise>` completion signal, but a Stop hook independently runs a user-set `verify_command` (embedded in a state-file frontmatter the agent cannot modify) and only accepts completion if that command exits zero, otherwise feeding the failure output back and continuing the loop.

Its main features are five design patterns: Oracle isolation (a verify command the agent can't edit), a two-phase gate (agent self-check then independent hook check), failure memory appended to a `.claude/pua-loop-history.jsonl` file so past failed approaches aren't repeated, stall detection that escalates behavior after repeated promise rejections, and unbounded iteration by default. A setup script (`setup-pua-loop.sh`) starts the loop, and the skill will auto-append a `--verify` command (for example `npm test` or a curl health check) when it can infer one from the task. The mode deliberately disables AskUserQuestion and forbids the agent from saying it cannot solve the problem, driving toward the completion signal.

Target users are developers who want a hands-off "run until verified" loop for tasks with a checkable success condition (fix all tests, build an API to a passing health check). The main limitation and caveat is exactly that autonomy: it runs shell verify commands and setup scripts without pausing for the user and, by default, never stops on its own until the Oracle passes or an abort/pause marker or Ctrl+C intervenes.

FAQ

How do I start it?

Run `/pua:pua-loop "task description"`, which invokes `setup-pua-loop.sh` with a completion promise; the skill auto-appends a `--verify` command when it can infer a checkable one from the task.

How does it prevent false 'done' claims?

A two-phase gate: the agent self-verifies (Phase 1), then a Stop hook independently runs the user-set verify_command (Phase 2). The verify command lives in a frontmatter the agent cannot modify, so only an exit-zero result accepts the promise.

Does it ever stop on its own?

By default max_iterations is 0 (unbounded). It terminates only when the Oracle verifies the promise, on a `<loop-abort>` or `<loop-pause>` marker, when a user-set iteration cap is reached, or on Ctrl+C.

Does it ask the user questions during the loop?

No. It disables AskUserQuestion and makes all decisions autonomously, and it forbids the agent from declaring it cannot solve the problem while looping.

How does it avoid repeating failed approaches?

Each iteration's result is appended to `.claude/pua-loop-history.jsonl` (which survives git reverts), and the agent reads it each round; stall detection escalates its behavior after repeated promise rejections.

Install pua-loop

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

tanweai/pua