Source profileQuality 91/100

event4u-app/agent-config/src/skills/verify-repair-loop/SKILL.md

verify-repair-loop

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'.

Source repository stars
7
Declared platforms
0
Static risk flags
1
Last source update
2026-08-04
Source checked
2026-08-04

Decision brief

What it does—and where it fits

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…

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.

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/verify-repair-loop"
Safe inspection promptEditorial

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

What the source asks the agent to do

  1. 01

    Procedure

    Before the first run, capture what "done" means and snapshot it:

    the task's acceptance criteria / requirement,the set of checks that define the verdict (test files + quality commands),a spec fingerprint = a hash of (requirement text + the check set).
  2. 02

    When to use

    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 change must converge against the project's test runner / quality toolsTest/quality coverage is the authoritative signal (high coverage, actionableYou want bounded auto-repair with a hard stop, not an open-ended fix loop.
  3. 03

    The Iron Law

    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.

    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 ch…
  4. 04

    1. Freeze the contract (spec fingerprint)

    Before the first run, capture what "done" means and snapshot it:

    the task's acceptance criteria / requirement,the set of checks that define the verdict (test files + quality commands),a spec fingerprint = a hash of (requirement text + the check set).
  5. 05

    2. Set the gate

    Review the “2. Set the gate” section in the pinned source before continuing.

    Review and apply the “2. Set the gate” source section.

Permission review

Static risk signals and limitations

Reads files

low · line 117

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

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score91/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars7SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
event4u-app/agent-config
Skill path
src/skills/verify-repair-loop/SKILL.md
Commit
798a65522c7a73b90526641d6d1589fe0937cb5f
License
MIT
Collected
2026-08-04
Default branch
main
View the original SKILL.md

verify-repair-loop

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.

When to use

  • 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 auto-repair with a hard stop, not an open-ended fix loop.

Do NOT use when:

  • The verdict is subjective craft (naming, architecture, style) or coverage is incomplete → use do-and-judge in subagent-orchestration (judge reads the diff and is sovereign).
  • You only need a one-shot multi-judge review of a finished diff → use /review-changes.
  • The verdict must come from a live app (Playwright against running services) → deferred (see Scope below); use test/quality verdicts until that trigger fires.

The Iron Law

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.

Procedure

1. Freeze the contract (spec fingerprint)

Before the first run, capture what "done" means and snapshot it:

  • the task's acceptance criteria / requirement,
  • the set of checks that define the verdict (test files + quality commands),
  • a spec fingerprint = a hash of (requirement text + the check set).

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.

2. Set the gate

KnobDefaultMeaning
thresholdall targeted checks greennumeric pass bar, absolute (fraction of total), not "± N tests"
allow_regressionsfalsea revision breaking a baseline-green check stops the loop
max_attempts3hard cap (test feedback is more actionable than diff critique → one more than do-and-judge's 2; bounded by autonomous-execution N=3)
plateau_window3stop if the last window scores sit within tolerance
tolerancesmall absolute fractionflake jitter that does not count as improvement

3. The loop (multi-turn — the conversation IS the loop)

Each iteration is agent turns, never executing control-flow code:

  1. Generate / revise — make the smallest change toward the contract.
  2. Run — execute the verdict commands; parse the structured result (counts green/total, which checks failed). This is one tool call, read in context.
  3. Score + regression check — compute the numeric score; compare failures against the baseline green set.
    • Regression (a baseline-green check now fails) → STOP, hand back with the regression named, even if the score rose. No whack-a-mole.
    • Plateau (last 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.
  4. Numeric gate — score < threshold and attempts remain → back to step 1 (attempts++). Score ≥ threshold, no regression → escalate (step 4 of the stage).

4. Judge escalation (only after the numeric gate passes)

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.

  • judge apply → DONE.
  • judge revise → back to step 3.1 (attempts++; still bounded).
  • judge reject → STOP, hand back; the approach must change.

5. Mid-loop invalidation (user-interrupt-priority)

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.

Scope — what runs, what is deferred

Verify contextIn scopeWhy
Unit / integration testsfast, 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 / E2Edeferredneeds 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).

Validation

Before finalizing, confirm:

  1. The numeric gate escalated to a judge — it did not apply on its own.
  2. No baseline-green check regressed (or the loop stopped and said so).
  3. The loop stopped at max_attempts, a plateau, or a judge apply — never ran unbounded.
  4. The judge saw only the diff + results, dispatched in fresh context.
  5. No daemon / persistent runtime introduced.

Output format

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):

  1. Contract — the frozen requirement + threshold + allow_regressions.
  2. Attemptsk/max, the score history, and the exact stop reason (threshold / plateau / cap / regression / reject).
  3. VerdictDONE, DONE_WITH_CONCERNS, or BLOCKED.
  4. Judge — the dispatched judge skill and its apply / revise / reject verdict (omit only when the loop stopped before escalation).
  5. Evidence — final green/total and any regressed checks by name.

Examples

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

Gotcha

  • Metric gaming — the agent "passes" by deleting a failing test or weakening an assertion. The numeric gate cannot catch this; the fresh-context judge is the safeguard. If the diff removes checks, that is a reject, not a pass.
  • Flake mistaken for a plateau — a single non-deterministic test flips the score and the window-comparison reads it as "no improvement". Re-run the suspected check before declaring a plateau; surface flakiness instead of thrashing.
  • Score rose, but a regression hid inside it — fixing 6 checks while breaking 2 still raises the total. Without the regression guard the loop ships a regression. Always diff failures against the baseline green set, not just the aggregate score.
  • Persona-switch theater — asking the same agent to "now judge what you wrote" is not separation. Dispatch the judge as a fresh-context subagent that never saw the generator's reasoning.
  • Stale contract — iterating against a requirement the user changed mid-loop. Re-check the spec fingerprint each turn; a change aborts.

Do NOT

  • NEVER let the numeric score apply a change without judge confirmation.
  • NEVER continue past a regression because the overall score improved.
  • NEVER run the live-app Playwright path here — it is deferred (needs a runtime).
  • NEVER judge with the generator's own context — dispatch a fresh-context judge.
  • NEVER loop past max_attempts or a detected plateau.

See also

  • subagent-orchestrationdo-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.
  • Optional impact pre-step (when a code-graph is present, ADR-124): run 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.