A deterministic, bounded quality improvement loop that eliminates infinite token burns, self-grading delusions, and regression churn. Deploys an unyielding, 4-role protocol (Freeze → Build → Fresh Critic → Automated Gate → Integrator) with hard mathematically enforced termination boundaries, OWASP security header verification, and multi-viewport visual regression gates.
When to Use
Trigger Conditions
Execute this skill when:
Multi-Round Code/Doc Refinement: A complex task requires iterative quality improvement across multiple passes.
Preventing Self-Grading Delusion: The builder agent must NOT evaluate its own output; an isolated Fresh Critic must score the work against frozen criteria.
Web Application Hardening Gate: Iterating on web apps, frontend templates, or API servers requiring strict security headers (CSP, HSTS) and responsive viewport checks (375px, 768px, 1280px).
Hard Stop Boundaries Required: Guarding against runaway agent loops where changes oscillate or degrade previous passes.
Mission-Critical Delivery: High-stakes deliverables requiring an ironclad ACCEPTANCE_PACKET.md.
Anti-Triggers
Do NOT use this skill when:
The task is a trivial one-liner fix or typo correction (use direct editing).
The task is exploratory research without a concrete deliverable (use research subagent).
Task dependencies are heavily coupled and unsplit (run coupling-router first).
Quick Reference
The 4 Gauntlet Roles & Blind Reference Bar
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────────────────┐ ┌─────────────────┐
│ BUILDER │ ────▶ │ FRESH CRITIC │ ────▶ │ AUTOMATED GATE │ ────▶ │ INTEGRATOR │
│ Minimal, clean │ │ Blind audit vs │ │ Tests, types, secret scans, │ │ Merges ONLY the │
│ diff candidate │ │ NAMED REAL BAR │ │ security headers & viewports│ │ #1 largest fix │
└─────────────────┘ └─────────────────┘ └─────────────────────────────┘ └─────────────────┘
🎯 "The Bar is the Whole Trick" Doctrine
The loop only produces quality if the thing it compares against is real:
Named: A specific entity, not an abstract category ("Nike's running landing page", not "modern athletic sites").
Fetchable: The critic can obtain the raw reality (live URL screenshot, published article, test suite).
Comparable: Both artifacts can sit side-by-side so a judge can pick a winner.
Goal Type
Concrete Passing Bar
Measurable Half
Web Apps & UI
Live site of named best-in-class product screenshotted at 375px & 1440px.
Zero layout shift, CSP/HSTS headers, zero horizontal scroll overflow.
Code & CLI Tools
Top-tier open source repository implementation (e.g. Bun, Ripgrep, Hono).
Benchmark latency, memory footprint, 100% test pass rate.
Writing & Essays
Specific published article by named author (e.g. Julia Evans, Paul Graham).
Reading grade level, clarity score, word count parity.
System Research
Named industry whitepaper or peer-reviewed methods section.
Round N (N = 1..max_rounds):
1. BUILD: Builder produces candidate patch based strictly on previous round critic feedback.
2. AUDIT (Blind A/B): Spawn isolated Fresh Critic subagent with NO memory of builder reasoning.
- Strip labels from candidate and bar.
- Put candidate next to the bar blind; judge which is better and name the single biggest remaining gap.
- Score 0.0–10.0 across: Correctness (40%), Minimal Diff (25%), Edge Cases (20%), Architecture (15%).
3. GATE: Run automated proof suite AND integrity checks AND Web App Security & Visual Gate:
- Check 5 mandatory security headers (CSP, HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy).
- Check 3 responsive viewports (375px, 768px, 1280px) for zero horizontal overflow.
- **Quality-bar regression check**: scan the round's diff for a lowered bar — new suppression directives, skipped or deleted tests, weakened assertions, thresholds edited down. Any of these zeroes the round score (0.0): a build that passes because the bar was lowered is a regression, not a pass.
- **Fail-closed eval check**: confirm the proof suite contains at least one test that CAN fail on the defect class the round claims to fix. If nothing in the suite could have caught the defect, a green run proves nothing — the round does not pass until a capable test exists (write it, watch it fail on the pre-fix state).
- Any test failure, missing critical security header, visual overflow, quality-bar regression, or failed fail-closed check zeroes the round score (0.0).
4. RECORD: Append round metrics, header receipts, viewport outcomes, and finding counts (new findings vs fixed findings this round) to ITERATION_LEDGER.md — the ledger is the convergence instrument: when new findings outnumber fixed findings two rounds running, the loop is diverging, not converging — stop and escalate instead of burning the remaining budget.
5. DECIDE: Evaluate Stop Conditions Matrix.
Step 3 — Integrator Gate
The Integrator agent NEVER merges bulk diffs. It isolates and applies only the single highest-impact delta that directly improved the score, preserving all previously verified baselines.
Upon reaching success termination, compile the final artifact:
Summary of rounds executed and score trajectory ($R_1 \rightarrow R_N$).
Verbatim execution receipts of automated proof commands, security headers, and viewport checks.
Verified diff summary and signature.
Option B: Gauntlet Prompt Synthesizer Mode
When the user asks to "make a gauntlet prompt" or "loop until it beats X", craft ONE short, paste-ready prompt (120–180 words):
Set the Bar: Name a concrete, fetchable reference.
Break into Pieces: Smallest judgeable components.
Blind Critic Directive: Fresh critic puts output next to the bar blind with labels stripped and names the #1 biggest gap.
Offer to Run: Append flat line: I can run this here.
Pitfalls
Self-Grading Bias: Never allow the builder subagent to evaluate its own work. The critic MUST run in an isolated conversation context.
Overlooking Security Headers: Shipping web apps or APIs with missing CSP or HSTS headers.
Horizontal Scroll Blowout: Failing to audit the 375px mobile viewport for layout blowouts.
Diff Bloat Across Iterations: Reject candidates that expand the diff surface by $>30%$ without a proportional score increase.
Ignoring Score Plateau: If round 2 scores 7.5 and round 3 scores 7.4, STOP immediately. Do not attempt round 4.
Lowered-Bar Green: Passing the gate by suppressing, skipping, or weakening checks in the same diff — the gate measures the artifact, not the artifact's ability to evade measurement.
Vacuous Green: Accepting a green proof suite that contains no test capable of failing on the round's defect class — an unevaluatable claim is not a pass; add the capable test first.
Verification
Before declaring gauntlet completion:
GAUNTLET_JOB_CONTRACT.md exists with frozen acceptance criteria.
ITERATION_LEDGER.md logs every round with objective critic score breakdown.
All automated proof commands exit with return code 0.
Multi-viewport visual check passes at 375px, 768px, and 1280px with zero horizontal overflow.
ACCEPTANCE_PACKET.md is generated with final verification receipts.
1---2name: gauntlet-loop3description: Bounded multi-agent quality improvement loop that prevents infinite iterations, self-grading delusions, and regression churn. Orchestrates Builder, Fresh Critic, Automated Gate (with web application security headers and visual breakpoint audit), and Integrator roles with strict stop conditions (proof of passing, 2-round score plateau, regression, or max iteration budget). Generates GAUNTLET_JOB_CONTRACT.md, ITERATION_LEDGER.md, and ACCEPTANCE_PACKET.md.4license: MIT5---67# 🛡️ Gauntlet Loop — Bounded Multi-Agent Quality Improvement Loop89> A deterministic, bounded quality improvement loop that eliminates infinite token burns, self-grading delusions, and regression churn. Deploys an unyielding, 4-role protocol (Freeze → Build → Fresh Critic → Automated Gate → Integrator) with hard mathematically enforced termination boundaries, OWASP security header verification, and multi-viewport visual regression gates.1011---1213## When to Use1415### Trigger Conditions16Execute this skill when:171. **Multi-Round Code/Doc Refinement**: A complex task requires iterative quality improvement across multiple passes.182. **Preventing Self-Grading Delusion**: The builder agent must NOT evaluate its own output; an isolated *Fresh Critic* must score the work against frozen criteria.193. **Web Application Hardening Gate**: Iterating on web apps, frontend templates, or API servers requiring strict security headers (CSP, HSTS) and responsive viewport checks (375px, 768px, 1280px).204. **Hard Stop Boundaries Required**: Guarding against runaway agent loops where changes oscillate or degrade previous passes.215. **Mission-Critical Delivery**: High-stakes deliverables requiring an ironclad `ACCEPTANCE_PACKET.md`.2223### Anti-Triggers24Do NOT use this skill when:25- The task is a trivial one-liner fix or typo correction (use direct editing).26- The task is exploratory research without a concrete deliverable (use research subagent).27- Task dependencies are heavily coupled and unsplit (run [`coupling-router`](../coupling-router/SKILL.md) first).2829---3031## Quick Reference3233### The 4 Gauntlet Roles & Blind Reference Bar3435```36┌─────────────────┐ ┌─────────────────┐ ┌─────────────────────────────┐ ┌─────────────────┐37│ BUILDER │ ────▶ │ FRESH CRITIC │ ────▶ │ AUTOMATED GATE │ ────▶ │ INTEGRATOR │38│ Minimal, clean │ │ Blind audit vs │ │ Tests, types, secret scans, │ │ Merges ONLY the │39│ diff candidate │ │ NAMED REAL BAR │ │ security headers & viewports│ │ #1 largest fix │40└─────────────────┘ └─────────────────┘ └─────────────────────────────┘ └─────────────────┘41```4243### 🎯 "The Bar is the Whole Trick" Doctrine4445The loop only produces quality if the thing it compares against is **real**:46- **Named**: A specific entity, not an abstract category (*"Nike's running landing page"*, not *"modern athletic sites"*).47- **Fetchable**: The critic can obtain the raw reality (live URL screenshot, published article, test suite).48- **Comparable**: Both artifacts can sit side-by-side so a judge can pick a winner.4950| Goal Type | Concrete Passing Bar | Measurable Half |51| :--- | :--- | :--- |52| **Web Apps & UI** | Live site of named best-in-class product screenshotted at 375px & 1440px. | Zero layout shift, CSP/HSTS headers, zero horizontal scroll overflow. |53| **Code & CLI Tools** | Top-tier open source repository implementation (e.g. Bun, Ripgrep, Hono). | Benchmark latency, memory footprint, 100% test pass rate. |54| **Writing & Essays** | Specific published article by named author (e.g. Julia Evans, Paul Graham). | Reading grade level, clarity score, word count parity. |55| **System Research** | Named industry whitepaper or peer-reviewed methods section. | Citation count, empirical receipts, falsifiable claims. |5657### Stop Conditions Matrix5859| Condition | Trigger Rule | Action |60| :--- | :--- | :--- |61| **✅ Proof of Passing** | All automated tests green + Critic score $\ge 9.0/10$ + zero blockers + security/visual gates pass | **TERMINATE (SUCCESS)** → Output `ACCEPTANCE_PACKET.md` |62| **🛑 Score Plateau** | 2 consecutive rounds without net score improvement ($\Delta \le 0$) | **TERMINATE (PLATEAU)** → Emit Dead-Letter escalation |63| **📉 Score Regression** | Round score drops by $> 1.0$ point or automated tests break | **REVERT** to previous round baseline & halt |64| **⏳ Budget Exhaustion** | Reaches `max_iterations` (default: 3 rounds, hard max: 5) | **TERMINATE (BUDGET)** → Deliver current best checkpoint |65| **👤 Human Override** | Explicit user halt or steering directive | **HALT** immediately |6667### Web Application Automated Gate Checklist6869When evaluating web endpoints or frontend components:70- **Security Headers (OWASP)**: CSP, HSTS, `X-Frame-Options: DENY`, `X-Content-Type-Options: nosniff`, `Referrer-Policy: strict-origin-when-cross-origin`.71- **Responsive Viewports**: Tested at `375px` (mobile), `768px` (tablet), `1280px` (desktop) for zero horizontal scrollbar overflow (`scrollWidth === innerWidth`).7273---7475## Procedure7677### Option A: Autonomous Multi-Role Execution Loop7879#### Step 1 — Set the Real Bar & Freeze the Job Contract (`GAUNTLET_JOB_CONTRACT.md`)801. **Name the Bar**: If the user supplied a reference, use it. If not, offer **2 or 3 candidate bars** (one line each) and wait for their pick.812. **Lock Contract**: Record in workspace root:82 - **Goal**: Precise, measurable objective statement.83 - **Concrete Bar**: Named fetchable reference artifact.84 - **Acceptance Criteria**: 3–5 binary checkboxes + OWASP security headers + responsive viewports.85 - **Automated Proof Commands**: Pinned commands (`bun test`, `tsc --noEmit`, `SecretScan.ts`, curl header audits).86 - **Iteration Budget**: Max rounds (default 3, hard ceiling 5).8788#### Step 2 — Round Execution Loop (with Blind A/B Critique)89```90Round N (N = 1..max_rounds):91 1. BUILD: Builder produces candidate patch based strictly on previous round critic feedback.92 2. AUDIT (Blind A/B): Spawn isolated Fresh Critic subagent with NO memory of builder reasoning.93 - Strip labels from candidate and bar.94 - Put candidate next to the bar blind; judge which is better and name the single biggest remaining gap.95 - Score 0.0–10.0 across: Correctness (40%), Minimal Diff (25%), Edge Cases (20%), Architecture (15%).96 3. GATE: Run automated proof suite AND integrity checks AND Web App Security & Visual Gate:97 - Check 5 mandatory security headers (CSP, HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy).98 - Check 3 responsive viewports (375px, 768px, 1280px) for zero horizontal overflow.99 - **Quality-bar regression check**: scan the round's diff for a lowered bar — new suppression directives, skipped or deleted tests, weakened assertions, thresholds edited down. Any of these zeroes the round score (0.0): a build that passes because the bar was lowered is a regression, not a pass.100 - **Fail-closed eval check**: confirm the proof suite contains at least one test that CAN fail on the defect class the round claims to fix. If nothing in the suite could have caught the defect, a green run proves nothing — the round does not pass until a capable test exists (write it, watch it fail on the pre-fix state).101 - Any test failure, missing critical security header, visual overflow, quality-bar regression, or failed fail-closed check zeroes the round score (0.0).102 4. RECORD: Append round metrics, header receipts, viewport outcomes, and finding counts (new findings vs fixed findings this round) to ITERATION_LEDGER.md — the ledger is the convergence instrument: when new findings outnumber fixed findings two rounds running, the loop is diverging, not converging — stop and escalate instead of burning the remaining budget.103 5. DECIDE: Evaluate Stop Conditions Matrix.104```105106#### Step 3 — Integrator Gate107The Integrator agent NEVER merges bulk diffs. It isolates and applies **only the single highest-impact delta** that directly improved the score, preserving all previously verified baselines.108109#### Step 4 — Acceptance Packet Synthesis (`ACCEPTANCE_PACKET.md`)110Upon reaching success termination, compile the final artifact:111- Summary of rounds executed and score trajectory ($R_1 \rightarrow R_N$).112- Verbatim execution receipts of automated proof commands, security headers, and viewport checks.113- Verified diff summary and signature.114115---116117### Option B: Gauntlet Prompt Synthesizer Mode118When the user asks to *"make a gauntlet prompt"* or *"loop until it beats X"*, craft ONE short, paste-ready prompt (120–180 words):1191. **Set the Bar**: Name a concrete, fetchable reference.1202. **Break into Pieces**: Smallest judgeable components.1213. **Blind Critic Directive**: Fresh critic puts output next to the bar blind with labels stripped and names the #1 biggest gap.1224. **Offer to Run**: Append flat line: `I can run this here.`123124---125126## Pitfalls127128- **Self-Grading Bias**: Never allow the builder subagent to evaluate its own work. The critic MUST run in an isolated conversation context.129- **Overlooking Security Headers**: Shipping web apps or APIs with missing CSP or HSTS headers.130- **Horizontal Scroll Blowout**: Failing to audit the 375px mobile viewport for layout blowouts.131- **Diff Bloat Across Iterations**: Reject candidates that expand the diff surface by $>30\%$ without a proportional score increase.132- **Ignoring Score Plateau**: If round 2 scores 7.5 and round 3 scores 7.4, STOP immediately. Do not attempt round 4.133- **Lowered-Bar Green**: Passing the gate by suppressing, skipping, or weakening checks in the same diff — the gate measures the artifact, not the artifact's ability to evade measurement.134- **Vacuous Green**: Accepting a green proof suite that contains no test capable of failing on the round's defect class — an unevaluatable claim is not a pass; add the capable test first.135136---137138## Verification139140Before declaring gauntlet completion:1411. [ ] `GAUNTLET_JOB_CONTRACT.md` exists with frozen acceptance criteria.1422. [ ] `ITERATION_LEDGER.md` logs every round with objective critic score breakdown.1433. [ ] All automated proof commands exit with return code `0`.1444. [ ] Web applications pass security header audit (CSP, HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy).1455. [ ] Multi-viewport visual check passes at 375px, 768px, and 1280px with zero horizontal overflow.1466. [ ] `ACCEPTANCE_PACKET.md` is generated with final verification receipts.
Run npx skillmds@latest add harshsinghmp/gauntlet-loop in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Bounded multi-agent quality improvement loop that prevents infinite iterations, self-grading delusions, and regression churn. Orchestrates Builder, Fresh Critic, Automated Gate (with web application security headers and visual breakpoint audit), and Integrator roles with strict stop conditions (proof of passing, 2-round score plateau, regression, or max iteration budget). Generates GAUNTLET_JOB_CONTRACT.md, ITERATION_LEDGER.md, and ACCEPTANCE_PACKET.md. It is listed under AI & ML on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under MIT.
harshsinghmp (@harshsinghmp) published this skill. Their other Agent Skills are listed on their SkillMD profile.