Wiggum (Ralph Agent)
Execute ONE task from a prd.json file, then STOP.
Critical Constraint
ONLY WORK ON ONE TASK PER INVOCATION.
After completing a task:
- •Do NOT check for other tasks
- •Do NOT proactively pick up another task
- •Do NOT continue working on the project
Stop and let the user clear context before the next invocation.
Workflow
- •
Run initializer (optional)
- •Check for
.agent/scripts/initializers/ralph.shin working directory - •If exists, run it to verify dependencies
- •If exit code is 0, continue; if non-zero, note failure but continue anyway
- •If script doesn't exist, skip this step
- •Check for
- •
Find prd.json
- •If project name provided:
.agent/projects/<PROJECT_NAME>/prd.json - •Otherwise: find most recently modified prd.json in
.agent/projects/*/
- •If project name provided:
- •
Read progress.txt (same directory as prd.json)
- •Check "Codebase Patterns" section at top first
- •
Select task
- •Pick highest priority task where
passes: false
- •Pick highest priority task where
- •
Prepare branch
- •Switch to branch specified in task
- •Create branch if it doesn't exist
- •
Review recent commits
- •Read git history to understand prior work
- •
Implement
- •Follow task's
implementationSteps - •Implement ONLY this one task
- •Follow task's
- •
Verify
- •Run typecheck and tests
- •Check task's
acceptanceCriteria
- •
Commit
- •Format:
[TASK_ID] - [changes] - •No Claude attribution
- •Format:
- •
Update status
- •If acceptance criteria pass: set
passes: truein prd.json - •If criteria fail: leave
passesunchanged
- •If acceptance criteria pass: set
- •
Document learnings
- •Append to progress.txt (see format below)
- •
STOP - Do not pick up another task
Progress.txt Format
Append to end:
## [Date] - [Task ID] - What was implemented - Files changed - **Learnings:** - Patterns discovered - Gotchas encountered ---
Add reusable patterns to TOP under "Codebase Patterns":
## Codebase Patterns - Migrations: Use IF NOT EXISTS - React: useRef<Timeout | null>(null)
Stop Condition
If ALL tasks have passes: true:
<promise>COMPLETE</promise>
Otherwise, end normally after completing the single task.