Loading...
Loading...
Sets up a Ralph autonomous development loop for any project. First generates a full PRD from the user's description, then derives a task plan from it. Wraps Claude Code in an intelligent while-true loop with circuit breakers, exit detection, session persistence, and progress tracking. Use when you want Claude to autonomously work through a task list until done.
npx skill4agent add aaarnv/claude-skills spideyUser's lazy description
↓
┌─────────────────────────────────┐
│ PHASE 0: PRD GENERATION │
│ Full product requirements doc │
│ from a one-line description │
└─────────────────────────────────┘
↓
┌─────────────────────────────────┐
│ PHASE 1: TASK DERIVATION │
│ fix_plan.md derived FROM the │
│ PRD, not invented from nothing │
└─────────────────────────────────┘
↓
┌─────────────────────────────────┐
│ PHASE 2: LOOP CONFIGURATION │
│ .ralphrc, PROMPT.md, AGENT.md │
└─────────────────────────────────┘
↓
┌─────────────────────────────────┐
│ PHASE 3: AUTONOMOUS EXECUTION │
│ ralph --monitor │
└─────────────────────────────────┘.ralph/specs/PRD.md# PRD: [Project Name]
## 1. Overview
One paragraph describing what this product does and why it exists.
## 2. Target Users
| User Type | Description | Primary Need |
|-----------|-------------|--------------|
| [Persona 1] | [Who they are] | [What they need] |
| [Persona 2] | [Who they are] | [What they need] |
## 3. User Stories
### Epic: [Feature Area 1]
- **US-001**: As a [user], I want to [action] so that [benefit]
- Acceptance Criteria:
- [ ] [Specific, testable criterion]
- [ ] [Specific, testable criterion]
- [ ] [Specific, testable criterion]
- **US-002**: As a [user], I want to [action] so that [benefit]
- Acceptance Criteria:
- [ ] ...
### Epic: [Feature Area 2]
- **US-003**: ...
(Continue for all features)
## 4. Technical Requirements
### Stack
| Layer | Technology | Rationale |
|-------|-----------|-----------|
| Frontend | [e.g., React Native / Expo] | [Why] |
| Backend | [e.g., Supabase] | [Why] |
| Auth | [e.g., Supabase Auth] | [Why] |
| State | [e.g., TanStack Query] | [Why] |
| Navigation | [e.g., Expo Router] | [Why] |
### Architecture
- [Key architectural decisions]
- [Data flow description]
- [API structure]
### Data Model
| Entity | Key Fields | Relationships |
|--------|-----------|---------------|
| User | id, email, name, avatar | has_many: workouts |
| Workout | id, user_id, date, type | belongs_to: user, has_many: sets |
| ... | ... | ... |
### API Endpoints / Procedures
| Method | Path / Name | Purpose | Auth |
|--------|------------|---------|------|
| POST | /auth/signup | Create account | Public |
| GET | /workouts | List user workouts | Authenticated |
| ... | ... | ... | ... |
## 5. Screens & Navigation
### Screen Map
### Screen Descriptions
| Screen | Purpose | Key Components |
|--------|---------|----------------|
| Home | [What it shows] | [Cards, lists, charts, etc.] |
| ... | ... | ... |
## 6. Non-Functional Requirements
### Performance
- App launch < [X] seconds
- Screen transitions < [X]ms
- API response time < [X]ms
### Security
- [Auth requirements]
- [Data encryption requirements]
- [RLS / permission model]
### Accessibility
- [WCAG level target]
- [Screen reader support]
- [Minimum touch targets]
### Offline Support
- [What works offline]
- [Sync strategy]
## 7. MVP Scope
### In Scope (MVP)
- [Feature 1]
- [Feature 2]
- [Feature 3]
### Out of Scope (Post-MVP)
- [Deferred feature 1]
- [Deferred feature 2]
## 8. Success Metrics
| Metric | Target | How Measured |
|--------|--------|--------------|
| [e.g., DAU] | [e.g., 100 in first month] | [Analytics tool] |
| ... | ... | ... |
## 9. Open Questions
- [Anything unresolved]
- [Decisions that need user input later].ralph/specs/PRD.mdfix_plan.md.ralph/fix_plan.md# Fix Plan
Derived from: .ralph/specs/PRD.md
## Critical (Infrastructure & Setup)
- [ ] Project scaffolding (init, deps, config)
- [ ] Data model / database schema (from PRD §4 Data Model)
- [ ] Auth setup (from PRD §4 Auth)
- [ ] Navigation skeleton (from PRD §5 Screen Map)
## High (Core User Stories)
- [ ] US-001: [User story title] (from PRD §3)
- Verify: [acceptance criteria 1]
- Verify: [acceptance criteria 2]
- [ ] US-002: [User story title]
- Verify: [acceptance criteria]
- [ ] US-003: ...
## Medium (Enhancement User Stories)
- [ ] US-004: [Enhancement feature]
- Verify: [acceptance criteria]
- [ ] US-005: ...
## Low (Polish & Post-MVP prep)
- [ ] Dark mode / theming
- [ ] Onboarding flow
- [ ] Error states & empty states
- [ ] Performance optimization
- [ ] App store assets / metadata
## Verification Gate
After all tasks complete, verify:
- [ ] All acceptance criteria from PRD met
- [ ] All screens from §5 implemented
- [ ] Non-functional requirements from §6 checked
- [ ] Tests passingwhich ralph-loop 2>/dev/null || which ralph 2>/dev/nullgit clone https://github.com/frankbria/ralph-claude-code.git /tmp/ralph-claude-code
cd /tmp/ralph-claude-code && ./install.sh# macOS
brew install jq tmux coreutils
# Linux
sudo apt install jq tmux coreutilsmkdir -p .ralph/specs .ralph/examples .ralph/logs .ralph/docs/generatedPROJECT_NAME="$ARGUMENTS"
PROJECT_TYPE="[detected]"
MAX_CALLS_PER_HOUR=100
CLAUDE_TIMEOUT_MINUTES=15
CLAUDE_OUTPUT_FORMAT="json"
ALLOWED_TOOLS="Write,Read,Edit,Bash(git *),Bash(npm *),Bash(npx *)"
SESSION_CONTINUITY=true
SESSION_EXPIRY_HOURS=24
TASK_SOURCES="local"
CB_NO_PROGRESS_THRESHOLD=3
CB_SAME_ERROR_THRESHOLD=5
CB_OUTPUT_DECLINE_THRESHOLD=70ALLOWED_TOOLSBash(npm *),Bash(npx *),Bash(node *)Bash(python *),Bash(pip *),Bash(pytest *)Bash(cargo *),Bash(rustc *)Bash(go *)Bash(docker *)# Project: [PROJECT_NAME]
## Your Mission
You are working autonomously in a Ralph loop. Each iteration:
1. Read `.ralph/specs/PRD.md` for full requirements context
2. Read `.ralph/fix_plan.md` for the current priority list
3. Implement the HIGHEST PRIORITY unchecked item
4. Run tests after implementation
5. Update fix_plan.md (check off completed items, note any verify: criteria met)
6. Output a RALPH_STATUS block (REQUIRED)
## Project Context
[GENERATED FROM PRD §1 Overview and §4 Technical Requirements]
## Specifications
- Full PRD: `.ralph/specs/PRD.md`
- Additional specs: `.ralph/specs/*`
## Key Architecture Rules
[EXTRACTED FROM PRD §4 Architecture section]
## Build & Test Instructions
See `.ralph/AGENT.md` for how to build, test, and run the project.
## Rules
- ONE task per loop iteration (stay focused)
- Always run tests after changes
- Never skip the RALPH_STATUS block
- If blocked, set STATUS: BLOCKED and explain why
- If all tasks are done, set EXIT_SIGNAL: true
- Reference the PRD for acceptance criteria — don't guess
- When implementing a user story, check ALL its acceptance criteria
## Required Output Format
At the END of every response, output EXACTLY:
---RALPH_STATUS---
STATUS: IN_PROGRESS | COMPLETE | BLOCKED
TASKS_COMPLETED_THIS_LOOP: <number>
FILES_MODIFIED: <number>
TESTS_STATUS: PASSING | FAILING | NOT_RUN
WORK_TYPE: IMPLEMENTATION | TESTING | DOCUMENTATION | REFACTORING
EXIT_SIGNAL: false
RECOMMENDATION: <one line summary of what was done and what's next>
---END_RALPH_STATUS---
Set EXIT_SIGNAL: true ONLY when ALL tasks in fix_plan.md are complete
AND the Verification Gate at the bottom of fix_plan.md passes.# Agent Instructions
## Build
[detected build command]
## Test
[detected test command]
## Run
[detected run command]
## Lint
[detected lint command]
## Type Check
[detected type check command if applicable]git diff --name-onlyfiles_changedCB_NO_PROGRESS_THRESHOLD# Add Ralph state files to .gitignore FIRST
echo -e "\n# Ralph loop state files\n.ralph/logs/\n.ralph/status.json\n.ralph/progress.json\n.ralph/.call_count\n.ralph/.last_reset\n.ralph/.exit_signals\n.ralph/.response_analysis\n.ralph/.circuit_breaker_state\n.ralph/.claude_session_id\n.ralph/.ralph_session\n.ralph/.ralph_session_history" >> .gitignore
# Initialize git if not already a repo
if ! git rev-parse --git-dir > /dev/null 2>&1; then
git init
git add -A
git commit -m "Initial Spidey scaffold"
fiSpidey setup complete.
PRD: .ralph/specs/PRD.md (review and edit before running)
Task plan: .ralph/fix_plan.md (derived from PRD)
Loop config: .ralphrc (edit rate limits, timeouts)
Loop prompt: .ralph/PROMPT.md (edit to add project-specific rules)
Build/test: .ralph/AGENT.md (edit if auto-detect was wrong)
To run:
ralph --monitor # Recommended: loop + live dashboard in tmux
ralph # Loop only
To review status:
ralph-monitor # Dashboard in separate terminal
The loop will work through fix_plan.md top to bottom, one task per iteration,
until all items are checked off and the verification gate passes.completion_indicators >= 2EXIT_SIGNAL: true| Trigger | Result |
|---|---|
| 3 loops no file changes | OPEN (halted) |
| 5 loops same error | OPEN (halted) |
| 2 loops no progress | HALF_OPEN (monitoring) |
| Progress in HALF_OPEN | CLOSED (recovered) |
--continueralph-enable # Interactive wizard for existing project
ralph-setup my-proj # Create new blank project
ralph-import prd.md # Convert existing PRD to Ralph format
ralph --monitor # Run loop + dashboard
ralph-monitor # Dashboard only