Interactive task planning for Ralph CLI. Use when user says "ralph plan", "plan a task for ralph", "plan ralph task", or wants to interactively define a task for autonomous execution.
Interactively create a task for Ralph autonomous execution.
/ralph-plan [task-id]
/ralph-plan - Create new task with next available ID/ralph-plan 1 - Plan/edit existing ralph-1If no ID provided:
# Find next available ID
ls .ralph/ # Look for ralph-N directories
# Next = highest N + 1, or ralph-1 if none exist
If ID provided, check if task exists:
Question 1: What to build
{
"questions": [{
"question": "What should Ralph accomplish?",
"header": "Goal",
"options": [
{"label": "New feature", "description": "Build new functionality"},
{"label": "Bug fix", "description": "Fix an existing issue"},
{"label": "Refactor", "description": "Improve code structure"},
{"label": "Tests", "description": "Add or improve tests"}
],
"multiSelect": false
}]
}
Question 2: Scope
{
"questions": [{
"question": "What area of the codebase?",
"header": "Scope",
"options": [
{"label": "Frontend", "description": "UI components, pages"},
{"label": "Backend", "description": "API, database, server"},
{"label": "Full stack", "description": "Both frontend and backend"},
{"label": "Tooling", "description": "Build, CI, developer experience"}
],
"multiSelect": false
}]
}
Question 3: Verification
{
"questions": [{
"question": "How should completion be verified?",
"header": "Test",
"options": [
{"label": "bun run verify (Recommended)", "description": "Full typecheck + lint + tests"},
{"label": "bun test", "description": "Just run tests"},
{"label": "bun run build", "description": "Verify it compiles"}
],
"multiSelect": false
}]
}
Based on answers, explore relevant code:
# Example for frontend feature
Glob: src/components/**/*.tsx
Grep: pattern relevant to task
Read: key files
Create directory:
mkdir -p .ralph/ralph-N
Create guardrails.md (if first task):
# Guardrails
## Safety Constraints (NEVER do these)
- Never push directly to main/master
- Never delete production data
- Never commit secrets/credentials
- Never skip tests
## Process Guidelines
- Study code before changing it
- Run tests before claiming done
- Keep changes focused
Create plan.md:
---