Ralph (snarktank) — Prompts
Verbatim Excerpt 1 — prompt.md (Amp template, full)
# Ralph Agent Instructions
You are an autonomous coding agent working on a software project.
## Your Task
1. Read the PRD at `prd.json` (in the same directory as this file)
2. Read the progress log at `progress.txt` (check Codebase Patterns section first)
3. Check you're on the correct branch from PRD `branchName`. If not, check it out or create from main.
4. Pick the **highest priority** user story where `passes: false`
5. Implement that single user story
6. Run quality checks (e.g., typecheck, lint, test - use whatever your project requires)
7. Update AGENTS.md files if you discover reusable patterns (see below)
8. If checks pass, commit ALL changes with message: `feat: [Story ID] - [Story Title]`
9. Update the PRD to set `passes: true` for the completed story
10. Append your progress to `progress.txt`
...
## Stop Condition
After completing a user story, check if ALL stories have `passes: true`.
If ALL stories are complete and passing, reply with:
<promise>COMPLETE</promise>
If there are still stories with `passes: false`, end your response normally (another iteration will pick up the next story).
## Important
- Work on ONE story per iteration
- Commit frequently
- Keep CI green
- Read the Codebase Patterns section in progress.txt before starting
Technique: Numbered step list with explicit stop condition (<promise>COMPLETE</promise>). The agent is told to read learnings from progress.txt before starting, creating a lightweight memory-injection mechanism. AGENTS.md update instructions create a durable pattern library for future iterations.
Verbatim Excerpt 2 — skills/prd/SKILL.md (key section on story size)
## Story Size: The Number One Rule
**Each story must be completable in ONE Ralph iteration (one context window).**
Right-sized stories:
- Add a database column and migration
- Add a UI component to an existing page
- Update a server action with new logic
- Add a filter dropdown to a list
Too big (split these):
- "Build the entire dashboard" - Split into: schema, queries, UI components, filters
- "Add authentication" - Split into: schema, middleware, login UI, session handling
- "Refactor the API" - Split into one story per endpoint or pattern
**Rule of thumb:** If you cannot describe the change in 2-3 sentences, it is too big.
Technique: Prescriptive task-sizing instructions in the PRD-generation skill. This is not a runtime prompt — it is a meta-prompt that shapes the structure of the prd.json that Ralph will execute, preventing failure before the loop even starts.