speccrew 0.6.25 → 0.6.27
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.
|
@@ -22,9 +22,9 @@ Phase 0: Stage Gate
|
|
|
22
22
|
Phase 1: Preparation
|
|
23
23
|
└── Identify PRD documents → Check existing specs
|
|
24
24
|
↓
|
|
25
|
-
Phase 2:
|
|
26
|
-
└── Read
|
|
27
|
-
└── Write .checkpoints.json → HARD STOP (user confirms Feature
|
|
25
|
+
Phase 2: Load Feature List
|
|
26
|
+
└── Read .prd-feature-list.json → Verify structure
|
|
27
|
+
└── Write .checkpoints.json → HARD STOP (user confirms Feature List)
|
|
28
28
|
↓
|
|
29
29
|
Phase 3: Feature Design — Two-Stage Pipeline
|
|
30
30
|
└── 3a: Analyze (fd-feature-analyze)
|
|
@@ -51,7 +51,8 @@ Phase 4: API Contract Generation
|
|
|
51
51
|
| Phase | Rule | Description |
|
|
52
52
|
|-------|------|-------------|
|
|
53
53
|
| Phase 0 | STAGE GATE | PRD must be confirmed before starting. If not → STOP |
|
|
54
|
-
| Phase 2 | HARD STOP | Feature
|
|
54
|
+
| Phase 2 | HARD STOP | Feature List must be confirmed by user before Phase 3 |
|
|
55
|
+
| Phase 2 | FILE REQUIRED | `.prd-feature-list.json` must exist. If missing → STOP |
|
|
55
56
|
| Phase 3a | SKILL-ONLY | Analyze workers MUST use speccrew-fd-feature-analyze skill. Agent MUST NOT perform function decomposition itself |
|
|
56
57
|
| Phase 3b | SKILL-ONLY | Design & Generate workers MUST use speccrew-fd-feature-design skill. Agent MUST NOT design features or write Feature Spec documents itself |
|
|
57
58
|
| Phase 3c | HARD STOP (multi) | For 2+ Features: Agent MUST present batch summary and wait for user confirmation after Feature Specs are generated |
|
|
@@ -59,7 +60,7 @@ Phase 4: API Contract Generation
|
|
|
59
60
|
| Phase 4 | HARD STOP | Joint Confirmation must be confirmed by user before finalizing |
|
|
60
61
|
| ALL | ABORT ON FAILURE | If any skill invocation fails → STOP and report. Do NOT attempt to generate content manually as fallback |
|
|
61
62
|
| ALL | SCRIPT ENFORCEMENT | All .checkpoints.json and WORKFLOW-PROGRESS.json updates via update-progress.js script. Manual JSON creation FORBIDDEN |
|
|
62
|
-
| ALL | NAME LOCK | After Phase 2 Feature
|
|
63
|
+
| ALL | NAME LOCK | After Phase 2 Feature List is confirmed, feature_name is immutable. All Skills MUST use the exact parameter value for output filenames. Name translation or substitution is FORBIDDEN |
|
|
63
64
|
|
|
64
65
|
## MANDATORY WORKER ENFORCEMENT
|
|
65
66
|
|
|
@@ -131,7 +132,7 @@ This agent MUST execute tasks continuously without unnecessary interruptions.
|
|
|
131
132
|
1. **Skill Invocation Failure**: Any skill call returns error → STOP. Do NOT generate content manually.
|
|
132
133
|
2. **Script Execution Failure**: `node ... update-progress.js` fails → STOP. Do NOT manually create/edit JSON files.
|
|
133
134
|
3. **Missing Intermediate Artifacts**: `.feature-analysis.md` missing before Phase 3b → STOP.
|
|
134
|
-
4. **User Rejection**: User rejects Feature
|
|
135
|
+
4. **User Rejection**: User rejects Feature List, batch design summary, or Joint Confirmation → STOP, ask for specific revision requirements.
|
|
135
136
|
5. **Worker Batch Failure**: If >50% workers in a batch fail → STOP entire batch, report to user.
|
|
136
137
|
|
|
137
138
|
## TIMESTAMP INTEGRITY
|
|
@@ -261,138 +262,121 @@ Check if feature specification documents already exist in the current iteration:
|
|
|
261
262
|
- If feature specification documents already exist → Ask user whether to overwrite or create a new version
|
|
262
263
|
- If no feature specification documents exist → Proceed directly to design phase
|
|
263
264
|
|
|
264
|
-
## Phase 2:
|
|
265
|
+
## Phase 2: Load Feature List
|
|
265
266
|
|
|
266
|
-
|
|
267
|
+
> 🛑 **ORCHESTRATOR RULES — Phase 2**
|
|
268
|
+
> - ❌ DO NOT read PRD files directly
|
|
269
|
+
> - ❌ DO NOT parse Feature Breakdown tables yourself
|
|
270
|
+
> - ✅ ONLY read `.prd-feature-list.json` generated by PM Agent
|
|
271
|
+
> - ✅ Verify file structure and content completeness
|
|
272
|
+
> - ✅ ONLY present summary and collect user confirmation
|
|
267
273
|
|
|
268
|
-
###
|
|
269
|
-
Read all confirmed PRD documents specified by the user. PRD documents contain:
|
|
270
|
-
- Feature background and goals
|
|
271
|
-
- User stories and scenarios
|
|
272
|
-
- Functional requirements description
|
|
273
|
-
- Business process flows
|
|
274
|
-
- Acceptance criteria
|
|
274
|
+
### Step 1: Confirm PRD Path
|
|
275
275
|
|
|
276
|
-
|
|
276
|
+
Confirm the PRD directory path with user. The PRD directory should contain:
|
|
277
|
+
- Master PRD (`*-master-prd.md`)
|
|
278
|
+
- Sub-PRD files (`*-sub-*.md`)
|
|
279
|
+
- Feature list (`.prd-feature-list.json`)
|
|
277
280
|
|
|
278
|
-
|
|
279
|
-
- Look for platform entries with type starting with `web-` or `mobile-`
|
|
280
|
-
- If multiple frontend platforms exist (e.g., web-vue + mobile-uniapp), frontend design MUST cover each platform separately
|
|
281
|
-
- If only one frontend platform exists, design for that single platform
|
|
282
|
-
- Store discovered platform list for use in Phase 3 worker dispatch
|
|
281
|
+
Default path: `{iteration_path}/01.product-requirement`
|
|
283
282
|
|
|
284
|
-
###
|
|
283
|
+
### Step 2: Read Feature List
|
|
285
284
|
|
|
286
|
-
|
|
285
|
+
Read `.prd-feature-list.json` from the PRD directory:
|
|
287
286
|
|
|
288
|
-
|
|
287
|
+
```bash
|
|
288
|
+
Get-Content "{iteration_path}/01.product-requirement/.prd-feature-list.json" | ConvertFrom-Json
|
|
289
|
+
```
|
|
289
290
|
|
|
290
|
-
|
|
291
|
-
- `Feature ID`: Unique identifier (e.g., `F-CRM-01`, `F-CRM-02`)
|
|
292
|
-
- `Feature Name`: Descriptive name (e.g., `Customer List Management`)
|
|
293
|
-
- `Type`: Either `Page+API` or `API-only`
|
|
294
|
-
- `Module`: Module identifier the feature belongs to (e.g., `M1-System`, `M2-Member`). Derive from the Sub-PRD's module classification.
|
|
295
|
-
- `Source PRD`: The Sub-PRD filename this feature was extracted from (e.g., `crm-system-sub-member.md`)
|
|
296
|
-
- `Dependencies`: List of prerequisite Feature IDs (if any)
|
|
291
|
+
**If file does not exist:**
|
|
297
292
|
|
|
298
|
-
|
|
293
|
+
```
|
|
294
|
+
❌ ERROR: Feature list file not found
|
|
295
|
+
├── Expected path: {iteration_path}/01.product-requirement/.prd-feature-list.json
|
|
296
|
+
└── This file should be generated by PM Agent during Sub-PRD dispatch
|
|
299
297
|
|
|
300
|
-
|
|
298
|
+
🛑 HARD STOP
|
|
299
|
+
Please ensure PRD phase completed successfully before starting Feature Design.
|
|
300
|
+
```
|
|
301
301
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
302
|
+
**Verify file structure:**
|
|
303
|
+
- File exists and is valid JSON
|
|
304
|
+
- Contains `modules` array
|
|
305
|
+
- Each module has:
|
|
306
|
+
- `module_id`: Unique identifier
|
|
307
|
+
- `module_name`: Display name
|
|
308
|
+
- `features`: Array of feature objects
|
|
309
|
+
- Each feature has:
|
|
310
|
+
- `feature_id`: Feature identifier (e.g., `F-CRM-01`)
|
|
311
|
+
- `feature_name`: Feature name
|
|
312
|
+
- `feature_type`: `Page+API` or `API-only`
|
|
313
|
+
- `dependencies`: Array of prerequisite Feature IDs
|
|
306
314
|
|
|
307
|
-
|
|
308
|
-
```json
|
|
309
|
-
{
|
|
310
|
-
"stage": "02_feature_design",
|
|
311
|
-
"checkpoints": {
|
|
312
|
-
"function_decomposition": {
|
|
313
|
-
"passed": false,
|
|
314
|
-
"confirmed_at": null,
|
|
315
|
-
"description": "Feature Registry extraction and confirmation",
|
|
316
|
-
"total_features": 42,
|
|
317
|
-
"total_modules": 13,
|
|
318
|
-
"features": [
|
|
319
|
-
{
|
|
320
|
-
"feature_id": "F-SYS-01",
|
|
321
|
-
"feature_name": "Account Login",
|
|
322
|
-
"type": "Page+API",
|
|
323
|
-
"module": "M1-System",
|
|
324
|
-
"source_prd": "crm-system-sub-system.md",
|
|
325
|
-
"dependencies": [],
|
|
326
|
-
"feature_spec_status": "pending",
|
|
327
|
-
"api_contract_status": "pending"
|
|
328
|
-
},
|
|
329
|
-
{
|
|
330
|
-
"feature_id": "F-MEMBER-01",
|
|
331
|
-
"feature_name": "Customer Info Management",
|
|
332
|
-
"type": "Page+API",
|
|
333
|
-
"module": "M2-Member",
|
|
334
|
-
"source_prd": "crm-system-sub-member.md",
|
|
335
|
-
"dependencies": ["F-SYS-01"],
|
|
336
|
-
"feature_spec_status": "pending",
|
|
337
|
-
"api_contract_status": "pending"
|
|
338
|
-
}
|
|
339
|
-
]
|
|
340
|
-
},
|
|
341
|
-
"feature_spec_review": {
|
|
342
|
-
"passed": false,
|
|
343
|
-
"confirmed_at": null
|
|
344
|
-
},
|
|
345
|
-
"api_contract_joint": {
|
|
346
|
-
"passed": false,
|
|
347
|
-
"confirmed_at": null
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
```
|
|
315
|
+
### Step 3: Extract Feature Statistics
|
|
352
316
|
|
|
353
|
-
|
|
354
|
-
- `pending`: Not started
|
|
355
|
-
- `in_progress`: Worker dispatched
|
|
356
|
-
- `completed`: Worker finished successfully
|
|
357
|
-
- `failed`: Worker failed (needs retry)
|
|
358
|
-
- `confirmed`: User confirmed the output
|
|
317
|
+
From the feature list, extract:
|
|
359
318
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
319
|
+
```
|
|
320
|
+
📊 Feature List Summary
|
|
321
|
+
├── Total Modules: {module_count}
|
|
322
|
+
├── Total Features: {total_feature_count}
|
|
323
|
+
├── Features by Type:
|
|
324
|
+
│ ├── Page+API: {page_api_count}
|
|
325
|
+
│ └── API-only: {api_only_count}
|
|
326
|
+
└── Features by Module:
|
|
327
|
+
├── {module_1}: {count} features
|
|
328
|
+
├── {module_2}: {count} features
|
|
329
|
+
└── ...
|
|
330
|
+
```
|
|
363
331
|
|
|
364
|
-
###
|
|
332
|
+
### Step 4: Write Checkpoint
|
|
365
333
|
|
|
366
|
-
|
|
334
|
+
Write feature statistics to `.checkpoints.json`:
|
|
367
335
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
336
|
+
```bash
|
|
337
|
+
node {update_progress_script} write-checkpoint `
|
|
338
|
+
--file {iterations_dir}/{iteration}/02.feature-design/.checkpoints.json `
|
|
339
|
+
--stage 02_feature_design `
|
|
340
|
+
--checkpoint function_decomposition `
|
|
341
|
+
--data '{"features": [...], "total_features": N, "total_modules": M}'
|
|
342
|
+
```
|
|
372
343
|
|
|
373
|
-
|
|
344
|
+
**Feature status values:**
|
|
345
|
+
- `pending`: Not started
|
|
346
|
+
- `in_progress`: Worker dispatched
|
|
347
|
+
- `completed`: Worker finished successfully
|
|
348
|
+
- `failed`: Worker failed (needs retry)
|
|
349
|
+
- `confirmed`: User confirmed the output
|
|
374
350
|
|
|
375
|
-
|
|
351
|
+
**After each worker completes**, update the corresponding feature's status:
|
|
352
|
+
- Feature Spec worker done → set `feature_spec_status` = `completed`
|
|
353
|
+
- API Contract worker done → set `api_contract_status` = `completed`
|
|
376
354
|
|
|
377
|
-
|
|
378
|
-
|---|-----------|-------------|------|--------|--------------|
|
|
379
|
-
| 1 | F-SYS-01 | Account Login | Page+API | M1-System | - |
|
|
380
|
-
| 2 | F-MEMBER-01 | Customer Info | Page+API | M2-Member | F-SYS-01 |
|
|
381
|
-
| ... | ... | ... | ... | ... | ... |
|
|
355
|
+
### Step 5: HARD STOP — User Confirmation
|
|
382
356
|
|
|
383
|
-
|
|
357
|
+
Present the Feature List to user and wait for confirmation before proceeding:
|
|
384
358
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
359
|
+
Display the full feature table:
|
|
360
|
+
|
|
361
|
+
| # | Feature ID | Feature Name | Type | Module | Dependencies |
|
|
362
|
+
|---|-----------|-------------|------|--------|--------------|
|
|
363
|
+
| 1 | F-SYS-01 | Account Login | Page+API | M1-System | - |
|
|
364
|
+
| 2 | F-MEMBER-01 | Customer Info | Page+API | M2-Member | F-SYS-01 |
|
|
365
|
+
| ... | ... | ... | ... | ... | ... |
|
|
366
|
+
|
|
367
|
+
⚠️ **HARD STOP — WAIT FOR USER CONFIRMATION**
|
|
368
|
+
|
|
369
|
+
```
|
|
370
|
+
DO NOT dispatch Feature Spec workers until user explicitly confirms the Feature List.
|
|
371
|
+
Ask user:
|
|
372
|
+
- Is the feature decomposition granularity appropriate?
|
|
373
|
+
- Are Feature IDs, Types, and dependencies correct?
|
|
374
|
+
- Any features to add, remove, or merge?
|
|
375
|
+
|
|
376
|
+
IF user requests changes → report error: Feature List is read-only (generated by PM Agent)
|
|
377
|
+
ONLY after user confirms → update function_decomposition.passed = true.
|
|
378
|
+
Then proceed to Phase 3.
|
|
379
|
+
```
|
|
396
380
|
|
|
397
381
|
### Read on Demand
|
|
398
382
|
When involving related business domains, read `{workspace_path}/knowledges/bizs/system-overview.md` first, then follow the links within it to navigate to:
|
|
@@ -417,7 +401,7 @@ When involving related business domains, read `{workspace_path}/knowledges/bizs/
|
|
|
417
401
|
> 4. **DO NOT generate Feature Spec documents yourself.** Your role is to DISPATCH workers.
|
|
418
402
|
> 5. **Phase 3a → 3b → 3c is STRICTLY SERIAL.** Each phase must complete before the next begins.
|
|
419
403
|
> 6. **Intermediate artifacts are MANDATORY.** .feature-analysis.md must exist before Phase 3b.
|
|
420
|
-
> 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
|
|
404
|
+
> 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.
|
|
421
405
|
|
|
422
406
|
---
|
|
423
407
|
|
|
@@ -551,41 +535,59 @@ If only **1 Feature** in registry:
|
|
|
551
535
|
|
|
552
536
|
### Phase 3c: Confirm — Batch Spec Review (Multi-Feature Only)
|
|
553
537
|
|
|
538
|
+
> 🛑 **ORCHESTRATOR RULES — Phase 3c**
|
|
539
|
+
> - ❌ DO NOT read feature-spec.md files for summary aggregation
|
|
540
|
+
> - ❌ DO NOT count functions/components/APIs by parsing Spec documents
|
|
541
|
+
> - ✅ ONLY read DISPATCH-PROGRESS.json for summary data
|
|
542
|
+
> - ✅ Summary metadata is written by each Worker via update-progress.js
|
|
543
|
+
|
|
554
544
|
**Condition**: Execute ONLY when 2+ Features exist
|
|
555
545
|
|
|
556
546
|
**Purpose**: Present batch Feature Spec summary and obtain user confirmation before proceeding to API Contract generation.
|
|
557
547
|
|
|
558
|
-
1
|
|
548
|
+
#### Step 1: Read Progress Summary
|
|
559
549
|
|
|
560
|
-
|
|
550
|
+
Read DISPATCH-PROGRESS.json to get completion status and metadata for all features:
|
|
561
551
|
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
| F-CRM-02 | Customer Detail | 4 | 2 | 3 | 1 new |
|
|
566
|
-
| ... | ... | ... | ... | ... | ... |
|
|
552
|
+
```bash
|
|
553
|
+
node {workspace_path}/scripts/update-progress.js read --file {dispatch_progress_path} --overview
|
|
554
|
+
```
|
|
567
555
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
556
|
+
The progress file contains each task's status and metadata (function_count, component_count, api_count, entity_count) updated by Workers upon completion.
|
|
557
|
+
|
|
558
|
+
#### Step 2: Build Summary from Progress Data
|
|
559
|
+
|
|
560
|
+
From the progress data, build the batch summary table:
|
|
561
|
+
|
|
562
|
+
| Feature ID | Feature Name | Functions | Frontend Components | APIs | Data Entities | Status |
|
|
563
|
+
|---|---|---|---|---|---|---|
|
|
564
|
+
|
|
565
|
+
> 🛑 **DO NOT read individual feature-spec.md files to build this summary.**
|
|
566
|
+
> All summary data comes from DISPATCH-PROGRESS.json metadata fields.
|
|
567
|
+
|
|
568
|
+
#### Step 3: Present Summary to User
|
|
569
|
+
|
|
570
|
+
```
|
|
571
|
+
📋 Batch Feature Spec Summary
|
|
572
|
+
|
|
573
|
+
Total Features: {N}
|
|
574
|
+
├── Functions Designed: {total}
|
|
575
|
+
├── Frontend Components: {total}
|
|
576
|
+
├── Backend APIs: {total}
|
|
577
|
+
└── Data Entities: {new} new, {modified} modified
|
|
578
|
+
|
|
579
|
+
[Summary table above]
|
|
580
|
+
|
|
581
|
+
⚠️ HARD STOP — Please review all Feature Specs before proceeding to API Contract generation.
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
#### Step 4: HARD STOP — Wait for User Confirmation
|
|
582
585
|
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
```
|
|
586
|
+
- If user requests modification for specific Feature → Re-dispatch design worker for that Feature only
|
|
587
|
+
- If user confirms → Update `.checkpoints.json`:
|
|
588
|
+
```bash
|
|
589
|
+
node {update_progress_script} write-checkpoint --file {iterations_dir}/{iteration}/02.feature-design/.checkpoints.json --stage 02_feature_design --checkpoint feature_spec_review --passed true
|
|
590
|
+
```
|
|
589
591
|
|
|
590
592
|
---
|
|
591
593
|
|
|
@@ -546,6 +546,62 @@ No knowledge base exists. A lightweight feature inventory scan is triggered to d
|
|
|
546
546
|
> The scope was already determined by the matcher in Step 1.
|
|
547
547
|
> Asking "do you want to continue?" mid-way is FORBIDDEN.
|
|
548
548
|
>
|
|
549
|
+
> **Path B Step 3.5: Generate Graph Data**
|
|
550
|
+
>
|
|
551
|
+
> After ALL feature analysis Workers in Step 3 complete, dispatch Graph Workers for each completed analysis task:
|
|
552
|
+
>
|
|
553
|
+
> **For each completed API analysis task** (analyzer_skill = speccrew-knowledge-bizs-api-analyze):
|
|
554
|
+
> - Dispatch Worker with skill: `speccrew-knowledge-bizs-api-graph`
|
|
555
|
+
> - Input: the generated analysis document from Step 3
|
|
556
|
+
> - Output: `.graph.json` file with nodes (api, service, table, dto) and edges (operates, invokes, references, depends-on, maps-to)
|
|
557
|
+
>
|
|
558
|
+
> **Agent Tool Invocation for API Graph Worker**:
|
|
559
|
+
> ```
|
|
560
|
+
> Use the Agent tool to invoke speccrew-task-worker:
|
|
561
|
+
> - agent: speccrew-task-worker
|
|
562
|
+
> - task: Execute speccrew-knowledge-bizs-api-graph for feature "{task.fileName}"
|
|
563
|
+
> - context:
|
|
564
|
+
> skill: speccrew-knowledge-bizs-api-graph
|
|
565
|
+
> api_analysis_path: {workspace_path}/{task.documentPath}
|
|
566
|
+
> platform_id: {task.platform_id}
|
|
567
|
+
> output_dir: {sync_state_bizs_dir}/completed
|
|
568
|
+
> module: {task.module}
|
|
569
|
+
> fileName: {task.fileName}
|
|
570
|
+
> sourcePath: {task.sourcePath}
|
|
571
|
+
> sourceFile: features-{task.platform_id}.json
|
|
572
|
+
> language: {language}
|
|
573
|
+
> subpath: {task.subpath}
|
|
574
|
+
> ```
|
|
575
|
+
>
|
|
576
|
+
> **For each completed UI analysis task** (analyzer_skill = speccrew-knowledge-bizs-ui-analyze):
|
|
577
|
+
> - Dispatch Worker with skill: `speccrew-knowledge-bizs-ui-graph`
|
|
578
|
+
> - Input: the generated UI analysis document from Step 3
|
|
579
|
+
> - Output: `.graph.json` file with UI component nodes and relationships
|
|
580
|
+
>
|
|
581
|
+
> **Agent Tool Invocation for UI Graph Worker**:
|
|
582
|
+
> ```
|
|
583
|
+
> Use the Agent tool to invoke speccrew-task-worker:
|
|
584
|
+
> - agent: speccrew-task-worker
|
|
585
|
+
> - task: Execute speccrew-knowledge-bizs-ui-graph for feature "{task.fileName}"
|
|
586
|
+
> - context:
|
|
587
|
+
> skill: speccrew-knowledge-bizs-ui-graph
|
|
588
|
+
> fileName: {task.fileName}
|
|
589
|
+
> sourcePath: {source_path}/{task.sourcePath}
|
|
590
|
+
> documentPath: {workspace_path}/{task.documentPath}
|
|
591
|
+
> module: {task.module}
|
|
592
|
+
> platform_type: {task.platform_type}
|
|
593
|
+
> platform_subtype: {task.platform_subtype}
|
|
594
|
+
> completed_dir: {sync_state_bizs_dir}/completed
|
|
595
|
+
> sourceFile: features-{task.platform_id}.json
|
|
596
|
+
> status: success
|
|
597
|
+
> analysisNotes: "Graph data generation from UI analysis"
|
|
598
|
+
> language: {language}
|
|
599
|
+
> ```
|
|
600
|
+
>
|
|
601
|
+
> **Dispatch Strategy**: Same batch parallel strategy as Step 3 (max 5 Workers per batch).
|
|
602
|
+
>
|
|
603
|
+
> ⚠️ Step 3.5 MUST complete before Step 4 (Module Summaries). Graph data enriches module summaries.
|
|
604
|
+
>
|
|
549
605
|
> **Path B Step 4: Generate Module Summaries**
|
|
550
606
|
> For each matched module, dispatch Worker with `speccrew-knowledge-module-summarize` skill:
|
|
551
607
|
> ```
|
|
@@ -1187,10 +1243,13 @@ From the Skill's Step 12c output, collect:
|
|
|
1187
1243
|
- `module_design_file`: Path to `.module-design.md`
|
|
1188
1244
|
- `output_dir`: Directory for Sub-PRD files (same as Master PRD directory)
|
|
1189
1245
|
- Module list with context for each module:
|
|
1246
|
+
- `module_id`: Unique identifier for the module (used for feature list indexing)
|
|
1190
1247
|
- `module_name`, `module_key`, `module_scope`, `module_entities`
|
|
1191
|
-
- `module_user_stories`, `module_requirements
|
|
1248
|
+
- `module_user_stories`, `module_requirements`
|
|
1192
1249
|
- `module_dependencies`
|
|
1193
1250
|
|
|
1251
|
+
> **Note**: The dispatch plan now contains only scheduling fields (module metadata, dependencies). Feature data (`module_features`) is stored separately in `.prd-feature-list.json`, which will be used by FD Agent for Feature Registry initialization.
|
|
1252
|
+
|
|
1194
1253
|
**Store these values as workflow context variables for use in Worker dispatches.**
|
|
1195
1254
|
|
|
1196
1255
|
---
|
|
@@ -1327,6 +1386,7 @@ Use the Agent tool to invoke speccrew-task-worker:
|
|
|
1327
1386
|
- task: Generate Sub-PRD for module "{module_name}"
|
|
1328
1387
|
- context:
|
|
1329
1388
|
skill: speccrew-pm-sub-prd-generate
|
|
1389
|
+
module_id: {module_id}
|
|
1330
1390
|
module_name: {module_name}
|
|
1331
1391
|
module_key: {module_key}
|
|
1332
1392
|
module_scope: {module_scope}
|
|
@@ -1349,13 +1409,14 @@ Use the Agent tool to invoke speccrew-task-worker:
|
|
|
1349
1409
|
| Parameter | Source | Description |
|
|
1350
1410
|
|-----------|--------|-------------|
|
|
1351
1411
|
| `skill` | Fixed | `speccrew-pm-sub-prd-generate` |
|
|
1412
|
+
| `module_id` | Dispatch Plan | Unique identifier for the module (used for feature list indexing) |
|
|
1352
1413
|
| `module_name` | Dispatch Plan | Display name (e.g., "Customer Management") |
|
|
1353
1414
|
| `module_key` | Dispatch Plan | Identifier for file naming (e.g., "customer") |
|
|
1354
1415
|
| `module_scope` | Dispatch Plan | What this module covers |
|
|
1355
1416
|
| `module_entities` | Dispatch Plan | Core business entities |
|
|
1356
1417
|
| `module_user_stories` | Dispatch Plan | Module-specific user stories |
|
|
1357
1418
|
| `module_requirements` | Dispatch Plan | Module-specific functional requirements (P0/P1/P2) |
|
|
1358
|
-
| `module_features` | Dispatch Plan | Feature Breakdown entries for this module |
|
|
1419
|
+
| `module_features` | Dispatch Plan | Feature Breakdown entries for this module (used by Sub-PRD Skill to generate content and write to feature list) |
|
|
1359
1420
|
| `module_dependencies` | Dispatch Plan | Dependencies on other modules |
|
|
1360
1421
|
| `master_prd_path` | Dispatch Plan | Path to the Master PRD |
|
|
1361
1422
|
| `clarification_file` | Step 5.1 | Path to `.clarification-summary.md` |
|
|
@@ -1516,6 +1577,41 @@ node "{update_progress_script}" write-checkpoint `
|
|
|
1516
1577
|
--status passed
|
|
1517
1578
|
```
|
|
1518
1579
|
|
|
1580
|
+
**Step 5.5.5: Verify Feature List Completeness**
|
|
1581
|
+
|
|
1582
|
+
After all Sub-PRDs are generated, verify that `.prd-feature-list.json` contains complete feature data:
|
|
1583
|
+
|
|
1584
|
+
1. **Read feature list file**:
|
|
1585
|
+
```bash
|
|
1586
|
+
Get-Content "{iterations_dir}/{iteration}/01.product-requirement/.prd-feature-list.json" | ConvertFrom-Json
|
|
1587
|
+
```
|
|
1588
|
+
|
|
1589
|
+
2. **Verify structure**:
|
|
1590
|
+
- File exists and is valid JSON
|
|
1591
|
+
- Contains `modules` array
|
|
1592
|
+
- Each module has `module_id` and `features` array
|
|
1593
|
+
|
|
1594
|
+
3. **Verify completeness**:
|
|
1595
|
+
- Module count in feature list should equal `totalModules` from dispatch plan
|
|
1596
|
+
- If any module is missing, display WARNING:
|
|
1597
|
+
```
|
|
1598
|
+
⚠️ WARNING: Feature list incomplete
|
|
1599
|
+
├── Expected modules: {expected_count}
|
|
1600
|
+
├── Found modules: {actual_count}
|
|
1601
|
+
└── Missing modules: {missing_module_ids}
|
|
1602
|
+
|
|
1603
|
+
Feature list will be used by FD Agent for Feature Registry initialization.
|
|
1604
|
+
Missing modules may cause errors in Feature Design phase.
|
|
1605
|
+
```
|
|
1606
|
+
|
|
1607
|
+
4. **If verification passes**:
|
|
1608
|
+
```
|
|
1609
|
+
✅ Feature list verification passed
|
|
1610
|
+
├── Modules: {count}
|
|
1611
|
+
├── Total features: {total_features}
|
|
1612
|
+
└── Ready for Feature Design phase
|
|
1613
|
+
```
|
|
1614
|
+
|
|
1519
1615
|
**Before proceeding to Phase 6, verify:**
|
|
1520
1616
|
- [ ] All workers were dispatched via speccrew-task-worker (one Worker per module)
|
|
1521
1617
|
- [ ] No Sub-PRD was generated by PM Agent directly
|
|
@@ -1761,12 +1857,13 @@ After PRD verification passes and user has confirmed, delete intermediate proces
|
|
|
1761
1857
|
- `{iteration_path}/01.product-requirement/.checkpoints.json` (execution checkpoint tracking)
|
|
1762
1858
|
- `{iteration_path}/01.product-requirement/.prd-generation-report.md` (intermediate generation report)
|
|
1763
1859
|
- `{iteration_path}/01.product-requirement/.prd-completion-report.md` (completion report)
|
|
1764
|
-
- `{iteration_path}/01.product-requirement/.sub-prd-dispatch-plan.json` (
|
|
1860
|
+
- `{iteration_path}/01.product-requirement/.sub-prd-dispatch-plan.json` (dispatch plan — no longer needed after dispatch complete)
|
|
1765
1861
|
|
|
1766
1862
|
**Files to KEEP (referenced by downstream phases):**
|
|
1767
1863
|
- Master PRD and all Sub-PRD documents (`*-prd.md`, `*-sub-*.md`)
|
|
1768
1864
|
- `.clarification-summary.md`
|
|
1769
1865
|
- `.module-design.md`
|
|
1866
|
+
- `.prd-feature-list.json` (Feature list for Feature Design phase — used by FD Agent to load Feature Registry)
|
|
1770
1867
|
- `.clarification-questions-round-*.md` (optional, for reference)
|
|
1771
1868
|
|
|
1772
1869
|
⚠️ **Only execute cleanup AFTER:**
|
|
@@ -510,6 +510,26 @@ node speccrew-workspace/scripts/update-progress.js write-checkpoint \
|
|
|
510
510
|
|
|
511
511
|
Log: "✅ Feature Spec generation completed. Checkpoint feature_spec_review passed."
|
|
512
512
|
|
|
513
|
+
## Step 9: Update Progress with Metadata
|
|
514
|
+
|
|
515
|
+
After generating the Feature Spec document, update the task in DISPATCH-PROGRESS.json with summary metadata:
|
|
516
|
+
|
|
517
|
+
```bash
|
|
518
|
+
node {workspace_path}/scripts/update-progress.js update-task \
|
|
519
|
+
--file {dispatch_progress_path} \
|
|
520
|
+
--task-id {feature_task_id} \
|
|
521
|
+
--status completed \
|
|
522
|
+
--metadata '{"function_count": X, "component_count": Y, "api_count": Z, "entity_count": W}'
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
Where:
|
|
526
|
+
- `function_count`: Number of functions defined in the Feature Spec
|
|
527
|
+
- `component_count`: Number of frontend components identified
|
|
528
|
+
- `api_count`: Number of API endpoints defined
|
|
529
|
+
- `entity_count`: Number of data entities defined
|
|
530
|
+
|
|
531
|
+
⚠️ This step is MANDATORY — the FD Agent relies on this metadata for batch summary in Phase 3c.
|
|
532
|
+
|
|
513
533
|
---
|
|
514
534
|
|
|
515
535
|
# Key Rules
|
|
@@ -555,6 +575,7 @@ Log: "✅ Feature Spec generation completed. Checkpoint feature_spec_review pass
|
|
|
555
575
|
- [ ] **[CRITICAL]** Processing Logic uses Mermaid flowchart TD (NOT ASCII)
|
|
556
576
|
- [ ] All Mermaid diagrams follow mermaid-rule.md compliance rules
|
|
557
577
|
- [ ] `.checkpoints.json` updated via script
|
|
578
|
+
- [ ] **CRITICAL**: DISPATCH-PROGRESS.json updated with metadata (function_count, component_count, api_count, entity_count)
|
|
558
579
|
- [ ] No technology decisions included
|
|
559
580
|
- [ ] No intermediate design-data artifact created
|
|
560
581
|
- [ ] **CRITICAL — Business Content Only**: Verify ALL sections use business-level descriptions. Zero tolerance for: file paths, code snippets, SQL, framework names, component names, technical types
|
|
@@ -30,6 +30,7 @@ tools: Read, Write, Glob, Grep
|
|
|
30
30
|
|
|
31
31
|
| Parameter | Required | Description |
|
|
32
32
|
|-----------|----------|-------------|
|
|
33
|
+
| module_id | Yes | Module ID for feature registry (e.g., "M1", "M2") |
|
|
33
34
|
| module_name | Yes | Human-readable module name (e.g., "Customer Management") |
|
|
34
35
|
| module_key | Yes | Module identifier for file naming (e.g., "customer") |
|
|
35
36
|
| module_scope | Yes | What this module covers |
|
|
@@ -188,3 +189,90 @@ IF verification fails:
|
|
|
188
189
|
→ Output: "❌ Sub-PRD verification failed: {reason}"
|
|
189
190
|
→ Attempt to fix the specific issue
|
|
190
191
|
```
|
|
192
|
+
|
|
193
|
+
## Step 5: Write Module Features to Feature List
|
|
194
|
+
|
|
195
|
+
> **Purpose:** Separate feature data from dispatch plan into dedicated `.prd-feature-list.json` file.
|
|
196
|
+
> Each Sub-PRD Worker writes its module's features upon completion.
|
|
197
|
+
|
|
198
|
+
### 5.1 Determine Feature List File Path
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
feature_list_path = dirname(output_path) + '/.prd-feature-list.json'
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
This is the same directory containing `.sub-prd-dispatch-plan.json`.
|
|
205
|
+
|
|
206
|
+
### 5.2 Read or Initialize Feature List File
|
|
207
|
+
|
|
208
|
+
```javascript
|
|
209
|
+
IF file exists at feature_list_path:
|
|
210
|
+
feature_list = read_json(feature_list_path)
|
|
211
|
+
ELSE:
|
|
212
|
+
feature_list = {
|
|
213
|
+
"created_at": "{timestamp from update-progress.js}",
|
|
214
|
+
"updated_at": "{timestamp from update-progress.js}",
|
|
215
|
+
"modules": []
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
> ⚠️ **Timestamp constraint:** Use `node scripts/update-progress.js write-checkpoint` or similar script to get accurate timestamps. DO NOT fabricate timestamps.
|
|
220
|
+
|
|
221
|
+
### 5.3 Build Current Module Feature Entry
|
|
222
|
+
|
|
223
|
+
Construct the module entry from input parameters:
|
|
224
|
+
|
|
225
|
+
```json
|
|
226
|
+
{
|
|
227
|
+
"module_id": "{module_id}",
|
|
228
|
+
"module_name": "{module_name}",
|
|
229
|
+
"module_key": "{module_key}",
|
|
230
|
+
"source_prd": "{feature_name}-sub-{module_key}.md",
|
|
231
|
+
"feature_count": {module_features.length},
|
|
232
|
+
"features": [
|
|
233
|
+
// Map each item in module_features to:
|
|
234
|
+
{
|
|
235
|
+
"feature_id": "{item.feature_id}",
|
|
236
|
+
"feature_name": "{item.feature_name}",
|
|
237
|
+
"type": "{item.type}",
|
|
238
|
+
"priority": "{item.priority}",
|
|
239
|
+
"sub_features": "{item.sub_features}",
|
|
240
|
+
"description": "{item.description}"
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### 5.4 Merge into Feature List
|
|
247
|
+
|
|
248
|
+
```javascript
|
|
249
|
+
existing_index = find_index(feature_list.modules, m => m.module_key === module_key)
|
|
250
|
+
|
|
251
|
+
IF existing_index >= 0:
|
|
252
|
+
// Retry scenario: replace existing entry
|
|
253
|
+
feature_list.modules[existing_index] = module_entry
|
|
254
|
+
ELSE:
|
|
255
|
+
// New module: append
|
|
256
|
+
feature_list.modules.push(module_entry)
|
|
257
|
+
|
|
258
|
+
// Update timestamp
|
|
259
|
+
feature_list.updated_at = "{current timestamp}"
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### 5.5 Write Feature List File
|
|
263
|
+
|
|
264
|
+
Write the updated `feature_list` to `{feature_list_path}` using `create_file`.
|
|
265
|
+
|
|
266
|
+
### 5.6 Report Result
|
|
267
|
+
|
|
268
|
+
```
|
|
269
|
+
IF write succeeds:
|
|
270
|
+
→ Output: "✅ Feature list updated: {feature_count} features for module {module_id}"
|
|
271
|
+
IF write fails:
|
|
272
|
+
→ Output: "⚠️ Feature list write failed: {error}"
|
|
273
|
+
→ Continue without blocking Sub-PRD completion
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
> **Note:** Step 5 is a pure incremental operation. Failure here should NOT affect the Sub-PRD file generation result. The primary deliverable is the Sub-PRD document itself.
|