mcpField

Guardrails Learning Loop

FeaturedOn demand
Continuous IntegrationUp to 12 rounds

About Guardrails Learning Loop

Each round runs npm test && npm run lint, fixes what failed, and keeps earlier failure patterns in mind so they are not repeated. It allows up to 12 rounds and lists Cursor and Claude Code as supported agents.

Key features

  1. 01Tests and lint are checked by a single command
  2. 02Tracks earlier failure patterns to reduce repeated mistakes
  3. 03Manual trigger with a 12-round limit
  4. 04Supports Cursor and Claude Code

Use cases

  1. 01The same kind of lint or test error keeps coming back during fixes
  2. 02Restoring both tests and lint after a broad refactor
  3. 03Keeping a coding agent consistent in its fixes across many rounds
Goal
npm test && npm run lint passes with no repeat of failure patterns seen in earlier rounds.
Exit when
Stop when all checks pass, or when the 12-round limit is reached.
Between iterations run
npm test && npm run lint

Launch prompt

Paste into Cursor / Claude Code. The agent repeats the steps below until the exit condition is met.

prompt.md
Start the "Guardrails Learning Loop" loop.
Goal: npm test && npm run lint passes with no repeat of failure patterns seen in earlier rounds.
Max iterations: 12.
Step 1: Run checks — Execute npm test && npm run lint and collect the test failures and lint errors. If everything passes, the loop ends. `npm test && npm run lint`
Step 2: Compare with past failures — Compare this round's failures with patterns from earlier rounds to spot repeated problems and their causes.
Step 3: Fix and record — Change the code to address the failures, avoid approaches that did not work before, and note this round's failure patterns for the next one.
Between iterations run: `npm test && npm run lint`
Exit when: Stop when all checks pass, or when the 12-round limit is reached.

Steps

Each round runs in order; if the exit condition isn’t met, another round starts, up to 12.

01
Run checks

Execute npm test && npm run lint and collect the test failures and lint errors. If everything passes, the loop ends.

$npm test && npm run lint
02
Compare with past failures

Compare this round's failures with patterns from earlier rounds to spot repeated problems and their causes.

03
Fix and record

Change the code to address the failures, avoid approaches that did not work before, and note this round's failure patterns for the next one.

Not met → next roundExits when met

Supported agents

Coding agents that can run this loop directly.

Cursor
Claude Code
Codex

Comments

Markdown supported