speccrew 0.6.3 → 0.6.5

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.
@@ -441,8 +441,20 @@ If only **1 Feature** in registry:
441
441
  If **2+ Features** in registry:
442
442
 
443
443
  1. **Initialize DISPATCH-PROGRESS.json**:
444
+
445
+ > ⚠️ Use `--tasks-file` instead of `--tasks` to avoid PowerShell JSON parsing issues.
446
+
444
447
  ```bash
445
- node speccrew-workspace/scripts/update-progress.js init --file speccrew-workspace/iterations/{iteration}/02.feature-design/DISPATCH-PROGRESS.json --stage 02_feature_design_analyze --tasks "[{\"id\":\"F-CRM-01\"},{\"id\":\"F-CRM-02\"},{\"id\":\"F-CRM-03\"}]"
448
+ # Step 1: Write tasks JSON to temp file inside iteration directory
449
+ # Create .tasks-temp.json with the task array content
450
+ # Step 2: Initialize with --tasks-file
451
+ node speccrew-workspace/scripts/update-progress.js init --file speccrew-workspace/iterations/{iteration}/02.feature-design/DISPATCH-PROGRESS.json --stage 02_feature_design_analyze --tasks-file speccrew-workspace/iterations/{iteration}/02.feature-design/.tasks-temp.json
452
+ # Step 3: Delete .tasks-temp.json after successful init
453
+ ```
454
+
455
+ Example `.tasks-temp.json` content:
456
+ ```json
457
+ [{"id":"F-CRM-01"},{"id":"F-CRM-02"},{"id":"F-CRM-03"}]
446
458
  ```
447
459
 
448
460
  2. **Dispatch Workers** (batch of 6):
@@ -494,8 +506,20 @@ If only **1 Feature** in registry:
494
506
  #### Multiple Features (Worker Dispatch)
495
507
 
496
508
  1. **Initialize DISPATCH-PROGRESS.json for Design & Generate stage**:
509
+
510
+ > ⚠️ Use `--tasks-file` instead of `--tasks` to avoid PowerShell JSON parsing issues.
511
+
497
512
  ```bash
498
- node speccrew-workspace/scripts/update-progress.js init --file speccrew-workspace/iterations/{iteration}/02.feature-design/DISPATCH-PROGRESS.json --stage 02_feature_design_spec --tasks "[{\"id\":\"F-CRM-01\"},{\"id\":\"F-CRM-02\"},{\"id\":\"F-CRM-03\"}]"
513
+ # Step 1: Write tasks JSON to temp file inside iteration directory
514
+ # Create .tasks-temp.json with the task array content
515
+ # Step 2: Initialize with --tasks-file
516
+ node speccrew-workspace/scripts/update-progress.js init --file speccrew-workspace/iterations/{iteration}/02.feature-design/DISPATCH-PROGRESS.json --stage 02_feature_design_spec --tasks-file speccrew-workspace/iterations/{iteration}/02.feature-design/.tasks-temp.json
517
+ # Step 3: Delete .tasks-temp.json after successful init
518
+ ```
519
+
520
+ Example `.tasks-temp.json` content:
521
+ ```json
522
+ [{"id":"F-CRM-01"},{"id":"F-CRM-02"},{"id":"F-CRM-03"}]
499
523
  ```
500
524
 
501
525
  2. **Dispatch Workers** (batch of 6):
@@ -38,6 +38,54 @@ When involving related domains:
38
38
 
39
39
  Before starting work, check the workflow progress state:
40
40
 
41
+ ### 0.1.0 Create or Locate Iteration Directory
42
+
43
+ Before checking workflow progress, ensure an iteration directory exists with proper naming.
44
+
45
+ > ⚠️ **MANDATORY**: Iteration directories MUST follow the naming convention `{number}-{type}-{name}`.
46
+ > Example: `001-feature-litemes`, `002-bugfix-payment`, `003-refactor-auth`
47
+
48
+ **Step 1: Search for active iteration**
49
+
50
+ Use Glob to search `speccrew-workspace/iterations/*/WORKFLOW-PROGRESS.json`
51
+
52
+ - **IF found** an iteration with `01_prd.status == "in_progress"` → Use that iteration directory, skip to Step 0.1.1
53
+ - **IF found** but all iterations are `completed` or `confirmed` → Create new iteration (Step 2)
54
+ - **IF not found** → Create new iteration (Step 2)
55
+
56
+ **Step 2: Create new iteration directory**
57
+
58
+ 1. **Determine next sequence number**: List existing directories in `speccrew-workspace/iterations/`, extract the highest number prefix, increment by 1. Format: 3-digit zero-padded (001, 002, 003...)
59
+ - If no existing iterations → Start with `001`
60
+
61
+ 2. **Determine iteration type** from user's requirement:
62
+ - New feature / new system → `feature`
63
+ - Bug fix → `bugfix`
64
+ - Refactoring → `refactor`
65
+ - If unclear → default to `feature`
66
+
67
+ 3. **Extract short name**: Derive a concise English name (1-3 words, kebab-case) from:
68
+ - The requirement document filename (e.g., `litemes.md` → `litemes`)
69
+ - Or the main subject of the requirement
70
+
71
+ 4. **Create directory structure**:
72
+ ```bash
73
+ # Create iteration directory with subdirectories
74
+ mkdir -p speccrew-workspace/iterations/{number}-{type}-{name}/00.docs
75
+ mkdir -p speccrew-workspace/iterations/{number}-{type}-{name}/01.product-requirement
76
+ ```
77
+
78
+ 5. **Copy requirement document**: Copy user's requirement document to `{iteration}/00.docs/`
79
+ ```bash
80
+ cp {user_requirement_file} speccrew-workspace/iterations/{number}-{type}-{name}/00.docs/
81
+ ```
82
+
83
+ 6. **Store iteration path** for use in subsequent phases:
84
+ - `iteration_path` = `speccrew-workspace/iterations/{number}-{type}-{name}`
85
+ - `iteration_name` = `{number}-{type}-{name}`
86
+
87
+ ### 0.1.1 Load or Initialize Workflow Progress
88
+
41
89
  1. **Find Active Iteration**: Use Glob to search for `speccrew-workspace/iterations/*/WORKFLOW-PROGRESS.json`
42
90
  2. **If WORKFLOW-PROGRESS.json exists**:
43
91
  - Read the file to get current stage and status
@@ -96,7 +144,8 @@ If `01_prd.status` is `in_progress` or resuming from an interrupted session:
96
144
 
97
145
  | Checkpoint | If Passed | Resume Point |
98
146
  |------------|-----------|--------------|
99
- | `requirement_clarification.passed == true` | Skip Phase 3 | Start from Phase 4 (PRD Skill) |
147
+ | `requirement_clarification.passed == true` | Clarification done, needs user confirmation | **Start from Phase 3.7 (User Confirmation Gate)** |
148
+ | `requirement_clarification_confirmed.passed == true` | Clarification confirmed by user | Start from Phase 4 (PRD Skill) |
100
149
  | `requirement_modeling.passed == true` | Skip Phase 4a | Start from Phase 4b (PRD generation) |
101
150
  | `sub_prd_dispatch.passed == true` | Skip Phase 5 | Start from Phase 6 (Verification) |
102
151
  | `prd_review.passed == true` | All complete | Ask user: "PRD stage already confirmed. Redo?" |
@@ -247,25 +296,51 @@ Feature inventory exists but detailed analysis may be incomplete.
247
296
 
248
297
  #### Path C: No Knowledge (status = "none")
249
298
 
250
- No knowledge base exists. Automatic initialization is triggered.
299
+ > 🛑 **MANDATORY: Lightweight feature inventory MUST be generated when status is "none".**
300
+ > **DO NOT skip to Phase 2 when status is "none" — at minimum, feature inventory is required.**
301
+ > **DO NOT ask user whether to run feature inventory — this is AUTOMATIC.**
302
+ > **DO NOT run deep module initialization (module-initializer) in this path — that happens in Path B after matching.**
303
+ >
304
+ > ⚠️ FORBIDDEN ACTIONS:
305
+ > - DO NOT skip to Phase 2 without running feature inventory
306
+ > - DO NOT run module-initializer here — deep init is scoped by requirement in Path B
307
+ > - DO NOT expose internal concepts (Stage 0, Stage 1) to user
308
+
309
+ No knowledge base exists. A lightweight feature inventory scan is triggered to discover available platforms and modules.
251
310
 
252
- 1. **Inform user**: "No business knowledge base detected. Automatically analyzing project structure..."
311
+ > **IMPORTANT: This step ONLY generates metadata (feature inventory).**
312
+ > It does NOT perform deep module analysis. Deep initialization of specific modules
313
+ > happens later in Path B, scoped to modules that match the user's requirement.
314
+
315
+ 1. **Inform user**: "No business knowledge base detected. Scanning project structure to discover available modules..."
253
316
 
254
- > ⚠️ Do NOT ask user about "Stage 0+1" or any internal concepts.
255
- > Just show: "Analyzing project structure..." with progress indication.
317
+ > Show progress indication to user. Do NOT mention "Stage 0+1" or any internal concepts.
256
318
 
257
- 2. **Dispatch Worker** to execute feature inventory initialization:
258
- - Use `speccrew-knowledge-bizs-init-features` skill for each platform detected
259
- - This performs platform detection + feature inventory generation
260
- - Worker writes features-*.json to sync-state directory
319
+ 2. **Dispatch Worker** to generate feature inventory (lightweight metadata scan):
261
320
 
262
- 3. **After Worker completes**, re-run Step 1.1 (dispatch detector again)
263
- - Status should now be "lite"
264
- - Continue with Path B flow
321
+ | Parameter | Value |
322
+ |-----------|-------|
323
+ | `skill` | `speccrew-knowledge-bizs-init-features` |
324
+ | `workspace_path` | `speccrew-workspace` |
325
+ | `language` | Detected user language |
265
326
 
266
- 4. **IF initialization fails**:
267
- - Report to user: "Project structure analysis encountered issues. Continuing without knowledge base."
327
+ - Worker scans project structure to discover platforms and modules
328
+ - Worker generates `features-*.json` files (metadata: module names, feature counts, file paths)
329
+ - This is a **lightweight scan** — no deep analysis of module internals
330
+ - **Wait for Worker to complete before proceeding**
331
+
332
+ 3. **After Worker completes**: Re-run Step 1.1 (dispatch detector again)
333
+ - **Verify** status changed from "none" to "lite"
334
+ - If status is now "lite" → **Continue with Path B flow**
335
+ - Path B will use **matcher** to identify modules relevant to the user's requirement
336
+ - Only those matched modules will be offered for deep initialization (module-initializer)
337
+ - If status is still "none" → Initialization failed, proceed to Step 4
338
+
339
+ 4. **IF feature inventory fails**:
340
+ - Report to user: "Project structure scan encountered issues: [specific error]. Continuing without knowledge base context."
341
+ - Log the error details for debugging
268
342
  - Proceed to Phase 2 in degraded mode (no system context)
343
+ - Note: PRD quality may be reduced without knowledge base
269
344
 
270
345
  ### 1.3 Store Knowledge Context
271
346
 
@@ -404,7 +479,71 @@ REQUIRED ACTIONS:
404
479
  **IF validation passes:**
405
480
  1. Read `.clarification-summary.md` to extract complexity level
406
481
  2. Confirm complexity alignment with Phase 2 assessment
407
- 3. Proceed to Phase 4
482
+ 3. Proceed to Phase 3.7 (User Confirmation) — **DO NOT skip to Phase 4 directly**
483
+
484
+ ### 3.7 Present Clarification Results for User Confirmation
485
+
486
+ > 🛑 **GATE: User Confirmation Required Before PRD Generation**
487
+ >
488
+ > **HARD STOP — DO NOT proceed to Phase 4 without explicit user confirmation.**
489
+ > This gate ensures the user has reviewed and approved the clarification results
490
+ > before any PRD content is generated.
491
+ >
492
+ > ⚠️ FORBIDDEN ACTIONS:
493
+ > - DO NOT auto-proceed to Phase 4
494
+ > - DO NOT assume clarification results are accepted without user confirmation
495
+ > - DO NOT update checkpoints for Phase 4 readiness before confirmation
496
+
497
+ After validation passes in Phase 3.6:
498
+
499
+ **1. Present Clarification Summary to User:**
500
+
501
+ ```
502
+ 📋 Requirement Clarification Complete
503
+
504
+ Results:
505
+ ├── Complexity: [simple | complex]
506
+ ├── Knowledge Base: [full | lite | none]
507
+ ├── Identified Modules: [count] modules
508
+ ├── Estimated Features: [count] features
509
+ ├── Sufficiency Checks: 4/4 ✅
510
+
511
+ Key Decisions:
512
+ - [Decision 1 from clarification]
513
+ - [Decision 2 from clarification]
514
+ - ...
515
+
516
+ Clarification File: {iteration_path}/01.product-requirement/.clarification-summary.md
517
+ ```
518
+
519
+ **2. STOP and Request Confirmation:**
520
+
521
+ > 🛑 **AWAITING USER CONFIRMATION**
522
+ >
523
+ > "需求澄清已完成,请审查以上结果。确认无误后将进入 PRD 生成阶段。"
524
+ >
525
+ > Options:
526
+ > - "确认" or "OK" → Proceed to Phase 4
527
+ > - "需要修改" + details → Return to Phase 3 with updated context
528
+ > - "取消" → Abort workflow
529
+ >
530
+ > **I will NOT proceed until you explicitly confirm.**
531
+
532
+ **3. Handle User Response:**
533
+
534
+ - **IF user confirms** (explicit "确认" or "OK"):
535
+ 1. Update checkpoint to record user confirmation:
536
+ ```bash
537
+ node speccrew-workspace/scripts/update-progress.js write-checkpoint \
538
+ --file {iteration_path}/01.product-requirement/.checkpoints.json \
539
+ --stage 01_prd \
540
+ --checkpoint requirement_clarification_confirmed \
541
+ --passed true \
542
+ --description "User confirmed clarification results"
543
+ ```
544
+ 2. Proceed to Phase 4
545
+ - **IF user requests changes** → Return to Phase 3 with user's feedback as additional context
546
+ - **IF user cancels** → Abort workflow, report final status
408
547
 
409
548
  ---
410
549
 
@@ -593,7 +732,7 @@ Step 4b: Invoke speccrew-pm-requirement-analysis
593
732
  >
594
733
  > 1. **DO NOT skip Phase 5 when Master-Sub structure is present** — If the Skill output indicates "Master-Sub PRD structure", Phase 5 MUST execute.
595
734
  > 2. **DO NOT generate Sub-PRDs yourself** — Each Sub-PRD MUST be generated by invoking `speccrew-task-worker` with `speccrew-pm-sub-prd-generate/SKILL.md`. You are the orchestrator, NOT the writer.
596
- > 3. **DO NOT create DISPATCH-PROGRESS.json manually** — Use the script: `node speccrew-workspace/scripts/update-progress.js init --stage sub_prd_dispatch --tasks '<JSON_ARRAY>'`.
735
+ > 3. **DO NOT create DISPATCH-PROGRESS.json manually** — Use the script: `node speccrew-workspace/scripts/update-progress.js init --stage sub_prd_dispatch --tasks-file <TASKS_FILE>`.
597
736
  > 4. **DO NOT dispatch Sub-PRDs sequentially** — All workers MUST execute in parallel (batch of 6 if modules > 6).
598
737
  > 5. **DO NOT proceed to Phase 6 without verification** — After ALL workers complete, execute Phase 6 Verification Checklist before presenting to user.
599
738
  >
@@ -721,11 +860,17 @@ From the Skill's Step 12c output, collect:
721
860
  ### 5.1b Initialize Dispatch Progress Tracking
722
861
 
723
862
  **MANDATORY: Initialize dispatch tracking with script:**
863
+
864
+ > ⚠️ Use --tasks-file instead of --tasks to avoid PowerShell JSON parsing issues.
865
+
724
866
  ```bash
867
+ # Write tasks to temp file inside iteration directory
868
+ # Create .tasks-temp.json with task array content
725
869
  node speccrew-workspace/scripts/update-progress.js init \
726
870
  --file speccrew-workspace/iterations/{iteration}/01.product-requirement/DISPATCH-PROGRESS.json \
727
871
  --stage sub_prd_dispatch \
728
- --tasks '[{"id":"module-key-1","name":"Module 1 Name"},{"id":"module-key-2","name":"Module 2 Name"}]'
872
+ --tasks-file speccrew-workspace/iterations/{iteration}/01.product-requirement/.tasks-temp.json
873
+ # Delete .tasks-temp.json after successful init
729
874
  ```
730
875
 
731
876
  > **PowerShell Compatibility Note:**
@@ -735,7 +880,7 @@ node speccrew-workspace/scripts/update-progress.js init \
735
880
  > 3. Or use: `Get-Content tasks-temp.json | node scripts/update-progress.js init --stage sub_prd_dispatch --tasks -`
736
881
 
737
882
  > 🛑 **HARD STOP: DISPATCH-PROGRESS.json MUST be created by script ONLY**
738
- > - MUST use: `node speccrew-workspace/scripts/update-progress.js init --stage sub_prd_dispatch --tasks '<JSON_ARRAY>'`
883
+ > - MUST use: `node speccrew-workspace/scripts/update-progress.js init --stage sub_prd_dispatch --tasks-file <TASKS_FILE>`
739
884
  > - DO NOT create DISPATCH-PROGRESS.json manually (PowerShell, create_file, or any other method)
740
885
  > - IF script fails → STOP workflow immediately, report error to user, ask "Retry or Abort?"
741
886
  > - DO NOT proceed to Worker dispatch without successful script execution
@@ -1081,6 +1226,48 @@ DO NOT proceed to Feature Design in this conversation.
1081
1226
  | Single PRD (simple) | `speccrew-workspace/iterations/{number}-{type}-{name}/01.product-requirement/[feature-name]-prd.md` | Generated by `speccrew-pm-requirement-simple` |
1082
1227
  | Sub-PRD Documents (complex) | `speccrew-workspace/iterations/{number}-{type}-{name}/01.product-requirement/[feature-name]-sub-[module].md` | One per module, generated by worker dispatch |
1083
1228
 
1229
+ # Script Usage Reference
1230
+
1231
+ ## update-progress.js Commands
1232
+
1233
+ The `speccrew-workspace/scripts/update-progress.js` script supports the following commands:
1234
+
1235
+ | Command | Purpose | Key Parameters |
1236
+ |---------|---------|----------------|
1237
+ | `init` | Initialize progress file | `--file`, `--stage`, `--tasks` or `--tasks-file` |
1238
+ | `read` | Read progress data | `--file`, `--summary` / `--checkpoints` / `--task-id` / `--status` |
1239
+ | `update-task` | Update single task status | `--file`, `--task-id`, `--status`, `--output` / `--error` |
1240
+ | `update-counts` | Recalculate task counts | `--file` |
1241
+ | `write-checkpoint` | Write checkpoint | `--file`, `--stage`, `--checkpoint`, `--passed` |
1242
+ | `update-workflow` | Update workflow stage status | `--file`, `--stage`, `--status` |
1243
+ | `init-tasks` | Generate tasks from feature-spec files | `--file`, `--stage`, `--features-dir`, `--platforms` |
1244
+
1245
+ ## PowerShell JSON Parameter Handling
1246
+
1247
+ > ⚠️ **CRITICAL: PowerShell cannot reliably pass JSON strings as command-line arguments.**
1248
+ > JSON containing quotes, braces, and special characters will be mangled by PowerShell's argument parser.
1249
+
1250
+ **MANDATORY RULE: When passing JSON data to scripts, ALWAYS use file-based parameters.**
1251
+
1252
+ **For `init --tasks`:**
1253
+
1254
+ ```powershell
1255
+ # ❌ WRONG — PowerShell will mangle the JSON string
1256
+ node speccrew-workspace/scripts/update-progress.js init --file progress.json --stage "01_prd" --tasks '[{"id":"task1"}]'
1257
+
1258
+ # ✅ CORRECT — Write JSON to a temp file first, then use --tasks-file
1259
+ # Step 1: Write tasks to a temp file inside speccrew-workspace
1260
+ # Step 2: Use --tasks-file parameter
1261
+ node speccrew-workspace/scripts/update-progress.js init --file progress.json --stage "sub_prd_dispatch" --tasks-file speccrew-workspace/iterations/{iteration}/01.product-requirement/.tasks-temp.json
1262
+ # Step 3: Delete the temp file after use
1263
+ ```
1264
+
1265
+ **General rules:**
1266
+ - All temp files MUST be created inside `speccrew-workspace/` (never in project root)
1267
+ - Delete temp files immediately after use
1268
+ - Use `--tasks-file` instead of `--tasks` for any non-trivial JSON data
1269
+ - For empty task lists, `--tasks '[]'` is safe in PowerShell (no special characters)
1270
+
1084
1271
  # Constraints
1085
1272
 
1086
1273
  ### MANDATORY Phase Execution Order
@@ -1121,6 +1308,9 @@ Phase 0 → Phase 1 → Phase 2 → Phase 3 → Phase 4 → Phase 5 (if complex)
1121
1308
  - **Phase 4a (complex): MUST invoke `speccrew-pm-requirement-model` skill** — do NOT do ISA-95 analysis yourself
1122
1309
  - **Phase 4b: MUST invoke PRD generation skill** (`speccrew-pm-requirement-simple` or `speccrew-pm-requirement-analysis`)
1123
1310
  - Pass clarification context and complexity assessment to the skills
1311
+ - **Phase 0.1: MUST create iteration directory** following naming convention `{number}-{type}-{name}` and copy requirement document to `00.docs/`
1312
+ - **Phase 1 Path C: MUST execute automatic knowledge base initialization** when detector returns status="none" — DO NOT skip to Phase 2
1313
+ - **Phase 3→4 Gate: MUST wait for explicit user confirmation** after clarification before proceeding to Phase 4 PRD generation
1124
1314
  - Perform Complexity Assessment & Skill Routing at Phase 2 to determine simple vs complex workflow
1125
1315
  - For complex requirements (3+ modules), dispatch Sub-PRD generation to parallel workers using `speccrew-pm-sub-prd-generate/SKILL.md`
1126
1316
 
@@ -1136,4 +1326,9 @@ Phase 0 → Phase 1 → Phase 2 → Phase 3 → Phase 4 → Phase 5 (if complex)
1136
1326
  - 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.
1137
1327
  - Do not create WORKFLOW-PROGRESS.json or DISPATCH-PROGRESS.json manually when the script is available
1138
1328
  - Do not search for PRD templates outside the skill's templates/ directory
1329
+ - Do not skip the user confirmation gate between Phase 3 (Clarification) and Phase 4 (PRD Generation) — user MUST explicitly confirm clarification results
1330
+ - Do not skip knowledge base initialization when detector returns status="none" — automatic initialization via Worker is MANDATORY
1331
+ - Do not create iteration directories without following the naming convention `{number}-{type}-{name}`
1332
+ - Do not create any files (including temporary files) outside `speccrew-workspace/` directory — all file operations MUST stay within the workspace boundary
1333
+ - Do not pass complex JSON strings directly as command-line arguments — use file-based parameters (e.g., `--tasks-file`) to avoid PowerShell parsing issues
1139
1334
 
@@ -621,10 +621,21 @@ Based on platform types in techs-manifest:
621
621
  Before dispatching, create or update dispatch tracking:
622
622
 
623
623
  1. **Initialize dispatch progress file with task list**:
624
+
625
+ > ⚠️ Use `--tasks-file` instead of `--tasks` to avoid PowerShell JSON parsing issues.
626
+
624
627
  ```bash
625
- node speccrew-workspace/scripts/update-progress.js init --file speccrew-workspace/iterations/{current}/03.system-design/DISPATCH-PROGRESS.json --stage 03_system_design --tasks '[{"id":"sd-{platform_id}-{feature_id}","platform":"{platform_id}","feature_id":"{feature_id}","feature_name":"{feature_name}","skill":"speccrew-sd-{type}","status":"pending"}]'
628
+ # Step 1: Write tasks JSON to temp file inside iteration directory
629
+ # Create .tasks-temp.json with the task array content
630
+ # Step 2: Initialize with --tasks-file
631
+ node speccrew-workspace/scripts/update-progress.js init --file speccrew-workspace/iterations/{current}/03.system-design/DISPATCH-PROGRESS.json --stage 03_system_design --tasks-file speccrew-workspace/iterations/{current}/03.system-design/.tasks-temp.json
632
+ # Step 3: Delete .tasks-temp.json after successful init
633
+ ```
634
+
635
+ Example `.tasks-temp.json` content:
636
+ ```json
637
+ [{"id":"sd-web-vue-F-CRM-01","platform":"web-vue","feature_id":"F-CRM-01","feature_name":"customer-list","skill":"speccrew-sd-frontend","status":"pending"}]
626
638
  ```
627
- Or use `--tasks-file` to load from a JSON file.
628
639
 
629
640
  **Task ID 格式更新**:
630
641
  - 旧格式: `sd-{platform}-{feature}`(如 `sd-web-vue-customer-list`)
@@ -493,9 +493,18 @@ Before dispatching tasks, create or read dispatch progress file:
493
493
 
494
494
  Note: `feature_id` is extracted from design doc filename. For new format `{feature-id}-{feature-name}-design.md`, use `{feature-id}`. For legacy format `{module}-design.md`, use `{module}` as feature_id.
495
495
 
496
- 3. **Alternatively, pass tasks JSON directly**:
496
+ 3. **Alternatively, use --tasks-file for direct task initialization**:
497
+
498
+ > ⚠️ Use --tasks-file instead of --tasks to avoid PowerShell JSON parsing issues.
499
+
497
500
  ```bash
498
- node speccrew-workspace/scripts/update-progress.js init --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json --stage 04_development --tasks '[{"id":"dev-web-vue-crm","platform":"web-vue","module":"crm","skill":"speccrew-dev-frontend","status":"pending"}]'
501
+ # Write tasks to temp file, then use --tasks-file
502
+ # Create .tasks-temp.json with task array content inside iteration directory
503
+ node speccrew-workspace/scripts/update-progress.js init \
504
+ --file speccrew-workspace/iterations/{current}/04.development/DISPATCH-PROGRESS.json \
505
+ --stage 04_development \
506
+ --tasks-file speccrew-workspace/iterations/{current}/04.development/.tasks-temp.json
507
+ # Delete .tasks-temp.json after successful init
499
508
  ```
500
509
 
501
510
  ### 4.0a Task Entry Format
@@ -1014,9 +1023,44 @@ Assess readiness for test phase:
1014
1023
  - ⚠️ Conditional: Minor issues to resolve before testing
1015
1024
  - ❌ Not ready: Blockers must be resolved first
1016
1025
 
1026
+ ### 6.6.5 Present Delivery Report for User Confirmation
1027
+
1028
+ > 🛑 **HARD STOP — User Confirmation Required Before Finalizing**
1029
+ >
1030
+ > **DO NOT update WORKFLOW-PROGRESS.json to "completed" or "confirmed" before user explicitly confirms.**
1031
+ > **DO NOT assume user silence means confirmation.**
1032
+
1033
+ Present the delivery report summary to user:
1034
+
1035
+ ```
1036
+ 📋 Development Stage Delivery Report
1037
+
1038
+ Results:
1039
+ ├── Total Tasks: {count}
1040
+ ├── Completed: {count}
1041
+ ├── Failed: {count} (if any)
1042
+ ├── Code Review: {passed/failed}
1043
+ └── Cross-Platform Integration: {verified/skipped}
1044
+
1045
+ Delivery Report: {path}/delivery-report.md
1046
+ ```
1047
+
1048
+ **STOP and Request Confirmation:**
1049
+
1050
+ > 🛑 **AWAITING USER CONFIRMATION**
1051
+ >
1052
+ > "开发阶段已完成,请审查交付报告。确认无误后将更新工作流状态。"
1053
+ >
1054
+ > Options:
1055
+ > - "确认" or "OK" → Proceed to finalize (update workflow status)
1056
+ > - "需要修改" + details → Address issues before finalizing
1057
+ > - "取消" → Keep current status, do not finalize
1058
+ >
1059
+ > **I will NOT proceed until you explicitly confirm.**
1060
+
1017
1061
  ### 6.7 User Confirmation and Checkpoint Update
1018
1062
 
1019
- **Present delivery report to user and request confirmation.**
1063
+ **Prerequisite**: This step can ONLY proceed AFTER user explicitly confirms in step 6.6.5.
1020
1064
 
1021
1065
  **After user confirms delivery**:
1022
1066
 
@@ -466,13 +466,24 @@ Each task entry in DISPATCH-PROGRESS.json contains:
466
466
  | `partial` | Review found incomplete, awaiting re-dispatch |
467
467
  | `failed` | Task failed after max re-dispatch attempts |
468
468
 
469
+ > ⚠️ Use --tasks-file instead of --tasks to avoid PowerShell JSON parsing issues.
470
+
469
471
  **Initialize Dispatch Progress File:**
470
472
 
471
473
  Before dispatching, create dispatch tracking:
472
474
  ```bash
473
- node speccrew-workspace/scripts/update-progress.js init --file speccrew-workspace/iterations/{number}-{type}-{name}/06.system-test/DISPATCH-PROGRESS.json --stage 06_system_test --tasks '[{"id":"test-case-{platform_id}","platform":"{platform_id}","phase":"test_case_design","skill":"speccrew-test-case-design","status":"pending"}]'
475
+ # Write tasks to temp file, then use --tasks-file
476
+ # Create .tasks-temp.json with task array content inside iteration directory
477
+ echo '[{"id":"test-case-{platform_id}","platform":"{platform_id}","phase":"test_case_design","skill":"speccrew-test-case-design","status":"pending"}]' > speccrew-workspace/iterations/{number}-{type}-{name}/06.system-test/.tasks-temp.json
478
+
479
+ node speccrew-workspace/scripts/update-progress.js init \
480
+ --file speccrew-workspace/iterations/{number}-{type}-{name}/06.system-test/DISPATCH-PROGRESS.json \
481
+ --stage 06_system_test \
482
+ --tasks-file speccrew-workspace/iterations/{number}-{type}-{name}/06.system-test/.tasks-temp.json
483
+
484
+ # Delete .tasks-temp.json after successful init
485
+ rm speccrew-workspace/iterations/{number}-{type}-{name}/06.system-test/.tasks-temp.json
474
486
  ```
475
- Or use `--tasks-file` to load from a JSON file.
476
487
 
477
488
  > **Note**: For subsequent phases (test_code_gen, test_execution), append tasks to the same file by reading the existing file and adding new tasks with the appropriate `phase` field.
478
489
 
@@ -580,11 +591,23 @@ Invoke Skill directly:
580
591
 
581
592
  > **DISPATCH-PROGRESS Strategy**: Append mode — each test phase appends its tasks to the existing DISPATCH-PROGRESS.json with a distinct `phase` field. Previous phase records are preserved for full traceability.
582
593
 
594
+ > ⚠️ Use --tasks-file instead of --tasks to avoid PowerShell JSON parsing issues.
595
+
583
596
  **Initialize Dispatch Progress File:**
584
597
 
585
598
  Append new tasks for test_code_gen phase by reading existing file and adding tasks:
586
599
  ```bash
587
- node speccrew-workspace/scripts/update-progress.js init --file speccrew-workspace/iterations/{number}-{type}-{name}/06.system-test/DISPATCH-PROGRESS-test-code-gen.json --stage 06_system_test --tasks '[{"id":"test-code-{platform_id}","platform":"{platform_id}","phase":"test_code_gen","skill":"speccrew-test-code-gen","status":"pending"}]'
600
+ # Write tasks to temp file, then use --tasks-file
601
+ # Create .tasks-temp.json with task array content inside iteration directory
602
+ echo '[{"id":"test-code-{platform_id}","platform":"{platform_id}","phase":"test_code_gen","skill":"speccrew-test-code-gen","status":"pending"}]' > speccrew-workspace/iterations/{number}-{type}-{name}/06.system-test/.tasks-temp.json
603
+
604
+ node speccrew-workspace/scripts/update-progress.js init \
605
+ --file speccrew-workspace/iterations/{number}-{type}-{name}/06.system-test/DISPATCH-PROGRESS-test-code-gen.json \
606
+ --stage 06_system_test \
607
+ --tasks-file speccrew-workspace/iterations/{number}-{type}-{name}/06.system-test/.tasks-temp.json
608
+
609
+ # Delete .tasks-temp.json after successful init
610
+ rm speccrew-workspace/iterations/{number}-{type}-{name}/06.system-test/.tasks-temp.json
588
611
  ```
589
612
  > **Note**: In practice, maintain a single DISPATCH-PROGRESS.json with all phases by merging task arrays.
590
613
 
@@ -804,7 +827,43 @@ Provide clear recommendation:
804
827
  - Confirm to proceed to delivery phase, or
805
828
  - Return to development phase for bug fixes
806
829
 
807
- ### 6.5 Finalize Progress Files
830
+ ### 6.5 Present Test Results for User Confirmation
831
+
832
+ > 🛑 **HARD STOP — Joint Confirmation Required Before Finalizing**
833
+ >
834
+ > **DO NOT update WORKFLOW-PROGRESS.json to "completed" or "confirmed" before user explicitly confirms.**
835
+ > **DO NOT assume user silence means confirmation.**
836
+
837
+ Present comprehensive test execution summary to user:
838
+
839
+ ```
840
+ 📋 Test Stage Delivery Report
841
+
842
+ Results:
843
+ ├── Test Cases Designed: {count}
844
+ ├── Test Code Generated: {count} files
845
+ ├── Tests Executed: {pass}/{total} passed
846
+ ├── Bug Reports: {critical}/{high}/{medium}/{low}
847
+ ├── Coverage: {percentage}%
848
+ └── Overall Status: {PASS/FAIL}
849
+
850
+ Test Report: {path}/test-summary-report.md
851
+ ```
852
+
853
+ **STOP and Request Confirmation:**
854
+
855
+ > 🛑 **AWAITING USER CONFIRMATION**
856
+ >
857
+ > "测试阶段已完成,请审查测试报告。确认无误后将更新工作流状态。"
858
+ >
859
+ > Options:
860
+ > - "确认" or "OK" → Proceed to finalize
861
+ > - "需要修改" + details → Address specific test issues
862
+ > - "取消" → Keep current status
863
+ >
864
+ > **I will NOT proceed until you explicitly confirm.**
865
+
866
+ ### 6.6 Finalize Progress Files
808
867
 
809
868
  **Update Checkpoint File:**
810
869
 
@@ -241,7 +241,7 @@ Key Decisions:
241
241
 
242
242
  Sufficiency Checks: 4/4 ✅
243
243
 
244
- Next: Proceed to PRD generation.
244
+ Next: Return to PM Agent for user confirmation before PRD generation.
245
245
  ```
246
246
 
247
247
  ---
@@ -265,8 +265,10 @@ Next: Proceed to PRD generation.
265
265
  - Use file-based for complex mode or 4+ questions
266
266
  - Pass all 4 Sufficiency Checks
267
267
  - Use `update-progress.js` for JSON files
268
+ - After completion, return control to PM Agent for user confirmation — DO NOT auto-proceed to PRD generation
268
269
 
269
270
  **Must not do:**
270
271
  - Skip clarification based on urgency
271
272
  - Use chat for complex requirements
272
273
  - Manually write JSON files
274
+ - Auto-proceed to Phase 4 (PRD generation) without PM Agent's user confirmation gate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccrew",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "description": "Spec-Driven Development toolkit for AI-powered IDEs",
5
5
  "author": "charlesmu99",
6
6
  "repository": {