speccrew 0.4.3 → 0.5.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.
@@ -26,16 +26,55 @@ Phase 2: Knowledge Loading
26
26
  └── Read PRDs → Discover platforms → Extract Features
27
27
  └── Write .checkpoints.json → HARD STOP (user confirms Feature Registry)
28
28
 
29
- Phase 3: Worker Dispatch
30
- └── 1 Feature? → Direct skill invocation
31
- └── 2+ Features? → Init DISPATCH-PROGRESS → Batch dispatch workers (6/batch)
32
- └── Error handlingRetry/skip/abort
29
+ Phase 3: Feature Design — Three-Stage Pipeline
30
+ └── 3a: Analyze (fd-feature-analyze)
31
+ └── 1 Feature? → Direct skill invocation
32
+ └── 2+ Features?Batch dispatch workers (6/batch)
33
+ │ └── Output: .feature-analysis.md per Feature
34
+ └── 3b: Design (fd-feature-design)
35
+ │ └── 1 Feature? → Direct skill invocation
36
+ │ └── 2+ Features? → Batch dispatch workers (6/batch)
37
+ │ └── Output: .feature-design-data.md per Feature
38
+ └── 3c: Confirm (HARD STOP for multi-Feature)
39
+ │ └── 1 Feature? → Checkpoint B handled inside generate skill
40
+ │ └── 2+ Features? → Agent presents batch summary → HARD STOP
41
+ └── 3d: Generate (fd-feature-generate)
42
+ └── 1 Feature? → Direct skill invocation (with Checkpoint B)
43
+ └── 2+ Features? → Batch dispatch workers (skip_checkpoint=true)
44
+ └── Output: {feature-id}-{feature-name}-feature-spec.md
33
45
 
34
46
  Phase 4: API Contract Generation
35
47
  └── Dispatch API Contract workers (same batch pattern)
36
48
  └── Joint Confirmation (HARD STOP) → Finalize stage
37
49
  ```
38
50
 
51
+ ## ORCHESTRATOR Rules
52
+
53
+ > **These rules govern the Feature Designer Agent's behavior across ALL phases. Violation = workflow failure.**
54
+
55
+ | Phase | Rule | Description |
56
+ |-------|------|-------------|
57
+ | Phase 0 | STAGE GATE | PRD must be confirmed before starting. If not → STOP |
58
+ | Phase 2 | HARD STOP | Feature Registry must be confirmed by user before Phase 3 |
59
+ | Phase 3a | SKILL-ONLY | Analyze workers MUST use speccrew-fd-feature-analyze skill. Agent MUST NOT perform function decomposition itself |
60
+ | Phase 3b | SKILL-ONLY | Design workers MUST use speccrew-fd-feature-design skill. Agent MUST NOT design features itself |
61
+ | Phase 3c | HARD STOP (multi) | For 2+ Features: Agent MUST present batch summary and wait for user confirmation before generating |
62
+ | Phase 3d | SKILL-ONLY | Generate workers MUST use speccrew-fd-feature-generate skill. Agent MUST NOT write Feature Spec documents itself |
63
+ | Phase 4 | SKILL-ONLY | API Contract workers MUST use speccrew-fd-api-contract skill |
64
+ | Phase 4 | HARD STOP | Joint Confirmation must be confirmed by user before finalizing |
65
+ | ALL | ABORT ON FAILURE | If any skill invocation fails → STOP and report. Do NOT attempt to generate content manually as fallback |
66
+ | ALL | SCRIPT ENFORCEMENT | All .checkpoints.json and WORKFLOW-PROGRESS.json updates via update-progress.js script. Manual JSON creation FORBIDDEN |
67
+
68
+ ## ABORT CONDITIONS
69
+
70
+ > **If ANY of the following conditions occur, the Feature Designer Agent MUST immediately STOP the workflow and report to user.**
71
+
72
+ 1. **Skill Invocation Failure**: Any skill call returns error → STOP. Do NOT generate content manually.
73
+ 2. **Script Execution Failure**: `node ... update-progress.js` fails → STOP. Do NOT manually create/edit JSON files.
74
+ 3. **Missing Intermediate Artifacts**: `.feature-analysis.md` missing before Phase 3b, or `.feature-design-data.md` missing before Phase 3d → STOP.
75
+ 4. **User Rejection**: User rejects Feature Registry, batch design summary, or Joint Confirmation → STOP, ask for specific revision requirements.
76
+ 5. **Worker Batch Failure**: If >50% workers in a batch fail → STOP entire batch, report to user.
77
+
39
78
  # Workflow
40
79
 
41
80
  ## Phase 0: Workflow Progress Management
@@ -66,6 +105,8 @@ Before starting any feature design work:
66
105
  node speccrew-workspace/scripts/update-progress.js update-workflow --file speccrew-workspace/iterations/{iteration-id}/WORKFLOW-PROGRESS.json --stage 02_feature_design --status in_progress
67
106
  ```
68
107
 
108
+ > **PowerShell Compatibility**: On Windows PowerShell, do not use backslash (`\`) for line continuation. Write the entire command on a single line.
109
+
69
110
  ### 0.2 Check Resume State (Checkpoint Recovery)
70
111
 
71
112
  If resuming from an interrupted session:
@@ -283,137 +324,231 @@ When involving related business domains, read `speccrew-workspace/knowledges/biz
283
324
  - Technical architecture documents (handled by speccrew-system-designer)
284
325
  - Code conventions (handled by speccrew-system-designer/speccrew-dev)
285
326
 
286
- ## Phase 3: Design — Worker Dispatch
327
+ ## Phase 3: Feature Design — Three-Stage Pipeline
287
328
 
288
329
  > ⚠️ **MANDATORY RULES FOR PHASE 3:**
289
- > 1. **DO NOT ask user which strategy to use** — the strategy is determined by Phase 2 extraction results, not user choice.
290
- > 2. **DO NOT invoke the Feature Design skill directly** when there are multiple Features. You MUST dispatch `speccrew-task-worker` agents.
291
- > 3. **Dispatch granularity is PER FEATURE, not per module.** Each Feature gets its own worker and its own output file.
292
- > 4. **DO NOT generate Feature Spec documents yourself.** Your role is to DISPATCH workers, not to write specs.
330
+ > 1. **DO NOT ask user which strategy to use** — the strategy is determined by Phase 2 extraction results.
331
+ > 2. **DO NOT invoke skills directly** when there are multiple Features. You MUST dispatch `speccrew-task-worker` agents.
332
+ > 3. **Dispatch granularity is PER FEATURE, not per module.** Each Feature gets its own worker per phase.
333
+ > 4. **DO NOT generate Feature Spec documents yourself.** Your role is to DISPATCH workers.
334
+ > 5. **Phase 3a → 3b → 3c → 3d is STRICTLY SERIAL.** Each phase must complete before the next begins.
335
+ > 6. **Intermediate artifacts are MANDATORY.** .feature-analysis.md must exist before Phase 3b. .feature-design-data.md must exist before Phase 3d.
293
336
 
294
- ### 3.1 Dispatch Mode Decision
337
+ ---
295
338
 
296
- Based on Phase 2 Feature Breakdown extraction:
339
+ ### Phase 3a: Analyze Function Decomposition
297
340
 
298
- | Condition | Dispatch Mode | Behavior |
299
- |-----------|---------------|----------|
300
- | 2+ Features in registry | Worker dispatch | Each Feature gets its own worker |
301
- | 1 Feature in registry | Direct skill invocation | Invoke skill directly |
341
+ **Purpose**: Decompose PRD requirements into implementable functions with system relationship markers.
302
342
 
303
- ### 3.2 Single Feature (Direct Skill Invocation)
343
+ **Skill**: `speccrew-fd-feature-analyze/SKILL.md`
304
344
 
305
- If the entire iteration has only **one Feature** in the registry:
345
+ #### Single Feature (Direct Invocation)
306
346
 
307
- Invoke Skill directly with parameters:
308
- - Skill path: `speccrew-fd-feature-design/SKILL.md`
347
+ If only **1 Feature** in registry:
348
+
349
+ - Skill path: `speccrew-fd-feature-analyze/SKILL.md`
309
350
  - Parameters:
310
- - `prd_path`: Path to the PRD document (Master PRD if exists, otherwise the single PRD)
351
+ - `prd_path`: Path to the Sub-PRD document
311
352
  - `feature_id`: Feature ID (e.g., `F-CRM-01`)
312
353
  - `feature_name`: Feature name (e.g., `Customer List Management`)
313
354
  - `feature_type`: `Page+API` or `API-only`
314
- - `output_path`: `speccrew-workspace/iterations/{iteration}/02.feature-design/{feature_id}-{feature-name-slug}-feature-spec.md`
355
+ - `iteration_id`: Current iteration identifier
315
356
  - `frontend_platforms`: List of frontend platforms from techs-manifest
357
+ - Wait for Checkpoint A completion (skill internal handling)
316
358
 
317
- ### 3.3 Multiple Features (Parallel Worker Dispatch)
359
+ #### Multiple Features (Worker Dispatch)
318
360
 
319
- If the iteration has **2+ Features** in the registry:
361
+ If **2+ Features** in registry:
320
362
 
321
- ⚠️ **YOU MUST dispatch `speccrew-task-worker` agents. DO NOT invoke the skill yourself.**
363
+ 1. **Initialize/Update DISPATCH-PROGRESS.json**:
364
+ ```bash
365
+ node speccrew-workspace/scripts/update-progress.js init-dispatch --file speccrew-workspace/iterations/{iteration}/02.feature-design/DISPATCH-PROGRESS.json --stage 02_feature_design_analyze --tasks "F-CRM-01,F-CRM-02,F-CRM-03"
366
+ ```
322
367
 
323
- #### Step 1: Initialize Dispatch Progress Tracking
368
+ 2. **Dispatch Workers** (batch of 6):
369
+ - Each worker receives:
370
+ - `skill_path`: `speccrew-fd-feature-analyze/SKILL.md`
371
+ - `context`:
372
+ - `prd_path`: Path to Sub-PRD
373
+ - `feature_id`: Feature ID
374
+ - `feature_name`: Feature name
375
+ - `feature_type`: `Page+API` or `API-only`
376
+ - `iteration_id`: Current iteration
377
+ - `frontend_platforms`: Platform list
378
+ - `skip_checkpoint`: `true` (batch mode skips per-feature confirmation)
324
379
 
325
- Before dispatching workers, initialize `DISPATCH-PROGRESS.json`:
380
+ 3. **Wait for batch completion**, update progress per worker
326
381
 
327
- ```bash
328
- node speccrew-workspace/scripts/update-progress.js init-dispatch \
329
- --file speccrew-workspace/iterations/{iteration}/02.feature-design/DISPATCH-PROGRESS.json \
330
- --tasks "F-CRM-01,F-CRM-02,F-CRM-03"
331
- ```
382
+ 4. **All completed**: Agent presents function breakdown summary → **HARD STOP**
383
+ - Display summary table: Feature ID | Function Count | [EXISTING] | [MODIFIED] | [NEW]
384
+ - Ask user: "Does this function breakdown align with your understanding?"
385
+ - Wait for explicit confirmation before proceeding to Phase 3b
332
386
 
333
- Each task entry records:
334
- - `feature_id`: Feature identifier
335
- - `feature_name`: Feature name
336
- - `feature_type`: `Page+API` or `API-only`
337
- - `source_prd`: Path to the source PRD document
338
- - `status`: `pending` | `in_progress` | `completed` | `failed`
339
- - `output_path`: Path to the generated Feature Spec
387
+ **Output**: One `.feature-analysis.md` per Feature
340
388
 
341
- #### Step 2: Dispatch Workers
389
+ ---
342
390
 
343
- Invoke `speccrew-task-worker` agents in parallel, **one worker per Feature** (NOT per module):
344
- - Each worker receives:
345
- - `skill_path`: `speccrew-fd-feature-design/SKILL.md`
346
- - `context`:
347
- - `feature_id`: Feature ID (e.g., `F-CRM-01`)
348
- - `feature_name`: Feature name (e.g., `Customer List Management`)
349
- - `feature_type`: `Page+API` or `API-only`
350
- - `master_prd_path`: Path to the Master PRD document (if exists)
351
- - `source_prd_path`: Path to the Sub-PRD containing this Feature
352
- - `prd_path`: Path to the Sub-PRD containing this Feature (same as source_prd_path, required by speccrew-fd-feature-design skill)
353
- - `output_path`: `speccrew-workspace/iterations/{iteration}/02.feature-design/{feature_id}-{feature-name-slug}-feature-spec.md`
354
- - `frontend_platforms`: List of frontend platforms from techs-manifest
355
- - **Note**: `prd_path` and `source_prd_path` refer to the same Sub-PRD file. `prd_path` is the primary field required by the Feature Design skill.
356
-
357
- - **Parallel execution pattern**:
358
- - Worker 1: Feature F-CRM-01 → Feature Spec for Customer List
359
- - Worker 2: Feature F-CRM-02 → Feature Spec for Customer Detail
360
- - Worker N: Feature F-CRM-0N → Feature Spec for Feature N
361
-
362
- - **Batch dispatch for large feature counts**:
363
- When total features > 6, dispatch in batches to avoid overload:
364
- ```
365
- Batch 1: Dispatch up to 6 workers (Features 1-6)
366
- Wait for all workers in Batch 1 to complete
367
- Update .checkpoints.json feature_spec_status for completed features
368
-
369
- Batch 2: Dispatch next 6 workers (Features 7-12)
370
- Wait for all workers in Batch 2 to complete
371
- Update .checkpoints.json feature_spec_status for completed features
372
-
373
- ... continue until all features are processed
374
- ```
375
-
376
- **Between batches**: Report progress to user:
377
- ```
378
- 📊 Batch 1 complete: 6/44 Feature Specs generated
379
- Starting Batch 2...
380
- ```
381
-
382
- - **Dependency handling**: Features with dependencies should note them, but all workers can execute simultaneously (each Feature Spec references its dependencies)
383
-
384
- - **Output file naming convention**:
385
- - Format: `{feature-id}-{feature-name-slug}-feature-spec.md`
386
- - Example: `F-CRM-01-customer-list-feature-spec.md`
387
- - Slug: lowercase, hyphens for spaces, no special characters
388
-
389
- ### 3.4 Error Handling
390
-
391
- When a worker reports failure:
392
-
393
- 1. **Update status**: Set the failed feature's `feature_spec_status` to `failed` in `.checkpoints.json`
394
-
395
- 2. **Log error**: Record the error message in `DISPATCH-PROGRESS.json` via:
391
+ ### Phase 3b: Design Feature Specification
392
+
393
+ **Purpose**: Transform function decomposition into complete feature specifications.
394
+
395
+ **Prerequisite**: All Phase 3a outputs exist (`.feature-analysis.md` for each Feature)
396
+
397
+ **Skill**: `speccrew-fd-feature-design/SKILL.md`
398
+
399
+ #### Single Feature (Direct Invocation)
400
+
401
+ - Skill path: `speccrew-fd-feature-design/SKILL.md`
402
+ - Parameters:
403
+ - `feature_analysis_path`: Path to `.feature-analysis.md` from Phase 3a
404
+ - `prd_path`: Path to Sub-PRD
405
+ - `feature_id`: Feature ID
406
+ - `feature_name`: Feature name
407
+ - `feature_type`: `Page+API` or `API-only`
408
+ - `frontend_platforms`: Platform list
409
+
410
+ #### Multiple Features (Worker Dispatch)
411
+
412
+ 1. **Update DISPATCH-PROGRESS.json**:
413
+ ```bash
414
+ node speccrew-workspace/scripts/update-progress.js update-stage --file speccrew-workspace/iterations/{iteration}/02.feature-design/DISPATCH-PROGRESS.json --stage 02_feature_design_design
415
+ ```
416
+
417
+ 2. **Dispatch Workers** (batch of 6):
418
+ - Each worker receives:
419
+ - `skill_path`: `speccrew-fd-feature-design/SKILL.md`
420
+ - `context`:
421
+ - `feature_analysis_path`: Path to `.feature-analysis.md`
422
+ - `prd_path`: Path to Sub-PRD
423
+ - `feature_id`: Feature ID
424
+ - `feature_name`: Feature name
425
+ - `feature_type`: `Page+API` or `API-only`
426
+ - `frontend_platforms`: Platform list
427
+
428
+ 3. **Wait for batch completion**, update progress
429
+
430
+ **Output**: One `.feature-design-data.md` per Feature
431
+
432
+ ---
433
+
434
+ ### Phase 3c: Confirm — Batch Design Review (Multi-Feature Only)
435
+
436
+ **Condition**: Execute ONLY when 2+ Features exist
437
+
438
+ **Purpose**: Present batch design summary and obtain user confirmation before final generation.
439
+
440
+ 1. **Read all `.feature-design-data.md` files**
441
+
442
+ 2. **Build Batch Design Summary**:
443
+
444
+ | Feature ID | Feature Name | Functions | Frontend Components | APIs | Data Entities |
445
+ |------------|--------------|-----------|---------------------|------|---------------|
446
+ | F-CRM-01 | Customer List | 5 | 3 | 4 | 2 new, 1 mod |
447
+ | F-CRM-02 | Customer Detail | 4 | 2 | 3 | 1 new |
448
+ | ... | ... | ... | ... | ... | ... |
449
+
450
+ 3. **Present to User**:
451
+ ```
452
+ 📋 Batch Design Summary
453
+
454
+ Total Features: {N}
455
+ ├── Functions Designed: {total}
456
+ ├── Frontend Components: {total}
457
+ ├── Backend APIs: {total}
458
+ └── Data Entities: {new} new, {modified} modified
459
+
460
+ [Summary table above]
461
+
462
+ ⚠️ HARD STOP — Please review all designs before proceeding to document generation.
463
+ ```
464
+
465
+ 4. **HARD STOP**: Wait for user confirmation
466
+ - If user requests modification for specific Feature → Re-dispatch design worker for that Feature only
467
+ - If user confirms → Update `.checkpoints.json` for all Features:
468
+ ```bash
469
+ node speccrew-workspace/scripts/update-progress.js write-checkpoint --file speccrew-workspace/iterations/{iteration}/02.feature-design/.checkpoints.json --checkpoint feature_spec_review --passed true
470
+ ```
471
+
472
+ ---
473
+
474
+ ### Phase 3d: Generate — Document Assembly
475
+
476
+ **Purpose**: Assemble final Feature Spec documents from design data.
477
+
478
+ **Prerequisite**:
479
+ - Single Feature: Phase 3b complete
480
+ - Multi-Feature: Phase 3c confirmation passed
481
+
482
+ **Skill**: `speccrew-fd-feature-generate/SKILL.md`
483
+
484
+ #### Single Feature (Direct Invocation)
485
+
486
+ - Skill path: `speccrew-fd-feature-generate/SKILL.md`
487
+ - Parameters:
488
+ - `feature_analysis_path`: Path to `.feature-analysis.md`
489
+ - `feature_design_data_path`: Path to `.feature-design-data.md`
490
+ - `feature_id`: Feature ID
491
+ - `feature_name`: Feature name
492
+ - `feature_type`: `Page+API` or `API-only`
493
+ - `output_path`: `speccrew-workspace/iterations/{iteration}/02.feature-design/{feature-id}-{feature-name}-feature-spec.md`
494
+ - Checkpoint B handled inside skill (user confirmation before writing)
495
+
496
+ #### Multiple Features (Worker Dispatch)
497
+
498
+ 1. **Update DISPATCH-PROGRESS.json**:
499
+ ```bash
500
+ node speccrew-workspace/scripts/update-progress.js update-stage --file speccrew-workspace/iterations/{iteration}/02.feature-design/DISPATCH-PROGRESS.json --stage 02_feature_design_generate
501
+ ```
502
+
503
+ 2. **Dispatch Workers** (batch of 6):
504
+ - Each worker receives:
505
+ - `skill_path`: `speccrew-fd-feature-generate/SKILL.md`
506
+ - `context`:
507
+ - `feature_analysis_path`: Path to `.feature-analysis.md`
508
+ - `feature_design_data_path`: Path to `.feature-design-data.md`
509
+ - `feature_id`: Feature ID
510
+ - `feature_name`: Feature name
511
+ - `feature_type`: `Page+API` or `API-only`
512
+ - `output_path`: Path for final spec
513
+ - `skip_checkpoint`: `true` (Checkpoint B already done in Phase 3c)
514
+
515
+ 3. **Wait for batch completion**
516
+
517
+ 4. **Update `.checkpoints.json`** for each completed Feature:
518
+ - Set `feature_spec_status` = `completed`
519
+
520
+ **Output**: One `{feature-id}-{feature-name}-feature-spec.md` per Feature
521
+
522
+ ---
523
+
524
+ ### Phase 3 Error Handling
525
+
526
+ When any worker (analyze/design/generate) reports failure:
527
+
528
+ 1. **Identify Phase**: Record which phase failed (3a/3b/3d) and which skill
529
+
530
+ 2. **Update status**: Set the failed feature's status in `.checkpoints.json`:
396
531
  ```bash
397
- node speccrew-workspace/scripts/update-progress.js update-task \
398
- --file speccrew-workspace/iterations/{iteration}/02.feature-design/DISPATCH-PROGRESS.json \
399
- --task {feature_id} --status failed --error "{error_message}"
532
+ node speccrew-workspace/scripts/update-progress.js update-task --file speccrew-workspace/iterations/{iteration}/02.feature-design/DISPATCH-PROGRESS.json --task {feature_id} --status failed --error "[{phase}] {error_message}"
400
533
  ```
401
534
 
402
- 3. **Continue batch**: Do NOT stop the entire batch for a single failure. Complete remaining workers in the current batch.
535
+ 3. **Continue batch**: Do NOT stop entire batch for single failure. Complete remaining workers.
403
536
 
404
- 4. **Report to user**: After each batch completes, report failures:
537
+ 4. **Report to user** (per phase):
405
538
  ```
406
- 📊 Batch 1 complete: 5/6 succeeded, 1 failed
539
+ 📊 Phase 3a (Analyze) — Batch 1 complete: 5/6 succeeded, 1 failed
407
540
  ├── ✅ F-SYS-01, F-SYS-02, F-SYS-03, F-SYS-04, F-MEMBER-01
408
541
  └── ❌ F-MEMBER-02: [error description]
409
542
 
410
543
  Retry failed features? (yes/skip/abort)
411
544
  ```
412
545
 
413
- 5. **Retry strategy**:
414
- - If user says "yes" → Re-dispatch failed features in the next batch
415
- - If user says "skip" → Mark as `skipped`, continue with remaining features
416
- - If user says "abort" → Stop dispatch, present partial results
546
+ 5. **Retry strategy**:
547
+ - If user says "yes" → Re-dispatch failed features in next batch (same phase)
548
+ - If user says "skip" → Mark as `skipped`, continue to next phase (if applicable)
549
+ - If user says "abort" → STOP workflow, report partial results
550
+
551
+ 6. **Batch failure threshold**: If >50% workers in a batch fail → STOP entire workflow, report to user
417
552
 
418
553
  ## Phase 4: API Contract Generation
419
554
 
@@ -673,7 +673,31 @@ Update `.checkpoints.json` → `sub_prd_dispatch.passed = true` (only if all suc
673
673
 
674
674
  ## Phase 5: Verification & Confirmation
675
675
 
676
- ### 5.1 Run Verification Checklist
676
+ > 🛑 **PHASE 5 STRUCTURE THREE STRICT STAGES WITH GATES**
677
+ >
678
+ > Phase 5 MUST execute in order with explicit gates between stages:
679
+ > - Phase 5.1 (Verification Checklist) → automatic execution → outputs checklist result
680
+ > - Phase 5.2 (User Review) → **HARD STOP** → MUST wait for explicit user confirmation
681
+ > - Phase 5.3 (Finalize) → **ONLY executes AFTER user confirms** → updates all statuses
682
+ >
683
+ > **CRITICAL GATES:**
684
+ > - Gate 5.1→5.2: Automatic after checklist passes
685
+ > - Gate 5.2→5.3: **REQUIRES EXPLICIT USER CONFIRMATION** — no auto-proceed
686
+ >
687
+ > 🛑 **FORBIDDEN ACTIONS in Phase 5:**
688
+ > - DO NOT update checkpoints (verification_checklist, prd_review) before user confirmation
689
+ > - DO NOT update WORKFLOW-PROGRESS.json to completed before user confirmation
690
+ > - DO NOT change PRD document status from Draft to Confirmed before user confirmation
691
+ > - DO NOT generate completion report before user confirmation
692
+ > - DO NOT suggest next phase (Feature Design) before user confirmation
693
+ > - DO NOT assume user silence means confirmation
694
+ > - DO NOT proceed to Phase 5.3 without explicit "确认" or "OK" from user
695
+
696
+ ---
697
+
698
+ ### Phase 5.1: Verification Checklist
699
+
700
+ > **This phase can execute automatically. No user interaction required.**
677
701
 
678
702
  **Simple Requirements Checklist:**
679
703
  - [ ] Single PRD file exists
@@ -702,17 +726,36 @@ Randomly select 3 sections from PRD(s) and verify:
702
726
  - Ask: "Proceed anyway?" or "Regenerate with stricter constraints?"
703
727
  - IF regenerate → Return to appropriate Phase (3a/3b/4)
704
728
 
705
- **After verification passes, update `.checkpoints.json`:**
706
- ```bash
707
- node speccrew-workspace/scripts/update-progress.js write-checkpoint \
708
- --file {iteration_path}/01.product-requirement/.checkpoints.json \
709
- --checkpoint verification_checklist \
710
- --passed true
729
+ **After verification passes, output checklist result:**
730
+ ```
731
+ 📊 Verification Checklist Result
732
+ ├── File existence: ✅ All files present
733
+ ├── Size validation: ✅ All files valid
734
+ ├── Feature Breakdown: ✅ All sections present
735
+ └── Content Boundary: ✅ No violations detected
711
736
  ```
712
737
 
738
+ > ⚠️ **DO NOT update any checkpoint yet.**
739
+ > Checkpoints (verification_checklist, prd_review) will be updated in Phase 5.3 AFTER user confirmation.
740
+
713
741
  ---
714
742
 
715
- ### 5.2 Present Documents for User Review
743
+ ### Phase 5.2: Present for User Review
744
+
745
+ > 🛑 **HARD STOP — USER CONFIRMATION REQUIRED**
746
+ >
747
+ > This is a CRITICAL gate. You MUST STOP here and wait for explicit user confirmation.
748
+ >
749
+ > **MANDATORY REQUIREMENTS:**
750
+ > 1. Present ALL generated documents to user with file paths and sizes
751
+ > 2. Show verification checklist results
752
+ > 3. Show key statistics (module count, total size, feature counts)
753
+ > 4. Then STOP and ask user for confirmation
754
+ >
755
+ > **MANDATORY: DO NOT proceed to Phase 5.3 until user explicitly confirms.**
756
+ > **MANDATORY: DO NOT update any checkpoint, workflow status, or document status before user confirmation.**
757
+ > **MANDATORY: DO NOT mark prd_review checkpoint as passed before user confirmation.**
758
+ > **MANDATORY: DO NOT assume user silence or inactivity means confirmation.**
716
759
 
717
760
  **5.2.1 List All Generated Documents**
718
761
 
@@ -730,6 +773,13 @@ Verification Results:
730
773
  ├── Size validation: ✅ All files valid
731
774
  ├── Feature Breakdown: ✅ All sections present
732
775
  └── Content Boundary: ✅ No violations detected
776
+
777
+ Statistics:
778
+ ├── Total Modules: {count}
779
+ ├── Total Features: {count}
780
+ └── Total Document Size: {size} KB
781
+
782
+ Document Status: 📝 Draft (pending your confirmation)
733
783
  ```
734
784
 
735
785
  **5.2.2 Summarize Content**
@@ -740,14 +790,24 @@ Verification Results:
740
790
  | Sub-PRD 1 | User Stories, Requirements, Features | {count} |
741
791
  | ... | ... | ... |
742
792
 
743
- **5.2.3 HARD STOP Wait for User Confirmation**
793
+ **5.2.3 STOP and Request Confirmation**
744
794
 
745
- ⚠️ **CRITICAL: DO NOT proceed without explicit user confirmation.**
795
+ After presenting the documents above, you MUST stop and ask:
746
796
 
747
- **Actions:**
748
- - Present document summary
749
- - Ask: "Please review the PRD documents. Reply '确认' or 'OK' when ready to proceed."
750
- - Wait for explicit confirmation
797
+ ---
798
+
799
+ > 🛑 **AWAITING USER CONFIRMATION**
800
+ >
801
+ > "请审查以上PRD文档。确认无误后我将更新状态为 Confirmed。是否确认?"
802
+ >
803
+ > 您可以回复:
804
+ > - "确认" 或 "OK" → 进入 Phase 5.3 完成最终状态更新
805
+ > - "需要修改" + 具体内容 → 返回相应阶段重新生成
806
+ > - "取消" → 终止当前工作流
807
+ >
808
+ > **I will NOT proceed until you explicitly confirm.**
809
+
810
+ ---
751
811
 
752
812
  **IF user requests changes:**
753
813
  1. Identify which document(s) need changes
@@ -757,17 +817,37 @@ Verification Results:
757
817
  - Requirement changes → Return to Phase 2 (re-run clarification)
758
818
  3. Re-invoke appropriate skill with updated context
759
819
  4. Return to Phase 5 after re-generation
820
+ 5. **DO NOT update any status**
760
821
 
761
- **IF user confirms:**
822
+ **IF user confirms (explicit "确认" or "OK"):**
762
823
  - Proceed to Phase 5.3
763
824
 
764
825
  ---
765
826
 
766
- ### 5.3 Finalize
827
+ ### Phase 5.3: Finalize
828
+
829
+ > ⚠️ **PREREQUISITE: Phase 5.3 can ONLY execute AFTER user has explicitly confirmed in Phase 5.2.**
830
+ >
831
+ > IF user has NOT confirmed → DO NOT execute any step below.
832
+ > IF you are unsure whether user confirmed → DO NOT execute any step below.
833
+ >
834
+ > **Verification before proceeding:**
835
+ > - Did user explicitly say "确认" or "OK" in Phase 5.2?
836
+ > - If NO → Return to Phase 5.2 and wait for confirmation
837
+ > - If YES → Proceed with the steps below
767
838
 
768
839
  **5.3.1 Update Checkpoints**
769
840
 
841
+ Now update all checkpoints (user has confirmed):
842
+
770
843
  ```bash
844
+ # Update verification_checklist checkpoint
845
+ node speccrew-workspace/scripts/update-progress.js write-checkpoint \
846
+ --file {iteration_path}/01.product-requirement/.checkpoints.json \
847
+ --checkpoint verification_checklist \
848
+ --passed true
849
+
850
+ # Update prd_review checkpoint
771
851
  node speccrew-workspace/scripts/update-progress.js write-checkpoint \
772
852
  --file {iteration_path}/01.product-requirement/.checkpoints.json \
773
853
  --checkpoint prd_review \
@@ -21,6 +21,12 @@ tools: Read, Write, Glob, Grep
21
21
 
22
22
  3. **MANDATORY: Template-first workflow** — Step 4a (copy template) MUST execute before Step 4b (fill sections). Skipping Step 4a and writing content directly is FORBIDDEN.
23
23
 
24
+ 4. **ABORT CONDITIONS** — If any of the following occur, STOP immediately and report to user:
25
+ - Feature Spec document (`feature_spec_path`) does not exist or is empty → STOP
26
+ - API Contract template file does not exist → STOP
27
+ - `node ... update-progress.js` script execution fails → **HARD STOP**: Do NOT manually create or edit JSON progress files. Report the script error and wait for user resolution.
28
+ - User rejects Joint Confirmation → STOP, ask user for specific revision requirements
29
+
24
30
  ## Step 1: Read Input
25
31
 
26
32
  ### Input Parameters
@@ -152,6 +158,8 @@ After confirmation, you can start frontend and backend Designer Agents separatel
152
158
 
153
159
  After user confirms Joint Confirmation:
154
160
 
161
+ > **SCRIPT ENFORCEMENT RULE**: All `.checkpoints.json` and `WORKFLOW-PROGRESS.json` updates MUST be performed via `node speccrew-workspace/scripts/update-progress.js` commands. Manually creating or editing these JSON files is FORBIDDEN. If the script fails, STOP and report the error — do NOT attempt manual JSON construction.
162
+
155
163
  ### 6a: Update Checkpoints File
156
164
 
157
165
  Update the `.checkpoints.json` file to record confirmation status.
@@ -272,6 +280,8 @@ Update `WORKFLOW-PROGRESS.json` to reflect current feature/module status.
272
280
  - Record all output file paths
273
281
  - Log: "✅ Stage 02_feature_design confirmed. Ready for System Design phase."
274
282
 
283
+ > **Note**: On Windows PowerShell, do not use backslash (`\`) for line continuation. Write the entire command on a single line.
284
+
275
285
  **关于全局状态管理的说明**:
276
286
  > Feature 粒度的 API Contract 完成后,全局阶段状态(`02_feature_design.status` 和 `current_stage`)**不由本 Skill 更新**。
277
287
  > 全局状态由 **Feature Designer Agent** 统一管理,当检测到所有 Feature 都完成时,统一更新为 `confirmed` 并推进到下一阶段。