speccrew 0.7.74 โ†’ 0.7.76

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.
Files changed (71) hide show
  1. package/.speccrew/agents/speccrew-feature-designer.md +4 -647
  2. package/.speccrew/agents/speccrew-product-manager.md +5 -480
  3. package/.speccrew/agents/speccrew-system-deployer.md +6 -457
  4. package/.speccrew/agents/speccrew-system-developer.md +9 -913
  5. package/.speccrew/agents/speccrew-test-manager.md +403 -1112
  6. package/.speccrew/skills/speccrew-agentflow-manager/SKILL.md +6 -149
  7. package/.speccrew/skills/speccrew-deploy-build/SKILL.md +2 -59
  8. package/.speccrew/skills/speccrew-deploy-migrate/SKILL.md +2 -64
  9. package/.speccrew/skills/speccrew-deploy-smoke-test/SKILL.md +2 -75
  10. package/.speccrew/skills/speccrew-deploy-startup/SKILL.md +2 -70
  11. package/.speccrew/skills/speccrew-dev-backend/SKILL.md +2 -381
  12. package/.speccrew/skills/speccrew-dev-desktop-electron/SKILL.md +2 -369
  13. package/.speccrew/skills/speccrew-dev-desktop-tauri/SKILL.md +2 -362
  14. package/.speccrew/skills/speccrew-dev-frontend/SKILL.md +2 -304
  15. package/.speccrew/skills/speccrew-dev-mobile/SKILL.md +2 -294
  16. package/.speccrew/skills/speccrew-dev-review-backend/SKILL.md +2 -204
  17. package/.speccrew/skills/speccrew-dev-review-desktop/SKILL.md +2 -173
  18. package/.speccrew/skills/speccrew-dev-review-frontend/SKILL.md +2 -169
  19. package/.speccrew/skills/speccrew-dev-review-mobile/SKILL.md +2 -173
  20. package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +2 -251
  21. package/.speccrew/skills/speccrew-fd-feature-analyze/SKILL.md +2 -254
  22. package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +2 -748
  23. package/.speccrew/skills/speccrew-feature-designer-orchestration/SKILL.md +6 -105
  24. package/.speccrew/skills/speccrew-get-timestamp/SKILL.md +6 -33
  25. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +3 -138
  26. package/.speccrew/skills/speccrew-knowledge-bizs-api-graph/SKILL.md +3 -283
  27. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +3 -1014
  28. package/.speccrew/skills/speccrew-knowledge-bizs-identify-entries/SKILL.md +4 -343
  29. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +4 -235
  30. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/SKILL.md +6 -72
  31. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +3 -534
  32. package/.speccrew/skills/speccrew-knowledge-bizs-ui-graph/SKILL.md +3 -432
  33. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/SKILL.md +4 -391
  34. package/.speccrew/skills/speccrew-knowledge-graph-query/SKILL.md +3 -98
  35. package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +3 -92
  36. package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +3 -181
  37. package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +3 -148
  38. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +3 -330
  39. package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +6 -159
  40. package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +3 -142
  41. package/.speccrew/skills/speccrew-knowledge-techs-generate-quality/SKILL.md +3 -568
  42. package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +3 -180
  43. package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +3 -154
  44. package/.speccrew/skills/speccrew-knowledge-techs-init/SKILL.md +3 -176
  45. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +3 -135
  46. package/.speccrew/skills/speccrew-pm-knowledge-detector/SKILL.md +4 -88
  47. package/.speccrew/skills/speccrew-pm-module-initializer/SKILL.md +4 -178
  48. package/.speccrew/skills/speccrew-pm-module-matcher/SKILL.md +3 -102
  49. package/.speccrew/skills/speccrew-pm-phase0-init/SKILL.md +5 -78
  50. package/.speccrew/skills/speccrew-pm-phase1-knowledge-check/SKILL.md +5 -85
  51. package/.speccrew/skills/speccrew-pm-phase2-complexity-assess/SKILL.md +4 -100
  52. package/.speccrew/skills/speccrew-pm-phase5-subprd-dispatch/SKILL.md +14 -106
  53. package/.speccrew/skills/speccrew-pm-phase6-verify-confirm/SKILL.md +7 -84
  54. package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +6 -66
  55. package/.speccrew/skills/speccrew-pm-requirement-assess/SKILL.md +4 -96
  56. package/.speccrew/skills/speccrew-pm-requirement-clarify/SKILL.md +4 -131
  57. package/.speccrew/skills/speccrew-pm-requirement-model/SKILL.md +6 -79
  58. package/.speccrew/skills/speccrew-pm-requirement-simple/SKILL.md +4 -76
  59. package/.speccrew/skills/speccrew-pm-sub-prd-generate/SKILL.md +3 -281
  60. package/.speccrew/skills/speccrew-product-manager-orchestration/SKILL.md +6 -165
  61. package/.speccrew/skills/speccrew-system-deployer-orchestration/SKILL.md +6 -79
  62. package/.speccrew/skills/speccrew-system-designer-orchestration/SKILL.md +2 -35
  63. package/.speccrew/skills/speccrew-system-developer-orchestration/SKILL.md +6 -98
  64. package/.speccrew/skills/speccrew-task-worker-execution/SKILL.md +6 -94
  65. package/.speccrew/skills/speccrew-team-leader-routing/SKILL.md +6 -79
  66. package/.speccrew/skills/speccrew-test-case-design/SKILL.md +2 -58
  67. package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +2 -61
  68. package/.speccrew/skills/speccrew-test-manager-orchestration/SKILL.md +6 -94
  69. package/.speccrew/skills/speccrew-test-reporter/SKILL.md +2 -102
  70. package/.speccrew/skills/speccrew-test-runner/SKILL.md +3 -121
  71. package/package.json +1 -1
@@ -83,6 +83,7 @@ When involving related domains:
83
83
  # ๐Ÿ›‘ CRITICAL: dispatch-to-worker Protocol
84
84
 
85
85
  ### Definition
86
+
86
87
  When `action="dispatch-to-worker"` appears in the orchestration workflow:
87
88
 
88
89
  **You (PM Agent) MUST:**
@@ -130,6 +131,10 @@ PM continues to next orchestration block
130
131
 
131
132
  # Workflow
132
133
 
134
+ > **Detailed Phase workflow is defined in the orchestration SKILL.xml.**
135
+ > Agent MUST load and execute SKILL.xml block-by-block per EXECUTION PROTOCOL.
136
+ > Phase Overview: P0(Init) โ†’ P1(Knowledge) โ†’ P2(Complexity) โ†’ P3(Clarify) โ†’ P4(PRD Gen) โ†’ P5(Sub-PRD Dispatch, complex only) โ†’ P6(Verify & Confirm)
137
+
133
138
  ## AgentFlow Definition
134
139
 
135
140
  <!-- @skill: speccrew-product-manager-orchestration -->
@@ -173,485 +178,6 @@ Phase 0 done. Moving to Phase 1...
173
178
 
174
179
  ---
175
180
 
176
- ## Phase Overview
177
-
178
- | Phase | Purpose | Skill | Execution Mode |
179
- |-------|---------|-------|----------------|
180
- | **Phase 0** | Initialization & Context Setup | `speccrew-pm-phase0-init` | Worker dispatch |
181
- | **Phase 1** | Knowledge Base Detection & Init | `speccrew-pm-phase1-knowledge-check` | Worker dispatch |
182
- | **Phase 2** | Complexity Assessment | `speccrew-pm-phase2-complexity-assess` | Worker dispatch |
183
- | **Phase 3** | Requirement Clarification | `speccrew-pm-requirement-clarify` | Worker dispatch |
184
- | **Phase 4a** | ISA-95 Modeling (complex) | `speccrew-pm-requirement-model` | Worker dispatch |
185
- | **Phase 4b** | PRD Generation (complex) | `speccrew-pm-requirement-analysis` | Worker dispatch |
186
- | **Phase 4** | Simple PRD Generation | `speccrew-pm-requirement-simple` | Worker dispatch |
187
- | **Phase 5** | Sub-PRD Dispatch (complex) | `speccrew-pm-phase5-subprd-dispatch` | PM Direct Orchestration |
188
- | **Phase 6** | Verification & Confirmation | `speccrew-pm-phase6-verify-confirm` | Worker dispatch |
189
-
190
- ---
191
-
192
- ## Phase 0: Initialization
193
-
194
- <!-- Phase 0 ็š„่ฏฆ็ป†ๆญฅ้ชคๅทฒๆๅ–ๅˆฐ AgentFlow Skill: speccrew-pm-phase0-init -->
195
- <!-- ๆ‰ง่กŒๆ—ถ็”ฑ orchestration ้€š่ฟ‡ dispatch-to-worker ่ฐƒ็”จ -->
196
-
197
- **Purpose**: Create or locate iteration directory, initialize workflow progress tracking.
198
-
199
- **Key Outputs**:
200
- - Iteration directory: `{iterations_dir}/{number}-{type}-{name}/`
201
- - WORKFLOW-PROGRESS.json initialized
202
-
203
- **Critical Rules**:
204
- - Iteration directory naming: `{number}-{type}-{name}` (e.g., `001-feature-litemes`)
205
- - DO NOT manually create WORKFLOW-PROGRESS.json โ€” MUST use `update-progress.js` script
206
-
207
- **Progress Sync Recovery**: If WORKFLOW-PROGRESS.json or DISPATCH-PROGRESS.json exists but appears stale or inconsistent with actual file state, run:
208
- ```
209
- node "speccrew-workspace/scripts/update-progress.js" sync --phase {current_phase}
210
- ```
211
- This rebuilds progress from actual file system state, preventing phantom task tracking.
212
-
213
- ---
214
-
215
- ## Phase 1: Knowledge Base Availability Check
216
-
217
- <!-- Phase 1 ็š„่ฏฆ็ป†ๆญฅ้ชคๅทฒๆๅ–ๅˆฐ AgentFlow Skill: speccrew-pm-phase1-knowledge-check -->
218
- <!-- ๆ‰ง่กŒๆ—ถ็”ฑ orchestration ้€š่ฟ‡ dispatch-to-worker ่ฐƒ็”จ -->
219
-
220
- **Purpose**: Detect knowledge base status, initialize if needed, prepare system context.
221
-
222
- ### 1.1 Knowledge Detection
223
-
224
- Dispatch Worker with `speccrew-pm-knowledge-detector` skill to detect knowledge base status.
225
-
226
- **Worker returns**:
227
- ```json
228
- {
229
- "status": "full | lite | none",
230
- "has_system_overview": true/false,
231
- "has_features": true/false,
232
- "available_platforms": [...],
233
- "module_count": number
234
- }
235
- ```
236
-
237
- ### 1.2 Branch on Knowledge Status
238
-
239
- | Status | Action | Next Step |
240
- |--------|--------|-----------|
241
- | `full` | Read system overview summary | Phase 2 |
242
- | `lite` | Dispatch matcher, optionally initialize matched modules | Phase 2 |
243
- | `none` | **MANDATORY**: Auto-initialize feature inventory | Phase 2 |
244
-
245
- ### 1.3 Critical Constraints
246
-
247
- > ๐Ÿ›‘ **MANDATORY โ€” Skill-Based Execution:**
248
- > - Knowledge Detection: MUST dispatch Worker with `speccrew-pm-knowledge-detector` skill
249
- > - Module Matching: MUST dispatch Worker with `speccrew-pm-module-matcher` skill
250
- > - Feature Inventory: MUST dispatch Worker with `speccrew-knowledge-bizs-init-features` skill
251
- >
252
- > **FORBIDDEN โ€” Manual File Operations:**
253
- > - DO NOT create `features-*.json` or `entry-dirs-*.json` files manually
254
- > - DO NOT write to `knowledges/techs/*/sync-state/` โ€” sync-state ONLY exists under `knowledges/base/`
255
- > - ALL feature files MUST be generated by scripts executed via Worker Agents
256
- > - PM Agent MUST NOT execute knowledge-base scripts via Bash directly
257
-
258
- ### 1.4 Output
259
-
260
- After Phase 1 completes, store:
261
- - `knowledge_status`: "full" | "lite" | "none"
262
- - `system_context`: Summary from system-overview.md or module list
263
- - `matched_modules`: List of relevant modules (if matcher invoked)
264
-
265
- ---
266
-
267
- ## Phase 2: Complexity Assessment & Skill Routing
268
-
269
- <!-- Phase 2 ็š„่ฏฆ็ป†ๆญฅ้ชคๅทฒๆๅ–ๅˆฐ AgentFlow Skill: speccrew-pm-phase2-complexity-assess -->
270
- <!-- ๆ‰ง่กŒๆ—ถ็”ฑ orchestration ้€š่ฟ‡ dispatch-to-worker ่ฐƒ็”จ -->
271
-
272
- **Purpose**: Evaluate requirement complexity and route to appropriate skill path.
273
-
274
- ### 2.1 Complexity Indicators
275
-
276
- | Indicator | Simple | Complex |
277
- |-----------|--------|---------|
278
- | Modules affected | 1-2 modules | 3+ modules |
279
- | Estimated features | 1-5 features | 6+ features |
280
- | System scope | Change to existing system | New system or major subsystem |
281
- | PRD structure | Single PRD | Master + Sub-PRDs |
282
- | Cross-module dependencies | None or minimal | Significant |
283
-
284
- ### 2.2 Skill Routing
285
-
286
- | Complexity | Skill | Characteristics |
287
- |-----------|-------|-----------------|
288
- | Simple | `speccrew-pm-requirement-simple` | Single PRD, streamlined flow |
289
- | Complex | `speccrew-pm-requirement-analysis` | Master-Sub PRD, worker dispatch |
290
-
291
- > โš ๏ธ **Default to Simple when in doubt.** It's easier to escalate from simple to complex than to simplify an over-engineered analysis.
292
-
293
- ---
294
-
295
- ## Phase 3: Requirement Clarification
296
-
297
- <!-- Phase 3 ็š„่ฏฆ็ป†ๆญฅ้ชคๅทฒๆๅ–ๅˆฐ AgentFlow Skill: speccrew-pm-requirement-clarify -->
298
- <!-- ๆ‰ง่กŒๆ—ถ็”ฑ orchestration ้€š่ฟ‡ dispatch-to-worker ่ฐƒ็”จ -->
299
-
300
- **Purpose**: Clarify requirements through Worker dispatch, generate clarification summary.
301
-
302
- ### 3.1 Prepare Parameters
303
-
304
- | Parameter | Value |
305
- |-----------|-------|
306
- | `requirement_file` | Path to user's requirement document |
307
- | `iteration_path` | `{iterations_dir}/{iteration}` (absolute path) |
308
- | `complexity_hint` | `simple` or `complex` (from Phase 2) |
309
- | `knowledge_status` | `full` / `lite` / `none` (from Phase 1) |
310
- | `language` | User's language (e.g., `zh`, `en`) |
311
-
312
- ### 3.2 Dispatch Clarification Worker
313
-
314
- **Action**: Create a Task for `speccrew-task-worker` with `speccrew-pm-requirement-clarify` skill.
315
-
316
- **FORBIDDEN**:
317
- - DO NOT invoke skill directly via Skill tool
318
- - DO NOT perform clarification rounds yourself
319
- - DO NOT generate `.clarification-summary.md` manually
320
-
321
- **REQUIRED**:
322
- - MUST use Agent tool to dispatch Worker Agent
323
- - MUST pass all context parameters to the Worker
324
- - MUST wait for Worker to complete and return results
325
-
326
- ### 3.3 Validate Output
327
-
328
- **MANDATORY**: Check `.clarification-summary.md` exists with:
329
- - [ ] File is non-empty (> 500 bytes)
330
- - [ ] Contains "Complexity" section with `simple` or `complex` value
331
- - [ ] All 4 sufficiency checks passed
332
-
333
- ### 3.4 Failure Handling
334
-
335
- **IF validation fails OR skill reports error:**
336
- 1. Report error to user with details
337
- 2. Ask: "Retry clarification with additional context?" or "Abort workflow?"
338
- 3. DO NOT create `.clarification-summary.md` manually
339
- 4. DO NOT proceed to Phase 4 without valid clarification
340
-
341
- ### 3.5 User Confirmation Gate
342
-
343
- > ๐Ÿ›‘ **GATE: User Confirmation Required Before PRD Generation**
344
- >
345
- > **HARD STOP โ€” DO NOT proceed to Phase 4 without explicit user confirmation.**
346
- >
347
- > โš ๏ธ FORBIDDEN ACTIONS:
348
- > - DO NOT auto-proceed to Phase 4
349
- > - DO NOT assume clarification results are accepted without user confirmation
350
- > - DO NOT update checkpoints for Phase 4 readiness before confirmation
351
-
352
- **After validation passes:**
353
- 1. Present Clarification Summary to User
354
- 2. STOP and Request Confirmation: "้œ€ๆฑ‚ๆพ„ๆธ…ๅทฒๅฎŒๆˆ๏ผŒ่ฏทๅฎกๆŸฅไปฅไธŠ็ป“ๆžœใ€‚็กฎ่ฎคๆ— ่ฏฏๅŽๅฐ†่ฟ›ๅ…ฅ PRD ็”Ÿๆˆ้˜ถๆฎตใ€‚"
355
- 3. Options:
356
- - "็กฎ่ฎค" or "OK" โ†’ Update checkpoint, Proceed to Phase 4
357
- - "้œ€่ฆไฟฎๆ”น" + details โ†’ Return to Phase 3 with updated context
358
- - "ๅ–ๆถˆ" โ†’ Abort workflow
359
-
360
- ---
361
-
362
- ## Phase 4: Invoke PRD Skill
363
-
364
- > โš ๏ธ **PM AGENT ORCHESTRATION PRINCIPLE (ALL PHASES 0-6)**
365
- > You are the ORCHESTRATOR, NOT the WRITER:
366
- > - Phase 0-3: DO NOT run scripts or create files yourself โ†’ Dispatch Worker
367
- > - Phase 4a (Model): DO NOT do ISA-95 analysis yourself โ†’ Dispatch Worker
368
- > - Phase 4a.5 (Confirm): MUST stop for user confirmation after module design
369
- > - Phase 4b (Generate): DO NOT generate Master PRD yourself โ†’ Dispatch Worker
370
- > - Phase 5: DO NOT generate Sub-PRD yourself โ†’ Workers generate them
371
- > - Phase 6: DO NOT modify PRD content yourself โ†’ Only verify and present
372
- > - **If ANY Skill fails: STOP and report error to user. DO NOT generate content as fallback.**
373
-
374
- ### Path A: Simple Requirements
375
-
376
- <!-- Phase 4 Simple ็š„่ฏฆ็ป†ๆญฅ้ชคๅœจ speccrew-pm-requirement-simple skill ไธญๅฎšไน‰ -->
377
-
378
- **Condition**: Complexity = `simple` (from `.clarification-summary.md`)
379
-
380
- **Flow**:
381
- ```
382
- Dispatch Worker with speccrew-pm-requirement-simple
383
- โ†’ Pass: iteration_path, clarification_file, language
384
- โ†’ Wait for: Single PRD file
385
- โ†’ Validate: PRD file exists and size > 2KB
386
- โ†’ IF fails โ†’ ABORT (ORCHESTRATOR rule)
387
- โ†’ IF succeeds โ†’ Skip Phase 5, go to Phase 6
388
- ```
389
-
390
- ### Path B: Complex Requirements
391
-
392
- <!-- Phase 4a/4b ็š„่ฏฆ็ป†ๆญฅ้ชคๅˆ†ๅˆซๅœจ speccrew-pm-requirement-model ๅ’Œ speccrew-pm-requirement-analysis skill ไธญๅฎšไน‰ -->
393
-
394
- **Condition**: Complexity = `complex` (from `.clarification-summary.md`)
395
-
396
- **Flow**:
397
- ```
398
- Step 4a: Dispatch Worker with speccrew-pm-requirement-model
399
- โ†’ Pass: iteration_path, clarification_file, language
400
- โ†’ Wait for: .module-design.md
401
- โ†’ Validate: .module-design.md exists + module count >= 2
402
- โ†’ IF fails โ†’ ABORT (do NOT do module decomposition yourself)
403
-
404
- Step 4a.5: User Confirmation Gate (MANDATORY)
405
- โ†’ Present: Module design summary to user
406
- โ†’ Request: Explicit confirmation before proceeding
407
- โ†’ IF user requests changes โ†’ Return to Phase 3 with feedback
408
- โ†’ IF user confirms โ†’ Proceed to Step 4b
409
-
410
- Step 4b: Dispatch Worker with speccrew-pm-requirement-analysis
411
- โ†’ Pass: iteration_path, clarification_file, module_design_file, language
412
- โ†’ Wait for: Master PRD + Dispatch Plan
413
- โ†’ Validate: Master PRD exists + Dispatch Plan has modules array
414
- โ†’ IF fails โ†’ ABORT (do NOT generate PRD yourself)
415
- โ†’ IF succeeds โ†’ MANDATORY: Execute Phase 5
416
- ```
417
-
418
- ### Error Recovery Rules
419
-
420
- > โš ๏ธ **ABORT CONDITIONS โ€” Execution MUST STOP:**
421
- > - Skill reported execution failure
422
- > - Output files were not generated
423
- > - Output validation failed
424
- >
425
- > **FORBIDDEN ACTIONS:**
426
- > - DO NOT generate PRD content yourself
427
- > - DO NOT create partial PRD documents
428
- > - DO NOT proceed to next phase without valid output
429
-
430
- **Actions**:
431
- 1. Report error to user with specific reason
432
- 2. Ask: "Retry with additional context?" or "Abort workflow?"
433
- 3. IF retry โ†’ Return to appropriate phase with additional context
434
- 4. IF abort โ†’ END workflow
435
-
436
- ---
437
-
438
- ## Phase 5: Sub-PRD Worker Dispatch (PM Direct Orchestration)
439
-
440
- <!-- Phase 5 ๆ˜ฏ PM ็›ดๆŽฅๆ‰ง่กŒ็š„็ผ–ๆŽ’ Skill๏ผŒPM ๅฟ…้กป่ฏปๅ– SKILL.xml ๅนถๆŒ‰ๆญฅ้ชคๆ‰ง่กŒ -->
441
- <!-- โš ๏ธ ่ฟ™้‡Œ็š„ dispatch-to-worker ๅ—็”ฑ PM Agent ็›ดๆŽฅๆ‰ง่กŒ๏ผŒไธ่ƒฝๅง”ๆดพ็ป™ Worker -->
442
-
443
- **Purpose**: As the orchestration layer, PM Agent directly coordinates batch dispatch of Sub-PRD generation tasks to Worker Agents.
444
-
445
- > ๐Ÿ›‘ **CRITICAL ARCHITECTURE RULE (Harness Principle 17: Orchestration Layer Separation)**
446
- >
447
- > Phase 5 is an **orchestration skill** containing internal `dispatch-to-worker` blocks.
448
- > - Workers CANNOT dispatch Workers (execution hierarchy)
449
- > - Therefore, Phase 5 MUST be executed directly by PM Agent
450
- > - PM Agent reads `SKILL.xml` and executes each block step-by-step
451
-
452
- ### 5.1 PM Agent Execution Protocol
453
-
454
- **PM Agent MUST:**
455
- 1. Read the skill's `SKILL.xml` to understand execution steps
456
- 2. Execute each block in order: read plan โ†’ init progress โ†’ dispatch workers โ†’ verify
457
- 3. Use Agent tool to create `speccrew-task-worker` for EACH module
458
- 4. Pass `speccrew-pm-sub-prd-generate` skill name to each Worker
459
-
460
- **PM Agent MUST NOT:**
461
- - Dispatch Phase 5 to a Worker (Worker cannot dispatch sub-Workers)
462
- - Skip reading the SKILL.xml
463
- - Generate Sub-PRD content directly
464
-
465
- ### 5.2 Prerequisites
466
-
467
- - Phase 4b completed with valid Dispatch Plan
468
- - Master PRD exists
469
- - Dispatch Plan contains module list (count โ‰ฅ 2)
470
- - `.sub-prd-dispatch-plan.json` exists in iteration directory
471
-
472
- ### 5.3 Workflow Steps (from SKILL.xml)
473
-
474
- **Step 5.1: Read Dispatch Plan**
475
- - Read `.sub-prd-dispatch-plan.json` from iteration directory
476
- - Parse module list and verify required fields
477
-
478
- **Step 5.2: Initialize Progress Tracking**
479
-
480
- > ๐Ÿ›‘ **MANDATORY: Initialize DISPATCH-PROGRESS.json BEFORE any Worker dispatch**
481
- >
482
- > PM Agent MUST:
483
- > 1. Create temp task file: `.tasks-temp.json`
484
- > 2. Run: `node {update_progress_script} init --file DISPATCH-PROGRESS.json --stage sub_prd_dispatch --tasks-file .tasks-temp.json`
485
- > 3. Verify initialization (Total: N | Pending: N | Completed: 0)
486
- >
487
- > **FORBIDDEN:**
488
- > - DO NOT dispatch ANY Worker before DISPATCH-PROGRESS.json is initialized
489
- > - DO NOT create DISPATCH-PROGRESS.json manually via create_file
490
-
491
- **Step 5.3: Batch Dispatch Workers**
492
-
493
- > โš ๏ธ **DISPATCH PROMPT FORMAT REMINDER:**
494
- > When dispatching Workers, the prompt MUST contain ONLY skill path + context data parameters.
495
- > DO NOT include "ๆ‰ง่กŒ่ฆๆฑ‚", step sequences, or output directives.
496
- > Worker will read the skill's SKILL.xml for its execution plan.
497
- > See: MANDATORY: Worker Dispatch Prompt Format section above.
498
-
499
- Dispatch Strategy:
500
- | Module Count | Dispatch Strategy |
501
- |--------------|-------------------|
502
- | 1-5 modules | Single batch, all parallel |
503
- | 6-10 modules | 2 batches of 5 |
504
- | 11-15 modules | 3 batches of 5 |
505
- | 16+ modules | Batches of 5, final batch may be smaller |
506
-
507
- **BATCH SIZE = 5 (maximum parallel Workers per batch)**
508
-
509
- > ๐Ÿ›‘ **MANDATORY: Update Progress After Each Worker Completes**
510
- >
511
- > After each Worker returns:
512
- > 1. Run: `node {update_progress_script} update-task --file DISPATCH-PROGRESS.json --task-id {module_id} --status {completed|failed}`
513
- > 2. Verify the update succeeded
514
- >
515
- > **FORBIDDEN:**
516
- > - DO NOT skip progress update
517
- > - DO NOT proceed to next batch until current batch is verified
518
-
519
- **Step 5.4: Failure Retry**
520
- - Check for tasks with `failed` status
521
- - Retry once if failures exist
522
- - Log persistent failures and continue
523
-
524
- **Step 5.5: Result Verification**
525
- - Read final DISPATCH-PROGRESS.json
526
- - Verify all Sub-PRD files exist and size > 3KB
527
- - Update checkpoint via script
528
-
529
- ### 5.4 Worker Context Parameters
530
-
531
- | Parameter | Source | Description |
532
- |-----------|--------|-------------|
533
- | `skill` | Fixed | `speccrew-pm-sub-prd-generate` |
534
- | `module_id` | Dispatch Plan | Unique identifier for the module |
535
- | `module_name` | Dispatch Plan | Display name |
536
- | `module_key` | Dispatch Plan | Identifier for file naming |
537
- | `module_scope` | Dispatch Plan | What this module covers |
538
- | `module_entities` | Dispatch Plan | Core business entities |
539
- | `master_prd_path` | Dispatch Plan | Path to the Master PRD |
540
- | `template_path` | Dispatch Plan | Path to PRD-TEMPLATE.md |
541
- | `output_path` | Computed | `{output_dir}/{feature_name}-sub-{module_key}.md` |
542
- | `language` | Detected | User's language |
543
-
544
- ### 5.5 Completion Verification
545
-
546
- Before proceeding to Phase 6, verify:
547
- - [ ] PM Agent executed Phase 5 directly (NOT dispatched to Worker)
548
- - [ ] DISPATCH-PROGRESS.json was initialized BEFORE any dispatch
549
- - [ ] All workers were dispatched via Agent tool (one Worker per module)
550
- - [ ] Progress was updated after each Worker completed
551
- - [ ] No Sub-PRD was generated by PM Agent directly
552
- - [ ] All workers completed (DISPATCH-PROGRESS.json counts.pending == 0)
553
- - [ ] All Sub-PRD files exist and have valid size
554
- - [ ] `.prd-feature-list.json` contains complete feature data
555
- - [ ] Checkpoint updated via script
556
-
557
- ---
558
-
559
- ## Phase 6: Verification & Confirmation
560
-
561
- <!-- Phase 6 ็š„่ฏฆ็ป†ๆญฅ้ชคๅทฒๆๅ–ๅˆฐ AgentFlow Skill: speccrew-pm-phase6-verify-confirm -->
562
- <!-- ๆ‰ง่กŒๆ—ถ็”ฑ orchestration ้€š่ฟ‡ dispatch-to-worker ่ฐƒ็”จ -->
563
-
564
- **Purpose**: Verify PRD completeness, present to user for final confirmation.
565
-
566
- ### 6.1 Phase Structure
567
-
568
- Phase 6 MUST execute in order with explicit gates:
569
- - **Phase 6.1** (Verification Checklist) โ†’ automatic execution
570
- - **Phase 6.2** (User Review) โ†’ **HARD STOP** โ†’ wait for explicit confirmation
571
- - **Phase 6.3** (Finalize) โ†’ **ONLY executes AFTER user confirms**
572
-
573
- ### 6.2 Verification Checklist
574
-
575
- **Simple Requirements:**
576
- - [ ] Single PRD file exists
577
- - [ ] File size > 2KB
578
- - [ ] Feature Breakdown section exists and has โ‰ฅ 1 feature
579
- - [ ] Content Boundary Compliance: No technical terms (API, DB, SQL, etc.)
580
-
581
- **Complex Requirements:**
582
- - [ ] Master PRD file exists and size > 2KB
583
- - [ ] All Sub-PRD files exist (match Dispatch Plan module count)
584
- - [ ] Each Sub-PRD size > 3KB
585
- - [ ] Master PRD Sub-PRD Index matches actual files
586
- - [ ] Each Sub-PRD contains Feature Breakdown
587
- - [ ] Content Boundary Compliance: No technical terms
588
-
589
- ### 6.3 User Confirmation Gate
590
-
591
- > ๐Ÿ›‘ **HARD STOP โ€” USER CONFIRMATION REQUIRED**
592
- >
593
- > This is a CRITICAL gate. You MUST STOP here and wait for explicit user confirmation.
594
- >
595
- > **MANDATORY REQUIREMENTS:**
596
- > 1. Present ALL generated documents to user with file paths and sizes
597
- > 2. Show verification checklist results
598
- > 3. Show key statistics
599
- > 4. Then STOP and ask user for confirmation
600
- >
601
- > **FORBIDDEN:**
602
- > - DO NOT update checkpoints before user confirmation
603
- > - DO NOT update WORKFLOW-PROGRESS.json before user confirmation
604
- > - DO NOT change document status from Draft to Confirmed before user confirmation
605
- > - DO NOT proceed to Phase 6.3 without explicit "็กฎ่ฎค" or "OK"
606
-
607
- **Presentation Format:**
608
- ```
609
- ๐Ÿ“‹ PRD Documents Ready for Review
610
-
611
- Generated Files:
612
- โ”œโ”€โ”€ Master PRD: {path} ({size} KB)
613
- โ”œโ”€โ”€ Sub-PRD 1: {path} ({size} KB)
614
- โ””โ”€โ”€ ...
615
-
616
- Verification Results:
617
- โ”œโ”€โ”€ File existence: โœ… All files present
618
- โ”œโ”€โ”€ Size validation: โœ… All files valid
619
- โ””โ”€โ”€ Content Boundary: โœ… No violations detected
620
-
621
- Document Status: ๐Ÿ“ Draft (pending your confirmation)
622
- ```
623
-
624
- **Confirmation Request:**
625
- > ๐Ÿ›‘ **AWAITING USER CONFIRMATION**
626
- >
627
- > "่ฏทๅฎกๆŸฅไปฅไธŠPRDๆ–‡ๆกฃใ€‚็กฎ่ฎคๆ— ่ฏฏๅŽๆˆ‘ๅฐ†ๆ›ดๆ–ฐ็Šถๆ€ไธบ Confirmedใ€‚ๆ˜ฏๅฆ็กฎ่ฎค๏ผŸ"
628
- >
629
- > Options:
630
- > - "็กฎ่ฎค" or "OK" โ†’ Proceed to Phase 6.3 (Finalize)
631
- > - "้œ€่ฆไฟฎๆ”น" + details โ†’ Return to appropriate phase
632
- > - "ๅ–ๆถˆ" โ†’ Abort workflow
633
-
634
- ### 6.4 Finalize (After User Confirms)
635
-
636
- **ONLY execute after explicit user confirmation:**
637
-
638
- 1. **Update Checkpoints**: Via `update-progress.js` script
639
- - `verification_checklist` โ†’ passed
640
- - `prd_review` โ†’ passed
641
-
642
- 2. **Update WORKFLOW-PROGRESS.json**:
643
- - `status` โ†’ `completed` โ†’ `confirmed`
644
-
645
- 3. **Update PRD Document Status**:
646
- - From: `Status: ๐Ÿ“ Draft`
647
- - To: `Status: โœ… Confirmed`
648
-
649
- 4. **Cleanup Intermediate Files**:
650
- - Delete: `.checkpoints.json`, `.prd-generation-report.md`, `.sub-prd-dispatch-plan.json`
651
- - Keep: PRD documents, `.clarification-summary.md`, `.module-design.md`, `.prd-feature-list.json`
652
-
653
- ---
654
-
655
181
  # Mandatory Worker Enforcement
656
182
 
657
183
  This agent is an **orchestrator/dispatcher**. For most operations, it MUST delegate work to `speccrew-task-worker` agents.
@@ -882,4 +408,3 @@ Phase 0 โ†’ Phase 1 โ†’ Phase 2 โ†’ Phase 3 โ†’ Phase 4 โ†’ Phase 5 (if complex)
882
408
  - Do not skip user confirmation gates
883
409
  - Do not create any files outside `speccrew-workspace/` directory
884
410
  - Do not pass complex JSON strings directly as command-line arguments
885
-