Skip to content

Commit 4c08a8b

Browse files
Kasper JungeRalphify
authored andcommitted
docs: add code annotations to RALPH.md format example on quick reference page (category 6)
Co-authored-by: Ralphify <noreply@ralphify.co>
1 parent ed11751 commit 4c08a8b

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

docs/quick-reference.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,35 @@ That's it. A ralph is a directory with a `RALPH.md` file. See [Getting Started](
4848

4949
```markdown
5050
---
51-
agent: claude -p --dangerously-skip-permissions # Required: agent command
52-
commands: # Optional: run each iteration
51+
agent: claude -p --dangerously-skip-permissions # (1)!
52+
commands: # (2)!
5353
- name: tests
5454
run: uv run pytest -x
5555
- name: lint
5656
run: uv run ruff check .
5757
- name: git-log
5858
run: git log --oneline -10
59-
args: [dir, focus] # Optional: declared user arguments
59+
args: [dir, focus] # (3)!
6060
---
6161

62-
# Prompt body
62+
# Prompt body <!-- (4) -->
6363

64-
{{ commands.git-log }}
64+
{{ commands.git-log }} <!-- (5) -->
6565

6666
{{ commands.tests }}
6767

6868
{{ commands.lint }}
6969

70-
Your instructions here. Use {{ args.dir }} for user arguments.
70+
Your instructions here. Use {{ args.dir }} for user arguments. <!-- (6) -->
7171
```
7272

73+
1. **Required.** The full shell command to pipe the prompt to. `-p` enables non-interactive mode, `--dangerously-skip-permissions` lets the agent work autonomously.
74+
2. **Optional.** Each command runs every iteration and its output fills the matching `{{ commands.<name> }}` placeholder.
75+
3. **Optional.** Declares positional argument names. Named flags (`--dir`, `--focus`) work without this — `args` is only needed for positional usage.
76+
4. Everything below the `---` frontmatter is the prompt body. It's re-read from disk every iteration, so you can edit it while the loop runs.
77+
5. Replaced with the command's stdout + stderr. Only commands with a matching placeholder appear in the assembled prompt.
78+
6. Replaced with the `--dir` value from the CLI. Missing args resolve to an empty string.
79+
7380
### Frontmatter fields
7481

7582
| Field | Type | Required | Description |

0 commit comments

Comments
 (0)