Guardrails that learn from failure
A Ralph-style loop that writes its own rules: when a check fails the same way twice, the failure pattern gets appended to a guardrails file that every later iteration reads first.
Implementation note
Create an empty .ralph/guardrails.md first and commit it so learned rules survive across sessions. The file becomes a project-specific playbook of what not to do.
Source: Geoffrey Huntley (Ralph technique) ↗graded B · 70/100 — how grades work (Safety Score v2) →
Similar loops
All automation loops →Draft weekly release notes
Every Friday at 2pm, draft release notes from merged PRs into releases/DRAFT.md and verify all links resolve.
Loop charter template
A fill-in-the-brackets charter that turns any pile of small tasks into a self-checking loop: where the work is, how to check each item with evidence, a needs-me escalation list, a state file, and a per-run stop.
Work a task to completion, then open a PR
The generic persistent-task Ralph pattern: iterate on one named task until its acceptance criteria are met and the suite is green, bounded by a 15-turn cap and a no-progress stop. Anti-reward-hacking clauses keep it from editing tests to go green, and it hands off via a PR instead of merging. Swap the check command for your stack's.