Best for
- A change must converge against the project's test runner / quality tools
- Test/quality coverage is the authoritative signal (high coverage, actionable
- You want bounded auto-repair with a hard stop, not an open-ended fix loop.
event4u-app/agent-config/src/skills/verify-repair-loop/SKILL.md
Use to iterate a change until tests/quality checks pass — bounded run→revise→re-run gated by a numeric threshold, then a judge confirms. Triggers 'iterate to green', 'keep fixing until tests pass'.
Decision brief
A bounded generate → run → revise → re-run cycle whose pass signal is the executed verdict — the project's real test/quality output, scored against a numeric threshold — escalated to a judge for qualitative confirmation only after the numeric gate passes (staged escalation). The…
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/verify-repair-loop"Inspect the Agent Skill "verify-repair-loop" from https://github.com/event4u-app/agent-config/blob/798a65522c7a73b90526641d6d1589fe0937cb5f/src/skills/verify-repair-loop/SKILL.md at commit 798a65522c7a73b90526641d6d1589fe0937cb5f. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
Before the first run, capture what "done" means and snapshot it:
A change must converge against the project's test runner / quality tools and you want the agent to iterate until checks pass before asking for review. Test/quality coverage is the authoritative signal (high coverage, actionable failures) — not subjective craft. You want bounded…
A loop that optimizes for passcount ≥ N can game the metric — delete tests, skip assertions, weaken checks — and still hit the threshold. The numeric gate only decides when to escalate; a judge with veto confirms the change is real.
Before the first run, capture what "done" means and snapshot it:
Review the “2. Set the gate” section in the pinned source before continuing.
Permission review
The documentation asks the agent to read local files, directories, or repositories.
State lives in the conversation, optionally mirrored to a re-read working file —Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 7 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
A bounded generate → run → revise → re-run cycle whose pass signal is the executed verdict — the project's real test/quality output, scored against a numeric threshold — escalated to a judge for qualitative confirmation only after the numeric gate passes (staged escalation). The loop is the conversation, not a process: no daemon, no persistent cross-session state. Use it to drive a change to green when the verdict source is runtime execution, not a judge reading a diff.
Do NOT use when:
do-and-judge in
subagent-orchestration (judge reads the
diff and is sovereign)./review-changes.THE NUMERIC VERDICT IS NEVER SOVEREIGN.
TESTS DECIDE WHEN TO ESCALATE — A JUDGE DECIDES WHETHER TO APPLY.
A REVISION THAT BREAKS A PREVIOUSLY-GREEN CHECK STOPS THE LOOP,
EVEN IF THE OVERALL SCORE ROSE.
GENERATOR NEVER APPROVES ITS OWN CHANGE.
A loop that optimizes for pass_count ≥ N can game the metric — delete tests,
skip assertions, weaken checks — and still hit the threshold. The numeric gate
only decides when to escalate; a judge with veto confirms the change is real.
Before the first run, capture what "done" means and snapshot it:
Record the baseline green set — which checks pass before any edit — so
regressions are detectable. Pick the verdict commands per the project's
toolchain-resolver (PHP / JS-TS
/ Python / Go / Rust), not a hardcoded runner.
| Knob | Default | Meaning |
|---|---|---|
threshold | all targeted checks green | numeric pass bar, absolute (fraction of total), not "± N tests" |
allow_regressions | false | a revision breaking a baseline-green check stops the loop |
max_attempts | 3 | hard cap (test feedback is more actionable than diff critique → one more than do-and-judge's 2; bounded by autonomous-execution N=3) |
plateau_window | 3 | stop if the last window scores sit within tolerance |
tolerance | small absolute fraction | flake jitter that does not count as improvement |
Each iteration is agent turns, never executing control-flow code:
plateau_window scores within tolerance) → STOP; surface
suspected flakiness or a stuck point. Do not thrash.attempts == max_attempts → STOP, hand back the best envelope.< threshold and attempts remain → back to step 1
(attempts++). Score ≥ threshold, no regression → escalate (step 4 of the
stage).Dispatch the judge as a subagent with fresh context (the judge-* cluster via
subagent-orchestration) that sees only the
diff + the executed results — never the generator's reasoning. This is the real
generator ≠ judge separation; single-agent persona-switching is theater.
apply → DONE.revise → back to step 3.1 (attempts++; still bounded).reject → STOP, hand back; the approach must change.Re-check the spec fingerprint each iteration. If the user changes the
requirement mid-loop (a new instruction in the conversation), the fingerprint
changes → abort and hand back per
user-interrupt-priority. Never keep
iterating against a stale contract.
| Verify context | In scope | Why |
|---|---|---|
| Unit / integration tests | ✅ | fast, deterministic, sandboxed — runtime-free |
| Static quality (lint, type-check, format) | ✅ | fast, deterministic, no side effects (auto-fixable failures may bypass the revise step) |
| Live-app Playwright / E2E | ⛔ deferred | needs running services (DB, API) = a runtime; trigger = a UI-observable mission output + Playwright wired into a consumer CI |
State lives in the conversation, optionally mirrored to a re-read working file —
never a daemon or persistent cross-session store (honors
no-runtime-boundary).
Before finalizing, confirm:
max_attempts, a plateau, or a judge apply — never
ran unbounded.verify-repair-loop
Contract: <one-line requirement> · threshold <X> · allow_regressions false
Attempts: <k>/<max> scores: [s1, s2, …] stop: threshold|plateau|cap|regression|reject
Verdict: DONE | DONE_WITH_CONCERNS | BLOCKED
Judge: <judge skill> → apply|revise|reject
Evidence: <green/total> · regressions: none | <named checks>
Required fields (ordered):
allow_regressions.k/max, the score history, and the exact stop reason
(threshold / plateau / cap / regression / reject).DONE, DONE_WITH_CONCERNS, or BLOCKED.apply / revise /
reject verdict (omit only when the loop stopped before escalation).green/total and any regressed checks by name.Good — staged, bounded, judge confirms:
iter1 84/100 (<90) → revise
iter2 93/100 (≥90, no regression) → escalate → judge apply → DONE
Bad — numeric verdict treated as sovereign (rejected by the Iron Law):
iter1 91/100 ≥ threshold → "PASS, done" ✗ no judge escalation; metric may be gamed
iter2 fixes A, breaks B, 92% → "PASS" ✗ regression ignored
reject, not a pass.max_attempts or a detected plateau.subagent-orchestration — do-and-judge
(judge-sovereign, diff-read) is the sibling; this skill is test-verdict-gated./review-changes — one-shot multi-judge
review; wires this loop as an opt-in step.playwright-testing,
quality-tools — verdict sources.autonomous-execution — the N=3 cap.no-runtime-boundary — the
runtime-free constraint this loop honors.agent-config code-graph affected --since <ref> to scope which symbols a
change touches before choosing verdict sources — cited, not duplicated; the
loop itself is unchanged when no graph exists.