speccrew 0.3.13 → 0.4.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,490 +1,84 @@
1
1
  ---
2
2
  name: speccrew-pm-requirement-analysis
3
- description: PRD Writing SOP with ISA-95 methodology integration. Guide PM Agent through requirements clarification, business domain analysis, and PRD document generation. Applies ISA-95 Stages 1-3 as internal thinking framework for clarification, functional decomposition, and prioritization — no separate modeling documents. Use when PM needs to write PRD, organize requirements, or create structured requirement documents.
3
+ description: SpecCrew PM PRD Generation Skill. Generates PRD documents from clarified requirements and module design. Produces Master PRD and Sub-PRD Dispatch Plan for downstream Feature Design. Third step in PRD workflow.
4
4
  tools: Read, Write, Glob, Grep
5
5
  ---
6
6
 
7
- # Trigger Scenarios
7
+ # Skill Overview
8
8
 
9
- - PM Agent receives user requirement description
10
- - User requests "Write a PRD" or "Help organize requirements" or "New feature requirements"
11
- - User needs structured requirement document with business-level diagrams (use case diagrams, business process flows, activity diagrams)
9
+ PRD document generation from clarification and modeling artifacts. Produces Master PRD and Sub-PRD Dispatch Plan.
12
10
 
13
- ## Methodology Foundation
14
-
15
- This skill applies the ISA-95 six-stage methodology (Stages 1-3) as an internal thinking framework:
16
-
17
- | ISA-95 Stage | Integrated Into | Purpose |
18
- |---|---|---|
19
- | Stage 1: Domain Description | Clarification process | Define domain boundary, participants, glossary |
20
- | Stage 2: Functions in Domain | PRD Section 3 (Functional Requirements) | WBS decomposition, capability mapping |
21
- | Stage 3: Functions of Interest | PRD Section 3.4 (Feature Breakdown) | MoSCoW prioritization, MVP scoping |
22
-
23
- > ⚠️ **No separate modeling documents.** The methodology guides thinking quality, not document quantity.
11
+ ## Trigger Scenarios
24
12
 
25
- # Workflow
26
-
27
- ## Absolute Constraints
13
+ - Modeling completed (`.module-design.md` exists)
14
+ - PRD document generation needed
15
+ - Feature breakdown and dispatch planning required
28
16
 
29
- > **These rules apply to ALL document generation steps. Violation = task failure.**
17
+ ## Input Parameters
30
18
 
31
- 1. **FORBIDDEN: `create_file` for documents** NEVER use `create_file` to write PRD or modeling documents. Documents MUST be created by copying the template then filling sections with `search_replace`.
19
+ | Parameter | Type | Required | Description |
20
+ |-----------|------|----------|-------------|
21
+ | `iteration_path` | string | Yes | Path to iteration directory |
22
+ | `clarification_file` | string | No | Path to clarification summary (default: `{iteration_path}/01.product-requirement/.clarification-summary.md`) |
23
+ | `module_design_file` | string | No | Path to module design (default: `{iteration_path}/01.product-requirement/.module-design.md`) |
32
24
 
33
- 2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire document content in a single operation. Always use targeted `search_replace` on specific sections.
25
+ ## Methodology Foundation
34
26
 
35
- 3. **MANDATORY: Template-first workflow** Copy template MUST execute before filling sections. Skipping copy and writing content directly is FORBIDDEN.
27
+ Applies ISA-95 Stages 2-3 outputs for PRD generation:
28
+ - WBS decomposition → Section 3 Functional Requirements
29
+ - MoSCoW prioritization → Section 3.4 Feature Breakdown
36
30
 
37
31
  ## PM Stage Content Boundary
38
32
 
39
- > **PM Stage Content Boundary DO NOT include:**
40
- > - API endpoint definitions, HTTP methods, request/response JSON
41
- > - Design class diagrams, component diagrams, deployment diagrams
42
- > - Database table structures, ER diagrams
43
- > - Code snippets, pseudocode
44
- > - Technical terminology in Domain Glossary (e.g., UUID, JSON, REST)
45
- > - Technical metrics (e.g., "code files", "CPU usage")
46
- >
47
- > These belong to Feature Designer (interaction design, data modeling) or System Designer (technical architecture).
48
-
49
- ## Step 1: Requirements Clarification (MANDATORY)
50
-
51
- ⚠️ **MANDATORY: This step CANNOT be skipped.**
52
-
53
- **ABORT CONDITIONS — If ANY of these apply, workflow MUST STOP:**
54
- - `.clarification-summary.md` file was not generated
55
- - Sufficiency Checks are not ALL marked as ✅
56
- - No Q&A round was conducted with the user
57
-
58
- **DO NOT proceed to Step 2 without completing this step.**
59
-
60
- **MANDATORY CLARIFICATION LOGIC:**
61
- - ALWAYS perform at least 1 clarification round, REGARDLESS of input completeness
62
- - NEVER skip clarification based on user urgency or perceived completeness
63
- - COMPLETE ALL Sufficiency Checks before proceeding
64
-
65
- **Clarification Depth:**
66
- - User provided complete requirement document → Minimum 1 confirmation round to verify understanding
67
- - User provided incomplete input → Minimum 2 rounds (Core scope + Boundaries), 3rd round if needed
68
- - User says "skip clarification" → REFUSE. Explain: "Clarification ensures PRD quality and cannot be skipped."
69
-
70
- Use progressive questioning to clarify requirements. Do NOT ask all questions at once.
71
-
72
- > **ISA-95 Stage 1 Thinking — Domain Description**
73
- > During clarification, apply domain description methodology:
74
- > - **Domain Boundary**: Explicitly define what is in-scope and out-of-scope. Record in clarification summary.
75
- > - **External Participants**: Identify all user roles, external systems, and integration points.
76
- > - **Domain Glossary**: Unify key business terms to eliminate ambiguity across stakeholders.
77
- > These elements should naturally flow into the clarification summary, NOT as a separate document.
78
-
79
- ### File-Based Clarification Workflow
80
-
81
- > ⚠️ **All clarification rounds use file-based interaction, NOT chat-based.**
82
- > This prevents users from having to copy-paste large amounts of content in chat.
83
-
84
- **Round 1: Core Understanding**
85
-
86
- 1. **Create** `.clarification-summary.md` in the iteration's `01.product-requirement/` directory:
87
- ```
88
- speccrew-workspace/iterations/{iteration}/01.product-requirement/.clarification-summary.md
89
- ```
90
-
91
- 2. **Write** Round 1 questions to the file using this format:
92
-
93
- ```markdown
94
- # Requirements Clarification
95
-
96
- ## Round 1: Core Understanding
97
-
98
- > **Instructions**: Please fill in your answers directly after each "**Answer:**" marker below, then save the file and notify me that you have completed your responses.
99
-
100
- ### 1. Business Background & Goals
101
-
102
- Based on the requirement document, the system aims to solve:
103
- - [PM's understanding point 1]
104
- - [PM's understanding point 2]
105
- - ...
106
-
107
- **Answer:** <!-- Fill your confirmation or corrections here -->
108
-
109
- ### 2. Target Users & Scenarios
110
-
111
- The document identifies the following user roles:
112
- - Role 1: description
113
- - Role 2: description
114
-
115
- Questions:
116
- - Are there additional roles not mentioned?
117
- - [Other specific questions]
118
-
119
- **Answer:** <!-- Fill your answers here -->
120
-
121
- ### 3. System Scope & Boundaries
122
-
123
- The functional scope includes:
124
- - Module 1
125
- - Module 2
126
- - ...
127
-
128
- Questions:
129
- - Are all modules required for Phase 1?
130
- - [Other scope questions]
131
-
132
- **Answer:** <!-- Fill your answers here -->
133
- ```
134
-
135
- 3. **Notify user** with a brief message:
136
- ```
137
- 📝 Clarification questions written to:
138
- `01.product-requirement/.clarification-summary.md`
139
-
140
- Please open the file, fill in your answers after each "**Answer:**" marker, save, and let me know when done.
141
- ```
142
-
143
- 4. **HARD STOP** — Wait for user to confirm they have answered.
144
-
145
- 5. **Read** the updated `.clarification-summary.md` file.
146
-
147
- 6. **Evaluate** if answers are sufficient for Sufficiency Checks.
148
-
149
- **Round 2 (if needed): Scope & Boundaries**
150
-
151
- 7. **Append** Round 2 questions to the SAME file:
152
-
153
- ```markdown
154
- ---
155
-
156
- ## Round 2: Scope & Boundaries
157
-
158
- > Based on your Round 1 answers, I need to clarify the following details.
159
- > Please fill in your answers after each "**Answer:**" marker.
160
-
161
- ### 1. Out-of-Scope Items
162
-
163
- Based on the requirement, the following appear to be out of scope:
164
- - [Item 1]
165
- - [Item 2]
166
-
167
- Questions:
168
- - Are there any explicit exclusions?
169
- - [Other boundary questions]
170
-
171
- **Answer:** <!-- Fill your answers here -->
172
-
173
- ### 2. Existing System Relationship
174
-
175
- Questions:
176
- - Does this overlap with any existing system capabilities?
177
- - Should this reuse or replace existing functionality?
178
-
179
- **Answer:** <!-- Fill your answers here -->
180
-
181
- ### 3. Constraints
182
-
183
- Questions:
184
- - Are there timeline constraints?
185
- - Technology or budget constraints?
186
-
187
- **Answer:** <!-- Fill your answers here -->
188
- ```
189
-
190
- 8. **Notify user** again and wait for response.
191
-
192
- 9. **Read** the updated file and evaluate Sufficiency Checks.
193
-
194
- **Round 3 (if still needed): Detail & Acceptance** — Same pattern: append to the file, notify, wait, read.
195
-
196
- ### Sufficiency Check
197
-
198
- After each round, evaluate whether collected information is sufficient to proceed:
33
+ > **DO NOT INCLUDE:** API definitions, DB structures, code snippets, technical terminology.
34
+ > **These belong to:** Feature Designer or System Designer.
35
+ > **Required:** Use BUSINESS LANGUAGE only.
199
36
 
200
- ```
201
- Sufficient to proceed when ALL of:
202
- - [ ] Business problem is clearly understood
203
- - [ ] Target users and core scenarios identified
204
- - [ ] Scope boundaries (in/out) are defined
205
- - [ ] Relationship to existing system is understood
206
-
207
- If ANY is unclear → append follow-up questions to the clarification file
208
- If ALL are clear → proceed to Finalize Clarification File
209
- ```
210
-
211
- ### Finalize Clarification File
212
-
213
- After all clarification rounds complete, append the Sufficiency Check results and Key Decisions to the file:
214
-
215
- ```markdown
216
37
  ---
217
38
 
218
- ## Sufficiency Check
219
-
220
- | Check Item | Status |
221
- |-----------|--------|
222
- | Core business problem clearly defined | ✅ |
223
- | Target user roles and permissions identified | ✅ |
224
- | System scope and boundaries confirmed | ✅ |
225
- | Key business rules clarified | ✅ |
226
-
227
- ## Key Decisions
228
-
229
- | # | Decision | Rationale |
230
- |---|----------|----------|
231
- | 1 | [Decision] | [From user's answer in Round X] |
232
- | 2 | [Decision] | [From user's answer in Round X] |
233
-
234
- ## Proceed Gate
235
-
236
- ✅ All checks passed. Ready for Step 2.
237
- ```
238
-
239
- ### Proceed Gate to Step 2
240
-
241
- ⚠️ **HARD STOP — Proceed Gate:**
242
-
243
- **ABORT if ANY condition is missing:**
244
- - [ ] `.clarification-summary.md` file MUST exist with complete content
245
- - [ ] ALL 4 Sufficiency Checks MUST be marked as ✅
246
- - [ ] At least 1 confirmed round of clarification Q&A
247
- - [ ] Key Decisions section MUST be filled
248
-
249
- **IF ANY condition fails:**
250
- → REFUSE to proceed to Step 2
251
- → Continue clarification until ALL conditions pass
252
-
253
- **ONLY after ALL conditions verified → Proceed to Step 2**
254
-
255
- After clarification is confirmed sufficient, write initial `.checkpoints.json`:
256
-
257
- Write the following structure to `speccrew-workspace/iterations/{iteration}/01.product-requirement/.checkpoints.json`:
258
-
259
- ```json
260
- {
261
- "stage": "01_prd",
262
- "checkpoints": {
263
- "requirement_clarification": {
264
- "passed": true,
265
- "confirmed_at": "{REAL_TIMESTAMP via node -e}",
266
- "description": "Requirement clarification completed",
267
- "clarification_file": ".clarification-summary.md",
268
- "sufficiency_checks": {
269
- "business_problem": true,
270
- "target_users": true,
271
- "scope_boundaries": true,
272
- "existing_system": true
273
- }
274
- },
275
- "sub_prd_dispatch": {
276
- "passed": false,
277
- "confirmed_at": null,
278
- "description": "Sub-PRD generation via worker dispatch"
279
- },
280
- "verification_checklist": {
281
- "passed": false,
282
- "confirmed_at": null,
283
- "description": "PRD structure and content verification"
284
- },
285
- "prd_review": {
286
- "passed": false,
287
- "confirmed_at": null,
288
- "description": "User review and confirmation of all PRD documents"
289
- }
290
- }
291
- }
292
- ```
293
-
294
- **Principles:**
295
- - Ask 2-3 questions per round, not 5+ at once
296
- - Adapt questions based on previous answers (skip what's already clear)
297
- - For vague inputs like "Build a WMS system", Round 1 may need extra probing: "What specific pain points in your current warehouse operations?" / "Which warehouse processes are highest priority?"
298
- - Never assume — if uncertain, ask
299
-
300
- ## Step 2: Load System Knowledge
301
-
302
- ### 2.1 Read System Overview
303
-
304
- Read the file to understand system context:
305
- ```
306
- speccrew-workspace/knowledges/bizs/system-overview.md
307
- ```
308
-
309
- ### 2.2 Load Related Module Overviews
310
-
311
- Based on user input, identify related modules and read their overview files:
312
- ```
313
- speccrew-workspace/knowledges/bizs/{module-name}/{module-name}-overview.md
314
- ```
315
-
316
- ### 2.3 Query Knowledge Graph (Optional)
317
-
318
- If cross-module relationships need analysis, use `speccrew-knowledge-graph-query` skill:
319
-
320
- | Action | Use Case |
321
- |--------|----------|
322
- | `query-nodes` | Find all nodes in a module |
323
- | `search` | Find related entities by keyword |
324
- | `trace-upstream` | Impact analysis for existing entities |
325
- | `trace-downstream` | Dependency analysis |
326
-
327
- ## Step 3: Confirm Business Boundaries
328
-
329
- After loading knowledge, confirm:
330
-
331
- - [ ] Does the requirement overlap with existing modules? If so, is it an extension or new build?
332
- - [ ] Which existing business processes does the requirement involve?
333
- - [ ] Are there relevant industry standards to reference? (If yes, read `domain/standards/`)
334
-
335
- ### 3.1 Check Active Iterations
336
-
337
- Before creating a new PRD, check if there are ongoing iterations with similar requirements:
338
-
339
- 1. List the `speccrew-workspace/iterations/` directory
340
- 2. Review PRD files in active iterations (non-archived)
341
- 3. Compare current requirements with existing iteration PRDs
342
-
343
- **If similar requirements found:**
344
-
345
- | Scenario | Action |
346
- |----------|--------|
347
- | Same feature, different scope | Ask user: "Found similar PRD in iteration XXX. Create new iteration or extend existing?" |
348
- | Same feature, same scope | Ask user: "This requirement already exists in iteration XXX. Skip or update existing PRD?" |
349
- | Related feature, same module | Ask user: "Found related feature in iteration XXX. Create new iteration or merge requirements?" |
350
-
351
- **Decision options:**
352
- - **New iteration**: Create a new iteration directory for this requirement
353
- - **Extend existing**: Update the existing PRD with additional requirements
354
- - **Merge**: Combine requirements into a single PRD
355
-
356
- **Principle**: Avoid duplicate or conflicting PRDs for the same feature.
357
-
358
- ## Step 4: Determine Complexity & Select Approach
359
-
360
- Evaluate requirement complexity to determine the appropriate workflow path:
361
-
362
- | Criteria | Simple | Complex |
363
- |----------|--------|---------|
364
- | Modules involved | 1 module | 2+ modules or new domain |
365
- | Domain clarity | Well-understood domain | New/unclear domain |
366
- | Cross-module deps | None or minimal | Significant |
367
- | Template | PRD-TEMPLATE.md only | PRD-TEMPLATE.md (with deeper analysis) |
368
-
369
- **Workflow Path:**
370
- - **Simple path**: Skip to Step 7 (Read PRD Template)
371
- - **Complex path**: Proceed to Step 5 (ISA-95 Business Modeling) → Step 6 (Module Decomposition)
372
-
373
- ## Step 5: ISA-95 Business Modeling Thinking (Complex Requirements Only)
374
-
375
- > ⚠️ **This step is a THINKING PROCESS, not a document generation step.**
376
- > Apply ISA-95 methodology internally to deepen your analysis. Results flow into the PRD.
377
-
378
- Apply ISA-95 six stages as internal thinking framework:
379
-
380
- ### 5.1 Stage 1 - Domain Description (Thinking)
381
- - Define domain boundary (in-scope, out-of-scope)
382
- - Identify external participants (users, systems, agents)
383
- - Create domain glossary
384
- - Visualize system context (mental model or rough sketch)
385
-
386
- **Checkpoint A: Briefly confirm domain boundary with user before proceeding.**
387
- Ask: "Here is the domain boundary and key participants. Does this match your understanding?"
388
-
389
- ### 5.2 Stage 2 - Functions in Domain (Thinking)
390
- - Create WBS decomposition (mental or rough sketch)
391
- - Map functions to business capabilities
392
- - Identify module boundaries
393
-
394
- ### 5.3 Stage 3 - Functions of Interest (Thinking)
395
- - Apply MoSCoW prioritization
396
- - Identify core vs non-core functions
397
- - Document non-core functions and their iteration plan
398
-
399
- **Checkpoint B: Confirm MVP scope with user before proceeding.**
400
- Ask: "Here are the core functions (Must have) and deferred functions. Is the MVP scope correct?"
401
-
402
- ### 5.4 Stage 4 - Information Flows (Thinking)
403
- - Document core information flows
404
- - Identify key interfaces
405
- - Understand data movement patterns
406
-
407
- ### 5.5 Stage 5 - Categories of Information (Thinking)
408
- - Define information categories
409
- - Identify core entities
410
- - Understand data relationships
411
-
412
- ### 5.6 Stage 6 - Information Descriptions (Thinking)
413
- - Consider technical implications
414
- - Identify component boundaries
415
- - Note implementation considerations
416
-
417
- **Checkpoint C: Present analysis summary to user for final confirmation.**
418
-
419
- > All ISA-95 thinking results will be reflected in the PRD document, NOT as a separate modeling file.
420
-
421
- **Key rules for this step:**
422
- - Use 3 checkpoints (A/B/C) for progressive confirmation, not all-at-once
423
- - This is an analysis phase — focus on understanding, not documentation
424
- - Results integrate into PRD Sections 3-7 during Step 9
425
-
426
- ## Step 6: Module Decomposition & Ordering (Complex Requirements Only)
427
-
428
- Based on ISA-95 analysis from Step 5, map identified modules into independent units. For each module:
429
-
430
- ### 6.1 Define Module List
431
-
432
- | Module | Scope | Key Entities | Owner Domain |
433
- |--------|-------|-------------|--------------|
434
- | {module} | {what it covers} | {core entities} | {business domain} |
39
+ # Workflow
435
40
 
436
- ### 6.2 Cross-Module Dependency Matrix
41
+ ## Absolute Constraints
437
42
 
438
- Based on information flow analysis from Step 5, identify dependencies:
43
+ > **Violation = task failure**
439
44
 
440
- | Module | Depends On | Dependency Type | Shared Entities |
441
- |--------|-----------|-----------------|-----------------|
442
- | {module A} | {module B} | Data / API / Event | {entities} |
45
+ 1. **FORBIDDEN:** `create_file` for documents use `search_replace` on templates
46
+ 2. **FORBIDDEN:** Full-file rewrite — use targeted `search_replace`
47
+ 3. **MANDATORY:** Template-first workflow
443
48
 
444
- ### 6.3 Implementation Order
49
+ ## Step 1: Verify Prerequisites
445
50
 
446
- Based on dependency matrix, determine module priority:
51
+ > 🚨 **MANDATORY: Both `.clarification-summary.md` AND `.module-design.md` MUST exist.**
52
+ > These files are generated by prior skills (clarify → model).
447
53
 
54
+ **IF either file is missing → ABORT immediately:**
448
55
  ```
449
- Phase 1 (Foundation): Modules with no upstream dependencies
450
- Phase 2 (Core): Modules depending only on Phase 1
451
- Phase 3 (Extension): Remaining modules
56
+ ERROR: Prerequisite files not found.
57
+ Missing: [filename]
58
+ Path: {iteration_path}/01.product-requirement/
59
+
60
+ This skill requires completed clarification and modeling.
61
+ Please run speccrew-pm-requirement-clarify and speccrew-pm-requirement-model first.
452
62
  ```
453
63
 
454
- **Present module decomposition to user for confirmation before proceeding.**
64
+ **Actions:**
65
+ 1. Read `.clarification-summary.md` — extract: key decisions, clarified scope, business rules
66
+ 2. Read `.module-design.md` — extract: module list, dependency matrix, implementation phases
455
67
 
456
- ## Step 7: Read PRD Template
68
+ ## Step 2: Read PRD Template
457
69
 
458
- **Locate and read the PRD template file using this search strategy:**
459
-
460
- 1. **Search** for the template using glob pattern:
70
+ **Actions:**
71
+ 1. Search for template using glob pattern:
461
72
  ```
462
73
  **/speccrew-pm-requirement-analysis/templates/PRD-TEMPLATE.md
463
74
  ```
464
- This will find the template regardless of IDE adapter path (.qoder/, .claude/, .cursor/, .speccrew/).
75
+ 2. Read the template file
465
76
 
466
- 2. **Read** the found template file.
77
+ > ⚠️ The template is ALWAYS located in the skill's own `templates/` subfolder.
467
78
 
468
- 3. **If BIZS modeling template is needed** (for complex systems with 3+ modules):
469
- ```
470
- **/speccrew-pm-requirement-analysis/templates/BIZS-MODELING-TEMPLATE.md
471
- ```
472
-
473
- > ⚠️ **DO NOT manually search in these directories:** bizs/, knowledges/, workspace docs, project src/
474
- > The template is ALWAYS located in the skill's own `templates/` subfolder.
475
- > If glob returns no results, check if speccrew was properly initialized (`speccrew init`).
476
-
477
- After reading the template, check if any required information is missing based on:
478
- - Template structure requirements
479
- - Previously clarified requirements from Step 1
480
-
481
- If there are gaps or unclear points, ask the user to confirm before proceeding.
79
+ ## Step 3: Determine PRD Structure
482
80
 
483
- ## Step 8: Determine PRD Structure
484
-
485
- Before writing, determine the PRD structure based on requirement complexity:
486
-
487
- ### Structure Decision (MANDATORY IF/THEN)
81
+ **Structure Decision (MANDATORY IF/THEN):**
488
82
 
489
83
  ```
490
84
  IF modules_count >= 2 OR cross_module_dependencies exist:
@@ -494,15 +88,13 @@ ELSE:
494
88
  → Use Single PRD Structure
495
89
  ```
496
90
 
497
- ### Simple Requirements (Single Document)
498
- - Single feature with clear boundaries
499
- - Minimal dependencies on existing modules
500
- - Can be completed in 1-2 iterations
91
+ ### Structure Types
501
92
 
502
- ### Complex Requirements (Master-Sub Structure)
503
- - Multiple related features or sub-modules
504
- - Cross-domain changes involving multiple modules
505
- - Requires phased implementation
93
+ **Single PRD Structure:**
94
+ ```
95
+ 01.product-requirement/
96
+ └── [feature-name]-prd.md
97
+ ```
506
98
 
507
99
  **Master-Sub Structure:**
508
100
  ```
@@ -513,240 +105,164 @@ ELSE:
513
105
  └── ...
514
106
  ```
515
107
 
516
- **Master PRD MUST include:**
108
+ ### Master PRD Requirements
109
+
517
110
  - Overall background, goals, and success metrics
518
111
  - System architecture overview (Mermaid graph TB)
519
- - Module list with scope boundaries (from Step 6.1)
520
- - Cross-module dependency matrix (from Step 6.2)
521
- - Implementation phases and ordering (from Step 6.3)
522
- - Shared entities and data contracts across modules
523
- - Global non-functional requirements (performance, security, scalability)
112
+ - Module list with scope boundaries
113
+ - Cross-module dependency matrix
114
+ - Implementation phases
115
+ - Shared entities and data contracts
116
+ - Global non-functional requirements
117
+
118
+ ### Sub-PRD Requirements (per module)
524
119
 
525
- **Each Sub-PRD covers ONE module:**
526
120
  - Module-specific user stories and functional requirements
527
121
  - Module-internal process flows and use cases
528
- - **Feature Breakdown** (required): List all business operation units with Feature ID, Type, and dependencies
122
+ - **Feature Breakdown** (required): Feature ID, Type, dependencies
529
123
  - Module-specific acceptance criteria
530
- - Interface contracts with other modules (referencing Master PRD dependency matrix)
531
-
532
- ## Step 9: Write PRD
533
-
534
- Fill in according to the template structure, requirements:
535
- - **Background & Goals**: Explain why we're doing this and what success looks like
536
- - **User Stories**: `As a [user role], I want [to do something], so that [I can achieve some goal]`
537
- - **Functional Requirements**: Group by priority (P0 Core / P1 Important / P2 Optional)
538
-
539
- > **ISA-95 Stage 2 Thinking — Functions in Domain**
540
- > When decomposing functional requirements:
541
- > - **WBS Decomposition**: Break down the system into functional modules using Work Breakdown Structure logic. Each module should map to a clear business capability.
542
- > - **Function-Capability Mapping**: Every function must answer "what business capability does this deliver?"
543
- > - **Module Boundaries**: Ensure modules have clear boundaries with minimal coupling.
544
- > This thinking drives PRD Section 3 content quality — no separate WBS document needed.
545
-
546
- - **Feature Breakdown**: Extract business operation units for downstream Feature Design (see Step 9.1)
547
- - **Non-functional Requirements**: Performance, security, compatibility, etc.
548
- - **Acceptance Criteria**: Quantifiable, verifiable definition of done
549
- - **Boundary Description**: Clearly define Not In Scope content
550
- - **Assumptions & Dependencies**: Prerequisites, external dependencies
551
-
552
- ### Step 9.1: Extract Feature Breakdown
553
-
554
- For both simple and complex requirements, extract Feature Breakdown to guide downstream Feature Design:
555
-
556
- > **ISA-95 Stage 3 Thinking — Functions of Interest**
557
- > When creating the Feature Breakdown table:
558
- > - **MoSCoW Prioritization**: Classify each feature as Must-have (P0), Should-have (P1), Could-have (P2), or Won't-have (deferred).
559
- > - **MVP Focus**: The Feature Breakdown table IS the MVP definition. Features marked P0 form the core scope.
560
- > - **Non-core Exclusion**: Explicitly note deferred features in Section 6 (Boundary & Constraints) with planned iteration.
561
- > The Feature Breakdown table in Section 3.4 serves as the core function selection — no separate priority matrix needed.
562
-
563
- **Analysis Steps:**
564
- 1. **Analyze user stories and functional requirements** for this module/feature
565
- 2. **Identify business operation units** - each unit should represent:
566
- - A complete business operation (e.g., "Customer List Management" includes search, filter, pagination, tag management)
567
- - Can span 1-2 pages but remains business-cohesive
568
- - Estimated implementation: can be completed by 1-2 developers in 1 sprint
569
- 3. **Classify Feature Type:**
570
- - `User Interaction`: Features involving user interface and business logic
571
- - `Backend Process`: Background processing or business logic without direct user interaction
572
- 4. **Assign Feature IDs**: Use format `F-{MODULE}-{NN}` (e.g., F-CRM-01, F-CRM-02)
573
- 5. **Document dependencies**: Identify data or workflow dependencies between features
124
+ - Interface contracts with other modules
574
125
 
575
- **Granularity Guidelines:**
576
- | Good Feature Size | Too Large (Split Further) |
577
- |-------------------|--------------------------|
578
- | Single CRUD operation group | Complete module with 5+ CRUDs |
579
- | One list page with filters | Entire reporting subsystem |
580
- | One form with validation | Multi-step wizard with 10+ steps |
581
- | Single business process | All processes for a domain |
126
+ ## Step 4: Write PRD Content
582
127
 
583
- **Output:** Complete the Feature Breakdown table in Section 3.4 of the PRD template.
128
+ > 🚨 **CRITICAL: PM Stage Content Boundary Enforcement**
129
+ >
130
+ > **ABORT if ANY section includes:**
131
+ > - API definitions, HTTP methods, JSON schemas
132
+ > - Database table structures, ER diagrams, SQL queries
133
+ > - Code snippets, pseudocode, implementation logic
134
+ > - Technical terminology (UUID, JWT, REST, Microservice, etc.)
135
+ >
136
+ > **All descriptions MUST use business language only.**
137
+ > ✅ "Customer can upload photos" ❌ "Implement S3 upload API"
138
+ > ✅ "Show error when name is empty" ❌ "throw ValidationException"
584
139
 
585
- **Note:** Even simple requirements (single-file PRD) should include Feature Breakdown, typically with 1-3 features.
140
+ **Actions:**
141
+ 1. Fill PRD sections using `search_replace` on template
586
142
 
587
- ### Marking Existing vs New Features
143
+ **Section Content:**
588
144
 
589
- When the requirement involves modifying existing system functions, clearly mark each item:
145
+ | Section | Content |
146
+ |---------|---------|
147
+ | 1. Background & Goals | Why we're doing this, success metrics |
148
+ | 2. User Stories | `As a [role], I want [action], so that [value]` |
149
+ | 3. Functional Requirements | Group by priority (P0/P1/P2), include Feature Breakdown |
150
+ | 4. Non-functional Requirements | Performance, security, compatibility |
151
+ | 5. Acceptance Criteria | Quantifiable, verifiable |
152
+ | 6. Boundary Description | In/out scope |
153
+ | 7. Assumptions & Dependencies | Prerequisites, external dependencies |
590
154
 
591
- | Marker | Meaning | Example |
592
- |--------|---------|---------|
593
- | `[EXISTING]` | Current system capability being reused | `[EXISTING] User authentication via OAuth` |
594
- | `[MODIFIED]` | Existing feature being enhanced/changed | `[MODIFIED] Add email field to user profile` |
595
- | `[NEW]` | Brand new functionality | `[NEW] Export report to PDF` |
155
+ ### 4.1 Feature Breakdown
596
156
 
597
- **Apply markers in:**
598
- - User stories (prefix the story)
599
- - Functional requirements (prefix each requirement)
600
- - UI mockups descriptions
601
- - System capability changes
157
+ **For each module, extract business operation units:**
602
158
 
603
- **Example:**
604
- ```markdown
605
- ## Functional Requirements
159
+ | Feature ID | Feature Name | Type | Priority | Scope | Description |
160
+ |------------|-------------|------|----------|-------|-------------|
161
+ | F-{MODULE}-01 | {name} | User Interaction / Backend Process | P0/P1/P2 | {scope} | {desc} |
606
162
 
607
- ### P0 Core
608
- - [EXISTING] User login system - reuse current JWT-based auth
609
- - [MODIFIED] User profile page - add "Department" dropdown field
610
- - [NEW] Department management module - CRUD operations for departments
611
- ```
163
+ **Feature Types:**
164
+ - `User Interaction`: Features involving user interface and business logic
165
+ - `Backend Process`: Background processing without direct user interaction
612
166
 
613
- ## Step 10: Task Granularity Check
167
+ **Granularity Guidelines:**
168
+ | Good Size | Too Large (Split) |
169
+ |-----------|-------------------|
170
+ | Single CRUD operation group | Complete module with 5+ CRUDs |
171
+ | One list page with filters | Entire reporting subsystem |
172
+ | One form with validation | Multi-step wizard with 10+ steps |
173
+
174
+ ### 4.2 Marking Existing vs New Features
175
+
176
+ | Marker | Meaning |
177
+ |--------|---------|
178
+ | `[EXISTING]` | Current system capability being reused |
179
+ | `[MODIFIED]` | Existing feature being enhanced/changed |
180
+ | `[NEW]` | Brand new functionality |
181
+
182
+ ## Step 5: Task Granularity Check
614
183
 
615
- After PRD completion, check if each user story's granularity aligns with the "single iteration completable" principle.
184
+ **After PRD completion, verify user story granularity:**
616
185
 
617
- **Appropriate Granularity (completable in one iteration)**:
618
- - Add a database field and write migration
619
- - Add a UI component in an existing page
186
+ **Appropriate Granularity (completable in one iteration):**
187
+ - Add a field and write migration
188
+ - Add a UI component in existing page
620
189
  - Modify existing server-side logic
621
- - Add a filter condition to a list page
190
+ - Add a filter condition to list page
622
191
 
623
- **Granularity Requiring Splitting (too large)**:
192
+ **Granularity Requiring Splitting:**
624
193
  - Implement a complete dashboard
625
194
  - Add a whole authentication/login system
626
195
  - Overall refactoring of existing APIs
627
196
  - Cross-domain changes involving multiple modules
628
197
 
629
- **Splitting Strategy**:
630
- - Break large user stories into multiple small user stories
631
- - Each small user story has independent acceptance criteria
632
- - Mark dependencies between user stories
198
+ **IF stories need splitting → Update PRD before proceeding.**
633
199
 
634
- If stories need splitting, update the PRD before proceeding.
200
+ ## Step 6: Determine Storage Path & Write Master PRD
635
201
 
636
- ## Step 11: Determine Storage Path
202
+ ### 6.1 Determine Path
637
203
 
638
- Ask the user for the current iteration number and determine the file path:
639
-
640
- ### Single PRD Structure
204
+ **Single PRD Structure:**
641
205
  ```
642
- speccrew-workspace/iterations/{number}-{type}-{name}/01.product-requirement/[feature-name]-prd.md
206
+ {iteration_path}/01.product-requirement/{feature-name}-prd.md
643
207
  ```
644
208
 
645
- ### Master-Sub PRD Structure
209
+ **Master-Sub PRD Structure:**
646
210
  ```
647
- speccrew-workspace/iterations/{number}-{type}-{name}/01.product-requirement/
648
- ├── [feature-name]-prd.md
649
- ├── [feature-name]-sub-[module1].md
650
- ├── [feature-name]-sub-[module2].md
211
+ {iteration_path}/01.product-requirement/
212
+ ├── {feature-name}-prd.md
213
+ ├── {feature-name}-sub-{module1-key}.md
214
+ ├── {feature-name}-sub-{module2-key}.md
651
215
  └── ...
652
216
  ```
653
217
 
654
- If the iteration directory does not exist, refer to the `000-sample` directory structure to create it.
655
-
656
- ## Step 12: Write PRD Files
657
-
658
- ### Step 12a: Plan File List (MANDATORY FIRST STEP)
218
+ ### 6.2 Plan File List
659
219
 
660
- Before writing any file, create a complete list of ALL files to generate:
661
-
662
- **For Single PRD Structure:**
220
+ **For Single PRD:**
663
221
 
664
222
  | # | File | Path |
665
223
  |---|------|------|
666
224
  | 1 | PRD | {iteration}/01.product-requirement/{feature-name}-prd.md |
667
225
 
668
- **For Master-Sub Structure (present this table to user):**
226
+ **For Master-Sub:**
669
227
 
670
228
  | # | File Type | Module | Path |
671
229
  |---|-----------|--------|------|
672
230
  | 1 | Master PRD | (system overview) | {iteration}/01.product-requirement/{feature-name}-prd.md |
673
- | 2 | Sub-PRD | {module-1-name} | {iteration}/01.product-requirement/{feature-name}-sub-{module-1-key}.md |
674
- | 3 | Sub-PRD | {module-2-name} | {iteration}/01.product-requirement/{feature-name}-sub-{module-2-key}.md |
231
+ | 2 | Sub-PRD | {module-1} | {iteration}/01.product-requirement/{feature-name}-sub-{module-1-key}.md |
675
232
  | ... | ... | ... | ... |
676
- | N+1 | Sub-PRD | {module-N-name} | {iteration}/01.product-requirement/{feature-name}-sub-{module-N-key}.md |
677
-
678
- Total files: 1 (Master) + N (Sub-PRDs) = N+1 files.
679
233
 
680
- ⚠️ **Present this file list to user for confirmation before proceeding.**
234
+ > ⚠️ **Present file list to user for confirmation before writing.**
681
235
 
682
- ---
236
+ ### 6.3 Write Master PRD
683
237
 
684
- ### Step 12b: Generate Master PRD
685
-
686
- 1. Read `templates/PRD-TEMPLATE.md` (already loaded in Step 7)
687
- 2. Create document using `create_file` at: `{iteration}/01.product-requirement/{feature-name}-prd.md`
688
-
689
- 3. Fill content using `search_replace` per section:
690
-
691
- **For Single PRD Structure** — fill ALL sections with full detail:
692
- - Section 1 (Background & Goals): Full background, goals
693
- - Section 2 (User Stories): All user stories with scenarios
694
- - Section 3 (Functional Requirements): All requirements including Feature Breakdown (3.4)
695
- - Section 4 (Non-functional Requirements): Performance, security, etc.
696
- - Section 5 (Acceptance Criteria): All criteria
697
- - Section 6 (Boundary Description): In/out scope
698
- - Section 7 (Assumptions & Dependencies)
699
-
700
- **For Master-Sub Structure** — fill ONLY system-level overview content:
701
-
702
- > ⚠️ **Master PRD = System Overview ONLY. All module-specific details go into Sub-PRDs.**
703
- > The Master PRD should read like an "executive summary" — a reader should understand
704
- > WHAT the system does and HOW modules relate, but NOT the detailed features of each module.
705
-
706
- - Section 1 (Background & Goals): System-wide background and goals (keep concise, 2-3 paragraphs max)
707
- - Section 2 (User Stories):
708
- - 2.1 Target Users: List all user roles with brief descriptions
709
- - 2.2 User Scenarios: **Maximum 3-5 HIGH-LEVEL system stories.** Each story describes a MODULE-LEVEL capability, NOT individual features.
710
- - ✅ Good: "As a store manager, I want a CRM system to manage customer relationships across all stores"
711
- - ❌ Bad: "As a beautician, I want to upload before/after photos" (this is module-specific, belongs in Sub-PRD)
712
- - Section 3 (Functional Requirements):
713
- - 3.1 Use Case Diagram: System-level use case diagram showing modules as use case groups (NOT individual features)
714
- - 3.2 Business Process Flow: ONE cross-module end-to-end process flow (the main business flow only)
715
- - 3.3 Feature List: **ONE row per MODULE** (NOT per feature). Columns: Module, Priority, Scope Summary, Key Capabilities (brief). Maximum N rows for N modules.
716
- - ✅ Good: `| M2-会员管理 | P0 | 顾客信息CRUD、自定义字段、公共池 |`
717
- - ❌ Bad: Listing 24 individual features across all modules
718
- - 3.4 Feature Breakdown: Write "See individual Sub-PRDs for module-specific Feature Breakdown"
719
- - 3.5 Feature Details: Write "See individual Sub-PRDs for module-specific Feature Details"
720
- - Section 4 (Non-functional Requirements): System-wide NFRs only (performance, security, compatibility — 1 line each)
721
- - Section 5 (Acceptance Criteria): **System-wide milestones only** (e.g., "All Phase 1 modules deployed"). NOT module-specific acceptance items.
722
- - Section 6 (Boundary Description): System-wide scope boundaries
723
- - Section 7 (Assumptions & Dependencies): System-wide dependencies
724
- - **APPEND after Section 7** using `search_replace` on the PRD Status line:
725
- - **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)
726
- - **Section 9: Sub-PRD Index** — List all Sub-PRD file paths with module names
727
-
728
- > ⚠️ **CRITICAL CONSTRAINTS:**
729
- > - **FORBIDDEN: `create_file` to rewrite the entire document**
730
- > - **MUST use `search_replace` to fill each section individually**
731
- > - **For Master-Sub: DO NOT include module-specific user stories, requirements, or Feature Breakdowns in the Master PRD**
238
+ **For Single PRD fill ALL sections with full detail.**
732
239
 
733
- ---
240
+ **For Master-Sub — fill system-level overview ONLY:**
734
241
 
735
- ### Step 12c: Sub-PRD Dispatch Plan (MANDATORY for Master-Sub)
242
+ > ⚠️ **Master PRD = System Overview ONLY. Module details go into Sub-PRDs.**
736
243
 
737
- **IF Step 8 determined Master-Sub structure:**
244
+ - Section 1: System-wide background (2-3 paragraphs max)
245
+ - Section 2.1: All user roles with brief descriptions
246
+ - Section 2.2: 3-5 HIGH-LEVEL system stories (module-level capabilities)
247
+ - Section 3.1: System-level use case diagram
248
+ - Section 3.2: ONE cross-module end-to-end process flow
249
+ - Section 3.3: ONE row per MODULE (not per feature)
250
+ - Section 3.4: "See individual Sub-PRDs"
251
+ - Section 4: System-wide NFRs (1 line each)
252
+ - Section 5: System-wide milestones only
253
+ - Section 8: Module list, dependency matrix, implementation phases
254
+ - Section 9: Sub-PRD Index (all file paths)
738
255
 
739
- ⚠️ **CRITICAL Sub-PRD Generation Rules:**
256
+ ## Step 7: Generate Dispatch Plan & Return
740
257
 
741
- 1. **DO NOT generate Sub-PRD files in this Skill** — this Skill outputs the dispatch plan ONLY
742
- 2. **DO NOT skip Sub-PRD generation** — If modules > 1, Sub-PRDs are REQUIRED
743
- 3. **This Skill MUST RETURN control to PM Agent for Phase 4 execution**
258
+ **IF Master-Sub Structure:**
744
259
 
745
- Prepare and output the dispatch plan for the PM Agent:
260
+ > ⚠️ **CRITICAL Sub-PRD Generation Rules:**
261
+ > 1. **DO NOT generate Sub-PRD files in this Skill** — output dispatch plan ONLY
262
+ > 2. **DO NOT skip Sub-PRD generation** — Sub-PRDs are REQUIRED
263
+ > 3. **RETURN control to PM Agent for Phase 4 execution**
746
264
 
747
- **Sub-PRD Dispatch Plan:**
748
-
749
- For each module from Step 6.1, prepare worker context:
265
+ **Output Sub-PRD Dispatch Plan:**
750
266
 
751
267
  | # | Module | module_key | Sub-PRD Path | Feature Count |
752
268
  |---|--------|-----------|--------------|---------------|
@@ -754,266 +270,70 @@ For each module from Step 6.1, prepare worker context:
754
270
  | 2 | {module-2-name} | {module-2-key} | {feature-name}-sub-{module-2-key}.md | {count} |
755
271
  | ... | ... | ... | ... | ... |
756
272
 
757
- For each module, collect and output the following context data:
758
- - `module_name`: Module name
759
- - `module_key`: Module identifier (for file naming)
760
- - `module_scope`: What this module covers (from Step 6.1)
761
- - `module_entities`: Core entities (from Step 6.1)
762
- - `module_user_stories`: User stories specific to this module (from Steps 1-5 analysis)
763
- - `module_requirements`: Functional requirements for this module (P0/P1/P2)
764
- - `module_features`: Feature Breakdown entries for this module (from Step 9.1 analysis)
765
- - `module_dependencies`: Dependencies on other modules (from Step 6.2)
766
-
767
- After outputting the dispatch plan:
768
-
769
- ```
770
- → **MANDATORY: RETURN to PM Agent Phase 4 (Sub-PRD Worker Dispatch)**
771
- → PM Agent MUST invoke speccrew-task-worker for each module
772
- → Each worker uses speccrew-pm-sub-prd-generate/SKILL.md
773
- → All workers execute in parallel
774
- → After ALL workers complete → PM Agent executes Phase 5 Verification
775
- ```
776
-
777
- **IF PM Agent skips Phase 4:**
778
- - Sub-PRDs will NOT be generated
779
- - Master PRD alone is INCOMPLETE for Feature Design stage
780
- - Entire PRD stage must be redone
781
-
782
- **IF Single PRD Structure:** Skip this step (no Sub-PRDs needed).
783
-
784
- ---
785
-
786
- ### Step 12d: Verification Checklist (Execute after all Sub-PRDs are generated)
787
-
788
- **After PM Agent confirms all workers have completed, verify:**
789
-
790
- - [ ] Master PRD exists and file size > 2KB
791
- - [ ] [Master-Sub] All {sub_prd_count} Sub-PRD files exist
792
- - [ ] [Master-Sub] Each Sub-PRD file size > 3KB
793
- - [ ] [Master-Sub] Master PRD Section 9 (Sub-PRD Index) matches actual files
794
- - [ ] [Master-Sub] Each Sub-PRD contains Section 3.4 Feature Breakdown
795
-
796
- IF any check fails → Report error and fix before proceeding.
797
-
798
- After all Sub-PRDs are verified, update `.checkpoints.json`:
799
- - Set `sub_prd_dispatch.passed = true`
800
- - Set `sub_prd_dispatch.confirmed_at` via real timestamp
801
- - Add sub_prd summary:
273
+ **For each module, provide context:**
802
274
 
803
275
  ```json
804
- "sub_prd_dispatch": {
805
- "passed": true,
806
- "confirmed_at": "{REAL_TIMESTAMP}",
807
- "total_modules": 11,
808
- "sub_prds": [
276
+ {
277
+ "module_name": "Module Name",
278
+ "module_key": "module-key",
279
+ "module_scope": "What this module covers",
280
+ "module_entities": ["Entity1", "Entity2"],
281
+ "module_user_stories": ["Story 1", "Story 2"],
282
+ "module_requirements": ["Requirement in business language"],
283
+ "module_features": [
809
284
  {
810
- "module_key": "member",
811
- "module_name": "Member Management",
812
- "file_path": "crm-system-sub-member.md",
813
- "status": "completed",
814
- "has_feature_breakdown": true,
815
- "feature_count": 5
285
+ "feature_id": "F-MOD-01",
286
+ "feature_name": "Feature Name",
287
+ "type": "User Interaction",
288
+ "priority": "P0",
289
+ "description": "Business description"
816
290
  }
817
- ]
291
+ ],
292
+ "module_dependencies": ["Depends on module X for Y"]
818
293
  }
819
294
  ```
820
295
 
821
- ---
822
-
823
- ### Step 12e: Present Documents for User Review
824
-
825
- Present the generated document summary to user:
826
-
827
- **Single PRD:**
828
- ```
829
- PRD generated: {path}
830
- ```
831
-
832
- **Master-Sub PRD:**
833
- ```
834
- Master PRD: {master_path}
835
- Sub-PRDs ({sub_prd_count} files):
836
- 1. {module-1}: {sub_prd_1_path}
837
- 2. {module-2}: {sub_prd_2_path}
838
- ...
839
- N. {module-N}: {sub_prd_N_path}
840
-
841
- Total files generated: {sub_prd_count + 1}
842
- ```
843
-
844
- Ask user to review the documents and check:
845
- 1. Feature boundary accurate?
846
- 2. Acceptance criteria quantifiable?
847
- 3. Not In Scope complete?
848
- 4. [Master-Sub] Module decomposition appropriate?
849
- 5. [Existing features] EXISTING/MODIFIED/NEW markers accurate?
850
-
851
- ⚠️ **HARD STOP — WAIT FOR USER CONFIRMATION**
852
-
853
- ```
854
- DO NOT proceed to Step 13 until user explicitly confirms.
855
- DO NOT update any status files or mark documents as confirmed.
856
- DO NOT suggest moving to the next stage.
857
-
858
- Wait for user to respond with confirmation (e.g., "确认", "OK", "没问题").
859
- IF user requests changes → make the changes, then re-present for review.
860
- ONLY after user explicitly confirms → proceed to Step 13.
861
- ```
862
-
863
- ## Step 13: Finalize PRD Stage (ONLY after user explicitly confirms)
864
-
865
- ⚠️ **PREREQUISITE: User has explicitly confirmed the PRD documents in Step 12e.**
866
- IF user has NOT confirmed yet → DO NOT execute this step. Return to Step 12e and wait.
867
-
868
- ### 13a Update Workflow Progress
869
-
870
- Use the `update-progress.js` script to update workflow status with real timestamps:
871
-
872
- ```bash
873
- node speccrew-workspace/scripts/update-progress.js update-workflow \
874
- --file speccrew-workspace/iterations/{iteration}/WORKFLOW-PROGRESS.json \
875
- --stage 01_prd --status confirmed \
876
- --output "01.product-requirement/{feature-name}-prd.md,01.product-requirement/{feature-name}-sub-{module1}.md,..."
877
- ```
878
-
879
- > The script automatically generates real ISO timestamps for `completed_at` and `confirmed_at`.
880
- > **DO NOT manually construct timestamps** — LLM-generated timestamps are always incorrect.
296
+ > ⚠️ **MANDATORY: Content Boundary Constraint for Workers**
297
+ > "PM Stage Content Boundary applies — NO API definitions, NO database structures, NO code snippets. Use BUSINESS LANGUAGE ONLY."
881
298
 
882
- IF the script is not available or fails, use the following shell command to get the real timestamp:
883
- ```bash
884
- node -e "console.log(new Date().toISOString())"
299
+ **Return message:**
885
300
  ```
886
- Then use the output to fill in the JSON fields manually.
887
-
888
- ### 13b Write Checkpoint File
889
-
890
- 1. First, get the real current timestamp:
891
- ```bash
892
- node -e "console.log(new Date().toISOString())"
893
- ```
894
-
895
- 2. Write or update the checkpoint file using the REAL timestamp from the command above:
896
- ```
897
- speccrew-workspace/iterations/{iteration}/01.product-requirement/.checkpoints.json
898
- ```
899
-
900
- Content (use the REAL timestamp from the command output):
901
- ```json
902
- {
903
- "stage": "01_prd",
904
- "checkpoints": {
905
- "requirement_clarification": {
906
- "passed": true,
907
- "confirmed_at": "{REAL_TIMESTAMP_FROM_COMMAND}",
908
- "description": "Requirement clarification completed",
909
- "clarification_file": ".clarification-summary.md",
910
- "sufficiency_checks": {
911
- "business_problem": true,
912
- "target_users": true,
913
- "scope_boundaries": true,
914
- "existing_system": true
915
- }
916
- },
917
- "sub_prd_dispatch": {
918
- "passed": true,
919
- "confirmed_at": "{REAL_TIMESTAMP_FROM_COMMAND}",
920
- "description": "Sub-PRD generation via worker dispatch",
921
- "total_modules": 11,
922
- "sub_prds": [
923
- {
924
- "module_key": "member",
925
- "module_name": "Member Management",
926
- "file_path": "crm-system-sub-member.md",
927
- "status": "completed",
928
- "has_feature_breakdown": true,
929
- "feature_count": 5
930
- }
931
- ]
932
- },
933
- "verification_checklist": {
934
- "passed": true,
935
- "confirmed_at": "{REAL_TIMESTAMP_FROM_COMMAND}",
936
- "description": "PRD structure and content verification",
937
- "checks": {
938
- "master_prd_exists": true,
939
- "master_prd_size": true,
940
- "sub_prds_exist": true,
941
- "sub_prd_index_match": true,
942
- "feature_breakdown_present": true
943
- }
944
- },
945
- "prd_review": {
946
- "passed": true,
947
- "confirmed_at": "{REAL_TIMESTAMP_FROM_COMMAND}",
948
- "description": "User review and confirmation of all PRD documents"
949
- }
950
- }
951
- }
301
+ MANDATORY: RETURN to PM Agent Phase 4 (Sub-PRD Worker Dispatch)
302
+ → PM Agent invokes speccrew-task-worker for each module
303
+ Each worker uses speccrew-pm-sub-prd-generate/SKILL.md
304
+ → After ALL workers complete → PM Agent executes Phase 5 Verification
952
305
  ```
953
306
 
954
- ### 13c Update PRD Document Status
955
-
956
- Update the PRD document status line from Draft to Confirmed:
957
-
958
- Use `search_replace` on the Master PRD (and all Sub-PRDs if Master-Sub structure):
959
- - Replace `📝 Draft` with `✅ Confirmed`
960
- - Replace `[Date]` with the real date from the timestamp command
961
- - Replace `[Name]` with `User`
307
+ **IF Single PRD Structure:** Skip dispatch plan (no Sub-PRDs needed).
962
308
 
963
- ### 13d Handle Missing Progress File
964
-
965
- If WORKFLOW-PROGRESS.json does not exist (backward compatibility):
966
- - Create the file with initial structure
967
- - Set `01_prd` to confirmed state directly
968
- - Other stages remain as `pending`
969
-
970
- **Status Flow**: `pending` → `in_progress` → `completed` → `confirmed`
309
+ ---
971
310
 
972
- ### 13e Output Completion Message
311
+ # Output Checklist
973
312
 
974
- After all status files are updated:
313
+ - [ ] Both prerequisite files verified
314
+ - [ ] PRD template loaded
315
+ - [ ] PRD structure determined (Single vs Master-Sub)
316
+ - [ ] All sections filled with business language only
317
+ - [ ] Feature Breakdown extracted with appropriate granularity
318
+ - [ ] Task granularity checked (completable in one iteration)
319
+ - [ ] File list confirmed with user
320
+ - [ ] Master PRD written to correct path
321
+ - [ ] [Master-Sub] Dispatch Plan generated
322
+ - [ ] [Master-Sub] Returned control to PM Agent
975
323
 
976
- ```
977
- ✅ PRD documents have been confirmed. PRD stage is complete.
978
- When you are ready to proceed with Feature Design, please start a new conversation and invoke the Feature Designer Agent.
979
- ```
324
+ ---
980
325
 
981
- **END** — Do not proceed further.
326
+ # Constraints
982
327
 
983
- ---
328
+ **Must do:**
329
+ - Verify both prerequisite files exist before starting
330
+ - Use business language only in all PRD content
331
+ - Use `search_replace` for section filling (not `create_file`)
332
+ - Include Feature Breakdown in every PRD/Sub-PRD
333
+ - Pass control to PM Agent after dispatch plan
984
334
 
985
- # Knowledge Loading Strategy
986
-
987
- 1. **First**: Read `system-overview.md` for system context
988
- 2. **Then**: Load related `{module}-overview.md` files
989
- 3. **As needed**: Query graph for cross-module relationships
990
-
991
- # Checklist
992
-
993
- - [ ] All unclear requirements have been clarified with the user (progressive multi-round)
994
- - [ ] Sufficiency check passed: problem, users, scenarios, scope, existing system relationship all clear
995
- - [ ] System overview and related module overviews loaded
996
- - [ ] Business module boundaries confirmed with existing features
997
- - [ ] Active iterations have been checked for similar/related requirements
998
- - [ ] **[If similar requirements found]** User has confirmed whether to create new iteration or extend existing
999
- - [ ] Complexity assessed and appropriate workflow path selected
1000
- - [ ] **[Complex path]** ISA-95 Checkpoint A passed: domain boundary confirmed
1001
- - [ ] **[Complex path]** ISA-95 Checkpoint B passed: MVP scope confirmed
1002
- - [ ] **[Complex path]** ISA-95 Checkpoint C passed: complete modeling confirmed
1003
- - [ ] **[Complex path]** All Mermaid diagrams follow mermaid-rule.md
1004
- - [ ] **[Complex path]** Module decomposition completed: module list, dependency matrix, implementation order
1005
- - [ ] **[Complex path]** Module decomposition confirmed with user
1006
- - [ ] PRD structure (single vs master-sub) determined appropriately
1007
- - [ ] **[Master-Sub]** Master PRD includes architecture overview, module list, dependency matrix, implementation phases
1008
- - [ ] **[Master-Sub]** Each Sub-PRD covers exactly one module with interface contracts
1009
- - [ ] **Feature Breakdown** extracted with appropriate granularity (each feature completable in 1 sprint)
1010
- - [ ] **Feature Breakdown** includes Feature IDs, Types (User Interaction / Backend Process), and dependencies
1011
- - [ ] PRD completely filled according to template structure
1012
- - [ ] User story granularity aligns with "single iteration completable" principle
1013
- - [ ] Acceptance criteria are quantifiable and verifiable
1014
- - [ ] Boundary description includes clear Not In Scope
1015
- - [ ] **[If modifying existing features]** All changes marked with [EXISTING]/[MODIFIED]/[NEW]
1016
- - [ ] Files written to correct paths
1017
- - [ ] Summary shown to user and confirmation requested
1018
- - [ ] **[After confirmation]** Checkpoint file written to `01.product-requirement/.checkpoints.json`
1019
- - [ ] **[After confirmation]** WORKFLOW-PROGRESS.json updated with confirmed status and outputs
335
+ **Must not do:**
336
+ - Include technical implementation details
337
+ - Generate Sub-PRD files directly (dispatch plan only)
338
+ - Skip user confirmation for file list
339
+ - Proceed without prerequisite files