skills/ralph-pipeline-interactive/SKILL.md
Run the complete Ralphetamine pipeline interactively: PRD creation, multi-perspective Review Party gates, spec generation, premortem review, and run script generation. Pauses for user input at key decision points. Triggers on: /ralph-pipeline-interactive, interactive ralph pipeline, ralph guided pipeline.
npx skillsauth add becerra-alberto/ralphetamine ralph-pipeline-interactiveInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run the complete Ralphetamine pipeline from idea to execution-ready project in one session. Each phase builds on the previous, with user interaction at key decision points.
This orchestrates the entire Ralphetamine workflow interactively. It chains worktree isolation, PRD creation, spec generation, premortem review, and run script generation into a single guided session. For the fully autonomous version, use /ralphetamine:pipeline-full-auto.
ralph run only. Do not generate custom per-story loops that call claude directly..ralph/stories.txt must include at least one active N.M | Title entry.Three Review Party gates are embedded in the pipeline — multi-perspective evaluations where 3 specialist voices assess an artifact. The term "party" comes from BMAD's collaborative multi-agent format.
Since the pipeline runs in a single Claude conversation, personas are simulated in-prompt — adopt each voice in sequence, then synthesize. Each persona gives 3-5 bullet points + a 1-sentence verdict (~300 words total per gate). This keeps reviews scannable and fast.
Each gate independently asks "Ready for the [Name] Party review, or skip?" before running. The user can skip any individual gate without affecting the others. If skipped, proceed immediately to the next step.
Gate reports are persisted to .ralph/reviews/:
vision-party.md — Gate 1 (pre-PRD)requirements-party.md — Gate 2 (post-PRD)execution-party.md — Gate 3 (post-specs)Create the .ralph/reviews/ directory if it doesn't exist.
| Phase | What Happens | User Input? |
|-------|-------------|-------------|
| 0. Worktree | Create an isolated git worktree for the feature | Yes — confirm feature slug |
| 1. PRD | Get feature description + clarifying questions | Yes — clarifying questions |
| 1b. Vision Party | Multi-perspective idea evaluation (Review Gate 1) | Yes — review findings |
| 1c. Generate PRD | Generate the PRD from validated idea | No |
| 1d. Requirements Party | Multi-perspective PRD evaluation (Review Gate 2) | Yes — review findings |
| 2. Commit PRD | Commit the PRD to git | No |
| 3. Specs | Convert PRD into epics, stories, batch queue | Yes — confirm breakdown |
| 4. Commit Specs | Commit specs and stories.txt to git | No |
| 5. Execution Coherence Party | Multi-perspective spec evaluation (Review Gate 3) | Yes — review findings |
| 6. Premortem | Analyze plan for failure modes, fix issues | Yes — review findings |
| 7. Commit Fixes | Commit all review fixes to git | No |
| 8. Run Script | Generate run-ralph.sh for autonomous execution | No |
Important: Complete each phase fully before moving to the next. Announce each phase transition clearly so the user knows where they are in the pipeline.
Create an isolated git worktree so all feature work happens on a dedicated branch, keeping the main branch clean.
After getting the feature description (from the user's initial message or by asking), derive a kebab-case slug. For example:
user-authenticationbudget-tracking-dashboardShow the user the proposed slug and branch name:
Feature branch: ralph/feature-<slug>
Worktree path: .ralph/worktrees/feature-<slug>
WAIT for the user to confirm or provide a different slug.
Run the following steps using the Bash tool:
Clean stale state:
rm -f .git/index.lock .git/HEAD.lock 2>/dev/null || true
git worktree prune 2>/dev/null || true
Create the worktree:
git worktree add .ralph/worktrees/feature-<slug> -b ralph/feature-<slug>
If the branch or worktree already exists (from a previous run), clean up and retry:
git worktree unlock .ralph/worktrees/feature-<slug> 2>/dev/null || true
git worktree remove .ralph/worktrees/feature-<slug> --force 2>/dev/null || true
rm -rf .ralph/worktrees/feature-<slug> 2>/dev/null || true
git worktree prune 2>/dev/null || true
git branch -D ralph/feature-<slug> 2>/dev/null || true
git worktree add .ralph/worktrees/feature-<slug> -b ralph/feature-<slug>
Resolve the absolute worktree path and store it for all subsequent phases:
WORKTREE_DIR="$(cd .ralph/worktrees/feature-<slug> && pwd)"
All subsequent phases (1-8) operate inside the worktree directory. When using the Bash tool, prefix commands with cd "$WORKTREE_DIR" && or use absolute paths within the worktree. When using Read/Write/Edit tools, use the absolute worktree path.
Create the .ralph/ directory and initialize ralph init inside the worktree if .ralph/config.json does not already exist:
cd "$WORKTREE_DIR" && ralph init
If the user's project has a CLAUDE.md or other config files in the repo root, they are already available in the worktree (it shares the same git content).
Announce: "Phase 0 complete — Worktree created at .ralph/worktrees/feature-<slug> on branch ralph/feature-<slug>. All work will happen in this isolated environment. Moving to Phase 1: PRD Creation."
Generate a Product Requirements Document interactively.
Ask the user: "What feature or project do you want to build?"
If the user has already described the feature, proceed directly to clarifying questions.
Ask 3-5 essential clarifying questions with lettered options. Focus on:
Format questions like this so users can respond "1A, 2C, 3B":
1. What is the primary goal?
A. Option one
B. Option two
C. Option three
D. Other: [please specify]
WAIT for the user to answer before continuing.
Ask the user: "Ready for the Vision Party review, or skip?"
WAIT for the user to respond. If they say "skip", proceed directly to Step 1.4.
If proceeding, evaluate the idea from three specialist perspectives before locking it into a PRD:
| Voice | Focus | Key Questions | |-------|-------|---------------| | Visionary Analyst | Problem-space depth | Is this solving the root problem or a symptom? What's the 10x version? What would make this transformative rather than incremental? | | User Advocate | Human-centered design | Who benefits most and how deeply? What's the emotional journey? What friction points in the user's current workflow are we missing? | | Innovation Strategist | Opportunity space | What adjacent capabilities does this unlock? What's the bleeding-edge approach? What would a competitor ship that makes this obsolete? |
Generate the report in this format and save to .ralph/reviews/vision-party.md:
## Vision Party Review
### Visionary Analyst
- [Bullet 1: problem depth assessment]
- [Bullet 2: leverage point identified]
- [Bullet 3: transformative potential or reframing]
Verdict: [One sentence summary]
### User Advocate
- [Bullet 1: who benefits and how deeply]
- [Bullet 2: friction/empathy gap identified]
- [Bullet 3: experience opportunity]
Verdict: [One sentence summary]
### Innovation Strategist
- [Bullet 1: adjacent capability unlocked]
- [Bullet 2: bleeding-edge approach or competitive angle]
- [Bullet 3: what would make this obsolete]
Verdict: [One sentence summary]
### Tensions & Synthesis
- [Where voices disagree and what it reveals]
### Recommended Adjustments
- [Specific, actionable changes to incorporate before PRD generation]
Present the report to the user. Ask: "Would you like to incorporate any of these insights before I generate the PRD, or proceed as-is?"
WAIT for the user to respond. If they request changes, note them for PRD generation. Then continue to Step 1.4.
Based on answers (and any Vision Party insights incorporated), generate a structured PRD with these sections:
Save to tasks/prd-[feature-name].md (kebab-case filename).
Ask the user: "Ready for the Requirements Party review, or skip?"
WAIT for the user to respond. If they say "skip", proceed directly to Phase 2.
If proceeding, evaluate the PRD from three specialist perspectives:
| Voice | Focus | Key Questions | |-------|-------|---------------| | Product Strategist | Requirements coherence | Do the functional requirements fully cover the goals? Are there contradictions? Is scope appropriate — not too narrow, not bloated? Do success metrics actually measure what matters? | | Experience Designer | User story quality | Are user stories genuinely user-centric or just developer tasks in disguise? Does the UX flow feel natural? Are edge-case user journeys covered? Is there an emotional design thread? | | Technical Architect | Feasibility & design | Are there implicit technical constraints the PRD doesn't acknowledge? Is the design consideration section realistic? Are there architectural decisions being deferred that will bite during implementation? |
Generate the report in this format and save to .ralph/reviews/requirements-party.md:
## Requirements Party Review
### Product Strategist
- [Bullet 1: goal-requirement alignment check]
- [Bullet 2: scope calibration — too narrow or bloated?]
- [Bullet 3: success metrics assessment]
Verdict: [One sentence summary]
### Experience Designer
- [Bullet 1: user story authenticity — user-centric or developer tasks in disguise?]
- [Bullet 2: UX flow coherence]
- [Bullet 3: edge-case journeys or empathy gaps]
Verdict: [One sentence summary]
### Technical Architect
- [Bullet 1: implicit constraints not acknowledged]
- [Bullet 2: feasibility of design considerations]
- [Bullet 3: deferred decisions that will bite later]
Verdict: [One sentence summary]
### Cross-Cutting Concerns
- [Tensions between voices — where business needs conflict with technical reality or UX]
### Recommended PRD Revisions
- [Specific revisions to apply to the PRD before committing]
Present the report to the user. Ask: "Should I apply these revisions to the PRD, adjust specific items, or commit as-is?"
WAIT for the user to respond. If revisions are accepted, edit the PRD file in-place, then continue.
Announce: "Phase 1 complete — PRD saved to tasks/prd-[name].md. Moving to Phase 2: Commit."
Commit the PRD to git so it's tracked before spec generation.
tasks/prd-*.md (the newly created PRD file)docs: add PRD for [feature-name]Announce: "Phase 2 complete — PRD committed. Moving to Phase 3: Spec Generation."
Convert the PRD into executable story specs. This follows the Ralphetamine spec conversion process.
Read the PRD and identify:
N.M (e.g., 1.1, 1.2, 2.1)Show the proposed breakdown:
Epic 1: [Name]
1.1 — [Story title]
1.2 — [Story title]
Epic 2: [Name]
2.1 — [Story title]
2.2 — [Story title]
...
WAIT for the user to confirm or request changes.
For each story, create specs/epic-{N}/story-{N.M}-{slug}.md with this format:
---
id: "N.M"
epic: N
title: "Short Descriptive Title"
status: pending
source_prd: "tasks/prd-<name>.md"
priority: critical|high|medium|low
estimation: small|medium|large
depends_on: []
---
# Story N.M — Short Descriptive Title
## User Story
As a [role], I want [capability] so that [benefit].
[1-2 sentences of additional context if needed.]
## Technical Context
[Brief description of the implementation approach, relevant architecture, or key technical decisions.]
## Acceptance Criteria
### AC1: [Criterion Name]
- **Given** [precondition]
- **When** [action]
- **Then** [expected result]
### AC2: [Criterion Name]
- **Given** [precondition]
- **When** [action]
- **Then** [expected result]
## Test Definition
### Unit Tests
- [Test case description]
### Integration/E2E Tests (if applicable)
- [Test scenario]
## Files to Create/Modify
- `path/to/file` — [what changes] (create|modify)
Story sizing rule: Each story must be completable in ONE Ralph iteration (one context window). If you can't describe the change in 2-3 sentences, split it.
Path normalization rule (critical):
Files to Create/Modify path must be relative to the current project root.skills/oss-prep/, use SKILL.md, not skills/oss-prep/SKILL.md.If 5+ stories: Use parallel Task agents to write specs concurrently for speed. Generate a manifest first, spawn agents, then run a consistency review.
Write .ralph/stories.txt with batch annotations:
# Source: tasks/prd-<name>.md
# Generated: <ISO timestamp>
# Stories: 1.1, 1.2, ..., N.M
# Ralph Story Queue
# Format: ID | Title
# [batch:1] — foundational / independent
1.1 | Story Title
1.2 | Story Title
# [batch:2] — depends on batch 1
2.1 | Story Title
Verify:
stories.txt has a matching spec fileFiles to Create/Modify path is project-root-relative (no duplicated root prefix).ralph/stories.txt has at least one active story line (N.M | Title)Announce: "Phase 3 complete — Specs generated. Moving to Phase 4: Commit Specs."
Commit all generated spec artifacts to git.
specs/ directory (all spec files).ralph/stories.txtralph: add specs for [feature-name] (N stories across M epics)Announce: "Phase 4 complete — Specs committed. Moving to Phase 5: Execution Coherence Review."
Evaluate whether the story breakdown actually serves the vision. This is strategic evaluation — the premortem that follows in Phase 6 is tactical.
Ask the user: "Ready for the Execution Coherence Party review, or skip?"
WAIT for the user to respond. If they say "skip", proceed directly to Phase 6.
If proceeding, evaluate the specs from three specialist perspectives:
| Voice | Focus | Key Questions | |-------|-------|---------------| | Systems Thinker | Holistic coherence | Do the stories compose into the intended whole, or has decomposition lost the narrative? Are there emergent behaviors from story interactions that nobody planned for? Is there a "golden thread" from vision → PRD → specs? | | Developer Experience Advocate | Implementation quality | Will a developer (or Claude) reading each spec understand why, not just what? Is there enough context to make good judgment calls? Are the stories enjoyable to implement or drudgework? | | Quality Strategist | Acceptance criteria & value | Do the acceptance criteria prove that value was delivered, or just that code was written? Are we testing behavior or implementation details? Would passing all tests mean a user would actually be satisfied? |
Generate the report in this format and save to .ralph/reviews/execution-party.md:
## Execution Coherence Party Review
### Systems Thinker
- [Bullet 1: do stories compose into the intended whole?]
- [Bullet 2: emergent behaviors from story interactions]
- [Bullet 3: golden thread — vision → PRD → specs alignment]
Verdict: [One sentence summary]
### Developer Experience Advocate
- [Bullet 1: spec clarity — does each spec explain *why*, not just *what*?]
- [Bullet 2: context sufficiency for good judgment calls]
- [Bullet 3: implementation ergonomics — enjoyable or drudgework?]
Verdict: [One sentence summary]
### Quality Strategist
- [Bullet 1: do ACs prove value delivered, or just code written?]
- [Bullet 2: testing behavior vs implementation details]
- [Bullet 3: would passing all tests mean a user is satisfied?]
Verdict: [One sentence summary]
### Integration Concerns
- [Gaps between stories where value falls through the cracks]
### Recommended Spec Adjustments
- [Specific adjustments before the tactical premortem runs]
Present the report to the user. Ask: "Should I apply these adjustments, modify specific items, or proceed to the premortem?"
WAIT for the user to respond. If adjustments are accepted, edit spec files and stories.txt, re-run validation (Step 3.6 logic), recommit specs (ralph: execution review adjustments for [feature-name]), then continue.
Announce: "Phase 5 complete — Execution coherence review done. Moving to Phase 6: Premortem Review."
Perform a structured premortem analysis on the generated specs and stories. The premortem imagines the project has already failed and works backward to identify what went wrong — catching issues before they happen.
Note: This is the tactical complement to Phase 5's strategic review. Phase 5 asked "are we building the right thing the right way?" — this phase asks "will the build actually work?"
Read every spec file in specs/ and the full stories.txt.
Systematically check each category. For each issue found, note the story ID, the problem, and the severity (critical / warning).
depends_on?Show the premortem report to the user, organized by severity:
## Premortem Report
### Critical Issues (must fix before running)
- [Story X.Y] Issue description — Recommended fix
### Warnings (should fix)
- [Story X.Y] Issue description — Recommended fix
### Observations (consider)
- [Story X.Y] Observation — Suggestion
If no issues are found, report: "Premortem clean — no issues detected."
WAIT for the user to review. Ask: "Should I apply all recommended fixes, or would you like to adjust any?"
Based on user approval, modify the spec files and stories.txt:
depends_on references, regenerate stories.txt entriesdepends_on entries to affected specsAfter applying fixes, re-run the validation from Step 3.6 to ensure consistency.
Announce: "Phase 6 complete — Premortem fixes applied. Moving to Phase 7: Commit Fixes."
Commit all review and premortem fixes to git.
specs/, .ralph/stories.txt, and .ralph/reviews/ralph: premortem fixes for [feature-name] (N issues resolved)Announce: "Phase 7 complete — Fixes committed. Moving to Phase 8: Generate Run Script."
Create a run-ralph.sh script in the project root that launches Ralph's autonomous execution loop.
The script should:
chmod +x)ralph run ...) and never call claude directlyralph, jq, .ralph/config.json, .ralph/stories.txt, and non-empty active queue.ralph/config.json spec pattern includes both placeholders: {{epic}} and {{id}}sequential when specs mostly target one fileparallel when targets are distributedRALPH_RUN_MODE=sequential|parallel|auto--no-dashboard, -t <timeout>)#!/usr/bin/env bash
# Run Ralphetamine autonomous implementation loop
# Generated by /ralph-pipeline-interactive on <date>
# PRD: tasks/prd-<name>.md
# Stories: <N> stories across <M> epics
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR"
# Preflight checks
command -v ralph >/dev/null 2>&1 || { echo "Error: ralph not found on PATH. Run install.sh first."; exit 1; }
command -v jq >/dev/null 2>&1 || { echo "Error: jq not found on PATH."; exit 1; }
[[ -f .ralph/config.json ]] || { echo "Error: .ralph/config.json not found."; exit 1; }
[[ -f .ralph/stories.txt ]] || { echo "Error: .ralph/stories.txt not found. Run spec generation first."; exit 1; }
active_stories=$(grep -cE '^[[:space:]]*[0-9]+(\.[0-9]+)+[[:space:]]*\|' .ralph/stories.txt || true)
if [[ "$active_stories" -eq 0 ]]; then
echo "Error: .ralph/stories.txt has no active stories."
echo "Regenerate the queue before running Ralph."
exit 1
fi
spec_pattern=$(jq -r '.specs.pattern // ""' .ralph/config.json 2>/dev/null || echo "")
if [[ "$spec_pattern" != *"{{epic}}"* || "$spec_pattern" != *"{{id}}"* ]]; then
echo "Error: invalid .ralph/config.json specs.pattern: $spec_pattern"
echo "Expected: specs/epic-{{epic}}/story-{{id}}-*.md"
exit 1
fi
# Count stories and batches
total_stories=$(grep -cE '^[[:space:]]*[0-9]+(\.[0-9]+)+[[:space:]]*\|' .ralph/stories.txt || true)
total_batches=$(grep -c '^[[:space:]]*# \[batch:' .ralph/stories.txt || true)
# Infer conflict risk from Files to Create/Modify sections.
target_count=$(
{
while IFS= read -r spec; do
awk '
/^## Files to Create\/Modify/ {in_files=1; next}
/^## / {in_files=0}
in_files && /^- `/ {
line=$0
sub(/^- `/, "", line)
sub(/`.*/, "", line)
gsub(/^[[:space:]]+|[[:space:]]+$/, "", line)
if (length(line) > 0) print line
}
' "$spec"
done < <(find specs -type f -name 'story-*.md' 2>/dev/null)
} | sort -u | sed '/^$/d' | wc -l | tr -d ' '
)
run_mode="${RALPH_RUN_MODE:-auto}"
if [[ "$run_mode" == "auto" ]]; then
if [[ "${target_count:-0}" -le 1 ]]; then
run_mode="sequential"
else
run_mode="parallel"
fi
fi
echo "Ralphetamine — Autonomous Implementation"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Stories: ${total_stories}"
echo "Batches: ${total_batches}"
echo "Targets: ${target_count:-0} unique file paths"
echo "Mode: ${run_mode}"
echo ""
echo "Starting in 3 seconds... (Ctrl+C to cancel)"
sleep 3
# Prevent duplicate loops for the same project.
if [[ -f .ralph/.lock ]]; then
lock_pid="$(cat .ralph/.lock 2>/dev/null || true)"
if [[ -n "${lock_pid:-}" ]] && kill -0 "$lock_pid" 2>/dev/null; then
echo "Ralph appears to already be running for this project (PID $lock_pid)."
echo "Skipping duplicate launch."
exit 0
fi
fi
# Run Ralph
if [[ "$run_mode" == "parallel" ]]; then
ralph run --parallel --no-interactive "$@"
else
ralph run --no-interactive "$@"
fi
Save to run-ralph.sh in the project root and make it executable.
After generating the script, automatically launch it in a new iTerm2 window so Ralph runs in its own dedicated terminal session inside the worktree.
Use the Bash tool to run this guarded launcher (checks for an active .ralph/.lock first, then launches):
PROJECT_DIR="$(pwd)"
lock_path="$PROJECT_DIR/.ralph/.lock"
if [[ -f "$lock_path" ]]; then
lock_pid="$(cat "$lock_path" 2>/dev/null || true)"
fi
if [[ -n "${lock_pid:-}" ]] && kill -0 "$lock_pid" 2>/dev/null; then
echo "Ralph already running for this project (PID $lock_pid). Skipping terminal launch."
else
if ! osascript -e '
tell application "iTerm2"
activate
set newWindow to (create window with default profile)
tell current session of newWindow
write text "cd \"'"$WORKTREE_DIR"'\" && ./run-ralph.sh"
end tell
end tell
'; then
open -a Terminal.app "$PROJECT_DIR/run-ralph.sh"
fi
fi
Where $WORKTREE_DIR is the absolute path to the worktree directory (resolved in Phase 0).
Fallback: If iTerm2 is not installed or the AppleScript fails, fall back to:
cd "$WORKTREE_DIR" && open -a Terminal.app "./run-ralph.sh"
If both fail, tell the user: "Could not auto-launch. Run ./run-ralph.sh from the worktree directory manually."
Announce: "Phase 8 complete — Ralph is now running in a new iTerm2 window (worktree: feature-<slug>)."
After all phases, print the final summary:
Ralphetamine Pipeline Complete
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Worktree: .ralph/worktrees/feature-<slug>
Branch: ralph/feature-<slug>
PRD: tasks/prd-[name].md
Reviews: .ralph/reviews/ (vision, requirements, execution)
Specs: N stories across M epics
Premortem: X issues found, Y fixed
Run script: ./run-ralph.sh
Execution: Launched in iTerm2 window
Ralph is running autonomously in an isolated worktree.
Check the iTerm2 window for progress.
When complete, merge back to your main branch:
cd <project-root>
git merge ralph/feature-<slug>
git worktree remove .ralph/worktrees/feature-<slug>
→ Then update the changelog:
# Update CHANGELOG.md and bump version
If any phase fails:
rm -f .git/index.lock), prune worktrees (git worktree prune), and retry. If the branch already exists, ask the user if they want to reuse it or start fresh.Before completing the pipeline:
.ralph/reviews/ (for gates not skipped)development
Audit and reconcile the latest Ralph run in Codex-driven repositories. Use when Ralph finishes and you want a post-run diagnostic or remediation pass to catch unmerged story branches, failures, state/spec drift, and merge issues, then execute a bounded recovery plan.
development
Audit and reconcile the latest Ralph run in Claude Code. Use when Ralph finishes with failures, tentative outcomes, or suspected missing merges; inspect story branches, state/spec drift, and merge conflicts, then produce or execute a prioritized remediation plan.
devops
Run the complete Ralphetamine pipeline fully autonomously with zero user input: PRD creation, spec generation, double premortem review, and run script generation. Triggers on: /ralph-pipeline-full-auto, ralph autopilot, ralph full auto, ralph autonomous pipeline, ralph auto.
tools
Convert a PRD into Ralphetamine story specs and queue. Reads a PRD file and generates specs/epic-{N}/story-{N.M}-{slug}.md files plus .ralph/stories.txt. Triggers on: /ralph, convert prd to specs, generate ralph specs, create story specs.