ralph-cli-sandboxed 0.4.2 → 0.5.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.
@@ -1,11 +1,26 @@
1
1
  # PRD Generator Guide
2
2
 
3
- This guide explains how to convert any document (specs, user stories, detailed PRDs) into a `prd.json` file that Ralph can execute.
3
+ This guide explains how to convert any document (specs, user stories, detailed PRDs) into a `prd.yaml` file that Ralph can execute.
4
+
5
+ > **Note:** Ralph now supports YAML format (recommended) and JSON format (legacy). New projects should use `prd.yaml`. Existing projects can migrate using `ralph prd convert`.
4
6
 
5
7
  ## Overview
6
8
 
7
9
  Ralph's PRD format is intentionally simple - each item should be completable in a single AI iteration. The challenge is converting complex, multi-level documents into this flat, actionable format.
8
10
 
11
+ ```yaml
12
+ - category: feature
13
+ description: Imperative description of what to implement
14
+ steps:
15
+ - Concrete action 1
16
+ - Concrete action 2
17
+ - Verification step
18
+ passes: false
19
+ ```
20
+
21
+ <details>
22
+ <summary>JSON format (legacy)</summary>
23
+
9
24
  ```json
10
25
  {
11
26
  "category": "feature",
@@ -18,6 +33,7 @@ Ralph's PRD format is intentionally simple - each item should be completable in
18
33
  "passes": false
19
34
  }
20
35
  ```
36
+ </details>
21
37
 
22
38
  ## Input Document Types
23
39
 
@@ -148,30 +164,27 @@ Steps tell the AI **how** to implement and **how** to verify.
148
164
  ### Step Patterns by Category
149
165
 
150
166
  **Feature:**
151
- ```json
152
- "steps": [
153
- "Create [file/component] with [functionality]",
154
- "Implement [specific behavior]",
155
- "Run [test/build command] and verify success"
156
- ]
167
+ ```yaml
168
+ steps:
169
+ - Create [file/component] with [functionality]
170
+ - Implement [specific behavior]
171
+ - Run [test/build command] and verify success
157
172
  ```
158
173
 
159
174
  **Bugfix:**
160
- ```json
161
- "steps": [
162
- "Identify root cause of [bug] in [location]",
163
- "Fix by [specific change]",
164
- "Add test case for regression, run tests"
165
- ]
175
+ ```yaml
176
+ steps:
177
+ - Identify root cause of [bug] in [location]
178
+ - Fix by [specific change]
179
+ - Add test case for regression, run tests
166
180
  ```
167
181
 
168
182
  **Setup:**
169
- ```json
170
- "steps": [
171
- "Run [init/install command]",
172
- "Configure [settings] in [file]",
173
- "Verify with [check command]"
174
- ]
183
+ ```yaml
184
+ steps:
185
+ - Run [init/install command]
186
+ - Configure [settings] in [file]
187
+ - Verify with [check command]
175
188
  ```
176
189
 
177
190
  ## Referencing External Documents
@@ -179,15 +192,12 @@ Steps tell the AI **how** to implement and **how** to verify.
179
192
  When your source document has code examples or detailed specs, reference them instead of copying:
180
193
 
181
194
  ### Good
182
- ```json
183
- {
184
- "description": "Implement WebSocket transport (Task 4.4.1)",
185
- "steps": [
186
- "Create internal/mcp/transport/websocket.go with WebSocketTransport struct",
187
- "Follow implementation pattern in lazymcp-prd.md section 4.4.1",
188
- "Run `go build ./...` and verify compilation"
189
- ]
190
- }
195
+ ```yaml
196
+ - description: Implement WebSocket transport (Task 4.4.1)
197
+ steps:
198
+ - Create internal/mcp/transport/websocket.go with WebSocketTransport struct
199
+ - Follow implementation pattern in lazymcp-prd.md section 4.4.1
200
+ - Run `go build ./...` and verify compilation
191
201
  ```
192
202
 
193
203
  ### Why Reference?
@@ -214,17 +224,14 @@ When your source document has code examples or detailed specs, reference them in
214
224
  ```
215
225
 
216
226
  **Converted:**
217
- ```json
218
- {
219
- "category": "feature",
220
- "description": "Implement stdio transport process management (Task 4.2.1)",
221
- "steps": [
222
- "Create internal/mcp/transport/stdio.go with StdioTransport struct",
223
- "Manage subprocess with exec.Command, setup stdin/stdout/stderr pipes",
224
- "See lazymcp-prd.md section 4.2.1 for implementation details"
225
- ],
226
- "passes": false
227
- }
227
+ ```yaml
228
+ - category: feature
229
+ description: Implement stdio transport process management (Task 4.2.1)
230
+ steps:
231
+ - Create internal/mcp/transport/stdio.go with StdioTransport struct
232
+ - Manage subprocess with exec.Command, setup stdin/stdout/stderr pipes
233
+ - See lazymcp-prd.md section 4.2.1 for implementation details
234
+ passes: false
228
235
  ```
229
236
 
230
237
  ### Example 2: User Story
@@ -240,37 +247,30 @@ Acceptance criteria:
240
247
  ```
241
248
 
242
249
  **Converted (3 items):**
243
- ```json
244
- {
245
- "category": "feature",
246
- "description": "Add password reset request endpoint POST /api/auth/reset-request",
247
- "steps": [
248
- "Create endpoint that accepts email address",
249
- "Generate secure token, store with expiry (1 hour)",
250
- "Queue email with reset link containing token"
251
- ],
252
- "passes": false
253
- },
254
- {
255
- "category": "feature",
256
- "description": "Implement password reset email sending",
257
- "steps": [
258
- "Create email template with reset link",
259
- "Integrate with email service (SendGrid/SES)",
260
- "Test email delivery in development"
261
- ],
262
- "passes": false
263
- },
264
- {
265
- "category": "feature",
266
- "description": "Add password reset completion endpoint POST /api/auth/reset-complete",
267
- "steps": [
268
- "Validate token exists and not expired",
269
- "Update user password with new value",
270
- "Invalidate token, return success response"
271
- ],
272
- "passes": false
273
- }
250
+ ```yaml
251
+ - category: feature
252
+ description: Add password reset request endpoint POST /api/auth/reset-request
253
+ steps:
254
+ - Create endpoint that accepts email address
255
+ - Generate secure token, store with expiry (1 hour)
256
+ - Queue email with reset link containing token
257
+ passes: false
258
+
259
+ - category: feature
260
+ description: Implement password reset email sending
261
+ steps:
262
+ - Create email template with reset link
263
+ - Integrate with email service (SendGrid/SES)
264
+ - Test email delivery in development
265
+ passes: false
266
+
267
+ - category: feature
268
+ description: Add password reset completion endpoint POST /api/auth/reset-complete
269
+ steps:
270
+ - Validate token exists and not expired
271
+ - Update user password with new value
272
+ - Invalidate token, return success response
273
+ passes: false
274
274
  ```
275
275
 
276
276
  ### Example 3: Bug Report
@@ -286,22 +286,49 @@ Steps to reproduce:
286
286
  ```
287
287
 
288
288
  **Converted:**
289
- ```json
290
- {
291
- "category": "bugfix",
292
- "description": "Fix crash when uploading files larger than 10MB",
293
- "steps": [
294
- "Add file size validation before upload (max 10MB with clear error)",
295
- "Implement streaming upload for large files to avoid memory issues",
296
- "Test with 15MB file - should show error or stream successfully"
297
- ],
298
- "passes": false
299
- }
289
+ ```yaml
290
+ - category: bugfix
291
+ description: Fix crash when uploading files larger than 10MB
292
+ steps:
293
+ - Add file size validation before upload (max 10MB with clear error)
294
+ - Implement streaming upload for large files to avoid memory issues
295
+ - Test with 15MB file - should show error or stream successfully
296
+ passes: false
300
297
  ```
301
298
 
302
299
  ## AI Conversion Prompt
303
300
 
304
- Use this prompt to have an AI convert documents to prd.json:
301
+ Use this prompt to have an AI convert documents to prd.yaml:
302
+
303
+ ```
304
+ Convert the following document into a Ralph prd.yaml file.
305
+
306
+ Rules:
307
+ 1. Each sub-task or atomic feature = one PRD item
308
+ 2. Use categories: setup, feature, bugfix, refactor, docs, test, release, config, ui, integration
309
+ 3. Descriptions: imperative verb + specific what + context
310
+ 4. Steps: 2-4 concrete actions + verification step
311
+ 5. Reference source document sections instead of copying code
312
+ 6. Order items by logical execution sequence
313
+ 7. Set all "passes: false"
314
+
315
+ Output format (YAML):
316
+ - category: ...
317
+ description: ...
318
+ steps:
319
+ - ...
320
+ - ...
321
+ - ...
322
+ passes: false
323
+
324
+ Document to convert:
325
+ ---
326
+ [paste document here]
327
+ ---
328
+ ```
329
+
330
+ <details>
331
+ <summary>AI Prompt for JSON format (legacy)</summary>
305
332
 
306
333
  ```
307
334
  Convert the following document into a Ralph prd.json file.
@@ -330,10 +357,11 @@ Document to convert:
330
357
  [paste document here]
331
358
  ---
332
359
  ```
360
+ </details>
333
361
 
334
362
  ## Validation Checklist
335
363
 
336
- After generating prd.json, verify:
364
+ After generating prd.yaml, verify:
337
365
 
338
366
  - [ ] Each item is completable in one AI iteration
339
367
  - [ ] Descriptions start with imperative verbs
@@ -355,7 +383,7 @@ After generating prd.json, verify:
355
383
 
356
384
  | Mistake | Problem | Fix |
357
385
  |---------|---------|-----|
358
- | Copy-pasting code into steps | JSON too large, hard to read | Reference source document |
386
+ | Copy-pasting code into steps | PRD file too large, hard to read | Reference source document |
359
387
  | Vague descriptions | AI doesn't know what to do | Be specific about what and where |
360
388
  | Missing verification | No way to confirm completion | Add test/build/check step |
361
389
  | Too many steps | Overwhelming, hard to track | Max 4-5 steps per item |
@@ -374,21 +402,19 @@ When running in Docker/Podman sandboxes, certain operations can cause the iterat
374
402
  - Telemetry/update checks may timeout on restricted networks
375
403
 
376
404
  **Bad:**
377
- ```json
378
- "steps": [
379
- "Create the component",
380
- "Run `npm run dev` and verify server starts on port 3000",
381
- "Open browser and check the page renders"
382
- ]
405
+ ```yaml
406
+ steps:
407
+ - Create the component
408
+ - Run `npm run dev` and verify server starts on port 3000
409
+ - Open browser and check the page renders
383
410
  ```
384
411
 
385
412
  **Good:**
386
- ```json
387
- "steps": [
388
- "Create the component",
389
- "Run `npm run build` and verify compilation succeeds",
390
- "Run `npm run lint` to check for errors"
391
- ]
413
+ ```yaml
414
+ steps:
415
+ - Create the component
416
+ - Run `npm run build` and verify compilation succeeds
417
+ - Run `npm run lint` to check for errors
392
418
  ```
393
419
 
394
420
  ### Verification Alternatives
@@ -420,3 +446,47 @@ Be aware that sandboxed environments may have restricted network access:
420
446
  }
421
447
  }
422
448
  ```
449
+
450
+ ## Migrating from JSON to YAML
451
+
452
+ If you have an existing `prd.json` file, you can migrate to YAML format using the convert command:
453
+
454
+ ```bash
455
+ ralph prd convert
456
+ ```
457
+
458
+ This will:
459
+ 1. Read your `.ralph/prd.json` file
460
+ 2. Convert it to YAML format
461
+ 3. Write the result to `.ralph/prd.yaml`
462
+ 4. Rename the original to `prd.json.pre-yaml` as a backup
463
+
464
+ ### Migration Options
465
+
466
+ ```bash
467
+ # Preview conversion without making changes
468
+ ralph prd convert --dry-run
469
+
470
+ # Overwrite existing prd.yaml if it exists
471
+ ralph prd convert --force
472
+ ```
473
+
474
+ ### Reverting to JSON
475
+
476
+ If you need to revert to JSON format:
477
+
478
+ ```bash
479
+ # Remove YAML file and restore JSON backup
480
+ rm .ralph/prd.yaml
481
+ mv .ralph/prd.json.pre-yaml .ralph/prd.json
482
+ ```
483
+
484
+ ### Why YAML?
485
+
486
+ YAML is now the recommended format for PRD files because:
487
+ - **More readable** - No quotes around strings, cleaner syntax
488
+ - **Easier to edit** - Simpler structure for manual edits
489
+ - **Better diffs** - Changes are easier to review in version control
490
+ - **Comments allowed** - You can add notes to your PRD items
491
+
492
+ Both formats work identically with Ralph. If both `prd.yaml` and `prd.json` exist, YAML takes precedence.
@@ -76,7 +76,7 @@ Set up a Ralph CLI project based on the configuration above.
76
76
  - Configure notifications if selected (see Reference below)
77
77
  - Configure daemon events if selected (see Reference below)
78
78
  3. Regenerate Docker files: `ralph docker init <language>`
79
- 4. Create `.ralph/prd.json` with tasks based on the concept
79
+ 4. Create `.ralph/prd.yaml` with tasks based on the concept
80
80
  5. Verify with `ralph list` and `ralph status`
81
81
  6. Start daemon on host (if using notifications): `ralph daemon start`
82
82
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ralph-cli-sandboxed",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "description": "AI-driven development automation CLI for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,7 +33,8 @@
33
33
  "ink-text-input": "^6.0.0",
34
34
  "openai": "^4.77.0",
35
35
  "react": "^18.3.1",
36
- "readline": "^1.3.0"
36
+ "readline": "^1.3.0",
37
+ "yaml": "^2.8.2"
37
38
  },
38
39
  "devDependencies": {
39
40
  "@types/node": "^20.0.0",