loop-testing
English | 简体中文

Autonomous QA loop for Claude Code & Codex. An AI agent uses your finished
project like a real user in a sandbox — finding bugs, fixing the safe ones with
regression tests, and looping until it converges. One command, hands-off.
loop-testing is a dual-platform skill for Claude Code
and OpenAI Codex. After your app is built, it drives an AI
agent to exercise every feature from a real user's entry points (CLI, API, Web, library),
surface bug / logic / flow / edge-case / hidden / security / UX issues, fix the safe
ones on the spot (reproduce → fix root cause → add a regression test → replay-verify →
atomic commit), route judgment calls to a multi-model committee, and stop only when
two consecutive rounds turn up nothing but trivia. It runs fully autonomously, pausing
only for keys / payment / network permission, a suspected security vuln, or a hard blocker.
✨ Highlights
- Uses your product, not just reads the code. Acts from real entry points with
realistic data, fat-fingers, cancels mid-flow, and goes off the happy path — instead of
statically scanning code or re-running existing tests.
- Finds a bug → fixes it. Low-risk issues are fixed immediately: reproduce → fix root
cause → add a regression assertion → replay-verify → single atomic commit
(
fix(qa): [ISSUE-xxx]).
- Multi-model decisions (MoA). Product judgment calls aren't decided unilaterally:
several reference models analyze in parallel, an aggregator synthesizes a recommendation,
and it's archived as a decision record for you to approve.
- Anti-gaming convergence. Stops only after two consecutive clean rounds, and the
second must use different scenarios to cross-check. Coverage may not shrink, unverified
fixes may not be marked passed, and a run that hits the round cap honestly reports
INCOMPLETE — it never fakes a PASS.
- Resume-safe. All progress lives in files. After an interruption or context
compaction, re-triggering the skill continues from the checkpoint — rounds and ledger
are never reset.
- Mechanism-layer enforcement (Claude Code). A Stop-hook blocks ending the session
before convergence — fail-closed, with a bounded deadlock valve (force-allow after 3
no-progress blocks, 24h stale-run auto-disarm,
LOOP_TESTING_DISABLE_STOP_GATE=1
opt-out). A companion hook raises the cost of
faking a "verified" fix (LOOP_TESTING_DISABLE_LEDGER_GATE=1 opts out) — best-effort and
bypassable by design, with the residue covered
by red-line discipline and human diff review; it is not a hard gate.
- One skill, two platforms. Claude Code and Codex share the same
SKILL.md — one repo,
two installs.
- Safe by construction. Sandbox isolation, fail-closed cleanup, env-only keys with log
redaction, and never push / deploy / touch production.
🧩 Features
| Capability | What it does |
|---|
| Dual persona | Uses the product as a real user (two alternating profiles: a novice who ignores the docs, and an impatient power user); switches to a rigorous engineer to fix (smallest diff, reproduce-first, verify-after, no drive-by refactors). |
| Round 0 inventory | Detects the product shape and entry points, cross-maps every reachable feature, designs normal / edge / misuse / cancel-recovery scenarios, runs a baseline check, and emits PLAN.md + FEATURE_MATRIX.md. |
| Per-round loop | Pick a scenario → use it like a real user → file / reproduce / grade (P0–P3) on discovery → triage-fix with regression guard → replay-verify → settle the round. |
| Issue ledger | Every issue (incidental ones included) is filed before it's touched; a fully auditable state machine (OPEN / FIXING / FIXED_UNVERIFIED / VERIFIED / NEEDS_CONFIRMATION / BLOCKED / WONT_FIX / CANNOT_REPRODUCE). |
| MoA decision engine | Zero-dependency Node script; OpenAI + OpenRouter wire formats, proxy-first, graceful degradation; emits a structured decision record. |
| Unattended drivers | unattended-loop.sh (Claude) / unattended-codex.sh (Codex) relaunch from the checkpoint until convergence, with a wall-clock watchdog, circuit breakers, and a concurrency lock. |
| Sandbox setup / clean | git worktree isolation + ownership markers; cleanup is fail-closed (deletes nothing without a marker), preserves evidence, and never touches your data. |
All state lives in docs/looptesting/ inside the target project (kept but not committed,
and your .gitignore is left untouched):