@graypark/ralph-codex 0.6.0 → 0.7.1
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/package.json +1 -1
- package/skills/ralph-interview/SKILL.md +152 -153
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graypark/ralph-codex",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
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,22 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ralph-interview
|
|
3
|
-
description: "Interactive interview that generates optimized
|
|
3
|
+
description: "Interactive interview that generates optimized ralph-loop commands with PRD-based phase tracking. Compatible with ralph-skills prd.json format."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Ralph Interview — Command Generator
|
|
7
7
|
|
|
8
|
-
You are an expert at crafting
|
|
9
|
-
When the user describes a task, conduct a brief interview to gather missing context, then generate a PRD
|
|
8
|
+
You are an expert at crafting 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 PRD, activate the loop, and start working immediately.
|
|
10
10
|
|
|
11
11
|
## Core Principles
|
|
12
12
|
|
|
13
|
-
- **PRD-driven**: All phases and items live in
|
|
14
|
-
- **Progress tracking**:
|
|
15
|
-
- **
|
|
13
|
+
- **PRD-driven**: All phases and items live in prd.json. The loop reads it each iteration.
|
|
14
|
+
- **Progress tracking**: progress.txt tracks what is done. Each iteration reads it to decide what is next.
|
|
15
|
+
- **One story per iteration**: Each loop iteration implements ONE user story, commits, and updates progress.
|
|
16
|
+
- **Self-correcting**: Every prompt embeds "modify, verify, retry on failure" cycles.
|
|
16
17
|
- **Escape hatches required**: Always specify what to do when stuck after N retries.
|
|
17
|
-
- **Atomic commits**: Instruct a git commit per logical work unit.
|
|
18
18
|
- **Objective completion criteria only**: No subjective criteria. Use test passes, linter clears, etc.
|
|
19
|
-
- **Parallel when possible**: Use
|
|
19
|
+
- **Parallel when possible**: Use ralph-orchestrator patterns for independent work streams.
|
|
20
20
|
|
|
21
21
|
## Interview Process
|
|
22
22
|
|
|
@@ -76,202 +76,201 @@ Evaluate the task against the ralph-orchestrator decision matrix:
|
|
|
76
76
|
| TDD-based feature implementation | 15-30 |
|
|
77
77
|
| Full refactor / migration | 30-50 |
|
|
78
78
|
|
|
79
|
-
**Rule of thumb:** `
|
|
80
|
-
|
|
81
|
-
## PRD
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
###
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
79
|
+
**Rule of thumb:** `story_count x 2 + 5` as baseline.
|
|
80
|
+
|
|
81
|
+
## PRD Format: prd.json (ralph-skills compatible)
|
|
82
|
+
|
|
83
|
+
Generate PRDs in the **prd.json** format used by ralph-skills. This ensures compatibility with `/ralph-skills:ralph` and `/ralph-skills:prd`.
|
|
84
|
+
|
|
85
|
+
### prd.json
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"project": "[Project Name]",
|
|
90
|
+
"branchName": "ralph/[feature-name]",
|
|
91
|
+
"description": "[Feature description]",
|
|
92
|
+
"userStories": [
|
|
93
|
+
{
|
|
94
|
+
"id": "US-001",
|
|
95
|
+
"title": "[Story title]",
|
|
96
|
+
"description": "As a [user], I want [feature] so that [benefit]",
|
|
97
|
+
"acceptanceCriteria": [
|
|
98
|
+
"Specific verifiable criterion",
|
|
99
|
+
"Another criterion",
|
|
100
|
+
"Typecheck passes"
|
|
101
|
+
],
|
|
102
|
+
"priority": 1,
|
|
103
|
+
"passes": false,
|
|
104
|
+
"notes": ""
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
###
|
|
110
|
+
### Story Sizing Rules
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
Each story MUST be completable in ONE iteration (one context window):
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
- **Right-sized**: Add a DB column, create one component, update one endpoint
|
|
115
|
+
- **Too big (split)**: "Build entire dashboard", "Add authentication", "Refactor API"
|
|
116
|
+
- **Rule of thumb**: If you cannot describe the change in 2-3 sentences, split it
|
|
116
117
|
|
|
117
|
-
|
|
118
|
+
### Story Ordering
|
|
118
119
|
|
|
119
|
-
|
|
120
|
-
- [x] Item 2 — commit def5678
|
|
120
|
+
Stories execute in priority order. Dependencies first:
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
1. Schema/database changes
|
|
123
|
+
2. Backend logic / server actions
|
|
124
|
+
3. UI components that use the backend
|
|
125
|
+
4. Aggregation views / dashboards
|
|
123
126
|
|
|
124
|
-
|
|
127
|
+
### Acceptance Criteria Rules
|
|
125
128
|
|
|
126
|
-
|
|
129
|
+
- MUST be verifiable, not vague
|
|
130
|
+
- Always include: `"Typecheck passes"` (or equivalent verification)
|
|
131
|
+
- For UI stories: add `"Verify in browser"` or equivalent
|
|
132
|
+
- Bad: "Works correctly", "Good UX"
|
|
133
|
+
- Good: "Button shows confirmation dialog before deleting", "Filter persists in URL params"
|
|
127
134
|
|
|
128
|
-
|
|
135
|
+
### progress.txt
|
|
129
136
|
|
|
130
|
-
|
|
137
|
+
An append-only log file that tracks iteration history:
|
|
131
138
|
|
|
132
|
-
Item 3
|
|
133
139
|
```
|
|
140
|
+
## Codebase Patterns
|
|
141
|
+
- [Reusable patterns discovered during iteration]
|
|
134
142
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
The ralph-loop prompt is always the same structure:
|
|
143
|
+
---
|
|
138
144
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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>
|
|
151
|
-
|
|
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
|
|
157
|
-
|
|
158
|
-
## References
|
|
159
|
-
[list of reference files]
|
|
160
|
-
|
|
161
|
-
## Verification
|
|
162
|
-
[verification command]" --max-iterations [N] --completion-promise "TADA"
|
|
145
|
+
## [Date] - US-001
|
|
146
|
+
- What was implemented
|
|
147
|
+
- Files changed
|
|
148
|
+
- **Learnings for future iterations:**
|
|
149
|
+
- Patterns discovered
|
|
150
|
+
- Gotchas encountered
|
|
151
|
+
---
|
|
163
152
|
```
|
|
164
153
|
|
|
165
|
-
|
|
154
|
+
The `## Codebase Patterns` section at the top is read first by each iteration to avoid repeating mistakes.
|
|
166
155
|
|
|
167
|
-
|
|
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.
|
|
156
|
+
## Compatibility with Existing Skills
|
|
172
157
|
|
|
173
|
-
|
|
158
|
+
### ralph-skills:prd (marketplace)
|
|
174
159
|
|
|
175
|
-
|
|
160
|
+
- Our prd.json output uses the EXACT same format
|
|
161
|
+
- User can generate PRD with `/ralph-skills:prd`, then use our interview to generate the loop command
|
|
162
|
+
- Or use our interview to generate both PRD and loop command
|
|
176
163
|
|
|
177
|
-
|
|
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.
|
|
164
|
+
### ralph-skills:ralph (marketplace)
|
|
181
165
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
Fix 3 P1 + 7 P2 responsive issues based on the audit report.
|
|
166
|
+
- Our loop prompt follows the same pattern as ralph-skills prompt.md
|
|
167
|
+
- Same prd.json format, same progress.txt format
|
|
168
|
+
- Same `passes: true/false` tracking, same commit convention
|
|
169
|
+
- Same `<promise>COMPLETE</promise>` completion signal
|
|
187
170
|
|
|
188
|
-
|
|
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
|
|
171
|
+
### Official ralph-loop plugin (claude-plugins-official)
|
|
194
172
|
|
|
195
|
-
|
|
196
|
-
-
|
|
197
|
-
...
|
|
198
|
-
|
|
199
|
-
## Command
|
|
200
|
-
` ` `
|
|
201
|
-
/ralph-loop:ralph-loop "..." --max-iterations 25 --completion-promise "TADA"
|
|
202
|
-
` ` `
|
|
203
|
-
|
|
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
|
|
209
|
-
```
|
|
173
|
+
- If the official plugin is installed, this interview works with its stop hook
|
|
174
|
+
- PRD and progress files work with either stop hook
|
|
210
175
|
|
|
211
176
|
## Rules
|
|
212
177
|
|
|
213
178
|
- **No subjective completion criteria**: Banned phrases: "works well", "looks clean", "properly done."
|
|
214
|
-
- **No prompt without verification**: At least one automated check
|
|
179
|
+
- **No prompt without verification**: At least one automated check is mandatory.
|
|
215
180
|
- **No missing escape hatch**: Every prompt MUST have a "When Stuck" section.
|
|
216
|
-
- **No oversized
|
|
217
|
-
- **Always
|
|
181
|
+
- **No oversized stories**: Each story must be completable in ONE iteration. Split if too big.
|
|
182
|
+
- **Always use prd.json format**: Ensures compatibility with ralph-skills ecosystem.
|
|
183
|
+
- **Default promise is COMPLETE**: Use `<promise>COMPLETE</promise>` to match ralph-skills convention.
|
|
218
184
|
|
|
219
185
|
## Conversation Flow
|
|
220
186
|
|
|
221
|
-
### Standard Flow
|
|
222
|
-
|
|
223
187
|
```
|
|
224
|
-
[User] ->
|
|
225
|
-
[Assistant] ->
|
|
188
|
+
[User] -> /ralph-interview "build X feature"
|
|
189
|
+
[Assistant] -> Interview questions (1 round, skip if context is sufficient)
|
|
226
190
|
[User] -> Answers
|
|
227
|
-
[Assistant] ->
|
|
191
|
+
[Assistant] -> Shows PRD briefly, asks "Ready?"
|
|
228
192
|
[User] -> "y"
|
|
229
|
-
[Assistant] -> Writes
|
|
193
|
+
[Assistant] -> Writes files + activates loop + starts US-001 IN THE SAME RESPONSE
|
|
230
194
|
```
|
|
231
195
|
|
|
232
|
-
### Quick-Run
|
|
196
|
+
### Quick-Run
|
|
233
197
|
|
|
234
198
|
If the user includes "run immediately", "just do it", "run it", "바로 실행", "바로 시작", or "--run":
|
|
199
|
+
Skip the "Ready?" prompt. Go straight to activation after showing the PRD briefly.
|
|
235
200
|
|
|
236
|
-
|
|
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.
|
|
240
|
-
|
|
241
|
-
### Execution — MANDATORY SKILL INVOCATION
|
|
201
|
+
## Activation Sequence
|
|
242
202
|
|
|
243
|
-
When the user confirms
|
|
203
|
+
When the user confirms (or quick-run), execute ALL of these steps in a SINGLE response. Do NOT stop between steps.
|
|
244
204
|
|
|
245
|
-
|
|
246
|
-
2. Actually invoke the ralph-loop skill to start the loop
|
|
205
|
+
### Step 1: Write prd.json via Bash
|
|
247
206
|
|
|
248
|
-
|
|
207
|
+
```bash
|
|
208
|
+
cat > prd.json << 'EOF'
|
|
209
|
+
{ ... generated PRD ... }
|
|
210
|
+
EOF
|
|
211
|
+
```
|
|
249
212
|
|
|
250
|
-
|
|
251
|
-
- Writing files and saying "ready" or "set up"
|
|
252
|
-
- Telling the user to copy-paste
|
|
213
|
+
### Step 2: Write progress.txt via Bash
|
|
253
214
|
|
|
254
|
-
|
|
215
|
+
```bash
|
|
216
|
+
cat > progress.txt << 'EOF'
|
|
217
|
+
## Codebase Patterns
|
|
218
|
+
(none yet)
|
|
219
|
+
EOF
|
|
220
|
+
```
|
|
255
221
|
|
|
256
|
-
|
|
257
|
-
- Then invoke ralph-loop skill so the loop actually starts
|
|
222
|
+
### Step 3: Activate the stop hook via Bash
|
|
258
223
|
|
|
259
|
-
|
|
224
|
+
Write the ralph-loop state file that makes the stop hook intercept session exits:
|
|
260
225
|
|
|
261
|
-
|
|
226
|
+
```bash
|
|
227
|
+
mkdir -p .claude
|
|
228
|
+
cat > .claude/ralph-loop.local.md << 'EOF'
|
|
229
|
+
---
|
|
230
|
+
active: true
|
|
231
|
+
iteration: 1
|
|
232
|
+
session_id:
|
|
233
|
+
max_iterations: <N>
|
|
234
|
+
completion_promise: "COMPLETE"
|
|
235
|
+
started_at: "<now>"
|
|
236
|
+
---
|
|
262
237
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
238
|
+
Read prd.json for task plan. Read progress.txt for status (Codebase Patterns first).
|
|
239
|
+
Check correct branch from branchName. If not on it, create from main.
|
|
240
|
+
Pick highest priority story where passes is false.
|
|
241
|
+
Implement that ONE story.
|
|
242
|
+
Run verification: <command>.
|
|
243
|
+
On failure: fix and retry, max 3 times.
|
|
244
|
+
On success: commit 'feat: [Story ID] - [Title]'.
|
|
245
|
+
Update prd.json: set passes to true. Append to progress.txt with learnings.
|
|
246
|
+
If ALL stories pass: <promise>COMPLETE</promise>.
|
|
247
|
+
When stuck: set notes in prd.json, skip to next story.
|
|
248
|
+
EOF
|
|
267
249
|
```
|
|
268
250
|
|
|
269
|
-
|
|
251
|
+
### Step 4: START WORKING ON US-001 IMMEDIATELY
|
|
270
252
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
253
|
+
This is the critical step. After writing files, you MUST begin actual work in the SAME response:
|
|
254
|
+
|
|
255
|
+
1. Read the prd.json you just wrote
|
|
256
|
+
2. Create/checkout the branch from branchName
|
|
257
|
+
3. Pick the first story (US-001)
|
|
258
|
+
4. Implement it — write real code, make real changes
|
|
259
|
+
5. Run the verification command
|
|
260
|
+
6. Commit the changes
|
|
261
|
+
7. Update prd.json (set passes: true)
|
|
262
|
+
8. Append to progress.txt
|
|
263
|
+
|
|
264
|
+
Do NOT:
|
|
265
|
+
|
|
266
|
+
- Say "loop is now active" and stop
|
|
267
|
+
- Say "starting work on US-001" and stop
|
|
268
|
+
- Print a summary and wait for user input
|
|
269
|
+
- Ask if the user wants to proceed
|
|
274
270
|
|
|
275
|
-
|
|
271
|
+
DO:
|
|
276
272
|
|
|
277
|
-
|
|
273
|
+
- Actually write code
|
|
274
|
+
- Actually run tests
|
|
275
|
+
- Actually commit
|
|
276
|
+
- The stop hook will handle continuation to US-002 when you finish
|