prd-parser 0.2.0 → 0.3.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 +175 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -242,8 +242,9 @@ prd-parser parse ./prd.md --testing comprehensive # or minimal, standard
|
|
|
242
242
|
# Preview without creating (dry run)
|
|
243
243
|
prd-parser parse ./prd.md --dry-run
|
|
244
244
|
|
|
245
|
-
#
|
|
246
|
-
prd-parser parse ./prd.md --
|
|
245
|
+
# Save/resume from checkpoint (useful for large PRDs)
|
|
246
|
+
prd-parser parse ./prd.md --save-json checkpoint.json
|
|
247
|
+
prd-parser parse ./prd.md --from-json checkpoint.json
|
|
247
248
|
```
|
|
248
249
|
|
|
249
250
|
### Full Options
|
|
@@ -257,17 +258,19 @@ prd-parser parse ./prd.md --include-context --include-testing
|
|
|
257
258
|
| `--testing` | | comprehensive | Testing level (minimal/standard/comprehensive) |
|
|
258
259
|
| `--llm` | `-l` | auto | LLM provider (auto/claude-cli/codex-cli/anthropic-api) |
|
|
259
260
|
| `--model` | `-m` | | Model to use (provider-specific) |
|
|
260
|
-
| `--multi-stage` | | | Force multi-stage parsing |
|
|
261
|
-
| `--single-shot` | | | Force single-shot parsing |
|
|
261
|
+
| `--multi-stage` | | false | Force multi-stage parsing |
|
|
262
|
+
| `--single-shot` | | false | Force single-shot parsing |
|
|
262
263
|
| `--smart-threshold` | | 300 | Line count for auto multi-stage (0 to disable) |
|
|
263
264
|
| `--validate` | | false | Run validation pass to check for gaps |
|
|
265
|
+
| `--no-review` | | false | Disable automatic LLM review pass (review ON by default) |
|
|
266
|
+
| `--interactive` | | false | Human-in-the-loop mode (review epics before task generation) |
|
|
264
267
|
| `--subtask-model` | | | Model for subtasks in multi-stage (can be faster/cheaper) |
|
|
265
268
|
| `--output` | `-o` | beads | Output adapter (beads/json) |
|
|
266
269
|
| `--output-path` | | | Output path for JSON adapter |
|
|
267
|
-
| `--working-dir` | `-w` | . | Working directory for beads |
|
|
268
270
|
| `--dry-run` | | false | Preview without creating items |
|
|
269
|
-
| `--
|
|
270
|
-
| `--
|
|
271
|
+
| `--from-json` | | | Resume from saved JSON checkpoint (skip LLM) |
|
|
272
|
+
| `--save-json` | | | Save generated JSON to file (for resume) |
|
|
273
|
+
| `--config` | | | Config file path (default: .prd-parser.yaml) |
|
|
271
274
|
|
|
272
275
|
### Smart Parsing (Default Behavior)
|
|
273
276
|
|
|
@@ -304,6 +307,164 @@ or
|
|
|
304
307
|
• Auth API built but no login page to test it
|
|
305
308
|
```
|
|
306
309
|
|
|
310
|
+
### Review Pass (Default)
|
|
311
|
+
|
|
312
|
+
By default, prd-parser runs an automatic review pass after generation that checks for and fixes structural issues:
|
|
313
|
+
|
|
314
|
+
- **Missing "Project Foundation" epic** as Epic 1 (setup should come first)
|
|
315
|
+
- **Feature epics not depending on Epic 1** (all work depends on setup)
|
|
316
|
+
- **Missing setup tasks** in foundation epic
|
|
317
|
+
- **Incorrect dependency chains** (setup → backend → frontend)
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
# Review is on by default
|
|
321
|
+
prd-parser parse ./prd.md
|
|
322
|
+
|
|
323
|
+
# See: "Reviewing structure..."
|
|
324
|
+
# See: "✓ Review fixed issues: Added Project Foundation epic..."
|
|
325
|
+
# Or: "✓ Review passed - no changes needed"
|
|
326
|
+
|
|
327
|
+
# Disable if you want raw output
|
|
328
|
+
prd-parser parse ./prd.md --no-review
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Interactive Mode
|
|
332
|
+
|
|
333
|
+
For human-in-the-loop review during generation:
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
prd-parser parse docs/prd.md --interactive
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
In interactive mode, you'll review epics after Stage 1 before task generation continues:
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
=== Stage 1 Complete: 4 Epics Generated ===
|
|
343
|
+
|
|
344
|
+
Proposed Epics:
|
|
345
|
+
1. Project Foundation (depends on: none)
|
|
346
|
+
Initialize Next.js, Convex, Clerk setup
|
|
347
|
+
2. Voice Infrastructure (depends on: 1)
|
|
348
|
+
Telnyx phone system integration
|
|
349
|
+
3. AI Conversations (depends on: 1)
|
|
350
|
+
LFM 2.5 integration for call handling
|
|
351
|
+
4. CRM Integration (depends on: 1)
|
|
352
|
+
Follow Up Boss sync
|
|
353
|
+
|
|
354
|
+
[Enter] continue, [e] edit in $EDITOR, [r] regenerate, [a] add epic:
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
**Options:**
|
|
358
|
+
- **Enter** - Accept epics and continue to task generation
|
|
359
|
+
- **e** - Open epics in your `$EDITOR` for manual editing
|
|
360
|
+
- **r** - Regenerate epics from scratch
|
|
361
|
+
- **a** - Add a new epic
|
|
362
|
+
|
|
363
|
+
Interactive mode skips the automatic review pass since you are the reviewer.
|
|
364
|
+
|
|
365
|
+
### Checkpoint Workflow (Manual Review)
|
|
366
|
+
|
|
367
|
+
For full manual control over the generated structure:
|
|
368
|
+
|
|
369
|
+
**Step 1: Generate Draft**
|
|
370
|
+
```bash
|
|
371
|
+
prd-parser parse docs/prd.md --save-json draft.json --dry-run
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
**Step 2: Review and Edit**
|
|
375
|
+
|
|
376
|
+
Open `draft.json` in your editor. You can:
|
|
377
|
+
- Reorder epics (change array order)
|
|
378
|
+
- Add/remove epics, tasks, or subtasks
|
|
379
|
+
- Fix dependencies
|
|
380
|
+
- Adjust priorities and estimates
|
|
381
|
+
|
|
382
|
+
**Step 3: Create from Edited Draft**
|
|
383
|
+
```bash
|
|
384
|
+
prd-parser parse --from-json draft.json
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
The PRD file argument is optional when using `--from-json`.
|
|
388
|
+
|
|
389
|
+
**Auto-Recovery**: If creation fails mid-way, prd-parser saves a checkpoint to `/tmp/prd-parser-checkpoint.json`. Retry with:
|
|
390
|
+
```bash
|
|
391
|
+
prd-parser parse --from-json /tmp/prd-parser-checkpoint.json
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
## Refining Issues After Generation
|
|
395
|
+
|
|
396
|
+
After parsing, you may find issues that are misaligned with your product vision. The `refine` command lets you correct an issue and automatically propagate fixes to related issues.
|
|
397
|
+
|
|
398
|
+
### Basic Usage
|
|
399
|
+
|
|
400
|
+
```bash
|
|
401
|
+
# Correct an epic that went off-track
|
|
402
|
+
prd-parser refine test-e6 --feedback "RealHerd is voice-first lead intelligence, not a CRM with pipeline management"
|
|
403
|
+
|
|
404
|
+
# Preview changes without applying
|
|
405
|
+
prd-parser refine test-e3t2 --feedback "Should use OpenRouter, not direct OpenAI" --dry-run
|
|
406
|
+
|
|
407
|
+
# Include PRD for better context
|
|
408
|
+
prd-parser refine test-e6 --feedback "Focus on conversation insights" --prd docs/prd.md
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
### How It Works
|
|
412
|
+
|
|
413
|
+
1. **Analyze**: LLM identifies wrong concepts in the target issue (e.g., "pipeline tracking", "deal stages")
|
|
414
|
+
2. **Correct**: Generates corrected version with right concepts ("conversation insights", "activity visibility")
|
|
415
|
+
3. **Scan**: Searches ALL issues (across all epics) for the same wrong concepts
|
|
416
|
+
4. **Propagate**: Regenerates affected issues with correction context
|
|
417
|
+
5. **Update**: Applies changes via `bd update`
|
|
418
|
+
|
|
419
|
+
### Options
|
|
420
|
+
|
|
421
|
+
| Flag | Default | Description |
|
|
422
|
+
|------|---------|-------------|
|
|
423
|
+
| `--feedback`, `-f` | required | What's wrong and how to fix it |
|
|
424
|
+
| `--cascade` | true | Also update children of target issue |
|
|
425
|
+
| `--scan-all` | true | Scan all issues for same misalignment |
|
|
426
|
+
| `--dry-run` | false | Preview changes without applying |
|
|
427
|
+
| `--prd` | | Path to PRD file for context |
|
|
428
|
+
|
|
429
|
+
### Example Output
|
|
430
|
+
|
|
431
|
+
```
|
|
432
|
+
$ prd-parser refine test-e6 --feedback "RealHerd is voice-first, not CRM"
|
|
433
|
+
|
|
434
|
+
Loading issue test-e6...
|
|
435
|
+
Found: Brokerage Dashboard & Reporting
|
|
436
|
+
|
|
437
|
+
Analyzing misalignment...
|
|
438
|
+
|
|
439
|
+
Identified misalignment:
|
|
440
|
+
- pipeline tracking
|
|
441
|
+
- deal management
|
|
442
|
+
- contract stages
|
|
443
|
+
|
|
444
|
+
Corrected version:
|
|
445
|
+
Title: Agent Activity Dashboard & Conversation Insights
|
|
446
|
+
Description: Real-time visibility into agent conversations...
|
|
447
|
+
|
|
448
|
+
Scanning for affected issues...
|
|
449
|
+
Found 3 children
|
|
450
|
+
Found 2 issues with similar misalignment
|
|
451
|
+
|
|
452
|
+
--- Changes to apply ---
|
|
453
|
+
Target: test-e6
|
|
454
|
+
+ test-e6t3: Pipeline Overview Component
|
|
455
|
+
+ test-e6t4: Deal Tracking Interface
|
|
456
|
+
+ test-e3t5: CRM Pipeline Sync
|
|
457
|
+
|
|
458
|
+
Applying corrections...
|
|
459
|
+
✓ Updated test-e6
|
|
460
|
+
✓ Updated test-e6t3
|
|
461
|
+
✓ Updated test-e6t4
|
|
462
|
+
✓ Updated test-e3t5
|
|
463
|
+
|
|
464
|
+
--- Summary ---
|
|
465
|
+
Updated: 1 target + 4 related issues
|
|
466
|
+
```
|
|
467
|
+
|
|
307
468
|
## LLM Providers
|
|
308
469
|
|
|
309
470
|
### Zero-Config (Recommended)
|
|
@@ -396,14 +557,18 @@ prd-parser/
|
|
|
396
557
|
├── internal/
|
|
397
558
|
│ ├── core/ # Core types and orchestration
|
|
398
559
|
│ │ ├── types.go # Hierarchical structs (guardrails)
|
|
399
|
-
│ │ ├── prompts.go #
|
|
400
|
-
│ │
|
|
560
|
+
│ │ ├── prompts.go # Single-shot system/user prompts
|
|
561
|
+
│ │ ├── stage_prompts.go # Multi-stage prompts (Stages 1-3)
|
|
562
|
+
│ │ ├── parser.go # Single-shot LLM → Output orchestration
|
|
563
|
+
│ │ ├── multistage.go # Multi-stage parallel parser
|
|
564
|
+
│ │ └── validate.go # Validation pass logic
|
|
401
565
|
│ ├── llm/ # LLM adapters
|
|
402
566
|
│ │ ├── adapter.go # Interface definition
|
|
403
567
|
│ │ ├── claude_cli.go # Claude Code CLI adapter
|
|
404
568
|
│ │ ├── codex_cli.go # Codex CLI adapter
|
|
405
569
|
│ │ ├── anthropic_api.go # API fallback
|
|
406
|
-
│ │
|
|
570
|
+
│ │ ├── detector.go # Auto-detection logic
|
|
571
|
+
│ │ └── multistage_generator.go # Multi-stage LLM calls
|
|
407
572
|
│ └── output/ # Output adapters
|
|
408
573
|
│ ├── adapter.go # Interface definition
|
|
409
574
|
│ ├── beads.go # beads issue tracker
|