speccrew 0.4.1 → 0.4.3
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.
|
@@ -503,6 +503,27 @@ Step 3b: Invoke speccrew-pm-requirement-analysis
|
|
|
503
503
|
|
|
504
504
|
After the Skill generates the Master PRD and outputs the dispatch plan, the PM Agent takes over to generate Sub-PRDs in parallel using worker agents.
|
|
505
505
|
|
|
506
|
+
> **Phase 4 Execution Flow:**
|
|
507
|
+
> ```
|
|
508
|
+
> Generate Skill outputs Dispatch Plan
|
|
509
|
+
> ↓
|
|
510
|
+
> PM reads Dispatch Plan (module list + contexts)
|
|
511
|
+
> ↓
|
|
512
|
+
> PM initializes DISPATCH-PROGRESS.json (via script)
|
|
513
|
+
> ↓
|
|
514
|
+
> PM invokes speccrew-task-worker × N (one per module)
|
|
515
|
+
> └─ Each worker internally calls speccrew-pm-sub-prd-generate
|
|
516
|
+
> ↓
|
|
517
|
+
> Workers complete → PM updates progress (via script)
|
|
518
|
+
> ↓
|
|
519
|
+
> ALL workers done → Phase 5
|
|
520
|
+
> ```
|
|
521
|
+
>
|
|
522
|
+
> **NOT this flow:**
|
|
523
|
+
> ```
|
|
524
|
+
> PM reads Dispatch Plan → PM generates Sub-PRDs directly ← VIOLATION
|
|
525
|
+
> ```
|
|
526
|
+
|
|
506
527
|
### 4.1 Read Dispatch Plan
|
|
507
528
|
|
|
508
529
|
From the Skill's Step 12c output, collect:
|
|
@@ -531,8 +552,11 @@ node speccrew-workspace/scripts/update-progress.js init \
|
|
|
531
552
|
> 2. Read file content in the command: `node scripts/update-progress.js init --stage sub_prd_dispatch --tasks (Get-Content tasks-temp.json -Raw)`
|
|
532
553
|
> 3. Or use: `Get-Content tasks-temp.json | node scripts/update-progress.js init --stage sub_prd_dispatch --tasks -`
|
|
533
554
|
|
|
534
|
-
>
|
|
535
|
-
>
|
|
555
|
+
> 🛑 **HARD STOP: DISPATCH-PROGRESS.json MUST be created by script ONLY**
|
|
556
|
+
> - MUST use: `node speccrew-workspace/scripts/update-progress.js init --stage sub_prd_dispatch --tasks '<JSON_ARRAY>'`
|
|
557
|
+
> - DO NOT create DISPATCH-PROGRESS.json manually (PowerShell, create_file, or any other method)
|
|
558
|
+
> - IF script fails → STOP workflow immediately, report error to user, ask "Retry or Abort?"
|
|
559
|
+
> - DO NOT proceed to Worker dispatch without successful script execution
|
|
536
560
|
|
|
537
561
|
After each worker completes:
|
|
538
562
|
```bash
|
|
@@ -550,13 +574,22 @@ node speccrew-workspace/scripts/update-progress.js update-task \
|
|
|
550
574
|
|
|
551
575
|
### 4.3 Dispatch Workers
|
|
552
576
|
|
|
553
|
-
**PM Agent Role: ORCHESTRATOR ONLY**
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
1.
|
|
557
|
-
2.
|
|
558
|
-
3.
|
|
559
|
-
4.
|
|
577
|
+
**PM Agent Role: ORCHESTRATOR ONLY — Phase 4 EXPLICIT RULES**
|
|
578
|
+
|
|
579
|
+
**MANDATORY — PM MUST:**
|
|
580
|
+
1. Read the Dispatch Plan from generate skill output
|
|
581
|
+
2. Initialize DISPATCH-PROGRESS.json via update-progress.js script
|
|
582
|
+
3. For EACH module in dispatch plan: invoke `speccrew-task-worker` with `skill_path: speccrew-pm-sub-prd-generate/SKILL.md`
|
|
583
|
+
4. Pass ALL required context parameters to each worker
|
|
584
|
+
5. Wait for ALL workers to complete
|
|
585
|
+
6. Update DISPATCH-PROGRESS.json via script after each worker completes
|
|
586
|
+
|
|
587
|
+
🛑 **FORBIDDEN — PM MUST NOT:**
|
|
588
|
+
- Generate Sub-PRD files directly (via create_file, write, or any file creation)
|
|
589
|
+
- Invoke speccrew-pm-sub-prd-generate skill directly (ONLY speccrew-task-worker invokes it)
|
|
590
|
+
- Create or edit any Sub-PRD content as fallback if worker fails
|
|
591
|
+
- Skip worker dispatch and generate Sub-PRDs inline
|
|
592
|
+
- IF PM attempts ANY of above → WORKFLOW VIOLATION → STOP immediately
|
|
560
593
|
|
|
561
594
|
**Implementation:**
|
|
562
595
|
|
|
@@ -312,6 +312,18 @@ ELSE:
|
|
|
312
312
|
→ After ALL workers complete → PM Agent executes Phase 5 Verification
|
|
313
313
|
```
|
|
314
314
|
|
|
315
|
+
🛑 **CRITICAL HANDOFF — PM Agent MUST NOT:**
|
|
316
|
+
- Generate Sub-PRD files directly
|
|
317
|
+
- Invoke speccrew-pm-sub-prd-generate as its own operation
|
|
318
|
+
- Create Sub-PRD content using create_file or any file write
|
|
319
|
+
- Skip speccrew-task-worker and directly produce Sub-PRD documents
|
|
320
|
+
|
|
321
|
+
**PM Agent MUST:**
|
|
322
|
+
1. Use Dispatch Plan above to invoke speccrew-task-worker for EACH module
|
|
323
|
+
2. Each worker uses skill_path: speccrew-pm-sub-prd-generate/SKILL.md
|
|
324
|
+
3. Initialize DISPATCH-PROGRESS.json via update-progress.js script (NOT manually)
|
|
325
|
+
4. After ALL workers complete → Execute Phase 5 Verification
|
|
326
|
+
|
|
315
327
|
**IF Single PRD Structure:** Skip dispatch plan (no Sub-PRDs needed).
|
|
316
328
|
|
|
317
329
|
---
|
package/package.json
CHANGED
|
@@ -73,10 +73,29 @@ const path = require('path');
|
|
|
73
73
|
// ============================================================================
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
76
|
+
* 生成本地时区的 ISO 8601 格式时间戳
|
|
77
|
+
* 例如:2026-04-10T20:38:21.978+08:00
|
|
78
|
+
*/
|
|
79
|
+
function getLocalISOString() {
|
|
80
|
+
const now = new Date();
|
|
81
|
+
const off = -now.getTimezoneOffset();
|
|
82
|
+
const sign = off >= 0 ? '+' : '-';
|
|
83
|
+
const pad2 = n => String(Math.abs(n)).padStart(2, '0');
|
|
84
|
+
const tz = sign + pad2(Math.floor(off / 60)) + ':' + pad2(off % 60);
|
|
85
|
+
return now.getFullYear() + '-' +
|
|
86
|
+
pad2(now.getMonth() + 1) + '-' +
|
|
87
|
+
pad2(now.getDate()) + 'T' +
|
|
88
|
+
pad2(now.getHours()) + ':' +
|
|
89
|
+
pad2(now.getMinutes()) + ':' +
|
|
90
|
+
pad2(now.getSeconds()) + '.' +
|
|
91
|
+
String(now.getMilliseconds()).padStart(3, '0') + tz;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 生成 ISO 8601 格式时间戳(本地时区)
|
|
77
96
|
*/
|
|
78
97
|
function getTimestamp() {
|
|
79
|
-
return
|
|
98
|
+
return getLocalISOString();
|
|
80
99
|
}
|
|
81
100
|
|
|
82
101
|
/**
|