Skip to content

Commit ad6c006

Browse files
Kasper Jungeclaude
authored andcommitted
docs: add checks, contexts, and instructions to README for users who want to understand the full value proposition
The README previously only showed the basic loop, making ralphify look like a simple bash wrapper. The three primitives (especially the self-healing check feedback loop) are the key differentiators and are now visible from the front door. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e4dfdaa commit ad6c006

1 file changed

Lines changed: 64 additions & 4 deletions

File tree

README.md

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,76 @@ The Ralph Wiggum technique works because:
7070

7171
Read the full writeup: [Ralph Wiggum as a "software engineer"](https://ghuntley.com/ralph/)
7272

73+
## Beyond the basic loop
74+
75+
The simple loop works, but ralphify's real power comes from three primitives that live in the `.ralph/` directory.
76+
77+
### Checks — the self-healing loop
78+
79+
Checks validate the agent's work after each iteration. When one fails, its output automatically feeds into the next iteration so the agent can fix its own mistakes.
80+
81+
```bash
82+
ralph new check tests
83+
```
84+
85+
Edit `.ralph/checks/tests/CHECK.md`:
86+
87+
```markdown
88+
---
89+
command: uv run pytest -x
90+
timeout: 120
91+
---
92+
Fix all failing tests. Do not skip or delete tests.
93+
```
94+
95+
Now the loop self-corrects:
96+
97+
```
98+
Iteration 1 → Agent adds feature → tests pass ✓ → moves on
99+
Iteration 2 → Agent adds feature → tests fail ✗
100+
Iteration 3 → Agent sees failure output → fixes tests → pass ✓
101+
```
102+
103+
You define what "valid" means. Ralphify feeds failures back automatically.
104+
105+
### Contexts — dynamic data injection
106+
107+
Contexts inject fresh data into the prompt each iteration — git history, test status, anything a shell command can produce.
108+
109+
```bash
110+
ralph new context git-log
111+
```
112+
113+
Edit `.ralph/contexts/git-log/CONTEXT.md`:
114+
115+
```markdown
116+
---
117+
command: git log --oneline -10
118+
---
119+
## Recent commits
120+
```
121+
122+
The command runs before each iteration. Use `{{ contexts.git-log }}` in your `PROMPT.md` to control where the output appears.
123+
124+
### Instructions — reusable rules
125+
126+
Instructions are static text blocks (coding standards, commit conventions) you can toggle on and off without editing the prompt.
127+
128+
```bash
129+
ralph new instruction code-style
130+
```
131+
132+
Drop `{{ instructions }}` into `PROMPT.md` to inject all enabled instructions.
133+
73134
## Customizing your prompt
74135

75136
The generated `PROMPT.md` is a starting point. A good prompt for autonomous loops typically includes:
76137

77138
- What to work on (specs, plan file, TODO list)
78-
- How to validate (run tests, type check, build)
79-
- What NOT to do (no placeholders, no skipping tests)
80-
- When to commit (after tests pass)
139+
- Constraints — what NOT to do (no placeholders, no skipping tests)
140+
- Process — how to validate and commit
81141

82-
The agent reads this prompt fresh every iteration, so you can edit it while the loop is running.
142+
The agent reads this prompt fresh every iteration, so you can edit it while the loop is running. When the agent does something dumb, add a sign to the prompt — the next iteration follows the new rules.
83143

84144
## Documentation
85145

0 commit comments

Comments
 (0)