Ralph
Prepare files for Ralph execution with exhaustive pre-flight checks. Creates PRD.md, plan.md, activity.md. BLOCKS until all prere…
---
name: ralph
description: Prepare files for Ralph execution with exhaustive pre-flight checks. Creates PRD.md, plan.md, activity.md. BLOCKS until all prerequisites are cleared.
---
# /ralph - Ralph Execution Preparation
You are preparing files for autonomous Ralph execution. Quality and completeness are paramount.
## CRITICAL RULES
1. **Exhaustive pre-flight checks** - Identify EVERYTHING that needs to happen first
2. **BLOCK until cleared** - Do not create files until prerequisites are handled
3. **Super clear instructions** - Every step must be unambiguous
4. **Phase X.0 → X.1 TDD** - Tests before implementation in all tasks
5. **FILES GO IN PROJECT ROOT** - ALWAYS put PRD.md, plan.md, activity.md, PROMPT_build.md in the project root directory. NEVER create subfolders. ALWAYS overwrite existing files.
6. **SELF-VERIFY EVERYTHING POSSIBLE** - Run commands yourself to verify. Only ask humans for things that REQUIRE human judgment (design decisions, business logic, external service setup). Never ask humans to run simple verification commands.
7. **CITE SOURCES FOR ALL CLAIMS** - When recommending approaches, cite: codebase patterns (file:line), external best practices (URLs), or prior decisions (alignment.md, retros). If citing your own reasoning, label it explicitly.
8. **SURFACE ALL ASSUMPTIONS** - Before proceeding past any phase, state assumptions explicitly and get user confirmation. Example: "I'm assuming the database schema already has X. Is that correct?"
---
## Self-Verification Protocol
**ALWAYS verify these yourself (run the command, don't ask human):**
- `npx tsc --noEmit` - TypeScript compiles
- `npm run build` - Build succeeds
- `npm test` / `npm run test:run` - Tests pass
- `npm run lint` - Linting passes
- File exists checks - Use Glob/Read tools
- Import verification - Run TypeScript compiler
- Package installation - Run `npm install` and check
**ONLY ask humans for:**
- Design decisions (how should X look?)
- Business logic choices (what should happen when Y?)
- External service setup (API keys, database credentials, OAuth config)
- Deployment decisions
- Anything requiring account access you don't have
**Example - BAD (don't do this):**
"Please run npx tsc --noEmit and let me know if it compiles."
**Example - GOOD (do this):**
Running TypeScript compiler to verify... [runs npx tsc --noEmit] ✓ TypeScript compiles successfully
---
## Phase 1: Alignment Check
### Step 1: Check for alignment.md
Use Glob/Read tools to look for `alignment.md` in the project root.
**If alignment.md EXISTS:**
1. Read the file
2. Check the `Last Updated` timestamp
3. If timestamp is recent (same day): Use this alignment, proceed to Phase 2
4. If timestamp is old (different day): Warn user that alignment may be stale
Found alignment.md (Last Updated: [timestamp])
Alignment Summary
[show key points from alignment.md]
This alignment looks [fresh/stale]. Proceed to pre-flight checklist?
**If alignment.md DOES NOT EXIST:**
Present options with clear gap communication:
I don't see a /plan summary for this feature. Your options:
A) Run /plan first ⭐ Recommended
Ensures requirements are clear, codebase is analyzed, risks are identified.
Run: /plan [your feature description]
This gives you: ✓ Codebase pattern analysis ✓ Technical approach research ✓ Risk assessment ✓ Test strategy
B) Quick alignment now (3 min) I'll ask 3 key questions to understand what you want.
⚠️ What you'll miss:
- No formal codebase analysis
- Less thorough risk assessment
- Test patterns not researched
C) Proceed to /ralph anyway I'll create execution files based on your description.
⚠️ What you'll miss:
- No codebase pattern analysis performed
- No explicit requirements alignment
- Higher risk of rework if requirements were unclear
- Pre-flight checklist may miss dependencies
- Tests may not follow existing conventions
If you choose this, I'll note it in the files created.
Which would you like?
**If user chooses B:**
Ask 3 key questions:
1. What exactly should this feature do? (success criteria)
2. What should it NOT do? (scope boundaries)
3. Any constraints I should know about? (tech, time, patterns)
Then proceed to Phase 2.
**If user chooses C:**
Add this header to PRD.md:
⚠️ PLANNING NOTE: This PRD was created without /plan workflow.
- Codebase analysis was NOT performed
- Risk assessment was NOT performed
- Test patterns were NOT researched Review carefully before Ralph executes.
Then proceed to Phase 2.
---
## Phase 2: Pre-Flight Research
Launch exhaustive research to identify all prerequisites:
### Check 1: Dependencies
What the feature requires:
- New npm packages needed?
- New environment variables?
- Database migrations/schema changes?
- External API keys or credentials?
- Configuration file changes?
### Check 2: Human Prerequisites
What must the HUMAN do before Ralph runs:
- Supabase SQL to execute?
- Manual file creation needed?
- Service configuration?
- Third-party setup (API keys, OAuth, etc.)?
### Check 3: Integration Points
How this integrates with existing code:
- Which files will be modified?
- Any breaking changes?
- Any deprecations to handle?
---
## Phase 3: Pre-Flight Checklist (BLOCKING)
Present checklist that MUST be cleared before files are created:
```markdown
# ⚠️ PRE-FLIGHT CHECKLIST
These items MUST be completed before Ralph can run successfully.
Do NOT skip this - Ralph will fail if prerequisites aren't met.
## Database/Backend
- [ ] Run SQL: `[exact SQL statement]`
- [ ] Create Supabase function: [name]
- [ ] Update RLS policies: [description]
## Dependencies
- [ ] Install: `npm install [package]`
- [ ] Add to package.json: [what]
## Environment
- [ ] Add to .env: `NEW_VAR=[description of what value should be]`
- [ ] Configure: [service/setting]
## Manual Setup
- [ ] Create file: [path] with [cont
Maintain Ralph?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Ralph on getagentictools](https://getagentictools.com/loops/vindows-ralph-ralph-execution-preparation?ref=badge)