ralph-plan
Ralph Plan
Interactive planning tools for defining product vision, roadmap, user stories, and tasks.
Canonical Rules
Use canonical atomic docs for shared planning rules instead of restating them:
- Naming/numbering/placement:
@context/blocks/docs/naming-convention.md - Subtask schema and ID allocation:
@context/workflows/ralph/planning/subtask-spec.md
Execution Instructions
When this skill is invoked, check the ARGUMENTS provided:
If argument is vision:
MANDATORY FIRST STEP: Use the Read tool to read context/workflows/ralph/planning/vision-interactive.md (relative to project root). DO NOT proceed without reading this file first - it contains the full Socratic workflow you MUST follow.
After reading the workflow file, begin the session with:
"Let's work on clarifying your product vision. I'll ask questions to help you articulate what you're building and why.
To start: What problem are you trying to solve, and for whom?
(You can say 'done' at any point when you feel we've covered enough. I'll offer to save our progress incrementally as we go.)"
Then follow ALL phases in the workflow file you just read.
If argument is roadmap:
MANDATORY FIRST STEP: Use the Read tool to read context/workflows/ralph/planning/roadmap-interactive.md (relative to project root). DO NOT proceed without reading this file first - it contains the full Socratic workflow with ALL phases you MUST follow.
- First, read
docs/planning/VISION.mdto understand the product vision - If no VISION.md exists, inform the user and suggest they run
/ralph-plan visionfirst - Begin the session with:
"Let's work on your product roadmap. I've read your vision document and I'll ask questions to help translate it into actionable milestones.
To start: What's the most important thing users should be able to do in your first release?
(You can say 'done' at any point when you feel we've covered enough. I'll offer to save our progress incrementally as we define milestones.)"
Then follow ALL phases in the workflow file you just read. Do NOT skip phases or give shallow output.
If argument is stories (with optional milestone name):
MANDATORY FIRST STEP: Use the Read tool to read context/workflows/ralph/planning/stories-interactive.md (relative to project root). DO NOT proceed without reading this file first - it contains the full Socratic workflow you MUST follow.
- First, read
docs/planning/VISION.mdanddocs/planning/ROADMAP.mdto understand the product context - If no VISION.md or ROADMAP.md exists, inform the user and suggest they run
/ralph-plan visionand/ralph-plan roadmapfirst - If a milestone name was provided as a second argument (e.g.,
/ralph-plan stories my-milestone), use that milestone - If no milestone was provided, ask the user which milestone they want to create stories for
- Begin the session with:
"Let's create user stories for the [milestone] milestone.
I've reviewed the roadmap - this milestone focuses on: [list key deliverables from ROADMAP.md]
To start: Who are the primary users that will benefit from these capabilities? What are they trying to accomplish?
(You can say 'done' at any point when you feel we've covered enough, or ask me to save a story when we've defined it well.)"
Then follow ALL phases in the workflow file you just read.
IMPORTANT - Incremental Saving: Save each story as it's well-defined:
- After each story is discussed and refined, offer to write it to a file
- Don't batch all stories at the end
- This protects against crashes/disconnects
If argument is tasks (with required story ID):
MANDATORY FIRST STEP: Use the Read tool to read context/workflows/ralph/planning/tasks-interactive.md (relative to project root). DO NOT proceed without reading this file first - it contains the full Socratic workflow you MUST follow.
- A story ID must be provided as the second argument (e.g.,
/ralph-plan tasks STORY-001-auth) - If no story ID is provided, ask the user which story to create tasks for and list available stories
- Find the story file in
docs/planning/milestones/*/stories/<story-id>.md - If the story is not found, list available stories and ask for clarification
- Read the story file to understand the user outcomes
- Explore the codebase to understand existing patterns relevant to the story
- Begin the session with:
"Let's create technical tasks for story [story-id].
I've read the story - it focuses on: [brief summary of narrative and key acceptance criteria].
Let me also explore the codebase to understand existing patterns..."
[Read relevant files/directories based on the story context]
"Based on the story and the codebase, here's what I see:
- [relevant existing code/patterns]
- [dependencies/integrations involved]
To start: Looking at the acceptance criteria, which capability should we tackle first? What's your thinking on the technical approach?
(You can say 'done' at any point when you feel we've covered enough, or ask me to save a task when we've defined it well.)"
Then follow ALL phases in the workflow file you just read.
IMPORTANT - Incremental Saving: Save each task as it's well-defined:
- After each task is discussed and refined, offer to write it to a file
- Don't batch all tasks at the end
- This protects against crashes/disconnects
If argument is tasks <story-id> --auto:
MANDATORY FIRST STEP: Use the Read tool to read context/workflows/ralph/planning/tasks-auto.md (relative to project root). DO NOT proceed without reading this file first - it contains the full auto-generation workflow.
- A story ID must be provided (e.g.,
/ralph-plan tasks STORY-001-auth --auto) - Find the story file in
docs/planning/milestones/*/stories/<story-id>.md - If the story is not found, report error and list available stories
- Analyze the codebase for patterns relevant to the story
- Generate task files automatically following the workflow
Auto mode outputs:
- Task files are created without interaction
- Summary reports what was generated
- No incremental saving prompts (all tasks saved at once)
If argument is tasks --milestone <name> --auto:
MANDATORY FIRST STEP: Use the Read tool to read context/workflows/ralph/planning/tasks-milestone.md (relative to project root). DO NOT proceed without reading this file first - it contains the parallel agent orchestration workflow.
- A milestone name must be provided (e.g.,
/ralph-plan tasks --milestone ralph --auto) - Discover all stories in
docs/planning/milestones/<name>/stories/ - If no stories found, report error with available milestones
- Follow canonical folder-local task numbering rules from
@context/blocks/docs/naming-convention.md - Spawn parallel
task-generatorsubagents (one per story) - Each agent generates tasks for its story independently
- Report summary of all generated tasks
Parallelization benefits:
- Faster: Multiple stories processed concurrently
- Better quality: Smaller context per agent
- Consistent: Same patterns applied across all stories
If argument is tasks --file or tasks --text (alternative source):
MANDATORY FIRST STEP: Use the Read tool to read context/workflows/ralph/planning/tasks-from-source.md (relative to project root). DO NOT proceed without reading this file first - it contains the workflow for generating tasks from alternative sources.
- An alternative source must be provided - one of:
--file <path>(e.g.,/ralph-plan tasks --file ./spec.md)--text <string>(e.g.,/ralph-plan tasks --text "Add user auth")
- Read the source and extract actionable items
- Generate tasks following the template
- Write to
docs/planning/tasks/
Begin the session with:
"I'll generate tasks from the provided source.
Source: [file path / text description]
Let me read and analyze the source to extract requirements..."
Then follow ALL steps in the workflow file you just read.
If argument is subtasks --milestone or subtasks --story (hierarchy source):
MANDATORY FIRST STEP: Use the Read tool to read context/workflows/ralph/planning/subtasks-from-hierarchy.md (relative to project root). DO NOT proceed without reading this file first - it contains the parallel agent orchestration workflow.
CRITICAL - Append, Don't Overwrite: When writing subtasks.json, use appendSubtasksToFile() from tools/src/commands/ralph/config.ts. This function appends new subtasks to existing files instead of overwriting them. Never use saveSubtasksFile() directly for subtask planning - it destroys existing subtasks.
- A hierarchy source must be provided:
--milestone <name>to process all tasks in the milestone--story <path>to process all tasks linked to that story
- Discover all tasks for the given scope
- Spawn parallel agents (one per task) to generate subtasks
- Aggregate results to
docs/planning/milestones/<milestone>/subtasks.jsonusing appendSubtasksToFile()
Begin the session with:
"I'll generate subtasks for all tasks in the [milestone/story].
Source: [milestone name / story path] Mode: Hierarchy-based (processing all tasks)
Let me discover the tasks and spawn parallel agents..."
Then follow ALL steps in the workflow file you just read.
If argument is subtasks with --file, --text, or --review-diary (alternative source):
MANDATORY FIRST STEP: Use the Read tool to read context/workflows/ralph/planning/subtasks-from-source.md (relative to project root). DO NOT proceed without reading this file first - it contains the full workflow you MUST follow.
CRITICAL - Append, Don't Overwrite: When writing subtasks.json, use appendSubtasksToFile() from tools/src/commands/ralph/config.ts. This function appends new subtasks to existing files instead of overwriting them. Never use saveSubtasksFile() directly for subtask planning - it destroys existing subtasks.
- An alternative source must be provided - one of:
--file <path>(e.g.,/ralph-plan subtasks --file ./review-findings.md)--text <string>(e.g.,/ralph-plan subtasks --text "Fix array bounds check")--review-diaryflag to parselogs/reviews.jsonl
- Read the source and extract actionable items
- Generate subtasks following the schema and sizing constraints from the workflow
- Write to
docs/planning/subtasks.jsonor specified milestone location using appendSubtasksToFile()
Begin the session with:
"I'll generate subtasks from the provided source.
Source: [file path / text / review diary]
Let me read and analyze the source to extract actionable items..."
Then follow ALL steps in the workflow file you just read.
If argument is subtasks --task (single task source):
MANDATORY FIRST STEP: Use the Read tool to read context/workflows/ralph/planning/subtasks-auto.md (relative to project root). DO NOT proceed without reading this file first.
CRITICAL - Append, Don't Overwrite: When writing subtasks.json, use appendSubtasksToFile() from tools/src/commands/ralph/config.ts. This function appends new subtasks to existing files instead of overwriting them. Never use saveSubtasksFile() directly for subtask planning - it destroys existing subtasks.
- A task path is required via
--task <path> - Read the task file to understand the implementation scope
- Generate subtasks for that specific task
- Write to appropriate subtasks.json location using appendSubtasksToFile()
Begin the session with:
"I'll generate subtasks for the specified task.
Task: [task path]
Let me read and analyze the task..."
Then follow ALL steps in the workflow file you just read.
If no argument or unknown argument:
Show the usage documentation below.
Usage
/ralph-plan <subcommand>
Subcommands
| Subcommand | Description |
|---|---|
vision |
Start interactive vision planning session |
roadmap |
Start interactive roadmap planning session |
stories |
Start interactive stories planning session for a milestone |
tasks |
Start interactive tasks planning session for a story |
subtasks |
Generate subtasks from any source (file, text, or review diary) |
Vision Planning
Start an interactive Socratic dialogue to help define and clarify product vision.
Invocation
/ralph-plan vision
What Happens
- Begins a multi-turn conversation using the Socratic method
- Guides you through exploring:
- Product purpose and problem being solved
- Target users using Jobs To Be Done framework
- Key capabilities and differentiators
- Current state vs future vision
- Creates or updates
docs/planning/VISION.mdwhen ready
Important Notes
- This is interactive only - no auto mode exists for vision planning
- Vision planning requires human insight and decision-making
- You control the pace and can exit anytime by saying "done"
- The session can span multiple turns as needed
Roadmap Planning
Start an interactive Socratic dialogue to help define product milestones and roadmap.
Invocation
/ralph-plan roadmap
What Happens
- Reads your existing VISION.md document (if it exists)
- Begins a multi-turn conversation using the Socratic method
- Guides you through exploring:
- Scope and priority for first release
- Tradeoffs and hard decisions
- Dependency mapping between features
- Milestone definition with outcomes
- Creates or updates
docs/planning/ROADMAP.mdwhen ready
Important Notes
- Requires VISION.md to exist (run
/ralph-plan visionfirst) - Interactive mode available, auto mode available via
roadmap-auto.md - Milestones use outcome-based names, not version numbers
- No time estimates - focus on sequence and dependencies
- You control the pace and can exit anytime by saying "done"
Stories Planning
Start an interactive Socratic dialogue to help create user stories for a specific milestone.
Invocation
/ralph-plan stories [milestone-name]
What Happens
- Reads your existing VISION.md and ROADMAP.md documents
- If a milestone name is provided, uses that milestone
- If no milestone is provided, asks which milestone to create stories for
- Begins a multi-turn conversation using Socratic method with JTBD framework
- Guides you through exploring:
- Primary users and their context
- Jobs to be done (functional, emotional, social)
- Story scope and boundaries
- Priority and sequencing
- Tradeoffs and decisions
- Acceptance criteria
- Creates story files in
docs/planning/milestones/<milestone>/stories/
Important Notes
- Requires VISION.md and ROADMAP.md to exist (run vision and roadmap planning first)
- Uses Jobs To Be Done (JTBD) framework for user-centered stories
- Stories focus on user outcomes, not technical implementation
- You control the pace and can exit anytime by saying "done"
- Can save stories incrementally during the session
Tasks Planning
Create technical tasks from stories. Three modes available:
Single Story Mode (Interactive, Supervised, or Headless)
/ralph-plan tasks <story-id>
What Happens:
- Reads the specified story file to understand user outcomes
- Explores the codebase to understand existing patterns relevant to the story
- Begins a multi-turn conversation using Socratic method (or auto-generates in supervised/headless mode)
- Creates task files in
docs/planning/tasks/
Milestone Mode (Supervised or Headless)
aaa ralph plan tasks --milestone <name> --headless
What Happens:
- Discovers all stories in
docs/planning/milestones/<name>/stories/ - Spawns parallel
task-generatorsubagents (one per story) - Each agent analyzes its story and the codebase
- Task files are generated concurrently for all stories
- Reports summary of all generated tasks
Benefits:
- Faster: Parallel generation vs sequential
- Better quality: Smaller context per agent
- Consistent: Same patterns applied across stories
Important Notes
- Single story mode: Requires
--story <id> - Milestone mode: Requires
--milestone <name>and one of--supervisedor--headless - Cannot combine
--storyand--milestone - Tasks are linked to their parent story for traceability
- Focus is on technical implementation, not user outcomes
- References specific files and patterns from the codebase
Subtasks Planning
Generate subtasks from hierarchy (tasks in milestone/story) or alternative sources (file, text, review).
Source Types
Hierarchy Sources (scope = source):
| Flag | Example | Meaning |
|---|---|---|
--milestone |
--milestone 003-ralph |
All tasks in milestone → subtasks |
--story |
--story STORY-001 |
All tasks for that story → subtasks |
--task |
--task TASK-001 |
That task → subtasks |
Alternative Sources:
| Flag | Example | Meaning |
|---|---|---|
--file |
--file ./spec.md |
File content → subtasks |
--text |
--text "Fix bug" |
Text description → subtasks |
--review-diary |
--review-diary |
Review diary findings → subtasks |
Invocation
# Hierarchy sources (scope flags)
aaa ralph plan subtasks --milestone 003-ralph-workflow --headless
aaa ralph plan subtasks --story STORY-001 --headless
aaa ralph plan subtasks --task TASK-001 --headless
# Alternative sources (explicit flags)
aaa ralph plan subtasks --file ./review-findings.md
aaa ralph plan subtasks --text "Fix array bounds check"
aaa ralph plan subtasks --review-diary
# With sizing
aaa ralph plan subtasks --milestone 003-ralph --size small --headless
Optional Flags
--size <mode>- Slice thickness: small, medium (default), large
What Happens
For hierarchy sources:
- Discovers all tasks in the scope (milestone or story)
- Spawns parallel agents (one per task)
- Each agent generates subtasks for its task
- Aggregates to
docs/planning/milestones/<milestone>/subtasks.json
For alternative sources:
- Reads the source (file content, text, or logs/reviews.jsonl)
- Extracts actionable items from the source
- Generates subtasks following schema and sizing constraints
- Writes to
docs/planning/subtasks.jsonor specified milestone location
Important Notes
- Hierarchy sources (
--milestone,--story) are the primary way to generate subtasks - Alternative sources bypass the planning hierarchy for ad-hoc use cases
- Each subtask should touch 1-3 files (not counting tests)
- Subtasks must be completable in 15-30 tool calls
- Subtask IDs use
SUB-NNNand are milestone-scoped in the target queue (see@context/workflows/ralph/planning/subtask-spec.md)
CLI Equivalent
This skill provides the same functionality as:
aaa ralph plan vision
aaa ralph plan roadmap
aaa ralph plan stories --milestone <name>
# Tasks from hierarchy
aaa ralph plan tasks --story <story-id> # Story → tasks
aaa ralph plan tasks --milestone <name> --headless # All stories in milestone → tasks
# Tasks from alternative sources
aaa ralph plan tasks --file ./spec.md # File → tasks
aaa ralph plan tasks --text "Add auth" # Text → tasks
# Subtasks from hierarchy
aaa ralph plan subtasks --milestone <name> # All tasks in milestone → subtasks
aaa ralph plan subtasks --story <story-id> # All tasks for story → subtasks
aaa ralph plan subtasks --task <task-id> # Single task → subtasks
# Subtasks from alternative sources
aaa ralph plan subtasks --file ./spec.md # File → subtasks
aaa ralph plan subtasks --text "Fix bug" # Text → subtasks
aaa ralph plan subtasks --review-diary # Review diary → subtasks
References
- Vision prompt:
context/workflows/ralph/planning/vision-interactive.md - Roadmap prompt:
context/workflows/ralph/planning/roadmap-interactive.md - Stories prompt:
context/workflows/ralph/planning/stories-interactive.md - Tasks prompt:
context/workflows/ralph/planning/tasks-interactive.md - Tasks milestone prompt:
context/workflows/ralph/planning/tasks-milestone.md - Tasks from source:
context/workflows/ralph/planning/tasks-from-source.md - Subtasks from hierarchy:
context/workflows/ralph/planning/subtasks-from-hierarchy.md - Subtasks from source:
context/workflows/ralph/planning/subtasks-from-source.md - Subtasks from task:
context/workflows/ralph/planning/subtasks-auto.md - Task generator agent:
.claude/agents/task-generator.md