Autonomous AI coding loop. Default: fast setup from minimal input. Use --detailed for iterative PRD refinement. Triggers on: ralphy, run ralphy, start ralphy, autonomous implementation.
A unified skill for setting up autonomous feature implementation.
You do NOT run the script. You help the user set up and create the PRD, then they run it.
IMPORTANT: Worktree-first approach. All files go into .ralphy/ inside the worktree. Nothing gets written to the main branch.
Just create the worktree and PRD immediately from the user's feature description. No questions asked.
Trigger: /ralphy <feature description>
Ask clarifying questions and iterate on the PRD with user feedback.
Trigger: Any of these:
/ralphy --detailed <feature description>If DEFAULT mode: Skip to Step 2 immediately.
If DETAILED mode: Ask clarifying questions first:
1. What is the primary goal of this feature?
A. [Option A]
B. [Option B]
C. [Option C]
D. Other: [please specify]
2. Who is the target user?
A. New users only
B. Existing users only
C. All users
D. Admin users only
Users respond with "1A, 2C, 3B" for quick iteration. Continue asking follow-up questions until PRD scope is clear.
Create the worktree immediately (default mode) or after user answers questions (detailed mode).
Invoke the /wt.create skill with the feature description:
/wt.create <feature description>
This will:
_wt/wtN_<slug> worktree with numbered prefix_wt/ to .gitignore.env files to worktreeSave the worktree path returned by wt.create for Step 3.
After /wt.create completes, create .ralphy/ and copy files into it:
# Get worktree path from wt.create output (e.g., _wt/wt1_feature-name)
WT_PATH="<path-from-wt-create>"
# Create .ralphy directory
mkdir -p "${WT_PATH}/.ralphy"
# Copy ralphy.sh into .ralphy/
cp ~/.claude/skills/ralphy/ralphy.sh "${WT_PATH}/.ralphy/ralphy.sh"
chmod +x "${WT_PATH}/.ralphy/ralphy.sh"
# Create progress.txt in .ralphy/
touch "${WT_PATH}/.ralphy/progress.txt"
# PRD.md will be written to .ralphy/ in Step 4
Create the PRD inside .ralphy/.
CRITICAL: NEVER use the Write tool for worktree files. The Write tool resolves paths relative to CWD (main repo), not the worktree. Always use cat > ... << 'EOF' via Bash to write files into the worktree path.
# Write PRD to .ralphy/ (NOT worktree root, NOT main branch)
cat > "${WT_PATH}/.ralphy/PRD.md" << 'EOF'
# [Feature Name]
...
EOF
# [Feature Name]
[Brief description of the feature and problem it solves]
## Goals
- Goal 1
- Goal 2
## Tasks
- [ ] Task 1 (specific and actionable)
- [ ] Task 2
- [ ] Task 3
## Functional Requirements
- FR-1: The system must...
- FR-2: When a user...
## Non-Goals
- What this will NOT include
## Technical Considerations
- Constraints, dependencies, etc.
Each task must be completable in ONE iteration.
Right-sized:
Too big (split these):
Rule of thumb: If you cannot describe the change in 2-3 sentences, it's too big.
Tasks execute in order. Earlier tasks must NOT depend on later ones.
Good:
status column to tasks table with default 'pending'"Bad:
Tmux window and clipboard were already handled by /wt.create.
โ
Setup complete!
Worktree: <wt-name> (tmux window created)
PRD: .ralphy/PRD.md
To run:
./.ralphy/ralphy.sh --prd .ralphy/PRD.md --codex
Other engines: ./.ralphy/ralphy.sh --prd .ralphy/PRD.md (Claude)
Copy files to .ralphy/ in project root instead:
mkdir -p .ralphy
cp ~/.claude/skills/ralphy/ralphy.sh ./.ralphy/ralphy.sh
chmod +x ./.ralphy/ralphy.sh
touch ./.ralphy/progress.txt
# Write PRD.md to .ralphy/
Then tell user:
โ
Setup complete!
To run Ralphy:
./.ralphy/ralphy.sh --prd .ralphy/PRD.md # Claude Code (default)
./.ralphy/ralphy.sh --prd .ralphy/PRD.md --codex # Codex CLI
./.ralphy/ralphy.sh --prd .ralphy/PRD.md --opencode # OpenCode
DO NOT run the script yourself. The user runs it.
When the autonomous loop finishes:
/wt.apply (rebases and fast-forward merges)/wt.remove (deletes worktree, branch, tmux window)Before finishing: