speccrew 0.3.1 → 0.3.2
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.
|
@@ -175,12 +175,114 @@ Pass the following context to the Skill:
|
|
|
175
175
|
- Pre-skill assessment results (clarification_status, expected_complexity, etc.)
|
|
176
176
|
- Clarification Q&A records (if any)
|
|
177
177
|
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Phase 3: Sub-PRD Worker Dispatch (Master-Sub Structure Only)
|
|
181
|
+
|
|
182
|
+
**IF the Skill output includes a Sub-PRD Dispatch Plan (from Step 12c), execute this phase.**
|
|
183
|
+
**IF Single PRD structure, skip to Phase 4.**
|
|
184
|
+
|
|
185
|
+
After the Skill generates the Master PRD and outputs the dispatch plan, the PM Agent takes over to generate Sub-PRDs in parallel using worker agents.
|
|
186
|
+
|
|
187
|
+
### 3.1 Read Dispatch Plan
|
|
188
|
+
|
|
189
|
+
From the Skill's Step 12c output, collect:
|
|
190
|
+
- `feature_name`: System-level feature name
|
|
191
|
+
- `template_path`: Path to PRD-TEMPLATE.md
|
|
192
|
+
- `master_prd_path`: Path to the generated Master PRD
|
|
193
|
+
- `output_dir`: Directory for Sub-PRD files (same as Master PRD directory)
|
|
194
|
+
- Module list with context for each module:
|
|
195
|
+
- `module_name`, `module_key`, `module_scope`, `module_entities`
|
|
196
|
+
- `module_user_stories`, `module_requirements`, `module_features`
|
|
197
|
+
- `module_dependencies`
|
|
198
|
+
|
|
199
|
+
### 3.2 Dispatch Workers
|
|
200
|
+
|
|
201
|
+
Invoke `speccrew-task-worker` agents in parallel, one per module:
|
|
202
|
+
|
|
203
|
+
Each worker receives:
|
|
204
|
+
- `skill_path`: `speccrew-pm-sub-prd-generate/SKILL.md`
|
|
205
|
+
- `context`:
|
|
206
|
+
- `module_name`: Module name (e.g., "Customer Management")
|
|
207
|
+
- `module_key`: Module identifier for file naming (e.g., "customer")
|
|
208
|
+
- `module_scope`: What this module covers
|
|
209
|
+
- `module_entities`: Core business entities
|
|
210
|
+
- `module_user_stories`: Module-specific user stories
|
|
211
|
+
- `module_requirements`: Module-specific functional requirements (P0/P1/P2)
|
|
212
|
+
- `module_features`: Feature Breakdown entries for this module
|
|
213
|
+
- `module_dependencies`: Dependencies on other modules
|
|
214
|
+
- `master_prd_path`: Path to the Master PRD
|
|
215
|
+
- `feature_name`: System-level feature name
|
|
216
|
+
- `template_path`: Path to PRD-TEMPLATE.md
|
|
217
|
+
- `output_path`: `{output_dir}/{feature_name}-sub-{module_key}.md`
|
|
218
|
+
|
|
219
|
+
**Parallel execution pattern:**
|
|
220
|
+
```
|
|
221
|
+
Worker 1: Module "customer" → crm-system-sub-customer.md
|
|
222
|
+
Worker 2: Module "contact" → crm-system-sub-contact.md
|
|
223
|
+
Worker 3: Module "opportunity" → crm-system-sub-opportunity.md
|
|
224
|
+
...
|
|
225
|
+
Worker N: Module "{module-N}" → crm-system-sub-{module-N}.md
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
**All workers execute simultaneously.** Wait for all workers to complete before proceeding.
|
|
229
|
+
|
|
230
|
+
### 3.3 Collect Results
|
|
231
|
+
|
|
232
|
+
After all workers complete:
|
|
233
|
+
|
|
234
|
+
1. **Check worker results**: Verify each worker reported success
|
|
235
|
+
2. **List generated files**:
|
|
236
|
+
```
|
|
237
|
+
📊 Sub-PRD Generation Results:
|
|
238
|
+
├── Worker 1: {module-1} → ✅ Generated ({file_size})
|
|
239
|
+
├── Worker 2: {module-2} → ✅ Generated ({file_size})
|
|
240
|
+
├── Worker N: {module-N} → ✅ Generated ({file_size})
|
|
241
|
+
│
|
|
242
|
+
Total: N workers | Completed: X | Failed: Y
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
3. **Handle failures**: If any worker failed:
|
|
246
|
+
- Report which modules failed and why
|
|
247
|
+
- Re-dispatch failed modules (retry once)
|
|
248
|
+
- If retry fails, report to user for manual intervention
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Phase 4: Verification & Confirmation
|
|
253
|
+
|
|
254
|
+
### 4.1 Execute Verification Checklist
|
|
255
|
+
|
|
256
|
+
Return to the Skill's Step 12d for verification:
|
|
257
|
+
- Verify Master PRD exists and size > 2KB
|
|
258
|
+
- Verify all Sub-PRD files exist and each size > 3KB
|
|
259
|
+
- Verify Master PRD Sub-PRD Index matches actual files
|
|
260
|
+
- Verify each Sub-PRD contains Feature Breakdown (Section 3.4)
|
|
261
|
+
|
|
262
|
+
### 4.2 Request User Confirmation
|
|
263
|
+
|
|
264
|
+
Execute Skill's Step 12e to present summary and request user review.
|
|
265
|
+
|
|
266
|
+
### 4.3 Finalize PRD Stage (After User Confirmation)
|
|
267
|
+
|
|
268
|
+
After user confirms the PRD documents are correct:
|
|
269
|
+
|
|
270
|
+
1. Execute Skill's Step 13 to write progress files (update WORKFLOW-PROGRESS.json, set `01_prd.status` = `confirmed`)
|
|
271
|
+
2. Update all PRD document status lines from `📝 Draft` to `✅ Confirmed` with confirmation date using `search_replace`
|
|
272
|
+
3. Output completion message:
|
|
273
|
+
```
|
|
274
|
+
✅ PRD documents have been confirmed. PRD stage is complete.
|
|
275
|
+
When you are ready to proceed with Feature Design, please start a new conversation and invoke the Feature Designer Agent.
|
|
276
|
+
```
|
|
277
|
+
4. **END** — Do not proceed further. Do not invoke or suggest transitioning to the next stage agent.
|
|
278
|
+
|
|
178
279
|
# Deliverables
|
|
179
280
|
|
|
180
281
|
| Deliverable | Path | Notes |
|
|
181
282
|
|-------------|------|-------|
|
|
182
283
|
| PRD Document | `speccrew-workspace/iterations/{number}-{type}-{name}/01.prd/[feature-name]-prd.md` | Based on template from `speccrew-pm-requirement-analysis/templates/PRD-TEMPLATE.md` |
|
|
183
284
|
| Business Modeling (complex) | `speccrew-workspace/iterations/{number}-{type}-{name}/01.prd/[feature-name]-bizs-modeling.md` | ISA-95 six-stage modeling, only for complex requirements |
|
|
285
|
+
| Sub-PRD Documents (complex) | `speccrew-workspace/iterations/{number}-{type}-{name}/01.prd/[feature-name]-sub-[module].md` | One per module, generated by worker dispatch |
|
|
184
286
|
|
|
185
287
|
# Constraints
|
|
186
288
|
|
|
@@ -193,13 +295,15 @@ Pass the following context to the Skill:
|
|
|
193
295
|
**Must do:**
|
|
194
296
|
- Read business module list to confirm boundaries between requirements and existing features
|
|
195
297
|
- Use templates from `speccrew-pm-requirement-analysis/templates/`
|
|
196
|
-
- Explicitly prompt user for confirmation after PRD completion
|
|
298
|
+
- Explicitly prompt user for review and confirmation after PRD completion
|
|
197
299
|
- Execute Pre-Skill Requirement Assessment before invoking the Skill
|
|
198
300
|
- Pass clarification context and complexity assessment to the Skill
|
|
301
|
+
- For complex requirements (2+ modules), dispatch Sub-PRD generation to parallel workers using `speccrew-pm-sub-prd-generate/SKILL.md`
|
|
199
302
|
|
|
200
303
|
**Must not do:**
|
|
201
304
|
- Do not make technical solution decisions (that's speccrew-planner's responsibility)
|
|
202
305
|
- Do not skip manual confirmation to directly start the next stage
|
|
203
306
|
- Do not assume business rules on your own; clarify unclear requirements with the user
|
|
204
307
|
- Do not skip the clarification process, even when user provides detailed documents
|
|
308
|
+
- Do not automatically transition to or invoke the next stage agent (Feature Designer). The user will start the next stage in a new conversation window.
|
|
205
309
|
|
|
@@ -484,147 +484,158 @@ speccrew-workspace/iterations/{number}-{type}-{name}/01.product-requirement/
|
|
|
484
484
|
|
|
485
485
|
If the iteration directory does not exist, refer to the `000-sample` directory structure to create it.
|
|
486
486
|
|
|
487
|
-
## Step 12: Write Files
|
|
487
|
+
## Step 12: Write PRD Files
|
|
488
488
|
|
|
489
|
-
|
|
490
|
-
- **DO NOT put all module content into the Master PRD.**
|
|
491
|
-
- **Each Sub-PRD is a SEPARATE file containing ONLY that module's requirements.**
|
|
489
|
+
### Step 12a: Plan File List (MANDATORY FIRST STEP)
|
|
492
490
|
|
|
493
|
-
|
|
491
|
+
Before writing any file, create a complete list of ALL files to generate:
|
|
492
|
+
|
|
493
|
+
**For Single PRD Structure:**
|
|
494
|
+
|
|
495
|
+
| # | File | Path |
|
|
496
|
+
|---|------|------|
|
|
497
|
+
| 1 | PRD | {iteration}/01.prd/{feature-name}-prd.md |
|
|
498
|
+
|
|
499
|
+
**For Master-Sub Structure (present this table to user):**
|
|
494
500
|
|
|
495
|
-
|
|
501
|
+
| # | File Type | Module | Path |
|
|
502
|
+
|---|-----------|--------|------|
|
|
503
|
+
| 1 | Master PRD | (system overview) | {iteration}/01.prd/{feature-name}-prd.md |
|
|
504
|
+
| 2 | Sub-PRD | {module-1-name} | {iteration}/01.prd/{feature-name}-sub-{module-1-key}.md |
|
|
505
|
+
| 3 | Sub-PRD | {module-2-name} | {iteration}/01.prd/{feature-name}-sub-{module-2-key}.md |
|
|
506
|
+
| ... | ... | ... | ... |
|
|
507
|
+
| N+1 | Sub-PRD | {module-N-name} | {iteration}/01.prd/{feature-name}-sub-{module-N-key}.md |
|
|
496
508
|
|
|
497
|
-
|
|
509
|
+
Total files: 1 (Master) + N (Sub-PRDs) = N+1 files.
|
|
498
510
|
|
|
499
|
-
|
|
500
|
-
- Read `templates/PRD-TEMPLATE.md` (already loaded in Step 7)
|
|
501
|
-
- Replace top-level placeholders (feature name, iteration, date)
|
|
502
|
-
- Create document using `create_file` at: `{iteration}/01.product-requirement/{feature-name}-prd.md`
|
|
511
|
+
⚠️ **Present this file list to user for confirmation before proceeding.**
|
|
503
512
|
|
|
504
|
-
|
|
505
|
-
- Section 1: Overall background, goals, success metrics
|
|
506
|
-
- Section 2: System architecture overview (Mermaid graph TB)
|
|
507
|
-
- Section 3: Module list with scope boundaries (from Step 6.1)
|
|
508
|
-
- Section 4: Cross-module dependency matrix (from Step 6.2)
|
|
509
|
-
- Section 5: Implementation phases and ordering (from Step 6.3)
|
|
510
|
-
- Section 6: Shared entities and data contracts
|
|
511
|
-
- Section 7: Global non-functional requirements
|
|
513
|
+
---
|
|
512
514
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
515
|
+
### Step 12b: Generate Master PRD
|
|
516
|
+
|
|
517
|
+
1. Read `templates/PRD-TEMPLATE.md` (already loaded in Step 7)
|
|
518
|
+
2. Create document using `create_file` at: `{iteration}/01.prd/{feature-name}-prd.md`
|
|
519
|
+
|
|
520
|
+
3. Fill content using `search_replace` per section:
|
|
521
|
+
|
|
522
|
+
**For Single PRD Structure** — fill ALL sections with full detail:
|
|
523
|
+
- Section 1 (Background & Goals): Full background, goals
|
|
524
|
+
- Section 2 (User Stories): All user stories with scenarios
|
|
525
|
+
- Section 3 (Functional Requirements): All requirements including Feature Breakdown (3.4)
|
|
526
|
+
- Section 4 (Non-functional Requirements): Performance, security, etc.
|
|
527
|
+
- Section 5 (Acceptance Criteria): All criteria
|
|
528
|
+
- Section 6 (Boundary Description): In/out scope
|
|
529
|
+
- Section 7 (Assumptions & Dependencies)
|
|
530
|
+
|
|
531
|
+
**For Master-Sub Structure** — fill ONLY system-level overview content:
|
|
532
|
+
- Section 1 (Background & Goals): System-wide background and goals
|
|
533
|
+
- Section 2 (User Stories): **HIGH-LEVEL system user stories ONLY** (e.g., "As a store manager, I want a CRM system to manage customer relationships"). DO NOT include module-specific user stories.
|
|
534
|
+
- Section 3 (Functional Requirements):
|
|
535
|
+
- 3.1 Use Case Diagram: System-level use case diagram showing all modules
|
|
536
|
+
- 3.2 Business Process Flow: Cross-module process flow overview
|
|
537
|
+
- 3.3 Feature List: Module-level feature summary table (NOT detailed features)
|
|
538
|
+
- 3.4 Feature Breakdown: Write "See individual Sub-PRDs for module-specific Feature Breakdown"
|
|
539
|
+
- 3.5 Feature Details: Write "See individual Sub-PRDs for module-specific Feature Details"
|
|
540
|
+
- Section 4 (Non-functional Requirements): System-wide NFRs only
|
|
541
|
+
- Section 5 (Acceptance Criteria): System-wide acceptance criteria only
|
|
542
|
+
- Section 6 (Boundary Description): System-wide scope boundaries
|
|
543
|
+
- Section 7 (Assumptions & Dependencies): System-wide dependencies
|
|
544
|
+
- **APPEND after Section 7** using `search_replace` on the PRD Status line:
|
|
545
|
+
- **Section 8: Module Overview** — Module list table (from Step 6.1), Cross-module dependency matrix (from Step 6.2), Implementation phases (from Step 6.3)
|
|
546
|
+
- **Section 9: Sub-PRD Index** — List all Sub-PRD file paths with module names
|
|
517
547
|
|
|
518
548
|
> ⚠️ **CRITICAL CONSTRAINTS:**
|
|
519
549
|
> - **FORBIDDEN: `create_file` to rewrite the entire document**
|
|
520
550
|
> - **MUST use `search_replace` to fill each section individually**
|
|
521
|
-
> - **
|
|
551
|
+
> - **For Master-Sub: DO NOT include module-specific user stories, requirements, or Feature Breakdowns in the Master PRD**
|
|
522
552
|
|
|
523
553
|
---
|
|
524
554
|
|
|
525
|
-
### Step
|
|
555
|
+
### Step 12c: Sub-PRD Dispatch Plan (MANDATORY for Master-Sub)
|
|
526
556
|
|
|
527
|
-
**IF Step 8 determined Master-Sub structure
|
|
557
|
+
**IF Step 8 determined Master-Sub structure:**
|
|
528
558
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
12b.1: Copy template to sub_prd_path
|
|
533
|
-
sub_prd_name = "{feature-name}-sub-{module-key}.md"
|
|
534
|
-
sub_prd_path = "{iteration}/01.product-requirement/{sub_prd_name}"
|
|
535
|
-
|
|
536
|
-
Action:
|
|
537
|
-
1. Read templates/PRD-TEMPLATE.md
|
|
538
|
-
2. Replace top-level placeholders
|
|
539
|
-
3. Create document using create_file at sub_prd_path
|
|
559
|
+
⚠️ **IMPORTANT: Sub-PRD generation is handled by the PM Agent through parallel worker dispatch.**
|
|
560
|
+
**DO NOT generate Sub-PRD files sequentially in this skill.**
|
|
540
561
|
|
|
541
|
-
|
|
542
|
-
- Section 1: Module-specific background and context
|
|
543
|
-
- Section 2: Module-specific user stories
|
|
544
|
-
- Section 3: Module-specific functional requirements
|
|
545
|
-
- Section 3.4: Module-specific Feature Breakdown (REQUIRED)
|
|
546
|
-
- Section 5: Module-specific acceptance criteria
|
|
547
|
-
- Add: Interface Contracts (from Master dependency matrix)
|
|
562
|
+
Prepare and output the dispatch plan for the PM Agent:
|
|
548
563
|
|
|
549
|
-
|
|
550
|
-
- Read sub_prd_path to confirm file was created
|
|
551
|
-
- Verify file size > 1KB (not empty placeholder)
|
|
564
|
+
**Sub-PRD Dispatch Plan:**
|
|
552
565
|
|
|
553
|
-
|
|
566
|
+
For each module from Step 6.1, prepare worker context:
|
|
554
567
|
|
|
555
|
-
|
|
556
|
-
|
|
568
|
+
| # | Module | module_key | Sub-PRD Path | Feature Count |
|
|
569
|
+
|---|--------|-----------|--------------|---------------|
|
|
570
|
+
| 1 | {module-1-name} | {module-1-key} | {feature-name}-sub-{module-1-key}.md | {count} |
|
|
571
|
+
| 2 | {module-2-name} | {module-2-key} | {feature-name}-sub-{module-2-key}.md | {count} |
|
|
572
|
+
| ... | ... | ... | ... | ... |
|
|
557
573
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
574
|
+
For each module, collect and output the following context data:
|
|
575
|
+
- `module_name`: Module name
|
|
576
|
+
- `module_key`: Module identifier (for file naming)
|
|
577
|
+
- `module_scope`: What this module covers (from Step 6.1)
|
|
578
|
+
- `module_entities`: Core entities (from Step 6.1)
|
|
579
|
+
- `module_user_stories`: User stories specific to this module (from Steps 1-5 analysis)
|
|
580
|
+
- `module_requirements`: Functional requirements for this module (P0/P1/P2)
|
|
581
|
+
- `module_features`: Feature Breakdown entries for this module (from Step 9.1 analysis)
|
|
582
|
+
- `module_dependencies`: Dependencies on other modules (from Step 6.2)
|
|
564
583
|
|
|
565
|
-
|
|
566
|
-
→ Create: inventory-management-sub-order.md
|
|
567
|
-
→ Fill: order-specific content
|
|
568
|
-
→ Verify: file exists and has content
|
|
584
|
+
After outputting the dispatch plan:
|
|
569
585
|
|
|
570
|
-
... continue until all modules processed
|
|
571
586
|
```
|
|
587
|
+
→ RETURN to PM Agent for parallel worker dispatch.
|
|
588
|
+
→ PM Agent will invoke speccrew-task-worker for each module.
|
|
589
|
+
→ Each worker uses speccrew-pm-sub-prd-generate/SKILL.md to generate one Sub-PRD.
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
**IF Single PRD Structure:** Skip this step (no Sub-PRDs needed).
|
|
572
593
|
|
|
573
594
|
---
|
|
574
595
|
|
|
575
|
-
### Step
|
|
596
|
+
### Step 12d: Verification Checklist (Execute after all Sub-PRDs are generated)
|
|
576
597
|
|
|
577
|
-
**After all
|
|
598
|
+
**After PM Agent confirms all workers have completed, verify:**
|
|
578
599
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
600
|
+
- [ ] Master PRD exists and file size > 2KB
|
|
601
|
+
- [ ] [Master-Sub] All {sub_prd_count} Sub-PRD files exist
|
|
602
|
+
- [ ] [Master-Sub] Each Sub-PRD file size > 3KB
|
|
603
|
+
- [ ] [Master-Sub] Master PRD Section 9 (Sub-PRD Index) matches actual files
|
|
604
|
+
- [ ] [Master-Sub] Each Sub-PRD contains Section 3.4 Feature Breakdown
|
|
582
605
|
|
|
583
|
-
|
|
584
|
-
□ All {sub_prd_count} Sub-PRD files exist
|
|
585
|
-
□ Each Sub-PRD file size > 3KB (not empty placeholder)
|
|
586
|
-
□ Master PRD Section index links match actual Sub-PRD files
|
|
587
|
-
□ No broken file references
|
|
588
|
-
□ Each Sub-PRD contains module-specific Feature Breakdown
|
|
589
|
-
|
|
590
|
-
IF any check fails → STOP and report error, fix before proceeding
|
|
591
|
-
IF all checks pass → Proceed to Step 12d
|
|
592
|
-
```
|
|
606
|
+
IF any check fails → Report error and fix before proceeding.
|
|
593
607
|
|
|
594
608
|
---
|
|
595
609
|
|
|
596
|
-
### Step
|
|
610
|
+
### Step 12e: Request Confirmation
|
|
597
611
|
|
|
598
|
-
|
|
612
|
+
Present summary to user:
|
|
599
613
|
|
|
600
|
-
**
|
|
614
|
+
**Single PRD:**
|
|
601
615
|
```
|
|
602
|
-
PRD generated:
|
|
616
|
+
PRD generated: {path}
|
|
603
617
|
```
|
|
604
618
|
|
|
605
|
-
**
|
|
606
|
-
```
|
|
607
|
-
Business Modeling generated: speccrew-workspace/iterations/XXX-{type}-{name}/01.product-requirement/[feature-name]-bizs-modeling.md
|
|
608
|
-
PRD generated: speccrew-workspace/iterations/XXX-{type}-{name}/01.product-requirement/[feature-name]-prd.md
|
|
619
|
+
**Master-Sub PRD:**
|
|
609
620
|
```
|
|
621
|
+
Master PRD: {master_path}
|
|
622
|
+
Sub-PRDs ({sub_prd_count} files):
|
|
623
|
+
1. {module-1}: {sub_prd_1_path}
|
|
624
|
+
2. {module-2}: {sub_prd_2_path}
|
|
625
|
+
...
|
|
626
|
+
N. {module-N}: {sub_prd_N_path}
|
|
610
627
|
|
|
611
|
-
|
|
612
|
-
```
|
|
613
|
-
Master PRD generated: speccrew-workspace/iterations/XXX-{type}-{name}/01.product-requirement/[feature-name]-prd.md
|
|
614
|
-
Sub-PRDs generated ({sub_prd_count} files):
|
|
615
|
-
- [feature-name]-sub-[module1].md
|
|
616
|
-
- [feature-name]-sub-[module2].md
|
|
617
|
-
- ...
|
|
628
|
+
Total files generated: {sub_prd_count + 1}
|
|
618
629
|
```
|
|
619
630
|
|
|
620
|
-
|
|
621
|
-
1.
|
|
622
|
-
2.
|
|
623
|
-
3.
|
|
624
|
-
4.
|
|
625
|
-
5.
|
|
631
|
+
Confirm:
|
|
632
|
+
1. Feature boundary accurate?
|
|
633
|
+
2. Acceptance criteria quantifiable?
|
|
634
|
+
3. Not In Scope complete?
|
|
635
|
+
4. [Master-Sub] Module decomposition appropriate?
|
|
636
|
+
5. [Existing features] EXISTING/MODIFIED/NEW markers accurate?
|
|
626
637
|
|
|
627
|
-
After
|
|
638
|
+
After user confirms, proceed to Step 13 to write progress files and finalize PRD stage.
|
|
628
639
|
|
|
629
640
|
## Step 13: Write Progress Files
|
|
630
641
|
|
|
@@ -657,7 +668,7 @@ Read and update the WORKFLOW-PROGRESS.json file:
|
|
|
657
668
|
|
|
658
669
|
1. **Read**: `speccrew-workspace/iterations/{iteration}/WORKFLOW-PROGRESS.json`
|
|
659
670
|
2. **Update the following fields**:
|
|
660
|
-
- `current_stage` = "
|
|
671
|
+
- `current_stage` = "01_prd" (keep current stage — the next agent will update this when it starts)
|
|
661
672
|
- `01_prd.status` = "confirmed"
|
|
662
673
|
- `01_prd.completed_at` = `<current-ISO-timestamp>`
|
|
663
674
|
- `01_prd.confirmed_at` = `<current-ISO-timestamp>`
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: speccrew-pm-sub-prd-generate
|
|
3
|
+
description: Generate a single Sub-PRD document for one module. Used by PM Agent's worker dispatch to parallelize Sub-PRD generation across multiple modules. Each worker invocation generates one complete Sub-PRD file based on the PRD template.
|
|
4
|
+
tools: Read, Write, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Trigger Scenarios
|
|
8
|
+
|
|
9
|
+
- PM Agent dispatches worker to generate Sub-PRD for a specific module
|
|
10
|
+
- Worker receives module context from PM Agent's dispatch plan
|
|
11
|
+
|
|
12
|
+
# Input Parameters
|
|
13
|
+
|
|
14
|
+
| Parameter | Required | Description |
|
|
15
|
+
|-----------|----------|-------------|
|
|
16
|
+
| module_name | Yes | Human-readable module name (e.g., "Customer Management") |
|
|
17
|
+
| module_key | Yes | Module identifier for file naming (e.g., "customer") |
|
|
18
|
+
| module_scope | Yes | What this module covers |
|
|
19
|
+
| module_entities | Yes | Core business entities in this module |
|
|
20
|
+
| module_user_stories | Yes | User stories specific to this module |
|
|
21
|
+
| module_requirements | Yes | Functional requirements for this module (P0/P1/P2) |
|
|
22
|
+
| module_features | Yes | Feature Breakdown entries for this module (Feature IDs, Types, Dependencies) |
|
|
23
|
+
| module_dependencies | No | Dependencies on other modules |
|
|
24
|
+
| master_prd_path | Yes | Path to the Master PRD (for cross-referencing) |
|
|
25
|
+
| feature_name | Yes | System-level feature name (for file naming prefix) |
|
|
26
|
+
| template_path | Yes | Path to PRD-TEMPLATE.md |
|
|
27
|
+
| output_path | Yes | Full path for the Sub-PRD output file |
|
|
28
|
+
|
|
29
|
+
# Absolute Constraints
|
|
30
|
+
|
|
31
|
+
> **These rules apply to ALL document generation steps. Violation = task failure.**
|
|
32
|
+
|
|
33
|
+
1. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire document content in a single operation. Always use targeted `search_replace` on specific sections.
|
|
34
|
+
2. **MANDATORY: Template-first workflow** — Copy template MUST execute before filling sections.
|
|
35
|
+
|
|
36
|
+
# Workflow
|
|
37
|
+
|
|
38
|
+
## Step 1: Load Context
|
|
39
|
+
|
|
40
|
+
1. Read Master PRD at `{master_prd_path}` to understand:
|
|
41
|
+
- System-wide background and goals
|
|
42
|
+
- Cross-module dependency matrix
|
|
43
|
+
- This module's position in the overall system
|
|
44
|
+
|
|
45
|
+
2. Read PRD template at `{template_path}`
|
|
46
|
+
|
|
47
|
+
## Step 2: Create Sub-PRD File
|
|
48
|
+
|
|
49
|
+
1. Copy template content to `{output_path}` using `create_file`
|
|
50
|
+
2. Replace the title: `# PRD - [Feature Name]` → `# Sub-PRD - {module_name}`
|
|
51
|
+
|
|
52
|
+
## Step 3: Fill Module-Specific Content
|
|
53
|
+
|
|
54
|
+
Fill each section using `search_replace`:
|
|
55
|
+
|
|
56
|
+
### 3.1 Section 1: Background & Goals
|
|
57
|
+
- 1.1 Background: Why this module exists within the system, what problem it solves
|
|
58
|
+
- 1.2 Goals: Module-specific business objectives
|
|
59
|
+
|
|
60
|
+
### 3.2 Section 2: User Stories
|
|
61
|
+
- 2.1 Target Users: Users who interact with this specific module
|
|
62
|
+
- 2.2 User Scenarios: Module-specific user stories in "As a / I want / So that" format
|
|
63
|
+
|
|
64
|
+
### 3.3 Section 3: Functional Requirements
|
|
65
|
+
- 3.1 Use Case Diagram: Module-specific use case diagram (Mermaid flowchart TB)
|
|
66
|
+
- 3.2 Business Process Flow: Module-internal process flow
|
|
67
|
+
- 3.3 Feature List: Module features with P0/P1/P2 priority
|
|
68
|
+
- 3.4 Feature Breakdown: **REQUIRED** — Fill with `{module_features}` data:
|
|
69
|
+
- Feature ID, Feature Name, Type (Page+API / API-only), Pages/Endpoints count, Description
|
|
70
|
+
- Feature Dependencies table
|
|
71
|
+
- 3.5 Feature Details: Detailed descriptions for each feature including:
|
|
72
|
+
- Requirement Description
|
|
73
|
+
- Interaction Flow
|
|
74
|
+
- Boundary Conditions table
|
|
75
|
+
- Exception Scenarios
|
|
76
|
+
|
|
77
|
+
### 3.4 Section 4: Non-functional Requirements
|
|
78
|
+
- Module-specific performance, security, compatibility requirements
|
|
79
|
+
- Reference Master PRD for system-wide NFRs
|
|
80
|
+
|
|
81
|
+
### 3.5 Section 5: Acceptance Criteria
|
|
82
|
+
- 5.1 Must Have: Module-specific acceptance items
|
|
83
|
+
- 5.2 Should Have: Module-specific nice-to-have items
|
|
84
|
+
|
|
85
|
+
### 3.6 Section 6: Boundary Description
|
|
86
|
+
- 6.1 In Scope: What this module covers
|
|
87
|
+
- 6.2 Out of Scope: What this module explicitly does NOT cover
|
|
88
|
+
|
|
89
|
+
### 3.7 Section 7: Assumptions & Dependencies
|
|
90
|
+
- Dependencies on other modules (reference Master PRD dependency matrix)
|
|
91
|
+
- External system dependencies
|
|
92
|
+
- Prerequisites
|
|
93
|
+
|
|
94
|
+
> ⚠️ **FORBIDDEN: `create_file` to rewrite the entire document. MUST use `search_replace` per section.**
|
|
95
|
+
|
|
96
|
+
## Step 4: Verify Output
|
|
97
|
+
|
|
98
|
+
1. Read the generated file to verify:
|
|
99
|
+
- File exists and is non-empty
|
|
100
|
+
- File size > 3KB (not a placeholder)
|
|
101
|
+
- Section 3.4 Feature Breakdown is populated
|
|
102
|
+
- Title contains module name
|
|
103
|
+
|
|
104
|
+
2. Report result:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
IF verification passes:
|
|
108
|
+
→ Output: "✅ Sub-PRD generated: {output_path}"
|
|
109
|
+
IF verification fails:
|
|
110
|
+
→ Output: "❌ Sub-PRD verification failed: {reason}"
|
|
111
|
+
→ Attempt to fix the specific issue
|
|
112
|
+
```
|