speccrew 0.6.25 → 0.6.26
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.
|
@@ -261,93 +261,63 @@ Check if feature specification documents already exist in the current iteration:
|
|
|
261
261
|
- If feature specification documents already exist → Ask user whether to overwrite or create a new version
|
|
262
262
|
- If no feature specification documents exist → Proceed directly to design phase
|
|
263
263
|
|
|
264
|
-
## Phase 2:
|
|
264
|
+
## Phase 2: Feature Registry Initialization
|
|
265
265
|
|
|
266
|
-
|
|
266
|
+
> 🛑 **ORCHESTRATOR RULES — Phase 2**
|
|
267
|
+
> - ❌ DO NOT read PRD files directly — dispatch Worker
|
|
268
|
+
> - ❌ DO NOT parse Feature Breakdown tables yourself
|
|
269
|
+
> - ❌ DO NOT read techs-manifest.json directly
|
|
270
|
+
> - ❌ DO NOT build Feature Registry manually
|
|
271
|
+
> - ✅ ONLY dispatch Worker with `speccrew-fd-feature-registry-init` skill
|
|
272
|
+
> - ✅ ONLY read `.feature-registry.json` after Worker completes
|
|
273
|
+
> - ✅ ONLY present summary and collect user confirmation
|
|
267
274
|
|
|
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
|
|
275
|
+
### Step 1: Confirm PRD Path
|
|
275
276
|
|
|
276
|
-
|
|
277
|
+
Confirm the PRD directory path with user. The PRD directory should contain:
|
|
278
|
+
- Master PRD (`*-master-prd.md`)
|
|
279
|
+
- Sub-PRD files (`*-sub-*.md`)
|
|
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: Dispatch Feature Registry Worker
|
|
285
284
|
|
|
286
|
-
|
|
285
|
+
Dispatch a Worker to execute `speccrew-fd-feature-registry-init` skill:
|
|
287
286
|
|
|
288
|
-
|
|
287
|
+
```
|
|
288
|
+
Worker dispatch parameters:
|
|
289
|
+
- skill: speccrew-fd-feature-registry-init
|
|
290
|
+
- prd_dir: {iteration_path}/01.product-requirement
|
|
291
|
+
- workspace_path: {workspace_path}
|
|
292
|
+
- language: {language}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Worker will:
|
|
296
|
+
- Read all PRD files and techs-manifest.json
|
|
297
|
+
- Extract Feature Breakdown from each Sub-PRD Section 3.4
|
|
298
|
+
- Generate `.feature-registry.json`
|
|
299
|
+
- Return summary statistics
|
|
289
300
|
|
|
290
|
-
|
|
301
|
+
### Step 3: Verify Feature Registry
|
|
302
|
+
|
|
303
|
+
After Worker completes:
|
|
304
|
+
1. Read `{prd_dir}/.feature-registry.json` — verify it exists and contains valid data
|
|
305
|
+
2. Extract the following for each Feature:
|
|
291
306
|
- `Feature ID`: Unique identifier (e.g., `F-CRM-01`, `F-CRM-02`)
|
|
292
307
|
- `Feature Name`: Descriptive name (e.g., `Customer List Management`)
|
|
293
308
|
- `Type`: Either `Page+API` or `API-only`
|
|
294
|
-
- `Module`: Module identifier the feature belongs to
|
|
295
|
-
- `Source PRD`: The Sub-PRD filename this feature was extracted from
|
|
309
|
+
- `Module`: Module identifier the feature belongs to
|
|
310
|
+
- `Source PRD`: The Sub-PRD filename this feature was extracted from
|
|
296
311
|
- `Dependencies`: List of prerequisite Feature IDs (if any)
|
|
297
312
|
|
|
298
|
-
3. **
|
|
299
|
-
|
|
300
|
-
4. **Write Feature Registry to `.checkpoints.json`**:
|
|
313
|
+
3. **Write Feature Registry to `.checkpoints.json`**:
|
|
301
314
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
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
|
-
}
|
|
315
|
+
```bash
|
|
316
|
+
node {update_progress_script} write-checkpoint \
|
|
317
|
+
--file {iterations_dir}/{iteration}/02.feature-design/.checkpoints.json \
|
|
318
|
+
--stage 02_feature_design \
|
|
319
|
+
--checkpoint function_decomposition \
|
|
320
|
+
--data '{"features": [...], "total_features": N, "total_modules": M}'
|
|
351
321
|
```
|
|
352
322
|
|
|
353
323
|
**Feature status values:**
|
|
@@ -361,38 +331,31 @@ After reading PRD documents, extract Feature Breakdown from each Sub-PRD:
|
|
|
361
331
|
- Feature Spec worker done → set `feature_spec_status` = `completed`
|
|
362
332
|
- API Contract worker done → set `api_contract_status` = `completed`
|
|
363
333
|
|
|
364
|
-
###
|
|
365
|
-
|
|
366
|
-
Before presenting the Feature Registry to user:
|
|
367
|
-
|
|
368
|
-
1. **Extract exact names** from PRD Section 3.4 table — use the name column value verbatim
|
|
369
|
-
2. **Store as-is** in `.checkpoints.json` `feature_name` field — no translation, no slug conversion
|
|
370
|
-
3. **Validate uniqueness**: Ensure no two Features share the same `feature_name`
|
|
371
|
-
4. **Language rule**: `feature_name` MUST preserve the PRD's original language (Chinese names stay Chinese)
|
|
334
|
+
### Step 4: HARD STOP — User Confirmation
|
|
372
335
|
|
|
373
|
-
|
|
336
|
+
Present the Feature Registry to user and wait for confirmation before proceeding:
|
|
374
337
|
|
|
375
|
-
|
|
338
|
+
Display the full feature table:
|
|
376
339
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
340
|
+
| # | Feature ID | Feature Name | Type | Module | Dependencies |
|
|
341
|
+
|---|-----------|-------------|------|--------|--------------|
|
|
342
|
+
| 1 | F-SYS-01 | Account Login | Page+API | M1-System | - |
|
|
343
|
+
| 2 | F-MEMBER-01 | Customer Info | Page+API | M2-Member | F-SYS-01 |
|
|
344
|
+
| ... | ... | ... | ... | ... | ... |
|
|
382
345
|
|
|
383
|
-
|
|
346
|
+
⚠️ **HARD STOP — WAIT FOR USER CONFIRMATION**
|
|
384
347
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
348
|
+
```
|
|
349
|
+
DO NOT dispatch Feature Spec workers until user explicitly confirms the Feature Registry.
|
|
350
|
+
Ask user:
|
|
351
|
+
- Is the feature decomposition granularity appropriate?
|
|
352
|
+
- Are Feature IDs, Types, and dependencies correct?
|
|
353
|
+
- Any features to add, remove, or merge?
|
|
354
|
+
|
|
355
|
+
IF user requests changes → update .checkpoints.json, then re-present.
|
|
356
|
+
ONLY after user confirms → update function_decomposition.passed = true.
|
|
357
|
+
Then proceed to Phase 3.
|
|
358
|
+
```
|
|
396
359
|
|
|
397
360
|
### Read on Demand
|
|
398
361
|
When involving related business domains, read `{workspace_path}/knowledges/bizs/system-overview.md` first, then follow the links within it to navigate to:
|
|
@@ -551,41 +514,59 @@ If only **1 Feature** in registry:
|
|
|
551
514
|
|
|
552
515
|
### Phase 3c: Confirm — Batch Spec Review (Multi-Feature Only)
|
|
553
516
|
|
|
517
|
+
> 🛑 **ORCHESTRATOR RULES — Phase 3c**
|
|
518
|
+
> - ❌ DO NOT read feature-spec.md files for summary aggregation
|
|
519
|
+
> - ❌ DO NOT count functions/components/APIs by parsing Spec documents
|
|
520
|
+
> - ✅ ONLY read DISPATCH-PROGRESS.json for summary data
|
|
521
|
+
> - ✅ Summary metadata is written by each Worker via update-progress.js
|
|
522
|
+
|
|
554
523
|
**Condition**: Execute ONLY when 2+ Features exist
|
|
555
524
|
|
|
556
525
|
**Purpose**: Present batch Feature Spec summary and obtain user confirmation before proceeding to API Contract generation.
|
|
557
526
|
|
|
558
|
-
1
|
|
527
|
+
#### Step 1: Read Progress Summary
|
|
559
528
|
|
|
560
|
-
|
|
529
|
+
Read DISPATCH-PROGRESS.json to get completion status and metadata for all features:
|
|
561
530
|
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
| F-CRM-02 | Customer Detail | 4 | 2 | 3 | 1 new |
|
|
566
|
-
| ... | ... | ... | ... | ... | ... |
|
|
531
|
+
```bash
|
|
532
|
+
node {workspace_path}/scripts/update-progress.js read --file {dispatch_progress_path} --overview
|
|
533
|
+
```
|
|
567
534
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
535
|
+
The progress file contains each task's status and metadata (function_count, component_count, api_count, entity_count) updated by Workers upon completion.
|
|
536
|
+
|
|
537
|
+
#### Step 2: Build Summary from Progress Data
|
|
538
|
+
|
|
539
|
+
From the progress data, build the batch summary table:
|
|
540
|
+
|
|
541
|
+
| Feature ID | Feature Name | Functions | Frontend Components | APIs | Data Entities | Status |
|
|
542
|
+
|---|---|---|---|---|---|---|
|
|
543
|
+
|
|
544
|
+
> 🛑 **DO NOT read individual feature-spec.md files to build this summary.**
|
|
545
|
+
> All summary data comes from DISPATCH-PROGRESS.json metadata fields.
|
|
546
|
+
|
|
547
|
+
#### Step 3: Present Summary to User
|
|
548
|
+
|
|
549
|
+
```
|
|
550
|
+
📋 Batch Feature Spec Summary
|
|
551
|
+
|
|
552
|
+
Total Features: {N}
|
|
553
|
+
├── Functions Designed: {total}
|
|
554
|
+
├── Frontend Components: {total}
|
|
555
|
+
├── Backend APIs: {total}
|
|
556
|
+
└── Data Entities: {new} new, {modified} modified
|
|
557
|
+
|
|
558
|
+
[Summary table above]
|
|
559
|
+
|
|
560
|
+
⚠️ HARD STOP — Please review all Feature Specs before proceeding to API Contract generation.
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
#### Step 4: HARD STOP — Wait for User Confirmation
|
|
582
564
|
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
```
|
|
565
|
+
- If user requests modification for specific Feature → Re-dispatch design worker for that Feature only
|
|
566
|
+
- If user confirms → Update `.checkpoints.json`:
|
|
567
|
+
```bash
|
|
568
|
+
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
|
|
569
|
+
```
|
|
589
570
|
|
|
590
571
|
---
|
|
591
572
|
|
|
@@ -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
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: speccrew-fd-feature-registry-init
|
|
3
|
+
description: Extract Feature Breakdown from Master PRD and Sub-PRD files to generate Feature Registry. Scans PRD directory, parses Feature Breakdown tables from all Sub-PRDs, and outputs .feature-registry.json with module-grouped features and summary statistics.
|
|
4
|
+
tools: Read, Write, Glob
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Feature Registry Initialization
|
|
8
|
+
|
|
9
|
+
Extract Feature Breakdown from Master PRD and Sub-PRD files to generate a centralized Feature Registry. This Skill discovers all PRD files, parses Feature Breakdown tables, and produces a structured registry with summary statistics.
|
|
10
|
+
|
|
11
|
+
## Trigger Scenarios
|
|
12
|
+
|
|
13
|
+
- "Initialize feature registry from PRDs"
|
|
14
|
+
- "Extract features from all Sub-PRDs"
|
|
15
|
+
- "Build feature registry for the project"
|
|
16
|
+
- "Generate feature breakdown summary"
|
|
17
|
+
|
|
18
|
+
## Input Parameters
|
|
19
|
+
|
|
20
|
+
| Parameter | Type | Description | Required |
|
|
21
|
+
|-----------|------|-------------|----------|
|
|
22
|
+
| `prd_dir` | string | Path to PRD documents directory (contains Master PRD and all Sub-PRDs) | **Yes** |
|
|
23
|
+
| `workspace_path` | string | Workspace root path for reading techs-manifest.json | **Yes** |
|
|
24
|
+
| `language` | string | Target language for output content | **Yes** |
|
|
25
|
+
|
|
26
|
+
## Output
|
|
27
|
+
|
|
28
|
+
- **JSON File**: `{prd_dir}/.feature-registry.json` - Structured feature registry
|
|
29
|
+
- **Summary**: Markdown table with module statistics and feature distribution
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Workflow
|
|
34
|
+
|
|
35
|
+
### Step 0: Read Template / Validate Inputs
|
|
36
|
+
|
|
37
|
+
1. **Validate prd_dir exists**
|
|
38
|
+
- Check if `{prd_dir}` directory exists
|
|
39
|
+
- If not found, report error and stop
|
|
40
|
+
|
|
41
|
+
2. **Validate Sub-PRD files exist**
|
|
42
|
+
- Scan for files matching `*-sub-*.md` pattern in `{prd_dir}`
|
|
43
|
+
- If no Sub-PRD files found, report error and stop
|
|
44
|
+
|
|
45
|
+
3. **Output**: "Step 0 Status: ✅ COMPLETED - Found {sub_prd_count} Sub-PRD files"
|
|
46
|
+
|
|
47
|
+
### Step 1: Discover PRD Files
|
|
48
|
+
|
|
49
|
+
1. **Scan PRD Directory**
|
|
50
|
+
- Find **Master PRD**: files matching `*-master-prd.md`
|
|
51
|
+
- Find **Sub-PRDs**: files matching `*-sub-*.md`
|
|
52
|
+
- Record file paths and names
|
|
53
|
+
|
|
54
|
+
2. **Discover Frontend Platforms**
|
|
55
|
+
- Read `{workspace_path}/knowledges/techs/techs-manifest.json`
|
|
56
|
+
- Extract platform list from the manifest
|
|
57
|
+
- Platforms typically include: `web-vue`, `mobile-uniapp`, etc.
|
|
58
|
+
|
|
59
|
+
3. **Output**:
|
|
60
|
+
- "Step 1 Status: ✅ COMPLETED - Found 1 Master PRD, {count} Sub-PRDs"
|
|
61
|
+
- "Frontend Platforms: {platform_list}"
|
|
62
|
+
|
|
63
|
+
### Step 2: Extract Feature Breakdown from Each Sub-PRD
|
|
64
|
+
|
|
65
|
+
For each Sub-PRD file:
|
|
66
|
+
|
|
67
|
+
1. **Read Sub-PRD Content**
|
|
68
|
+
- Parse the markdown file
|
|
69
|
+
|
|
70
|
+
2. **Locate Section 3.4 "Feature Breakdown"**
|
|
71
|
+
- Find the section header (may be in different languages based on `language`)
|
|
72
|
+
- Common patterns: "3.4 Feature Breakdown", "3.4 功能分解", etc.
|
|
73
|
+
|
|
74
|
+
3. **Parse Feature Table**
|
|
75
|
+
- Extract table rows containing feature information
|
|
76
|
+
- For each feature, extract:
|
|
77
|
+
|
|
78
|
+
| Field | Description | Example |
|
|
79
|
+
|-------|-------------|---------|
|
|
80
|
+
| `feature_id` | Feature identifier | F-SYS-01, F-CRM-05 |
|
|
81
|
+
| `feature_name` | Human-readable feature name | User Management, Order List |
|
|
82
|
+
| `type` | Feature type | User Interaction / Backend Process |
|
|
83
|
+
| `priority` | Priority level | P0 / P1 / P2 |
|
|
84
|
+
| `sub_features` | List of sub-feature IDs | ["M1-F01-01", "M1-F01-02"] |
|
|
85
|
+
| `description` | Brief description | Manage system users and permissions |
|
|
86
|
+
| `source_prd` | Source file name | litemes-sub-system-management.md |
|
|
87
|
+
| `module_key` | Module identifier | system-management |
|
|
88
|
+
|
|
89
|
+
4. **Extract Module Information**
|
|
90
|
+
- Derive `module_id` from PRD (e.g., M1, M2)
|
|
91
|
+
- Derive `module_name` from PRD header or content
|
|
92
|
+
- Map to `module_key` (kebab-case identifier)
|
|
93
|
+
|
|
94
|
+
5. **Output**: "Step 2 Status: ✅ COMPLETED - Extracted {feature_count} features from {prd_name}"
|
|
95
|
+
|
|
96
|
+
### Step 3: Build Feature Registry
|
|
97
|
+
|
|
98
|
+
1. **Merge All Features**
|
|
99
|
+
- Combine features from all Sub-PRDs into a single collection
|
|
100
|
+
- Group features by module
|
|
101
|
+
|
|
102
|
+
2. **Calculate Summary Statistics**
|
|
103
|
+
|
|
104
|
+
| Statistic | Calculation |
|
|
105
|
+
|-----------|-------------|
|
|
106
|
+
| `total_modules` | Count of unique modules |
|
|
107
|
+
| `total_features` | Total count of all features |
|
|
108
|
+
| `by_priority` | Count by priority (P0, P1, P2) |
|
|
109
|
+
| `by_type` | Count by type (User Interaction, Backend Process) |
|
|
110
|
+
| `frontend_platforms` | List from techs-manifest.json |
|
|
111
|
+
|
|
112
|
+
3. **Organize Registry Structure**
|
|
113
|
+
- Group features under their respective modules
|
|
114
|
+
- Sort modules by module_id (M1, M2, M3...)
|
|
115
|
+
- Sort features by feature_id within each module
|
|
116
|
+
|
|
117
|
+
4. **Output**: "Step 3 Status: ✅ COMPLETED - Registry contains {total_features} features across {total_modules} modules"
|
|
118
|
+
|
|
119
|
+
### Step 4: Write Output Files
|
|
120
|
+
|
|
121
|
+
1. **Write `.feature-registry.json`**
|
|
122
|
+
|
|
123
|
+
Output path: `{prd_dir}/.feature-registry.json`
|
|
124
|
+
|
|
125
|
+
Structure:
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"created_at": "2026-01-15T10:30:00Z",
|
|
129
|
+
"summary": {
|
|
130
|
+
"total_modules": 8,
|
|
131
|
+
"total_features": 42,
|
|
132
|
+
"by_priority": {
|
|
133
|
+
"P0": 35,
|
|
134
|
+
"P1": 5,
|
|
135
|
+
"P2": 2
|
|
136
|
+
},
|
|
137
|
+
"by_type": {
|
|
138
|
+
"User Interaction": 30,
|
|
139
|
+
"Backend Process": 12
|
|
140
|
+
},
|
|
141
|
+
"frontend_platforms": ["web-vue", "mobile-uniapp"]
|
|
142
|
+
},
|
|
143
|
+
"modules": [
|
|
144
|
+
{
|
|
145
|
+
"module_id": "M1",
|
|
146
|
+
"module_name": "System Management",
|
|
147
|
+
"module_key": "system-management",
|
|
148
|
+
"source_prd": "litemes-sub-system-management.md",
|
|
149
|
+
"features": [
|
|
150
|
+
{
|
|
151
|
+
"feature_id": "F-SYS-01",
|
|
152
|
+
"feature_name": "User Management",
|
|
153
|
+
"type": "User Interaction",
|
|
154
|
+
"priority": "P0",
|
|
155
|
+
"sub_features": ["M1-F01-01", "M1-F01-02"],
|
|
156
|
+
"description": "Manage system users and permissions"
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
2. **Output**: "Step 4 Status: ✅ COMPLETED - Written .feature-registry.json"
|
|
165
|
+
|
|
166
|
+
### Step 5: Output Summary
|
|
167
|
+
|
|
168
|
+
Generate and output a Markdown summary table for Agent display:
|
|
169
|
+
|
|
170
|
+
```markdown
|
|
171
|
+
## Feature Registry Summary
|
|
172
|
+
|
|
173
|
+
| Module | Features | P0 | P1 | P2 | Types |
|
|
174
|
+
|--------|----------|----|----|----|-------|
|
|
175
|
+
| M1 System Management | 4 | 4 | 0 | 0 | UI: 4, Backend: 0 |
|
|
176
|
+
| M2 User Center | 6 | 5 | 1 | 0 | UI: 5, Backend: 1 |
|
|
177
|
+
| ... | ... | ... | ... | ... | ... |
|
|
178
|
+
| **Total** | **42** | **35** | **5** | **2** | **UI: 30, Backend: 12** |
|
|
179
|
+
|
|
180
|
+
**Frontend Platforms:** web-vue, mobile-uniapp
|
|
181
|
+
|
|
182
|
+
**Registry File:** `{prd_dir}/.feature-registry.json`
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**Output**: "Step 5 Status: ✅ COMPLETED - Summary generated"
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Task Completion Report
|
|
190
|
+
|
|
191
|
+
When the task is complete, report:
|
|
192
|
+
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"status": "success",
|
|
196
|
+
"skill": "speccrew-fd-feature-registry-init",
|
|
197
|
+
"result": {
|
|
198
|
+
"registry_file": "{prd_dir}/.feature-registry.json",
|
|
199
|
+
"total_modules": 8,
|
|
200
|
+
"total_features": 42,
|
|
201
|
+
"by_priority": {
|
|
202
|
+
"P0": 35,
|
|
203
|
+
"P1": 5,
|
|
204
|
+
"P2": 2
|
|
205
|
+
},
|
|
206
|
+
"by_type": {
|
|
207
|
+
"User Interaction": 30,
|
|
208
|
+
"Backend Process": 12
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"message": "Feature registry initialized successfully"
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Constraints
|
|
218
|
+
|
|
219
|
+
1. **READ-ONLY on PRDs**: Do not modify any PRD files
|
|
220
|
+
2. **JSON Output**: Registry must be valid JSON
|
|
221
|
+
3. **Feature ID Uniqueness**: Each feature_id should be unique across all modules
|
|
222
|
+
4. **Module Grouping**: Features must be grouped by their source module
|
|
223
|
+
5. **Priority Validation**: Only accept P0, P1, P2 as valid priority values
|
|
224
|
+
6. **Type Validation**: Only accept "User Interaction" or "Backend Process" as valid types
|
|
225
|
+
|
|
226
|
+
## Error Handling
|
|
227
|
+
|
|
228
|
+
| Scenario | Action |
|
|
229
|
+
|----------|--------|
|
|
230
|
+
| prd_dir not found | Report error, stop execution |
|
|
231
|
+
| No Sub-PRD files found | Report error, stop execution |
|
|
232
|
+
| Master PRD not found | Log warning, continue with Sub-PRDs only |
|
|
233
|
+
| techs-manifest.json not found | Use empty platform list, log warning |
|
|
234
|
+
| Feature table not found in Sub-PRD | Skip that PRD, log warning |
|
|
235
|
+
| Invalid feature data | Skip invalid row, log warning |
|
|
236
|
+
| Duplicate feature_id | Keep first occurrence, log warning |
|
|
237
|
+
|
|
238
|
+
## Checklist
|
|
239
|
+
|
|
240
|
+
- [ ] Step 0: Validated prd_dir exists
|
|
241
|
+
- [ ] Step 0: Found at least one Sub-PRD file
|
|
242
|
+
- [ ] Step 1: Discovered Master PRD and all Sub-PRDs
|
|
243
|
+
- [ ] Step 1: Read techs-manifest.json for frontend platforms
|
|
244
|
+
- [ ] Step 2: All Sub-PRD files scanned
|
|
245
|
+
- [ ] Step 2: Feature Breakdown tables parsed from each Sub-PRD
|
|
246
|
+
- [ ] Step 3: Features merged and grouped by module
|
|
247
|
+
- [ ] Step 3: Summary statistics calculated (total, by_priority, by_type)
|
|
248
|
+
- [ ] Step 4: `.feature-registry.json` written to correct path
|
|
249
|
+
- [ ] Step 5: Summary table generated and output
|