@graypark/ralph-codex 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/lib/state.mjs +0 -1
- package/lib/stop-hook-core.mjs +0 -71
- package/package.json +1 -1
- package/skills/ralph-interview/SKILL.md +135 -199
package/README.md
CHANGED
|
@@ -69,16 +69,16 @@ node bin/install.mjs --global
|
|
|
69
69
|
/ralph-interview Refactor the auth module across 3 services, run immediately
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
**Multi-phase
|
|
72
|
+
**Multi-phase tasks:** The interview generates `.ralph/prd.md` + `.ralph/progress.md` files. The loop reads these each iteration to track phases and items:
|
|
73
73
|
|
|
74
74
|
```
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
- n → Copy-paste commands yourself
|
|
79
|
-
- edit → Modify the generated commands
|
|
75
|
+
.ralph/
|
|
76
|
+
├── prd.md # All phases and work items
|
|
77
|
+
└── progress.md # What's done, what's next, what's blocked
|
|
80
78
|
```
|
|
81
79
|
|
|
80
|
+
The loop naturally transitions between phases by reading progress. Stop anytime — restart the same command and it picks up where it left off.
|
|
81
|
+
|
|
82
82
|
### `/ralph-orchestrator` — Multi-Agent Patterns
|
|
83
83
|
|
|
84
84
|
Analyzes your task and recommends the best orchestration strategy:
|
package/lib/state.mjs
CHANGED
package/lib/stop-hook-core.mjs
CHANGED
|
@@ -75,40 +75,7 @@ export async function processStopHook(hookInput, readStateFn, writeStateFn) {
|
|
|
75
75
|
stderr.push(
|
|
76
76
|
`Ralph loop: max iterations (${state.maxIterations}) reached.\n`,
|
|
77
77
|
);
|
|
78
|
-
|
|
79
|
-
// On max iterations, also check queue for next phase
|
|
80
|
-
const queue = Array.isArray(state.queue) ? state.queue : [];
|
|
81
|
-
if (queue.length > 0) {
|
|
82
|
-
const next = queue.shift();
|
|
83
|
-
state.prompt = next.prompt;
|
|
84
|
-
state.completionPromise = next.completionPromise || "TADA";
|
|
85
|
-
state.maxIterations = next.maxIterations || 20;
|
|
86
|
-
state.currentIteration = 0;
|
|
87
|
-
state.queue = queue;
|
|
88
|
-
await writeStateFn(state);
|
|
89
|
-
|
|
90
|
-
stderr.push(
|
|
91
|
-
`Ralph loop: advancing to next phase (${queue.length} remaining).\n`,
|
|
92
|
-
);
|
|
93
|
-
const reason = [
|
|
94
|
-
state.prompt,
|
|
95
|
-
"",
|
|
96
|
-
"---",
|
|
97
|
-
`Ralph Loop — new phase started (iteration 1/${state.maxIterations}). Previous phase hit max iterations. Work on the task above.`,
|
|
98
|
-
].join("\n");
|
|
99
|
-
const output = { decision: "block", reason };
|
|
100
|
-
if (state.completionPromise) {
|
|
101
|
-
output.systemMessage = `Ralph phase started (${queue.length} more queued) | To complete: output <promise>${state.completionPromise}</promise>`;
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
exitCode: 0,
|
|
105
|
-
stdout: JSON.stringify(output),
|
|
106
|
-
stderr: stderr.join(""),
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
78
|
state.active = false;
|
|
111
|
-
state.queue = [];
|
|
112
79
|
await writeStateFn(state);
|
|
113
80
|
return { exitCode: 0, stdout: "", stderr: stderr.join("") };
|
|
114
81
|
}
|
|
@@ -124,45 +91,7 @@ export async function processStopHook(hookInput, readStateFn, writeStateFn) {
|
|
|
124
91
|
stderr.push(
|
|
125
92
|
`Ralph loop: completion promise "${state.completionPromise}" detected.\n`,
|
|
126
93
|
);
|
|
127
|
-
|
|
128
|
-
// Check queue for next phase
|
|
129
|
-
const queue = Array.isArray(state.queue) ? state.queue : [];
|
|
130
|
-
if (queue.length > 0) {
|
|
131
|
-
const next = queue.shift();
|
|
132
|
-
state.prompt = next.prompt;
|
|
133
|
-
state.completionPromise = next.completionPromise || "TADA";
|
|
134
|
-
state.maxIterations = next.maxIterations || 20;
|
|
135
|
-
state.currentIteration = 0;
|
|
136
|
-
state.queue = queue;
|
|
137
|
-
await writeStateFn(state);
|
|
138
|
-
|
|
139
|
-
const phasesLeft = queue.length;
|
|
140
|
-
stderr.push(
|
|
141
|
-
`Ralph loop: advancing to next phase (${phasesLeft} remaining in queue).\n`,
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
const nextIterInfo =
|
|
145
|
-
state.maxIterations > 0 ? `1/${state.maxIterations}` : "1";
|
|
146
|
-
const reason = [
|
|
147
|
-
state.prompt,
|
|
148
|
-
"",
|
|
149
|
-
"---",
|
|
150
|
-
`Ralph Loop — new phase started (iteration ${nextIterInfo}). Work on the task above.`,
|
|
151
|
-
].join("\n");
|
|
152
|
-
|
|
153
|
-
const output = { decision: "block", reason };
|
|
154
|
-
if (state.completionPromise) {
|
|
155
|
-
output.systemMessage = `Ralph phase started (${phasesLeft} more queued) | To complete: output <promise>${state.completionPromise}</promise> (ONLY when TRUE)`;
|
|
156
|
-
}
|
|
157
|
-
return {
|
|
158
|
-
exitCode: 0,
|
|
159
|
-
stdout: JSON.stringify(output),
|
|
160
|
-
stderr: stderr.join(""),
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
94
|
state.active = false;
|
|
165
|
-
state.queue = [];
|
|
166
95
|
await writeStateFn(state);
|
|
167
96
|
return { exitCode: 0, stdout: "", stderr: stderr.join("") };
|
|
168
97
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graypark/ralph-codex",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Ralph Loop for Codex CLI & Claude Code — iterative dev loops with multi-agent orchestration, interactive interview, and stop hooks",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ralph-interview
|
|
3
|
-
description: "Interactive interview that generates optimized /ralph-loop commands
|
|
3
|
+
description: "Interactive interview that generates optimized /ralph-loop commands with PRD-based phase tracking"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Ralph Interview — Command Generator
|
|
7
7
|
|
|
8
8
|
You are an expert at crafting `/ralph-loop:ralph-loop` commands for the Ralph Loop plugin.
|
|
9
|
-
When the user describes a task, conduct a brief interview to gather missing context, then generate a
|
|
9
|
+
When the user describes a task, conduct a brief interview to gather missing context, then generate a PRD + progress file pair and a single ralph-loop command.
|
|
10
10
|
|
|
11
11
|
## Core Principles
|
|
12
12
|
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
13
|
+
- **PRD-driven**: All phases and items live in `.ralph/prd.md`. The loop prompt reads it each iteration.
|
|
14
|
+
- **Progress tracking**: `.ralph/progress.md` tracks what's done. Each iteration reads it to decide what's next.
|
|
15
|
+
- **Self-correcting loops**: Every prompt embeds "modify, verify, retry on failure" cycles.
|
|
15
16
|
- **Escape hatches required**: Always specify what to do when stuck after N retries.
|
|
16
17
|
- **Atomic commits**: Instruct a git commit per logical work unit.
|
|
17
|
-
- **Objective completion criteria only**:
|
|
18
|
-
- **Parallel when possible**: Use the ralph-orchestrator patterns
|
|
18
|
+
- **Objective completion criteria only**: No subjective criteria. Use test passes, linter clears, etc.
|
|
19
|
+
- **Parallel when possible**: Use the ralph-orchestrator patterns for independent work streams.
|
|
19
20
|
|
|
20
21
|
## Interview Process
|
|
21
22
|
|
|
22
23
|
When the user provides a task description, ask **concise questions** for any missing items below.
|
|
23
|
-
Skip items already covered. Bundle questions — max 3
|
|
24
|
+
Skip items already covered. Bundle questions — max 3-5 per round, one round only if possible.
|
|
24
25
|
|
|
25
26
|
### Required Information
|
|
26
27
|
|
|
@@ -41,10 +42,10 @@ Skip items already covered. Bundle questions — max 3–5 per round, one round
|
|
|
41
42
|
|
|
42
43
|
### When to Split into Phases
|
|
43
44
|
|
|
44
|
-
- **Research needed first**
|
|
45
|
-
- **More than 8 items**
|
|
46
|
-
- **Dependencies exist**
|
|
47
|
-
- **5 or fewer simple items**
|
|
45
|
+
- **Research needed first** -> Phase 1: Analysis, Phase 2: Implementation
|
|
46
|
+
- **More than 8 items** -> Split by nature (e.g., P1/P2, frontend/backend)
|
|
47
|
+
- **Dependencies exist** -> Prerequisite work in a prior Phase
|
|
48
|
+
- **5 or fewer simple items** -> Single Phase is fine
|
|
48
49
|
|
|
49
50
|
### When to Use Subagents (via ralph-orchestrator)
|
|
50
51
|
|
|
@@ -60,160 +61,123 @@ Evaluate the task against the ralph-orchestrator decision matrix:
|
|
|
60
61
|
| Needs cross-file understanding | -1 |
|
|
61
62
|
| Multiple services/repos | +3 |
|
|
62
63
|
|
|
63
|
-
- **Score >= 3
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- _Fan-Out / Fan-In_ for comprehensive audits
|
|
67
|
-
- _Scout-Then-Execute_ for unfamiliar codebases
|
|
68
|
-
- **Score 0–2** → Sequential loop, optional scout phase
|
|
69
|
-
- **Score < 0** → Single sequential Ralph Loop
|
|
70
|
-
|
|
71
|
-
When subagents are recommended, embed subagent spawn instructions directly in the generated ralph-loop prompt using Codex's experimental multi-agent capabilities.
|
|
64
|
+
- **Score >= 3**: Recommend parallel subagents within the ralph-loop prompt
|
|
65
|
+
- **Score 0-2**: Sequential loop, optional scout phase
|
|
66
|
+
- **Score < 0**: Single sequential Ralph Loop
|
|
72
67
|
|
|
73
68
|
### Recommended max-iterations
|
|
74
69
|
|
|
75
70
|
| Task type | Iterations |
|
|
76
71
|
| ---------------------------------------------- | ---------- |
|
|
77
|
-
| Research only (file reads, pattern extraction) | 3
|
|
78
|
-
| Simple fixes, 1
|
|
79
|
-
| Medium scope, 4
|
|
80
|
-
| Large scope, 8+ items | 20
|
|
81
|
-
| TDD-based feature implementation | 15
|
|
82
|
-
| Full refactor / migration | 30
|
|
72
|
+
| Research only (file reads, pattern extraction) | 3-5 |
|
|
73
|
+
| Simple fixes, 1-3 items | 5-10 |
|
|
74
|
+
| Medium scope, 4-7 items | 10-20 |
|
|
75
|
+
| Large scope, 8+ items | 20-30 |
|
|
76
|
+
| TDD-based feature implementation | 15-30 |
|
|
77
|
+
| Full refactor / migration | 30-50 |
|
|
83
78
|
|
|
84
|
-
**Rule of thumb:** `item_count
|
|
79
|
+
**Rule of thumb:** `item_count x 2 + 5` as baseline.
|
|
85
80
|
|
|
86
|
-
##
|
|
81
|
+
## PRD + Progress Pattern
|
|
87
82
|
|
|
88
|
-
|
|
83
|
+
This is the core mechanism for multi-phase work. Instead of embedding all phases in one prompt or chaining state files, generate two files that the loop reads each iteration.
|
|
89
84
|
|
|
90
|
-
###
|
|
85
|
+
### .ralph/prd.md
|
|
91
86
|
|
|
92
|
-
|
|
93
|
-
/ralph-loop:ralph-loop "## Goal
|
|
94
|
-
[One-line summary of the task]
|
|
87
|
+
Contains all phases and work items:
|
|
95
88
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
## Work Cycle (repeat for each item)
|
|
100
|
-
1. [How to pick the next incomplete item]
|
|
101
|
-
2. [Specific modification to make]
|
|
102
|
-
3. [Run verification command]
|
|
103
|
-
4. On failure → read the error, fix, go back to step 3. Max N retries.
|
|
104
|
-
5. On pass → [state update action]
|
|
105
|
-
6. git add -A && git commit -m '[convention-compliant message]'
|
|
106
|
-
7. Return to step 1 for the next item.
|
|
107
|
-
|
|
108
|
-
## Work Items
|
|
109
|
-
- [Item 1]
|
|
110
|
-
- [Item 2]
|
|
111
|
-
- ...
|
|
89
|
+
```markdown
|
|
90
|
+
# PRD: [Task Title]
|
|
112
91
|
|
|
113
|
-
##
|
|
114
|
-
|
|
115
|
-
- [
|
|
92
|
+
## Phase 1: [Phase Name]
|
|
93
|
+
|
|
94
|
+
- [ ] Item 1 description
|
|
95
|
+
- [ ] Item 2 description
|
|
96
|
+
- [ ] Item 3 description
|
|
97
|
+
|
|
98
|
+
## Phase 2: [Phase Name]
|
|
99
|
+
|
|
100
|
+
- [ ] Item 4 description
|
|
101
|
+
- [ ] Item 5 description
|
|
116
102
|
|
|
117
103
|
## Completion Criteria
|
|
104
|
+
|
|
118
105
|
- [Objective condition 1]
|
|
119
106
|
- [Objective condition 2]
|
|
120
107
|
- [Verification command] passes
|
|
121
|
-
|
|
122
|
-
Output <promise>[PROMISE]</promise>" --max-iterations [N] --completion-promise "[PROMISE]"
|
|
123
108
|
```
|
|
124
109
|
|
|
125
|
-
###
|
|
110
|
+
### .ralph/progress.md
|
|
126
111
|
|
|
127
|
-
|
|
112
|
+
Updated by the loop after each completed item:
|
|
128
113
|
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
[Task summary]
|
|
114
|
+
```markdown
|
|
115
|
+
# Progress
|
|
132
116
|
|
|
133
|
-
##
|
|
134
|
-
Spawn these subagents simultaneously:
|
|
117
|
+
## Completed
|
|
135
118
|
|
|
136
|
-
|
|
137
|
-
|
|
119
|
+
- [x] Item 1 — commit abc1234
|
|
120
|
+
- [x] Item 2 — commit def5678
|
|
138
121
|
|
|
139
|
-
|
|
140
|
-
Search src/backend/** for [pattern]. Write findings to .ralph/reports/backend.md
|
|
122
|
+
## Current Phase
|
|
141
123
|
|
|
142
|
-
|
|
124
|
+
Phase 1: [Phase Name]
|
|
143
125
|
|
|
144
|
-
##
|
|
145
|
-
Read .ralph/reports/merged.md, then for each item:
|
|
146
|
-
1. Apply the fix
|
|
147
|
-
2. Run [verification command]
|
|
148
|
-
3. git commit
|
|
126
|
+
## Blocked
|
|
149
127
|
|
|
150
|
-
|
|
151
|
-
- All items from merged.md addressed
|
|
152
|
-
- [Verification command] passes
|
|
128
|
+
(none)
|
|
153
129
|
|
|
154
|
-
|
|
155
|
-
```
|
|
130
|
+
## Next
|
|
156
131
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
When a task requires multiple phases, generate a **single** `/ralph-loop:ralph-loop` command with a `queue` in the state file. The stop hook automatically advances to the next phase when a completion promise is detected.
|
|
160
|
-
|
|
161
|
-
**How to set up pipeline mode:**
|
|
162
|
-
|
|
163
|
-
Create the state file at `.codex/ralph-loop.state.json` with a queue:
|
|
164
|
-
|
|
165
|
-
```json
|
|
166
|
-
{
|
|
167
|
-
"active": true,
|
|
168
|
-
"prompt": "Phase 1 prompt here...",
|
|
169
|
-
"completionPromise": "PHASE1_DONE",
|
|
170
|
-
"maxIterations": 10,
|
|
171
|
-
"currentIteration": 0,
|
|
172
|
-
"sessionId": "",
|
|
173
|
-
"queue": [
|
|
174
|
-
{
|
|
175
|
-
"prompt": "Phase 2 prompt here...",
|
|
176
|
-
"completionPromise": "PHASE2_DONE",
|
|
177
|
-
"maxIterations": 20
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
"prompt": "Phase 3 prompt here...",
|
|
181
|
-
"completionPromise": "TADA",
|
|
182
|
-
"maxIterations": 15
|
|
183
|
-
}
|
|
184
|
-
]
|
|
185
|
-
}
|
|
132
|
+
Item 3
|
|
186
133
|
```
|
|
187
134
|
|
|
188
|
-
|
|
135
|
+
### The Loop Prompt
|
|
136
|
+
|
|
137
|
+
The ralph-loop prompt is always the same structure:
|
|
189
138
|
|
|
190
139
|
```
|
|
191
|
-
/ralph-loop:ralph-loop "
|
|
192
|
-
|
|
140
|
+
/ralph-loop:ralph-loop "## Instructions
|
|
141
|
+
1. Read .ralph/prd.md for the full task plan
|
|
142
|
+
2. Read .ralph/progress.md for current status
|
|
143
|
+
3. Pick the next incomplete item (first unchecked item in current phase)
|
|
144
|
+
4. If current phase is complete, advance to next phase and update progress
|
|
145
|
+
5. Implement the item
|
|
146
|
+
6. Run verification: [command]
|
|
147
|
+
7. On failure: read error, fix, retry (max 3 times per item)
|
|
148
|
+
8. On success: update .ralph/progress.md (mark item done, note commit hash)
|
|
149
|
+
9. git add -A && git commit -m '[convention]: [item description]'
|
|
150
|
+
10. If ALL items in ALL phases are done and verification passes, output <promise>TADA</promise>
|
|
193
151
|
|
|
194
|
-
When
|
|
152
|
+
## When Stuck
|
|
153
|
+
After 3 retries on any item:
|
|
154
|
+
- Add it to Blocked section in .ralph/progress.md with error details
|
|
155
|
+
- Move to next item
|
|
156
|
+
- Document in .ralph/progress.md
|
|
195
157
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
3. Re-inject Phase 2's prompt as a new loop — no user intervention needed
|
|
158
|
+
## References
|
|
159
|
+
[list of reference files]
|
|
199
160
|
|
|
200
|
-
|
|
161
|
+
## Verification
|
|
162
|
+
[verification command]" --max-iterations [N] --completion-promise "TADA"
|
|
163
|
+
```
|
|
201
164
|
|
|
202
|
-
|
|
165
|
+
### Why This Works
|
|
203
166
|
|
|
204
|
-
-
|
|
205
|
-
-
|
|
206
|
-
-
|
|
167
|
+
- **Resumable**: Stop anytime. Progress is on disk. Restart the same command and it picks up where it left off.
|
|
168
|
+
- **Inspectable**: Open `.ralph/progress.md` to see exactly what's done and what's next.
|
|
169
|
+
- **Phase transitions are natural**: The agent reads the PRD, sees Phase 1 is done, moves to Phase 2.
|
|
170
|
+
- **No state file conflicts**: The ralph-loop state file only manages the loop itself, not the task.
|
|
171
|
+
- **Fresh context each iteration**: Agent re-reads PRD and progress, no context rot.
|
|
207
172
|
|
|
208
173
|
## Output Format
|
|
209
174
|
|
|
210
175
|
Structure the final output as:
|
|
211
176
|
|
|
212
177
|
1. **Task summary** — One paragraph describing the overall work.
|
|
213
|
-
2. **
|
|
214
|
-
3. **
|
|
215
|
-
4. **Execution
|
|
216
|
-
5. **Cancel reminder** — `/ralph-loop:cancel-ralph`
|
|
178
|
+
2. **PRD preview** — Show the .ralph/prd.md content.
|
|
179
|
+
3. **Loop command** — The single ralph-loop command to run.
|
|
180
|
+
4. **Execution prompt** — Ask how to proceed.
|
|
217
181
|
|
|
218
182
|
### Example Output
|
|
219
183
|
|
|
@@ -221,121 +185,93 @@ Structure the final output as:
|
|
|
221
185
|
## Task Summary
|
|
222
186
|
Fix 3 P1 + 7 P2 responsive issues based on the audit report.
|
|
223
187
|
|
|
224
|
-
##
|
|
225
|
-
|
|
226
|
-
|
|
188
|
+
## PRD (.ralph/prd.md)
|
|
189
|
+
# PRD: Responsive Fixes
|
|
190
|
+
## Phase 1: P1 Critical
|
|
191
|
+
- [ ] Fix header overflow on mobile
|
|
192
|
+
- [ ] Fix nav collapse breakpoint
|
|
193
|
+
- [ ] Fix card grid stacking
|
|
227
194
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
` ` `
|
|
195
|
+
## Phase 2: P2 Important
|
|
196
|
+
- [ ] Adjust sidebar width at 768px
|
|
197
|
+
...
|
|
232
198
|
|
|
233
|
-
|
|
199
|
+
## Command
|
|
234
200
|
` ` `
|
|
235
|
-
/ralph-loop:ralph-loop "..." --max-iterations
|
|
201
|
+
/ralph-loop:ralph-loop "..." --max-iterations 25 --completion-promise "TADA"
|
|
236
202
|
` ` `
|
|
237
203
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
204
|
+
---
|
|
205
|
+
**Ready to run?**
|
|
206
|
+
- **y** → Write PRD + progress files and start the loop
|
|
207
|
+
- **n** → Files and command are above, set up manually
|
|
208
|
+
- **edit** → Tell me what to change
|
|
242
209
|
```
|
|
243
210
|
|
|
244
211
|
## Rules
|
|
245
212
|
|
|
246
|
-
- **No subjective completion criteria**: Banned phrases
|
|
213
|
+
- **No subjective completion criteria**: Banned phrases: "works well", "looks clean", "properly done."
|
|
247
214
|
- **No prompt without verification**: At least one automated check (tsc, test, lint, build) is mandatory.
|
|
248
|
-
- **No missing
|
|
249
|
-
- **No
|
|
250
|
-
- **
|
|
215
|
+
- **No missing escape hatch**: Every prompt MUST have a "When Stuck" section.
|
|
216
|
+
- **No oversized single Phase**: Do not put more than 8 independent items in one Phase. Split them.
|
|
217
|
+
- **Always generate .ralph/prd.md and .ralph/progress.md**: These are mandatory for multi-phase tasks.
|
|
251
218
|
|
|
252
219
|
## Conversation Flow
|
|
253
220
|
|
|
254
221
|
### Standard Flow
|
|
255
222
|
|
|
256
223
|
```
|
|
257
|
-
[User]
|
|
258
|
-
[Assistant]
|
|
259
|
-
[User]
|
|
260
|
-
[Assistant]
|
|
261
|
-
[
|
|
262
|
-
[
|
|
263
|
-
[Assistant] → Executes accordingly
|
|
224
|
+
[User] -> Describes the task
|
|
225
|
+
[Assistant] -> Asks interview questions (1 round, max 5 questions)
|
|
226
|
+
[User] -> Answers
|
|
227
|
+
[Assistant] -> Generates PRD + command + asks "Ready to run?"
|
|
228
|
+
[User] -> "y"
|
|
229
|
+
[Assistant] -> Writes .ralph/ files via Bash, then invokes ralph-loop skill
|
|
264
230
|
```
|
|
265
231
|
|
|
266
232
|
### Quick-Run Flow
|
|
267
233
|
|
|
268
|
-
If the user includes
|
|
269
|
-
|
|
270
|
-
1. Conduct the interview as normal (skip if enough context is provided).
|
|
271
|
-
2. Generate the command blocks. Show them briefly.
|
|
272
|
-
3. For multi-phase: write state file with queue via Bash tool.
|
|
273
|
-
4. Make the Skill tool call: skill="ralph-loop:ralph-loop", args=Phase 1 prompt+flags.
|
|
274
|
-
Do NOT stop after step 3. You MUST proceed to step 4.
|
|
234
|
+
If the user includes "run immediately", "just do it", "run it", "바로 실행", "바로 시작", or "--run":
|
|
275
235
|
|
|
276
|
-
|
|
236
|
+
1. Conduct the interview (skip if enough context).
|
|
237
|
+
2. Generate PRD + command. Show briefly.
|
|
238
|
+
3. Write .ralph/prd.md and .ralph/progress.md via Bash tool.
|
|
239
|
+
4. Invoke ralph-loop skill immediately. Do NOT stop after step 3.
|
|
277
240
|
|
|
278
|
-
|
|
241
|
+
### Execution — MANDATORY SKILL INVOCATION
|
|
279
242
|
|
|
280
|
-
|
|
243
|
+
When the user confirms with "y", "yes", "run", etc., you MUST:
|
|
281
244
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
**Ready to run?**
|
|
285
|
-
- **y** / **yes** / **실행** → Pipeline mode: run all phases automatically (Phase 1 → 2 → 3, no stops between phases)
|
|
286
|
-
- **step** / **단계별** → Manual mode: run Phase 1 only, I'll ask before each next phase
|
|
287
|
-
- **n** / **no** / **아니오** → Commands are above, copy-paste when ready
|
|
288
|
-
- **edit** / **수정** → Tell me what to change
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
**For single-phase tasks:**
|
|
292
|
-
|
|
293
|
-
```
|
|
294
|
-
---
|
|
295
|
-
**Ready to run?**
|
|
296
|
-
- **y** / **yes** / **실행** → Start immediately
|
|
297
|
-
- **n** / **no** / **아니오** → Command is above, copy-paste when ready
|
|
298
|
-
- **edit** / **수정** → Tell me what to change
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
### Execution — MANDATORY TOOL CALL
|
|
302
|
-
|
|
303
|
-
When the user confirms with "y", "yes", "step", "run", "바로 실행", etc., you MUST perform an actual Skill tool call. This is NON-NEGOTIABLE.
|
|
245
|
+
1. Create .ralph/ directory and write prd.md + progress.md via Bash tool
|
|
246
|
+
2. Actually invoke the ralph-loop skill to start the loop
|
|
304
247
|
|
|
305
248
|
WRONG (do NOT do this):
|
|
306
249
|
|
|
307
|
-
- Printing the
|
|
308
|
-
- Writing
|
|
250
|
+
- Printing the command as text and stopping
|
|
251
|
+
- Writing files and saying "ready" or "set up"
|
|
309
252
|
- Telling the user to copy-paste
|
|
310
|
-
- Saying "Phase 1 is set up"
|
|
311
253
|
|
|
312
254
|
RIGHT (you MUST do this):
|
|
313
255
|
|
|
314
|
-
-
|
|
256
|
+
- Write the .ralph/ files via Bash
|
|
257
|
+
- Then invoke ralph-loop skill so the loop actually starts
|
|
315
258
|
|
|
316
|
-
|
|
259
|
+
#### How to invoke ralph-loop
|
|
260
|
+
|
|
261
|
+
**Claude Code**: Use the Skill tool:
|
|
317
262
|
|
|
318
263
|
```
|
|
319
|
-
|
|
264
|
+
Skill tool call:
|
|
320
265
|
skill: "ralph-loop:ralph-loop"
|
|
321
|
-
args: "<
|
|
266
|
+
args: "<prompt>" --max-iterations <N> --completion-promise "TADA"
|
|
322
267
|
```
|
|
323
268
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
**Pipeline mode ("y"):**
|
|
269
|
+
**Codex CLI**: Reference the skill via markdown link:
|
|
327
270
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
**Manual mode ("step"):**
|
|
333
|
-
|
|
334
|
-
1. IMMEDIATELY make the Skill tool call for Phase 1
|
|
335
|
-
2. After it completes, ask before making the next Skill tool call
|
|
336
|
-
|
|
337
|
-
**Single-phase ("y"):**
|
|
271
|
+
```
|
|
272
|
+
[$ralph-loop](~/.codex/skills/ralph-loop/SKILL.md) "<prompt>" --max-iterations <N> --completion-promise "TADA"
|
|
273
|
+
```
|
|
338
274
|
|
|
339
|
-
|
|
275
|
+
Note: On Windows use `%USERPROFILE%\.codex\skills\ralph-loop\SKILL.md`. If CODEX_HOME is set, use that.
|
|
340
276
|
|
|
341
|
-
If you do not
|
|
277
|
+
If you do not actually invoke the skill, the loop will not start.
|