Guardrails Learning Loop
FeaturedOn demandAbout 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
- 01Tests and lint are checked by a single command
- 02Tracks earlier failure patterns to reduce repeated mistakes
- 03Manual trigger with a 12-round limit
- 04Supports Cursor and Claude Code
Use cases
- 01The same kind of lint or test error keeps coming back during fixes
- 02Restoring both tests and lint after a broad refactor
- 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.
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.
Execute npm test && npm run lint and collect the test failures and lint errors. If everything passes, the loop ends.
npm test && npm run lintCompare this round's failures with patterns from earlier rounds to spot repeated problems and their causes.
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.
Supported agents
Coding agents that can run this loop directly.