Skip to content

Commit eada307

Browse files
Kasper JungeRalphify
authored andcommitted
docs: use Q&A headings and add self-contained intro on when-to-use page (category 7)
Convert generic headings to explicit question format for better LLM consumption and search discoverability. Add a standalone definition of "ralph loop" at the top so the page works without context from other pages. Co-authored-by: Ralphify <noreply@ralphify.co>
1 parent 7e9f76d commit eada307

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

docs/when-to-use.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ keywords: automate coding tasks with AI, autonomous AI coding agent use cases, A
99
!!! tldr "TL;DR"
1010
Use a ralph loop when the task breaks into small, independent steps with automated validation (tests, linters, builds). Use a single conversation for quick tasks, interactive work, or anything requiring subjective judgment. The key ingredient is a command that can tell the agent "you broke something" — that's what makes the loop self-healing.
1111

12-
ralph loops are powerful but they're not the right tool for everything. This page helps you decide whether a loop fits your task before you invest time setting one up.
12+
A **ralph loop** is an autonomous coding cycle powered by [ralphify](index.md). Each iteration: run shell commands (tests, lint, git log), inject their output into a prompt template, pipe the assembled prompt to an AI coding agent (like Claude Code), and repeat. The agent starts fresh every cycle with no conversation history — it reads the current codebase state instead. A ralph is defined by a single `RALPH.md` file containing YAML frontmatter (agent command, commands, args) and a prompt body with `{{ placeholders }}`.
1313

14-
## The sweet spot
14+
Ralph loops are powerful but they're not the right tool for everything. This page helps you decide whether a loop fits your task before you invest time setting one up.
1515

16-
ralph loops work best when a task has these properties:
16+
## What makes a task good for a ralph loop?
17+
18+
Ralph loops work best when a task has these properties:
1719

1820
**Decomposable into small, independent steps.** The loop does one thing per iteration. Tasks that naturally break into "do this, then this, then this" are ideal — implementing features from a TODO list, writing tests module by module, fixing lint errors one at a time. See the [Cookbook](cookbook.md) for real examples of this pattern.
1921

@@ -23,7 +25,7 @@ ralph loops work best when a task has these properties:
2325

2426
**Progress is visible in the codebase.** The agent's work must be observable on disk — files changed, tests added, docs written, commits made. The next iteration reads the codebase to understand what's been done. Tasks that produce output elsewhere (a Slack message, a deployment, an email) need a wrapper that records progress locally.
2527

26-
## What works well
28+
## What tasks work well in a ralph loop?
2729

2830
| Task | Why it fits |
2931
|---|---|
@@ -37,7 +39,7 @@ ralph loops work best when a task has these properties:
3739
| **Security hardening** | Run a scanner each iteration; the agent picks one finding, fixes it, and verifies the fix ([recipe](cookbook.md#security-scan)) |
3840
| **Research & knowledge building** | Each iteration deepens one area; a report file accumulates findings across iterations ([recipe](cookbook.md#deep-research)) |
3941

40-
## What doesn't work well
42+
## What tasks don't work well in a ralph loop?
4143

4244
| Task | Why it doesn't fit |
4345
|---|---|
@@ -48,7 +50,7 @@ ralph loops work best when a task has these properties:
4850
| **Creative writing** | Prose quality is subjective; no command can validate "is this well-written?" |
4951
| **Interacting with external services** | API calls, deployments, and messages are hard to undo if the agent makes a mistake |
5052

51-
## Loop vs. single conversation
53+
## Should I use a ralph loop or a single agent conversation?
5254

5355
Use a **single conversation** when:
5456

@@ -65,7 +67,7 @@ Use a **ralph loop** when:
6567
- The task would fill up a conversation's context window
6668
- You want to walk away and come back to completed work
6769

68-
## Making a borderline task work
70+
## How do I adapt a borderline task for a ralph loop?
6971

7072
Some tasks seem like they don't fit but can be adapted:
7173

@@ -81,7 +83,7 @@ Some tasks seem like they don't fit but can be adapted:
8183
??? note ""I need to review the agent's work before it continues.""
8284
Use `-n 1` to run single iterations, review, then run again. Or use `--stop-on-error` with a command that checks for your sign-off.
8385

84-
## How many iterations?
86+
## How many iterations should I run?
8587

8688
- **Start with [`-n 3`](cli.md#ralph-run)** to verify your setup works and the agent produces useful output
8789
- **Use `-n 10-20`** for bounded tasks (a TODO list with known items)

0 commit comments

Comments
 (0)