speccrew 0.7.27 → 0.7.29

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.
@@ -143,6 +143,19 @@ This agent MUST execute tasks continuously without unnecessary interruptions.
143
143
  2. **FORBIDDEN: Manual JSON creation** — DO NOT use `create_file` or `write` to create progress/checkpoint JSON files. ALWAYS use the appropriate `update-progress.js` command.
144
144
  3. **FORBIDDEN: Timestamp parameters** — DO NOT pass `--started-at`, `--completed-at`, or `--confirmed-at` parameters to `update-progress.js` commands. These parameters are deprecated.
145
145
 
146
+ ## update-progress.js Command Reference
147
+
148
+ | Command | Purpose | Key Parameters |
149
+ |---------|---------|----------------|
150
+ | `init` | Initialize DISPATCH-PROGRESS.json | `--file`, `--stage`, `--tasks-file` (recommended) or `--tasks` |
151
+ | `read` | Query progress status | `--file`, `--summary`, `--checkpoints`, `--overview`, `--task-id`, `--status` |
152
+ | `update-task` | Mark worker completion | `--file`, `--task-id`, `--status`, `--output`, `--error` |
153
+ | `write-checkpoint` | Mark phase checkpoint | `--file`, `--stage`, `--checkpoint`, `--passed`, `--description` (optional) |
154
+ | `update-workflow` | Update workflow stage | `--file`, `--stage`, `--status`, `--output` (optional) |
155
+ | `update-counts` | Recalculate counts | `--file` |
156
+
157
+ > **Note**: Use `--tasks-file` instead of `--tasks` on Windows PowerShell to avoid JSON parsing issues.
158
+
146
159
  # Workflow
147
160
 
148
161
  ## AgentFlow Definition
@@ -346,9 +359,12 @@ node {update_progress_script} write-checkpoint `
346
359
  --file {iterations_dir}/{iteration}/02.feature-design/.checkpoints.json `
347
360
  --stage 02_feature_design `
348
361
  --checkpoint function_decomposition `
349
- --data '{"features": [...], "total_features": N, "total_modules": M}'
362
+ --passed true `
363
+ --description "Feature decomposition confirmed: N features across M modules"
350
364
  ```
351
365
 
366
+ > **Note**: Use `--passed` and `--description` for write-checkpoint. The `--data` parameter is NOT supported by update-progress.js.
367
+
352
368
  **Feature status values:**
353
369
  - `pending`: Not started
354
370
  - `in_progress`: Worker dispatched
@@ -411,6 +427,67 @@ When involving related business domains, read `{workspace_path}/knowledges/bizs/
411
427
  > 6. **Intermediate artifacts are MANDATORY.** .feature-analysis.md must exist before Phase 3b.
412
428
  > 7. **Feature name is LOCKED after Phase 2 confirmation.** All Worker dispatch parameters MUST use the exact `feature_name` from `.checkpoints.json`. DO NOT derive, translate, or modify feature names at any point after the Feature List is confirmed.
413
429
 
430
+ ### Prepare Task List for Dispatch
431
+
432
+ > ⚠️ **CRITICAL: Two Different File Formats**
433
+ >
434
+ > The `.prd-feature-list.json` and `init --tasks-file` expect DIFFERENT formats. Do NOT use one in place of the other.
435
+
436
+ #### `.prd-feature-list.json` — Feature Metadata Registry
437
+
438
+ This file is generated by PM Agent and contains the complete feature metadata with nested structure:
439
+
440
+ ```json
441
+ {
442
+ "modules": [
443
+ {
444
+ "module_id": "M1-System",
445
+ "module_name": "System Management",
446
+ "features": [
447
+ {
448
+ "feature_id": "F-SYS-01",
449
+ "feature_name": "Account Login",
450
+ "feature_type": "Page+API",
451
+ "dependencies": []
452
+ }
453
+ ]
454
+ }
455
+ ]
456
+ }
457
+ ```
458
+
459
+ - **Purpose**: Source of truth for feature metadata (names, types, dependencies)
460
+ - **Structure**: Nested `modules > features` array
461
+ - **Used by**: Agent reads this to understand feature breakdown
462
+ - **NOT for**: Direct use with `update-progress.js init` command
463
+
464
+ #### `.tasks-temp.json` — Flat Task Array for init Command
465
+
466
+ The `update-progress.js init --tasks-file` expects a **flat array** of task IDs:
467
+
468
+ ```json
469
+ [
470
+ {"id": "F-SYS-01"},
471
+ {"id": "F-MEMBER-01"},
472
+ {"id": "F-CRM-01"}
473
+ ]
474
+ ```
475
+
476
+ - **Purpose**: Initialize DISPATCH-PROGRESS.json task list
477
+ - **Structure**: Flat array with `id` field only
478
+ - **Used by**: `update-progress.js init --tasks-file <path>`
479
+ - **Naming**: Recommend `.tasks-temp.json` (delete after init)
480
+
481
+ #### Conversion Step
482
+
483
+ Before initializing DISPATCH-PROGRESS.json, extract feature IDs from `.prd-feature-list.json`:
484
+
485
+ 1. Read `.prd-feature-list.json`
486
+ 2. Flatten `modules[].features[].feature_id` into array
487
+ 3. Write `[{"id": "F-XXX"}, ...]` to `.tasks-temp.json`
488
+ 4. Run `update-progress.js init --tasks-file .tasks-temp.json`
489
+ 5. Delete `.tasks-temp.json`
490
+
414
491
  ---
415
492
 
416
493
  ### Phase 3a: Analyze — Function Decomposition
@@ -94,7 +94,7 @@ PM continues to next orchestration block
94
94
  | Phase 3 | speccrew-pm-requirement-clarify | ✅ dispatch-to-worker |
95
95
  | Phase 4a | speccrew-pm-requirement-model | ✅ dispatch-to-worker |
96
96
  | Phase 4b | speccrew-pm-requirement-analysis | ✅ dispatch-to-worker |
97
- | Phase 5 | speccrew-pm-phase5-subprd-dispatch | dispatch-to-worker |
97
+ | Phase 5 | speccrew-pm-phase5-subprd-dispatch | PM direct execution |
98
98
  | Phase 6 | speccrew-pm-phase6-verify-confirm | ✅ dispatch-to-worker |
99
99
 
100
100
  ---
@@ -155,7 +155,7 @@ Phase 0 done. Moving to Phase 1...
155
155
  | **Phase 4a** | ISA-95 Modeling (complex) | `speccrew-pm-requirement-model` | Worker dispatch |
156
156
  | **Phase 4b** | PRD Generation (complex) | `speccrew-pm-requirement-analysis` | Worker dispatch |
157
157
  | **Phase 4** | Simple PRD Generation | `speccrew-pm-requirement-simple` | Worker dispatch |
158
- | **Phase 5** | Sub-PRD Dispatch (complex) | `speccrew-pm-phase5-subprd-dispatch` | Parallel Worker dispatch |
158
+ | **Phase 5** | Sub-PRD Dispatch (complex) | `speccrew-pm-phase5-subprd-dispatch` | PM Direct Orchestration |
159
159
  | **Phase 6** | Verification & Confirmation | `speccrew-pm-phase6-verify-confirm` | Worker dispatch |
160
160
 
161
161
  ---
@@ -400,21 +400,62 @@ Step 4b: Dispatch Worker with speccrew-pm-requirement-analysis
400
400
 
401
401
  ---
402
402
 
403
- ## Phase 5: Sub-PRD Worker Dispatch
403
+ ## Phase 5: Sub-PRD Worker Dispatch (PM Direct Orchestration)
404
404
 
405
- <!-- Phase 5 的详细步骤已提取到 AgentFlow Skill: speccrew-pm-phase5-subprd-dispatch -->
406
- <!-- 执行时由 orchestration 通过 dispatch-to-worker 调用 -->
405
+ <!-- Phase 5 PM 直接执行的编排 Skill,PM 必须读取 workflow.agentflow.xml 并按步骤执行 -->
406
+ <!-- ⚠️ 这里的 dispatch-to-worker 块由 PM Agent 直接执行,不能委派给 Worker -->
407
+
408
+ **Purpose**: As the orchestration layer, PM Agent directly coordinates batch dispatch of Sub-PRD generation tasks to Worker Agents.
409
+
410
+ > 🛑 **CRITICAL ARCHITECTURE RULE (Harness Principle 17: Orchestration Layer Separation)**
411
+ >
412
+ > Phase 5 is an **orchestration skill** containing internal `dispatch-to-worker` blocks.
413
+ > - Workers CANNOT dispatch Workers (execution hierarchy)
414
+ > - Therefore, Phase 5 MUST be executed directly by PM Agent
415
+ > - PM Agent reads `workflow.agentflow.xml` and executes each block step-by-step
416
+
417
+ ### 5.1 PM Agent Execution Protocol
418
+
419
+ **PM Agent MUST:**
420
+ 1. Read the skill's `workflow.agentflow.xml` to understand execution steps
421
+ 2. Execute each block in order: read plan → init progress → dispatch workers → verify
422
+ 3. Use Agent tool to create `speccrew-task-worker` for EACH module
423
+ 4. Pass `speccrew-pm-sub-prd-generate` skill name to each Worker
407
424
 
408
- **Purpose**: Dispatch parallel Workers to generate Sub-PRD documents for each module.
425
+ **PM Agent MUST NOT:**
426
+ - Dispatch Phase 5 to a Worker (Worker cannot dispatch sub-Workers)
427
+ - Skip reading the workflow.agentflow.xml
428
+ - Generate Sub-PRD content directly
409
429
 
410
- ### 5.1 Prerequisites
430
+ ### 5.2 Prerequisites
411
431
 
412
432
  - Phase 4b completed with valid Dispatch Plan
413
433
  - Master PRD exists
414
434
  - Dispatch Plan contains module list (count ≥ 2)
435
+ - `.sub-prd-dispatch-plan.json` exists in iteration directory
436
+
437
+ ### 5.3 Workflow Steps (from workflow.agentflow.xml)
415
438
 
416
- ### 5.2 Dispatch Strategy
439
+ **Step 5.1: Read Dispatch Plan**
440
+ - Read `.sub-prd-dispatch-plan.json` from iteration directory
441
+ - Parse module list and verify required fields
417
442
 
443
+ **Step 5.2: Initialize Progress Tracking**
444
+
445
+ > 🛑 **MANDATORY: Initialize DISPATCH-PROGRESS.json BEFORE any Worker dispatch**
446
+ >
447
+ > PM Agent MUST:
448
+ > 1. Create temp task file: `.tasks-temp.json`
449
+ > 2. Run: `node {update_progress_script} init --file DISPATCH-PROGRESS.json --stage sub_prd_dispatch --tasks-file .tasks-temp.json`
450
+ > 3. Verify initialization (Total: N | Pending: N | Completed: 0)
451
+ >
452
+ > **FORBIDDEN:**
453
+ > - DO NOT dispatch ANY Worker before DISPATCH-PROGRESS.json is initialized
454
+ > - DO NOT create DISPATCH-PROGRESS.json manually via create_file
455
+
456
+ **Step 5.3: Batch Dispatch Workers**
457
+
458
+ Dispatch Strategy:
418
459
  | Module Count | Dispatch Strategy |
419
460
  |--------------|-------------------|
420
461
  | 1-5 modules | Single batch, all parallel |
@@ -424,24 +465,25 @@ Step 4b: Dispatch Worker with speccrew-pm-requirement-analysis
424
465
 
425
466
  **BATCH SIZE = 5 (maximum parallel Workers per batch)**
426
467
 
427
- ### 5.3 Worker Dispatch Rules
428
-
429
- > 🛑 **CRITICAL: ONE Worker per Module — NO EXCEPTIONS**
468
+ > 🛑 **MANDATORY: Update Progress After Each Worker Completes**
469
+ >
470
+ > After each Worker returns:
471
+ > 1. Run: `node {update_progress_script} update-task --file DISPATCH-PROGRESS.json --task-id {module_id} --status {completed|failed}`
472
+ > 2. Verify the update succeeded
473
+ >
474
+ > **FORBIDDEN:**
475
+ > - DO NOT skip progress update
476
+ > - DO NOT proceed to next batch until current batch is verified
430
477
 
431
- **PM Agent MUST:**
432
- 1. Read the Dispatch Plan from generate skill output
433
- 2. Initialize DISPATCH-PROGRESS.json via update-progress.js script
434
- 3. For EACH module: invoke ONE `speccrew-task-worker` with `speccrew-pm-sub-prd-generate`
435
- 4. Pass ALL required context parameters to each worker
436
- 5. Dispatch in batches of 5, wait for each batch to complete
437
- 6. After each Worker completes, update DISPATCH-PROGRESS.json via script
478
+ **Step 5.4: Failure Retry**
479
+ - Check for tasks with `failed` status
480
+ - Retry once if failures exist
481
+ - Log persistent failures and continue
438
482
 
439
- **PM Agent MUST NOT:**
440
- - Generate Sub-PRD files directly (via create_file, write, or any file creation)
441
- - Invoke speccrew-pm-sub-prd-generate skill directly
442
- - Dispatch ONE Worker to handle MULTIPLE modules
443
- - Create or edit any Sub-PRD content as fallback
444
- - Skip worker dispatch and generate Sub-PRDs inline
483
+ **Step 5.5: Result Verification**
484
+ - Read final DISPATCH-PROGRESS.json
485
+ - Verify all Sub-PRD files exist and size > 3KB
486
+ - Update checkpoint via script
445
487
 
446
488
  ### 5.4 Worker Context Parameters
447
489
 
@@ -458,21 +500,18 @@ Step 4b: Dispatch Worker with speccrew-pm-requirement-analysis
458
500
  | `output_path` | Computed | `{output_dir}/{feature_name}-sub-{module_key}.md` |
459
501
  | `language` | Detected | User's language |
460
502
 
461
- ### 5.5 Progress Tracking
462
-
463
- - Track progress in `DISPATCH-PROGRESS.json` via `update-progress.js` script
464
- - After ALL workers complete, verify Sub-PRD files exist
465
- - Update checkpoint `sub_prd_dispatch` to `passed`
466
-
467
- ### 5.6 Completion Verification
503
+ ### 5.5 Completion Verification
468
504
 
469
505
  Before proceeding to Phase 6, verify:
470
- - [ ] All workers were dispatched via speccrew-task-worker (one Worker per module)
506
+ - [ ] PM Agent executed Phase 5 directly (NOT dispatched to Worker)
507
+ - [ ] DISPATCH-PROGRESS.json was initialized BEFORE any dispatch
508
+ - [ ] All workers were dispatched via Agent tool (one Worker per module)
509
+ - [ ] Progress was updated after each Worker completed
471
510
  - [ ] No Sub-PRD was generated by PM Agent directly
472
511
  - [ ] All workers completed (DISPATCH-PROGRESS.json counts.pending == 0)
473
512
  - [ ] All Sub-PRD files exist and have valid size
474
513
  - [ ] `.prd-feature-list.json` contains complete feature data
475
- - [ ] Checkpoint updated
514
+ - [ ] Checkpoint updated via script
476
515
 
477
516
  ---
478
517
 
@@ -2,15 +2,32 @@
2
2
 
3
3
  ## Description
4
4
 
5
- PM Phase 5 Sub-PRD Batch Dispatch Skill. Core orchestration component for Master-Sub PRD workflow, executed directly by PM Agent (NOT dispatched to Worker).
5
+ PM Phase 5 Sub-PRD Batch Dispatch Skill. **Orchestration-layer skill** executed directly by PM Agent (NOT dispatched to Worker).
6
6
 
7
- PM Agent loads and executes this skill directly to coordinate batch dispatch of Sub-PRD generation tasks to Worker Agents, implementing:
8
- - Reading Dispatch Plan from Master PRD
9
- - Initializing dispatch progress tracking
10
- - Dispatching Workers in parallel batches for Sub-PRD generation per module
11
- - Failure retry and result verification
7
+ This is an **orchestration skill** that PM Agent must execute directly:
8
+ - PM Agent reads `workflow.agentflow.xml` and executes each block step-by-step
9
+ - PM Agent uses Agent tool to dispatch Workers for Sub-PRD generation
10
+ - Workers generate Sub-PRD files; PM Agent only coordinates
12
11
 
13
- **CRITICAL**: This skill contains dispatch-to-worker logic internally. It MUST be executed by PM Agent (who has Agent tool access), NOT by a Worker Agent (who cannot create sub-Workers).
12
+ **CRITICAL ARCHITECTURE RULE (Harness Principle 17: Orchestration Layer Separation)**:
13
+ - This skill contains internal `dispatch-to-worker` blocks
14
+ - Workers CANNOT dispatch Workers (execution hierarchy constraint)
15
+ - Therefore, this skill MUST be executed by PM Agent directly
16
+ - PM Agent MUST NOT dispatch this skill to a Worker
17
+
18
+ **Execution Method**: PM Agent reads `workflow.agentflow.xml` and follows the workflow steps.
19
+
20
+ ## MANDATORY: PM Must Read workflow.agentflow.xml
21
+
22
+ > 🛑 **BEFORE executing this skill, PM Agent MUST:**
23
+ > 1. Read the `workflow.agentflow.xml` file in this skill directory
24
+ > 2. Parse each block and execute in order
25
+ > 3. Follow the exact workflow steps defined in the XML
26
+ >
27
+ > **FORBIDDEN:**
28
+ > - DO NOT execute this skill without reading the XML workflow
29
+ > - DO NOT skip blocks defined in the XML
30
+ > - DO NOT dispatch this skill to a Worker Agent
14
31
 
15
32
  ## Input Parameters
16
33
 
@@ -69,27 +86,22 @@ PM Agent loads and executes this skill directly to coordinate batch dispatch of
69
86
  ### Step 5.6: User Confirmation
70
87
  - [ ] Wait for user confirmation of Sub-PRD generation results
71
88
 
72
- ## Key Rules
73
-
74
- ### MANDATORY - Worker Dispatch Rules
75
- - **ONE Worker per Module** - Dispatch one independent Worker per Sub-PRD module
76
- - **PM Must Not Generate Directly** - PM Agent must NOT directly generate Sub-PRD content
77
- - **Must Use dispatch-to-worker** - All Workers must be executed via `dispatch-to-worker` action
78
- - **Direct Skill Invocation Forbidden** - Must NOT directly invoke `speccrew-pm-sub-prd-generate` skill
79
-
80
- ### MANDATORY - Batch Processing Rules
81
- - **Batch Size = 5** - Maximum 5 parallel Workers per batch
82
- - **Parallel Dispatch** - Workers in the same batch must be dispatched simultaneously
83
- - **Sequential Wait** - Wait for current batch to complete before dispatching next batch
84
- - **Progress Update** - Immediately update DISPATCH-PROGRESS.json after each Worker completes
85
-
86
- ### MANDATORY - Progress Tracking Rules
87
- - **Script Initialization** - DISPATCH-PROGRESS.json must be created via update-progress.js
88
- - **Manual Creation Forbidden** - Must NOT create progress files directly via create_file or PowerShell
89
- - **Idempotent Update** - Use `update-task` command to update individual task status
90
-
91
- ### FORBIDDEN - Prohibited Actions
92
- - PM Agent directly generating Sub-PRD files is forbidden
93
- - Dispatching one Worker to handle multiple modules is forbidden
94
- - Skipping Worker dispatch as a fallback after failure is forbidden
95
- - Marking checkpoint as passed before user confirmation is forbidden
89
+ ## Must Do
90
+
91
+ - **READ workflow.agentflow.xml FIRST** PM Agent must parse the XML workflow before any execution
92
+ - **Initialize DISPATCH-PROGRESS.json BEFORE any Worker dispatch** Use update-progress.js init command
93
+ - **Dispatch one Worker per module** Use Agent tool to create speccrew-task-worker with speccrew-pm-sub-prd-generate skill
94
+ - **Update progress after each Worker completes** Use update-progress.js update-task command
95
+ - **Verify all Sub-PRD files exist** Check file existence and size > 3KB
96
+ - **Update checkpoint via script** — Use update-progress.js write-checkpoint command
97
+
98
+ ## Must Not Do
99
+
100
+ - **DO NOT dispatch this skill to a Worker** Phase 5 is PM direct execution
101
+ - **DO NOT skip reading workflow.agentflow.xml** XML workflow is the execution guide
102
+ - **DO NOT dispatch Workers before DISPATCH-PROGRESS.json is initialized** — Progress tracking is mandatory
103
+ - **DO NOT create DISPATCH-PROGRESS.json manually** Must use update-progress.js script
104
+ - **DO NOT generate Sub-PRD content directly** Only Workers generate Sub-PRDs
105
+ - **DO NOT skip progress update after Worker completes** Must call update-task for each completed Worker
106
+ - **DO NOT dispatch one Worker for multiple modules** One Worker per module
107
+ - **DO NOT proceed to Phase 6 without verifying all Sub-PRDs** — Completion verification is mandatory
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speccrew",
3
- "version": "0.7.27",
3
+ "version": "0.7.29",
4
4
  "description": "Spec-Driven Development toolkit for AI-powered IDEs",
5
5
  "author": "charlesmu99",
6
6
  "repository": {