soloopx.by solo lemon.
Back to loops
Automationmanual

Guardrails Learning Loop

When a check fails twice the same way, append a guardrail sign to .ralph/guardrails.md so the next iteration avoids repeating it.

1 views0 usesby solo lemon.

// parameters

Triggermanual
Max iterations12
Check commandnpm test && npm run lint
Exit conditionChecks pass and no repeated failure pattern remains

// run_this_loop

Copy the kickoff into your agent first. The blueprint below explains how the loop evaluates progress and when it should stop.

Open in CursorOpen in Claude

Use loop copies the kickoff prompt. Share copies the loop link. Open in Cursor / Claude only pre-fill that prompt — they do not install hook files. Download loop saves the loop as guardrails-learning-loop.md.

Start the "Guardrails Learning Loop" loop.

Goal: tests and lint pass without repeating prior failure patterns
Max iterations: 12
Between iterations run: npm test && npm run lint
Exit when: all checks pass

Step 1: Read .ralph/guardrails.md, run checks, and if a failure repeats, add a sign before fixing.

Self-pace this loop. After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when the exit condition passes or max iterations is reached. Give a short status update each pass.

// blueprint

The loop contract: target outcome, execution sequence, checks, stopping condition, and safety constraints.

Goal

tests and lint pass without repeating prior failure patterns

// loop_sequence

// loop_sequence_diagram.json
closed loop

Trigger

Manual start

Actions block

4 steps
1Read guardrails
2Run checks
3Record failure sign
4Fix with guardrails

Feedback gate

Evaluate: npm test && npm run lint

Run the check, read the output, then decide whether the loop is complete.

Check failed

Repeat actions with the latest feedback.

Success

Checks pass and no repeated failure pattern remains

Safety capMax 12 iterations

// steps

  1. 1
    Read guardrails

    Read .ralph/guardrails.md before any work. Treat each sign as a hard constraint.

  2. 2
    Run checks

    Run the project's backpressure commands.

    npm test && npm run lint
  3. 3
    Record failure sign

    If the same error occurred before, append a concise sign to guardrails.md: what failed and how to avoid it.

  4. 4
    Fix with guardrails

    Apply a fix that respects all guardrail signs. Do not repeat prior failed approaches.