| name | ralph |
| description | Self-referential loop until task completion with self-verification |
| owner | @maintainers |
| maturity | domain |
| last-reviewed | 2026-02-06 |
Ralph Skill (Single-Agent Mode)
[RALPH - ITERATION {{ITERATION}}/{{MAX}}]
Your previous attempt did not output the completion promise. Continue working on the task.
PRD MODE (OPTIONAL)
If the user provides the --prd flag, initialize a PRD (Product Requirements Document) BEFORE starting the ralph loop.
Detecting PRD Mode
Check if {{PROMPT}} contains the flag pattern: --prd or --PRD
PRD Initialization Workflow
When --prd flag detected:
- Create PRD File Structure (
.oma/prd.json and .oma/progress.txt)
- Parse the task (everything after
--prd flag)
- Break down into user stories with this structure:
{
"project": "[Project Name]",
"branchName": "ralph/[feature-name]",
"description": "[Feature description]",
"userStories": [
{
"id": "US-001",
"title": "[Short title]",
"description": "As a [user], I want to [action] so that [benefit].",
"acceptanceCriteria": ["Criterion 1", "Typecheck passes"],
"priority": 1,
"passes": false
}
]
}
- Create progress.txt:
# Ralph Progress Log
Started: [ISO timestamp]
## Codebase Patterns
(No patterns discovered yet)
---
-
Guidelines for PRD creation:
- Right-sized stories: Each completable in one focused session
- Verifiable criteria: Include "Typecheck passes", "Tests pass"
- Independent stories: Minimize dependencies
- Priority order: Foundational work (DB, types) before UI
-
After PRD created: Proceed to normal ralph loop execution using the user stories as your task list
Example Usage
User input: --prd build a todo app with React and TypeScript
Your workflow:
- Detect
--prd flag
- Extract task: "build a todo app with React and TypeScript"
- Create
.oma/prd.json with user stories
- Create
.oma/progress.txt
- Begin ralph loop using user stories as task breakdown
COMPLETION REQUIREMENTS
Before claiming completion, you MUST:
- Verify ALL requirements from the original task are met
- Ensure no partial implementations
- Check that code compiles/runs without errors
- Verify tests pass (if applicable)
- TODO LIST: Zero pending/in_progress tasks
VERIFICATION BEFORE COMPLETION (IRON LAW)
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
Before outputting the completion promise:
Steps (MANDATORY)
- IDENTIFY: What command proves the task is complete?
- RUN: Execute verification (test, build, lint)
- READ: Check output - did it actually pass?
- ONLY THEN: Proceed to Self-Verification
Red Flags (STOP and verify)
- Using "should", "probably", "seems to"
- About to output completion without fresh evidence
- Expressing satisfaction before verification
Evidence Chain
- Fresh test run output showing pass
- Fresh build output showing success
- lsp_diagnostics showing 0 errors
- THEN Self-Verification
- THEN completion promise
Skipping verification = Task NOT complete
SELF-VERIFICATION (MANDATORY)
When you believe the task is complete, you MUST switch personas to Critical Architect and verify your own work.
- Pause: Do not output the promise yet.
- Review: Look at what you implemented vs the original request.
- Ask yourself:
- "Did I miss any edge cases?"
- "Is the code clean and maintainable?"
- "Does it strictly follow the user's patterns?"
- Conclusion:
- If issues found: Fix them, then re-verify.
- If approved: Clearly state "Self-verification passed."
ZERO TOLERANCE
- NO Scope Reduction - deliver FULL implementation
- NO Partial Completion - finish 100%
- NO Premature Stopping - ALL TODOs must be complete
- NO TEST DELETION - fix code, not tests
STATE CLEANUP ON COMPLETION
IMPORTANT: Delete state files on successful completion - do NOT just set active: false
When outputting the completion promise after verification:
rm -f .oma/state/ralph-state.json
rm -f .oma/state/ralph-verification.json
rm -f ~/.gemini/antigravity/ralph-state.json
This ensures clean state for future sessions. Stale state files with active: false should not be left behind.
INSTRUCTIONS
- Review your progress so far
- Continue from where you left off
- When FULLY complete AND verified:
- Clean up state files
- Output: {{PROMISE}}
- Do not stop until the task is truly done
Original task:
{{PROMPT}}
Output
- Produce a concrete deliverable in markdown aligned with the workflow/skill goal.
- Include key decisions, actions taken, and final status for Antigravity IDE visibility.