speccrew 0.5.1 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -26,22 +26,18 @@ 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: Feature Design —
|
|
29
|
+
Phase 3: Feature Design — Two-Stage Pipeline
|
|
30
30
|
└── 3a: Analyze (fd-feature-analyze)
|
|
31
31
|
│ └── 1 Feature? → Direct skill invocation
|
|
32
32
|
│ └── 2+ Features? → Batch dispatch workers (6/batch)
|
|
33
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:
|
|
34
|
+
└── 3b: Design & Generate (fd-feature-design)
|
|
35
|
+
│ └── 1 Feature? → Direct skill invocation (with Checkpoint B)
|
|
36
|
+
│ └── 2+ Features? → Batch dispatch workers (6/batch, skip_checkpoint=true)
|
|
37
|
+
│ └── Output: {feature-id}-{feature-name}-feature-spec.md per Feature
|
|
38
38
|
└── 3c: Confirm (HARD STOP for multi-Feature)
|
|
39
|
-
|
|
40
|
-
|
|
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
|
|
39
|
+
└── 1 Feature? → Checkpoint B handled inside design skill
|
|
40
|
+
└── 2+ Features? → Agent presents batch summary → HARD STOP
|
|
45
41
|
↓
|
|
46
42
|
Phase 4: API Contract Generation
|
|
47
43
|
└── Dispatch API Contract workers (same batch pattern)
|
|
@@ -57,9 +53,8 @@ Phase 4: API Contract Generation
|
|
|
57
53
|
| Phase 0 | STAGE GATE | PRD must be confirmed before starting. If not → STOP |
|
|
58
54
|
| Phase 2 | HARD STOP | Feature Registry must be confirmed by user before Phase 3 |
|
|
59
55
|
| 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
|
|
62
|
-
| Phase 3d | SKILL-ONLY | Generate workers MUST use speccrew-fd-feature-generate skill. Agent MUST NOT write Feature Spec documents itself |
|
|
56
|
+
| 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
|
+
| Phase 3c | HARD STOP (multi) | For 2+ Features: Agent MUST present batch summary and wait for user confirmation after Feature Specs are generated |
|
|
63
58
|
| Phase 4 | SKILL-ONLY | API Contract workers MUST use speccrew-fd-api-contract skill |
|
|
64
59
|
| Phase 4 | HARD STOP | Joint Confirmation must be confirmed by user before finalizing |
|
|
65
60
|
| ALL | ABORT ON FAILURE | If any skill invocation fails → STOP and report. Do NOT attempt to generate content manually as fallback |
|
|
@@ -71,7 +66,7 @@ Phase 4: API Contract Generation
|
|
|
71
66
|
|
|
72
67
|
1. **Skill Invocation Failure**: Any skill call returns error → STOP. Do NOT generate content manually.
|
|
73
68
|
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
|
|
69
|
+
3. **Missing Intermediate Artifacts**: `.feature-analysis.md` missing before Phase 3b → STOP.
|
|
75
70
|
4. **User Rejection**: User rejects Feature Registry, batch design summary, or Joint Confirmation → STOP, ask for specific revision requirements.
|
|
76
71
|
5. **Worker Batch Failure**: If >50% workers in a batch fail → STOP entire batch, report to user.
|
|
77
72
|
|
|
@@ -324,15 +319,15 @@ When involving related business domains, read `speccrew-workspace/knowledges/biz
|
|
|
324
319
|
- Technical architecture documents (handled by speccrew-system-designer)
|
|
325
320
|
- Code conventions (handled by speccrew-system-designer/speccrew-dev)
|
|
326
321
|
|
|
327
|
-
## Phase 3: Feature Design —
|
|
322
|
+
## Phase 3: Feature Design — Two-Stage Pipeline
|
|
328
323
|
|
|
329
324
|
> ⚠️ **MANDATORY RULES FOR PHASE 3:**
|
|
330
325
|
> 1. **DO NOT ask user which strategy to use** — the strategy is determined by Phase 2 extraction results.
|
|
331
326
|
> 2. **DO NOT invoke skills directly** when there are multiple Features. You MUST dispatch `speccrew-task-worker` agents.
|
|
332
327
|
> 3. **Dispatch granularity is PER FEATURE, not per module.** Each Feature gets its own worker per phase.
|
|
333
328
|
> 4. **DO NOT generate Feature Spec documents yourself.** Your role is to DISPATCH workers.
|
|
334
|
-
> 5. **Phase 3a → 3b → 3c
|
|
335
|
-
> 6. **Intermediate artifacts are MANDATORY.** .feature-analysis.md must exist before Phase 3b.
|
|
329
|
+
> 5. **Phase 3a → 3b → 3c is STRICTLY SERIAL.** Each phase must complete before the next begins.
|
|
330
|
+
> 6. **Intermediate artifacts are MANDATORY.** .feature-analysis.md must exist before Phase 3b.
|
|
336
331
|
|
|
337
332
|
---
|
|
338
333
|
|
|
@@ -360,9 +355,9 @@ If only **1 Feature** in registry:
|
|
|
360
355
|
|
|
361
356
|
If **2+ Features** in registry:
|
|
362
357
|
|
|
363
|
-
1. **Initialize
|
|
358
|
+
1. **Initialize DISPATCH-PROGRESS.json**:
|
|
364
359
|
```bash
|
|
365
|
-
node speccrew-workspace/scripts/update-progress.js init
|
|
360
|
+
node speccrew-workspace/scripts/update-progress.js init --file speccrew-workspace/iterations/{iteration}/02.feature-design/DISPATCH-PROGRESS.json --stage 02_feature_design_analyze --tasks "[{\"id\":\"F-CRM-01\"},{\"id\":\"F-CRM-02\"},{\"id\":\"F-CRM-03\"}]"
|
|
366
361
|
```
|
|
367
362
|
|
|
368
363
|
2. **Dispatch Workers** (batch of 6):
|
|
@@ -388,9 +383,9 @@ If **2+ Features** in registry:
|
|
|
388
383
|
|
|
389
384
|
---
|
|
390
385
|
|
|
391
|
-
### Phase 3b: Design — Feature
|
|
386
|
+
### Phase 3b: Design & Generate — Feature Spec Production
|
|
392
387
|
|
|
393
|
-
**Purpose**: Transform function decomposition into complete
|
|
388
|
+
**Purpose**: Transform function decomposition into complete Feature Spec documents in a single pass (design + document generation).
|
|
394
389
|
|
|
395
390
|
**Prerequisite**: All Phase 3a outputs exist (`.feature-analysis.md` for each Feature)
|
|
396
391
|
|
|
@@ -398,6 +393,8 @@ If **2+ Features** in registry:
|
|
|
398
393
|
|
|
399
394
|
#### Single Feature (Direct Invocation)
|
|
400
395
|
|
|
396
|
+
If only **1 Feature** in registry:
|
|
397
|
+
|
|
401
398
|
- Skill path: `speccrew-fd-feature-design/SKILL.md`
|
|
402
399
|
- Parameters:
|
|
403
400
|
- `feature_analysis_path`: Path to `.feature-analysis.md` from Phase 3a
|
|
@@ -406,12 +403,14 @@ If **2+ Features** in registry:
|
|
|
406
403
|
- `feature_name`: Feature name
|
|
407
404
|
- `feature_type`: `Page+API` or `API-only`
|
|
408
405
|
- `frontend_platforms`: Platform list
|
|
406
|
+
- `output_path`: `speccrew-workspace/iterations/{iteration}/02.feature-design/{feature-id}-{feature-name}-feature-spec.md`
|
|
407
|
+
- Checkpoint B handled inside skill (user confirmation before writing)
|
|
409
408
|
|
|
410
409
|
#### Multiple Features (Worker Dispatch)
|
|
411
410
|
|
|
412
|
-
1. **
|
|
411
|
+
1. **Initialize DISPATCH-PROGRESS.json for Design & Generate stage**:
|
|
413
412
|
```bash
|
|
414
|
-
node speccrew-workspace/scripts/update-progress.js
|
|
413
|
+
node speccrew-workspace/scripts/update-progress.js init --file speccrew-workspace/iterations/{iteration}/02.feature-design/DISPATCH-PROGRESS.json --stage 02_feature_design_spec --tasks "[{\"id\":\"F-CRM-01\"},{\"id\":\"F-CRM-02\"},{\"id\":\"F-CRM-03\"}]"
|
|
415
414
|
```
|
|
416
415
|
|
|
417
416
|
2. **Dispatch Workers** (batch of 6):
|
|
@@ -424,22 +423,27 @@ If **2+ Features** in registry:
|
|
|
424
423
|
- `feature_name`: Feature name
|
|
425
424
|
- `feature_type`: `Page+API` or `API-only`
|
|
426
425
|
- `frontend_platforms`: Platform list
|
|
426
|
+
- `output_path`: Path for final spec
|
|
427
|
+
- `skip_checkpoint`: `true` (batch mode — Checkpoint B deferred to Phase 3c)
|
|
428
|
+
|
|
429
|
+
3. **Wait for batch completion**, update progress per worker
|
|
427
430
|
|
|
428
|
-
|
|
431
|
+
4. **Update `.checkpoints.json`** for each completed Feature:
|
|
432
|
+
- Set `feature_spec_status` = `completed`
|
|
429
433
|
|
|
430
|
-
**Output**: One
|
|
434
|
+
**Output**: One `{feature-id}-{feature-name}-feature-spec.md` per Feature
|
|
431
435
|
|
|
432
436
|
---
|
|
433
437
|
|
|
434
|
-
### Phase 3c: Confirm — Batch
|
|
438
|
+
### Phase 3c: Confirm — Batch Spec Review (Multi-Feature Only)
|
|
435
439
|
|
|
436
440
|
**Condition**: Execute ONLY when 2+ Features exist
|
|
437
441
|
|
|
438
|
-
**Purpose**: Present batch
|
|
442
|
+
**Purpose**: Present batch Feature Spec summary and obtain user confirmation before proceeding to API Contract generation.
|
|
439
443
|
|
|
440
|
-
1. **Read all
|
|
444
|
+
1. **Read all `feature-spec.md` files** generated in Phase 3b
|
|
441
445
|
|
|
442
|
-
2. **Build Batch
|
|
446
|
+
2. **Build Batch Spec Summary**:
|
|
443
447
|
|
|
444
448
|
| Feature ID | Feature Name | Functions | Frontend Components | APIs | Data Entities |
|
|
445
449
|
|------------|--------------|-----------|---------------------|------|---------------|
|
|
@@ -449,7 +453,7 @@ If **2+ Features** in registry:
|
|
|
449
453
|
|
|
450
454
|
3. **Present to User**:
|
|
451
455
|
```
|
|
452
|
-
📋 Batch
|
|
456
|
+
📋 Batch Feature Spec Summary
|
|
453
457
|
|
|
454
458
|
Total Features: {N}
|
|
455
459
|
├── Functions Designed: {total}
|
|
@@ -459,77 +463,27 @@ If **2+ Features** in registry:
|
|
|
459
463
|
|
|
460
464
|
[Summary table above]
|
|
461
465
|
|
|
462
|
-
⚠️ HARD STOP — Please review all
|
|
466
|
+
⚠️ HARD STOP — Please review all Feature Specs before proceeding to API Contract generation.
|
|
463
467
|
```
|
|
464
468
|
|
|
465
469
|
4. **HARD STOP**: Wait for user confirmation
|
|
466
470
|
- If user requests modification for specific Feature → Re-dispatch design worker for that Feature only
|
|
467
|
-
- If user confirms → Update `.checkpoints.json
|
|
471
|
+
- If user confirms → Update `.checkpoints.json`:
|
|
468
472
|
```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
|
|
473
|
+
node speccrew-workspace/scripts/update-progress.js write-checkpoint --file speccrew-workspace/iterations/{iteration}/02.feature-design/.checkpoints.json --stage 02_feature_design --checkpoint feature_spec_review --passed true
|
|
470
474
|
```
|
|
471
475
|
|
|
472
476
|
---
|
|
473
477
|
|
|
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
478
|
### Phase 3 Error Handling
|
|
525
479
|
|
|
526
|
-
When any worker (analyze/design
|
|
480
|
+
When any worker (analyze/design) reports failure:
|
|
527
481
|
|
|
528
|
-
1. **Identify Phase**: Record which phase failed (3a/3b
|
|
482
|
+
1. **Identify Phase**: Record which phase failed (3a/3b) and which skill
|
|
529
483
|
|
|
530
484
|
2. **Update status**: Set the failed feature's status in `.checkpoints.json`:
|
|
531
485
|
```bash
|
|
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}"
|
|
486
|
+
node speccrew-workspace/scripts/update-progress.js update-task --file speccrew-workspace/iterations/{iteration}/02.feature-design/DISPATCH-PROGRESS.json --task-id {feature_id} --status failed --error "[{phase}] {error_message}"
|
|
533
487
|
```
|
|
534
488
|
|
|
535
489
|
3. **Continue batch**: Do NOT stop entire batch for single failure. Complete remaining workers.
|
|
@@ -144,6 +144,7 @@ After user confirms (or if skipped):
|
|
|
144
144
|
```bash
|
|
145
145
|
node speccrew-workspace/scripts/update-progress.js write-checkpoint \
|
|
146
146
|
--file speccrew-workspace/iterations/{iteration_id}/02.feature-design/.checkpoints.json \
|
|
147
|
+
--stage 02_feature_design \
|
|
147
148
|
--checkpoint function_decomposition \
|
|
148
149
|
--passed true
|
|
149
150
|
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: speccrew-fd-feature-design
|
|
3
|
-
description: Feature Design
|
|
4
|
-
tools: Read, Write, Glob, Grep
|
|
3
|
+
description: Feature Design & Spec Generation SOP. Reads .feature-analysis.md and PRD documents, performs frontend/backend/data design, and generates complete Feature Spec document using template-first workflow. Combines design thinking with document generation in a single pass, without producing any intermediate design-data artifacts. Use when Feature Designer needs to produce Feature Spec from completed analysis.
|
|
4
|
+
tools: Read, Write, Glob, Grep, search_replace
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Methodology Foundation
|
|
@@ -20,45 +20,55 @@ ISA-95 Stages 4-6 as internal thinking framework:
|
|
|
20
20
|
|
|
21
21
|
- Function decomposition completed (`.feature-analysis.md` exists)
|
|
22
22
|
- Checkpoint A passed (function breakdown confirmed)
|
|
23
|
-
-
|
|
23
|
+
- Feature Spec document generation needed
|
|
24
24
|
|
|
25
25
|
# Workflow
|
|
26
26
|
|
|
27
27
|
## Absolute Constraints
|
|
28
28
|
|
|
29
|
-
**ABORT CONDITIONS:**
|
|
29
|
+
**ABORT CONDITIONS:**
|
|
30
|
+
- `.feature-analysis.md` missing OR Checkpoint A not passed → HARD STOP
|
|
31
|
+
- Template file missing → HARD STOP
|
|
30
32
|
|
|
31
|
-
**FORBIDDEN:**
|
|
33
|
+
**FORBIDDEN:**
|
|
34
|
+
- `create_file` for final documents in section-fill phase — use template + search_replace
|
|
35
|
+
- Full-file rewrite — use targeted search_replace per section
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
**MANDATORY:** Verify `.feature-analysis.md` exists.
|
|
36
|
-
|
|
37
|
-
**IF missing → ABORT:** `ERROR: .feature-analysis.md not found. Run speccrew-fd-feature-analysis first.`
|
|
38
|
-
|
|
39
|
-
**Actions:**
|
|
40
|
-
1. Read `.feature-analysis.md`
|
|
41
|
-
2. Verify Checkpoint A: `function_decomposition.passed == true`
|
|
42
|
-
3. IF not passed → STOP
|
|
43
|
-
4. Extract: feature_id, feature_name, feature_type, functions[], platforms[]
|
|
37
|
+
**MANDATORY:**
|
|
38
|
+
- Template-first workflow — Step 5 (copy template) MUST precede Step 6 (fill content)
|
|
44
39
|
|
|
45
|
-
|
|
40
|
+
**NOTE:** Design process is internal — no intermediate design-data files are produced.
|
|
46
41
|
|
|
47
|
-
|
|
42
|
+
## Step 0: Precondition Check
|
|
48
43
|
|
|
49
|
-
|
|
50
|
-
|--------|-------------|---------|
|
|
51
|
-
| Single File | `{feature-id}-{feature-name}.feature-design-data.md` | `F-CRM-01-customer-list.feature-design-data.md` |
|
|
44
|
+
### Step 0 Input Parameters
|
|
52
45
|
|
|
53
|
-
|
|
46
|
+
| Parameter | Required | Description |
|
|
47
|
+
|-----------|----------|-------------|
|
|
48
|
+
| `feature_analysis_path` | Yes | Path to `.feature-analysis.md` |
|
|
49
|
+
| `prd_path` | Yes | Path to the Sub-PRD document |
|
|
50
|
+
| `feature_id` | No | Feature identifier (e.g., `F-CRM-01`) |
|
|
51
|
+
| `feature_name` | No | Feature name in English |
|
|
52
|
+
| `feature_type` | No | `Page+API` or `API-only` |
|
|
53
|
+
| `frontend_platforms` | No | List of frontend platforms |
|
|
54
|
+
| `output_path` | No | Custom output path for Feature Spec (auto-generated if not provided) |
|
|
55
|
+
| `skip_checkpoint` | No | Boolean, default `false`. Skip Checkpoint B if `true` (batch mode) |
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
### Step 0 Actions
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
1. Read `.feature-analysis.md` at `feature_analysis_path`
|
|
60
|
+
2. Verify Checkpoint A: `function_decomposition.passed == true`
|
|
61
|
+
3. IF not passed → ABORT: `ERROR: Checkpoint A not passed. Run speccrew-fd-feature-analysis first.`
|
|
62
|
+
4. Extract key data:
|
|
63
|
+
- `feature_id`: From analysis file or parameter
|
|
64
|
+
- `feature_name`: From analysis file or parameter
|
|
65
|
+
- `feature_type`: From analysis file or parameter (`Page+API` or `API-only`)
|
|
66
|
+
- `functions[]`: Function breakdown list
|
|
67
|
+
- `platforms[]`: Frontend platforms list
|
|
58
68
|
|
|
59
|
-
## Step
|
|
69
|
+
## Step 1: Frontend Design
|
|
60
70
|
|
|
61
|
-
###
|
|
71
|
+
### 1.0 Conditional Execution
|
|
62
72
|
|
|
63
73
|
`feature_type = "Page+API"` → Execute design; `feature_type = "API-only"` → Skip; Not provided → Execute (backward compatibility)
|
|
64
74
|
|
|
@@ -118,7 +128,7 @@ Pattern M-C: Action Sheet
|
|
|
118
128
|
+----------------------------------+
|
|
119
129
|
```
|
|
120
130
|
|
|
121
|
-
###
|
|
131
|
+
### 1.1 UI Prototype
|
|
122
132
|
|
|
123
133
|
Create ASCII wireframes showing layout, UI elements, navigation.
|
|
124
134
|
|
|
@@ -139,13 +149,13 @@ Create ASCII wireframes showing layout, UI elements, navigation.
|
|
|
139
149
|
+--------------------------------------------------+
|
|
140
150
|
```
|
|
141
151
|
|
|
142
|
-
###
|
|
152
|
+
### 1.2 Interface Element Descriptions
|
|
143
153
|
|
|
144
154
|
| Element | Type | Behavior |
|
|
145
155
|
|---------|------|----------|
|
|
146
156
|
| {name} | {component type} | {behavior description} |
|
|
147
157
|
|
|
148
|
-
###
|
|
158
|
+
### 1.3 Interaction Flow
|
|
149
159
|
|
|
150
160
|
Document: `User Action → Frontend Response → Backend API Call`
|
|
151
161
|
|
|
@@ -155,21 +165,21 @@ Document: `User Action → Frontend Response → Backend API Call`
|
|
|
155
165
|
> - Interface identification: Every data exchange point = potential API endpoint
|
|
156
166
|
> - Exception flows: Document alternative paths, not just happy path
|
|
157
167
|
|
|
158
|
-
###
|
|
168
|
+
### 1.4 Backend API Mapping
|
|
159
169
|
|
|
160
170
|
| Frontend Action | Backend API | Purpose |
|
|
161
171
|
|-----------------|-------------|---------|
|
|
162
172
|
| {action} | {API endpoint} | {data exchanged} |
|
|
163
173
|
|
|
164
|
-
## Step
|
|
174
|
+
## Step 2: Backend Design
|
|
165
175
|
|
|
166
|
-
###
|
|
176
|
+
### 2.1 API/Interface List
|
|
167
177
|
|
|
168
178
|
| Interface | Method | Description |
|
|
169
179
|
|-----------|--------|-------------|
|
|
170
180
|
| {name} | {GET/POST/PUT/DELETE} | {purpose} |
|
|
171
181
|
|
|
172
|
-
###
|
|
182
|
+
### 2.2 Processing Logic Flow
|
|
173
183
|
|
|
174
184
|
| Stage | Description |
|
|
175
185
|
|-------|-------------|
|
|
@@ -178,22 +188,22 @@ Document: `User Action → Frontend Response → Backend API Call`
|
|
|
178
188
|
| Data Operations | What data to read/write |
|
|
179
189
|
| Response | What data to return |
|
|
180
190
|
|
|
181
|
-
###
|
|
191
|
+
### 2.3 Data Access Scheme
|
|
182
192
|
|
|
183
193
|
| Operation | Data Target | Type |
|
|
184
194
|
|-----------|-------------|------|
|
|
185
195
|
| Read | {data} | [EXISTING]/[NEW] |
|
|
186
196
|
| Write | {data} | [EXISTING]/[NEW] |
|
|
187
197
|
|
|
188
|
-
###
|
|
198
|
+
### 2.4 Cross-Module Interactions
|
|
189
199
|
|
|
190
200
|
| This Module | Interacts With | Interface | Data Exchanged |
|
|
191
201
|
|-------------|----------------|-----------|----------------|
|
|
192
202
|
| {module} | {other module} | {API/Event} | {what data} |
|
|
193
203
|
|
|
194
|
-
## Step
|
|
204
|
+
## Step 3: Data Model & Business Rules
|
|
195
205
|
|
|
196
|
-
###
|
|
206
|
+
### 3.1 New Data Structures
|
|
197
207
|
|
|
198
208
|
| Field | Type | Constraints | Description |
|
|
199
209
|
|-------|------|-------------|-------------|
|
|
@@ -205,13 +215,13 @@ Document: `User Action → Frontend Response → Backend API Call`
|
|
|
205
215
|
> - Semantic consistency: Align with domain glossary
|
|
206
216
|
> - Relationships: Identify core relationships (1:1, 1:N, N:N)
|
|
207
217
|
|
|
208
|
-
###
|
|
218
|
+
### 3.2 Modifications to Existing Data Structures
|
|
209
219
|
|
|
210
220
|
| Entity | Change Type | Details | Impact |
|
|
211
221
|
|--------|-------------|---------|--------|
|
|
212
222
|
| {entity} | Add/Modify/Remove field | {description} | {affected areas} |
|
|
213
223
|
|
|
214
|
-
###
|
|
224
|
+
### 3.3 Data Relationships
|
|
215
225
|
|
|
216
226
|
**New Relationships:** `EntityA --1:N--> EntityB`
|
|
217
227
|
|
|
@@ -219,13 +229,13 @@ Document: `User Action → Frontend Response → Backend API Call`
|
|
|
219
229
|
|------------|-----------------|--------------|
|
|
220
230
|
| {new} | {existing} | {1:1 / 1:N / N:M} |
|
|
221
231
|
|
|
222
|
-
###
|
|
232
|
+
### 3.4 Data Source Descriptions
|
|
223
233
|
|
|
224
234
|
| Data | Source | Update Frequency |
|
|
225
235
|
|------|--------|------------------|
|
|
226
236
|
| {item} | {internal/external/user} | {real-time/periodic/on-demand} |
|
|
227
237
|
|
|
228
|
-
|
|
238
|
+
### 3.5 Permission Rules
|
|
229
239
|
|
|
230
240
|
> **ISA-95 Stage 6 Thinking — Information Descriptions**
|
|
231
241
|
> - Validation: Field-level, cross-field, business logic rules
|
|
@@ -233,74 +243,184 @@ Document: `User Action → Frontend Response → Backend API Call`
|
|
|
233
243
|
> - Permissions: Data access rules mapping to API authorization
|
|
234
244
|
> - Traceability: Every rule traces back to PRD requirement
|
|
235
245
|
|
|
236
|
-
### 5.1 Permission Rules
|
|
237
|
-
|
|
238
246
|
| Function | Required Permission | Scope |
|
|
239
247
|
|----------|---------------------|-------|
|
|
240
248
|
| {function} | {permission} | {global/module/resource-specific} |
|
|
241
249
|
|
|
242
|
-
###
|
|
250
|
+
### 3.6 Business Logic Rules
|
|
243
251
|
|
|
244
252
|
| Rule ID | Description | Trigger | Action |
|
|
245
253
|
|---------|-------------|---------|--------|
|
|
246
254
|
| BR-{number} | {description} | {when applies} | {what happens} |
|
|
247
255
|
|
|
248
|
-
###
|
|
256
|
+
### 3.7 Validation Rules
|
|
249
257
|
|
|
250
258
|
| Field | Frontend Validation | Backend Validation |
|
|
251
259
|
|-------|---------------------|---------------------|
|
|
252
260
|
| {field} | {client rules} | {server rules} |
|
|
253
261
|
|
|
254
|
-
## Step
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
[
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
###
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
262
|
+
## Step 4: Checkpoint B — User Confirmation
|
|
263
|
+
|
|
264
|
+
**Conditional Execution:** Skip if `skip_checkpoint=true`
|
|
265
|
+
|
|
266
|
+
### 4.1 Present Design Summary
|
|
267
|
+
|
|
268
|
+
```
|
|
269
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
270
|
+
║ FEATURE DESIGN SUMMARY - CHECKPOINT B ║
|
|
271
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
272
|
+
║ Feature: {feature_name} ({feature_id}) ║
|
|
273
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
274
|
+
║ FUNCTIONS DESIGNED ║
|
|
275
|
+
║ Total: {N} functions ║
|
|
276
|
+
║ ║
|
|
277
|
+
║ Function Breakdown: ║
|
|
278
|
+
║ • {Function 1} - [EXISTING/MODIFIED/NEW] ║
|
|
279
|
+
║ • {Function 2} - [EXISTING/MODIFIED/NEW] ║
|
|
280
|
+
║ • {Function 3} - [EXISTING/MODIFIED/NEW] ║
|
|
281
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
282
|
+
║ SYSTEM RELATIONSHIP SUMMARY ║
|
|
283
|
+
║ • [EXISTING]: {count} - Reuse existing capabilities ║
|
|
284
|
+
║ • [MODIFIED]: {count} - Enhance existing features ║
|
|
285
|
+
║ • [NEW]: {count} - Create new functionality ║
|
|
286
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
287
|
+
║ FRONTEND COMPONENTS ║
|
|
288
|
+
║ • Platforms: {platform list} ║
|
|
289
|
+
║ • UI Patterns: {list of wireframe patterns used} ║
|
|
290
|
+
║ • Total Functions with UI: {count} ║
|
|
291
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
292
|
+
║ BACKEND INTERFACES ║
|
|
293
|
+
║ • Total APIs: {count} ║
|
|
294
|
+
║ • New APIs: {count} ║
|
|
295
|
+
║ • Modified APIs: {count} ║
|
|
296
|
+
║ • Cross-Module Interactions: {count} ║
|
|
297
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
298
|
+
║ DATA ENTITIES ║
|
|
299
|
+
║ • New Entities: {count} ║
|
|
300
|
+
║ • Modified Entities: {count} ║
|
|
301
|
+
║ • Business Rules: {count} ║
|
|
302
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### 4.2 HARD STOP — 5 Confirmation Questions
|
|
306
|
+
|
|
307
|
+
**STOP — DO NOT PROCEED until user confirms:**
|
|
308
|
+
|
|
309
|
+
1. **Function Coverage**: "Does this design cover all functions from the analysis? Are any functions missing?"
|
|
310
|
+
|
|
311
|
+
2. **System Relationship Markers**: "Are the [EXISTING]/[MODIFIED]/[NEW] markers accurate for each component?"
|
|
312
|
+
|
|
313
|
+
3. **UI/UX Approach**: "Do the ASCII wireframes and interaction flows match your expectations?"
|
|
314
|
+
|
|
315
|
+
4. **Backend Interface Scope**: "Are the API endpoints and cross-module interactions correctly identified?"
|
|
316
|
+
|
|
317
|
+
5. **Data Model Completeness**: "Does the data model cover all fields and relationships needed?"
|
|
318
|
+
|
|
319
|
+
**WAIT for user confirmation before proceeding to document generation.**
|
|
320
|
+
|
|
321
|
+
### 4.3 Update Checkpoints
|
|
322
|
+
|
|
323
|
+
After user confirms (or if skipped):
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
node speccrew-workspace/scripts/update-progress.js write-checkpoint \
|
|
327
|
+
--file speccrew-workspace/iterations/{iteration_id}/02.feature-design/.checkpoints.json \
|
|
328
|
+
--stage 02_feature_design \
|
|
329
|
+
--checkpoint feature_design_review \
|
|
330
|
+
--passed true
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Log: "✅ Checkpoint B (feature_design_review) passed and recorded"
|
|
334
|
+
|
|
335
|
+
## Step 5: Determine Output Path & Copy Template
|
|
336
|
+
|
|
337
|
+
### 5.1 Determine Output Path
|
|
338
|
+
|
|
339
|
+
**Single Feature Mode** (when `feature_id` provided):
|
|
340
|
+
```
|
|
341
|
+
{iteration_path}/02.feature-design/{feature_id}-{feature_name}-feature-spec.md
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
**Legacy Single Mode** (backward compatibility):
|
|
303
345
|
```
|
|
346
|
+
{iteration_path}/02.feature-design/[feature-name]-feature-spec.md
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
**Legacy Master-Sub Mode** (backward compatibility):
|
|
350
|
+
- Master Spec: `{iteration_path}/02.feature-design/[master-name]-feature-spec.md`
|
|
351
|
+
- Sub Specs: `{iteration_path}/02.feature-design/[sub-name]-feature-spec.md` (one per sub-feature)
|
|
352
|
+
|
|
353
|
+
### 5.2 Copy Template
|
|
354
|
+
|
|
355
|
+
1. Read template: `templates/FEATURE-SPEC-TEMPLATE.md` (relative path from skill directory)
|
|
356
|
+
2. Replace top-level placeholders:
|
|
357
|
+
- `[Feature Name]` → actual feature name
|
|
358
|
+
- `{Feature ID}` → actual feature ID
|
|
359
|
+
- `{Feature Name}` → actual feature name
|
|
360
|
+
- `{Page+API / API-only}` → actual feature type
|
|
361
|
+
- `{Link to Sub-PRD document}` → `prd_path` value
|
|
362
|
+
3. Create document using `create_file` with template content
|
|
363
|
+
4. Verify section structure exists (Sections 1-6 with proper numbering)
|
|
364
|
+
|
|
365
|
+
## Step 6: Fill Sections Using search_replace
|
|
366
|
+
|
|
367
|
+
### Section Mapping Table
|
|
368
|
+
|
|
369
|
+
| Template Section | Data Source |
|
|
370
|
+
|------------------|-------------|
|
|
371
|
+
| 1. Overview (Basic Information, Feature Scope) | `.feature-analysis.md` Feature Information + summary |
|
|
372
|
+
| 1.3 Relationship to Existing System | `.feature-analysis.md` System Relationships |
|
|
373
|
+
| 2. Function Details | Step 1 Frontend Design + Step 2 Backend Design results (internal) |
|
|
374
|
+
| 2.1.x Frontend Prototype | Step 1.1 UI Prototype results |
|
|
375
|
+
| 2.1.x Interaction Flow | Step 1.3 Interaction Flow results |
|
|
376
|
+
| 2.1.x Backend Interface | Step 2.1-2.3 Backend Design results |
|
|
377
|
+
| 2.1.x Data Definition | Step 3.1-3.4 Data Model results |
|
|
378
|
+
| 3. Cross-Function Concerns | Step 2.4 Cross-Module results |
|
|
379
|
+
| 4. Business Rules & Constraints | Step 3.5-3.7 Business Rules results |
|
|
380
|
+
| 5. API Contract Summary | Aggregated from Step 2.1 API List |
|
|
381
|
+
| 6. Notes | Contextual notes from analysis |
|
|
382
|
+
|
|
383
|
+
### Filling Rules
|
|
384
|
+
|
|
385
|
+
- Use `search_replace` for each section individually
|
|
386
|
+
- Preserve all section titles and numbering
|
|
387
|
+
- No applicable content → "N/A"
|
|
388
|
+
- Multi-platform: Create separate sub-sections per platform
|
|
389
|
+
|
|
390
|
+
### Legacy Master-Sub Mode
|
|
391
|
+
|
|
392
|
+
If processing Master-Sub structure:
|
|
393
|
+
- Repeat Step 5+6 for each sub-spec
|
|
394
|
+
- Master spec contains: Overview, Cross-module diagram, shared data structures
|
|
395
|
+
- Sub specs contain: Per-feature detailed design
|
|
396
|
+
|
|
397
|
+
## Step 7: Mermaid Diagram Compliance
|
|
398
|
+
|
|
399
|
+
Verify all Mermaid diagrams follow compliance rules:
|
|
400
|
+
|
|
401
|
+
1. **NO style definitions** — No `classDef`, `style`, or CSS-like syntax
|
|
402
|
+
2. **NO HTML tags** — No `<br/>`, `<b>`, or other HTML in labels
|
|
403
|
+
3. **Use standard syntax only:**
|
|
404
|
+
- `sequenceDiagram` for interaction flows
|
|
405
|
+
- `flowchart TD` for processing logic
|
|
406
|
+
- Plain text labels with standard characters
|
|
407
|
+
4. **Reference:** `speccrew-workspace/docs/rules/mermaid-rule.md`
|
|
408
|
+
|
|
409
|
+
**Validation:** Before finalizing, scan all Mermaid blocks for non-compliant syntax.
|
|
410
|
+
|
|
411
|
+
## Step 8: Update Checkpoints
|
|
412
|
+
|
|
413
|
+
Set final checkpoint status:
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
node speccrew-workspace/scripts/update-progress.js write-checkpoint \
|
|
417
|
+
--file speccrew-workspace/iterations/{iteration_id}/02.feature-design/.checkpoints.json \
|
|
418
|
+
--stage 02_feature_design \
|
|
419
|
+
--checkpoint feature_spec_review \
|
|
420
|
+
--passed true
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
Log: "✅ Feature Spec generation completed. Checkpoint feature_spec_review passed."
|
|
304
424
|
|
|
305
425
|
---
|
|
306
426
|
|
|
@@ -312,19 +432,30 @@ Write to `{feature-id}-{feature-name}.feature-design-data.md`:
|
|
|
312
432
|
| Focus on WHAT not HOW | Describe what system does, not how it's implemented |
|
|
313
433
|
| ASCII Wireframes Only | Use ASCII art for UI prototypes |
|
|
314
434
|
| Mermaid Compatibility | Follow mermaid-rule.md guidelines |
|
|
315
|
-
| Clear Markers | Use [EXISTING]/[MODIFIED]/[NEW]
|
|
435
|
+
| Clear Markers | Use [EXISTING]/[MODIFIED]/[NEW] consistently |
|
|
436
|
+
| Template-First | Copy template before filling content |
|
|
437
|
+
| search_replace Only | Never use create_file for section updates after template copy |
|
|
438
|
+
| Checkpoint B | Get user confirmation before writing files (unless skipped) |
|
|
439
|
+
| No Intermediate Files | Design process is internal — do NOT output any intermediate design-data artifacts |
|
|
316
440
|
|
|
317
441
|
# Checklist
|
|
318
442
|
|
|
319
|
-
- [ ] `.feature-analysis.md` verified
|
|
320
|
-
- [ ] Checkpoint A passed
|
|
321
|
-
- [ ]
|
|
443
|
+
- [ ] `.feature-analysis.md` verified and exists
|
|
444
|
+
- [ ] Checkpoint A passed (`function_decomposition.passed == true`)
|
|
445
|
+
- [ ] All input parameters resolved (feature_id, feature_name, feature_type)
|
|
446
|
+
- [ ] Template file `templates/FEATURE-SPEC-TEMPLATE.md` exists
|
|
322
447
|
- [ ] **[API-only]** Frontend design skipped
|
|
323
|
-
- [ ] **[Page+API]** ASCII wireframes
|
|
324
|
-
- [ ] **[Multi-platform]** Per-platform designs
|
|
448
|
+
- [ ] **[Page+API]** ASCII wireframes created for all platforms
|
|
449
|
+
- [ ] **[Multi-platform]** Per-platform designs completed
|
|
325
450
|
- [ ] Backend interfaces and logic documented
|
|
326
|
-
- [ ] Data model with entities and modifications
|
|
327
|
-
- [ ] Business rules documented
|
|
451
|
+
- [ ] Data model with entities and modifications documented
|
|
452
|
+
- [ ] Business rules (permissions, logic, validation) documented
|
|
328
453
|
- [ ] ISA-95 Stage 4/5/6 thinking applied
|
|
329
|
-
- [ ]
|
|
454
|
+
- [ ] Checkpoint B passed: design summary confirmed with user (or skipped)
|
|
455
|
+
- [ ] Output path determined
|
|
456
|
+
- [ ] Template copied using `create_file`
|
|
457
|
+
- [ ] All sections filled using `search_replace`
|
|
458
|
+
- [ ] Mermaid diagrams verified for compliance
|
|
459
|
+
- [ ] `.checkpoints.json` updated via script
|
|
330
460
|
- [ ] No technology decisions included
|
|
461
|
+
- [ ] No intermediate design-data artifact created
|
package/package.json
CHANGED
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: speccrew-fd-feature-generate
|
|
3
|
-
description: Feature Spec Generation SOP. Reads .feature-analysis.md and .feature-design-data.md interface contracts, assembles complete Feature Spec document using template-first workflow. Handles Checkpoint B user confirmation before writing files. Use when Feature Designer needs to generate final Feature Spec document from completed design data.
|
|
4
|
-
tools: Read, Write, Glob, Grep
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Skill Overview
|
|
8
|
-
|
|
9
|
-
Generates final Feature Spec document from completed design data. Reads intermediate artifacts and assembles complete specification using template-first workflow.
|
|
10
|
-
|
|
11
|
-
## Trigger Scenarios
|
|
12
|
-
|
|
13
|
-
- Feature design data ready (`.feature-design-data.md` exists)
|
|
14
|
-
- Feature analysis complete (`.feature-analysis.md` exists)
|
|
15
|
-
- Final Feature Spec document generation needed
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
# Workflow
|
|
20
|
-
|
|
21
|
-
## Absolute Constraints
|
|
22
|
-
|
|
23
|
-
> **Violation = task failure**
|
|
24
|
-
|
|
25
|
-
### ABORT CONDITIONS
|
|
26
|
-
- `.feature-analysis.md` missing → **HARD STOP**
|
|
27
|
-
- `.feature-design-data.md` missing → **HARD STOP**
|
|
28
|
-
- Template file missing → **HARD STOP**
|
|
29
|
-
- **NEVER skip preconditions verification**
|
|
30
|
-
|
|
31
|
-
### FORBIDDEN
|
|
32
|
-
- `create_file` for final documents — use template + `search_replace`
|
|
33
|
-
- Full-file rewrite — use targeted `search_replace` per section
|
|
34
|
-
|
|
35
|
-
### MANDATORY
|
|
36
|
-
- **Template-first workflow** — Step 4 (copy template) MUST precede Step 5 (fill content)
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Step 1: Read Input & Verify Preconditions
|
|
41
|
-
|
|
42
|
-
### 1.1 Input Parameters
|
|
43
|
-
|
|
44
|
-
| Parameter | Required | Description |
|
|
45
|
-
|-----------|----------|-------------|
|
|
46
|
-
| `feature_analysis_path` | Yes | Path to `.feature-analysis.md` |
|
|
47
|
-
| `feature_design_data_path` | Yes | Path to `.feature-design-data.md` |
|
|
48
|
-
| `feature_id` | No | Feature identifier (e.g., F-CRM-01) |
|
|
49
|
-
| `feature_name` | No | Feature name |
|
|
50
|
-
| `feature_type` | No | Page+API or API-only |
|
|
51
|
-
| `output_path` | No | Custom output path (auto-generated if not provided) |
|
|
52
|
-
| `skip_checkpoint` | No | Boolean. If true, skip Checkpoint B (batch mode) |
|
|
53
|
-
|
|
54
|
-
### 1.2 Verify Input Files
|
|
55
|
-
|
|
56
|
-
**IF either file missing → ABORT:**
|
|
57
|
-
```
|
|
58
|
-
❌ ERROR: Prerequisite files not found.
|
|
59
|
-
Missing: [filename]
|
|
60
|
-
|
|
61
|
-
This skill requires completed feature analysis and design.
|
|
62
|
-
Please run speccrew-fd-feature-analyze and speccrew-fd-feature-design first.
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### 1.3 Read Files
|
|
66
|
-
|
|
67
|
-
1. Read `.feature-analysis.md` — extract: Function Breakdown, [EXISTING]/[MODIFIED]/[NEW] counts
|
|
68
|
-
2. Read `.feature-design-data.md` — extract: Frontend Design, Backend Design, Data Model, Business Rules
|
|
69
|
-
3. Read Feature Spec template: `speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md`
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## Step 2: Build Design Summary
|
|
74
|
-
|
|
75
|
-
Extract statistics from intermediate artifacts:
|
|
76
|
-
|
|
77
|
-
| Metric | Source |
|
|
78
|
-
|--------|--------|
|
|
79
|
-
| Functions Designed | `.feature-analysis.md` Function Breakdown section |
|
|
80
|
-
| [EXISTING] / [MODIFIED] / [NEW] counts | Function markers in analysis |
|
|
81
|
-
| Frontend Components | `.feature-design-data.md` Frontend Design (0 if API-only) |
|
|
82
|
-
| Backend Interfaces | `.feature-design-data.md` Backend Design API count |
|
|
83
|
-
| Data Entities | `.feature-design-data.md` Data Model (new/modified) |
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
## Step 3: Checkpoint B — User Confirmation
|
|
88
|
-
|
|
89
|
-
> **Skip this step if `skip_checkpoint=true`**
|
|
90
|
-
|
|
91
|
-
### 3.1 Present Summary
|
|
92
|
-
|
|
93
|
-
```
|
|
94
|
-
Feature Design Summary for: {feature-name}
|
|
95
|
-
|
|
96
|
-
Functions Designed: {count}
|
|
97
|
-
├── [EXISTING] {count} functions reuse existing capabilities
|
|
98
|
-
├── [MODIFIED] {count} functions enhance existing features
|
|
99
|
-
└── [NEW] {count} functions are brand new
|
|
100
|
-
|
|
101
|
-
Frontend Components: {count} pages/components
|
|
102
|
-
Backend Interfaces: {count} APIs
|
|
103
|
-
Data Entities: {count} new, {count} modified
|
|
104
|
-
|
|
105
|
-
Output File: {filename}
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
### 3.2 Confirm 5 Questions
|
|
109
|
-
|
|
110
|
-
**HARD STOP** — Wait for user confirmation on:
|
|
111
|
-
|
|
112
|
-
1. Is the frontend prototype appropriate? (if applicable)
|
|
113
|
-
2. Is the backend logic flow correct and complete?
|
|
114
|
-
3. Is the data model reasonable and extensible?
|
|
115
|
-
4. Are all business rules captured?
|
|
116
|
-
5. [Legacy Master-Sub] Is the module breakdown appropriate?
|
|
117
|
-
|
|
118
|
-
### 3.3 Update Checkpoint
|
|
119
|
-
|
|
120
|
-
Update `.checkpoints.json`:
|
|
121
|
-
```json
|
|
122
|
-
{
|
|
123
|
-
"feature_spec_review": {
|
|
124
|
-
"passed": true,
|
|
125
|
-
"confirmed_at": "{timestamp}",
|
|
126
|
-
"description": "Feature specification confirmed"
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## Step 4: Determine Output Path & Copy Template
|
|
134
|
-
|
|
135
|
-
### 4.1 Determine Output Path
|
|
136
|
-
|
|
137
|
-
| Mode | Path Pattern |
|
|
138
|
-
|------|--------------|
|
|
139
|
-
| Single Feature | `{iteration}/02.feature-design/{feature-id}-{feature-name}-feature-spec.md` |
|
|
140
|
-
| Legacy Single | `{iteration}/02.feature-design/[feature-name]-feature-spec.md` |
|
|
141
|
-
| Legacy Master-Sub | Multiple files (master + sub-specs) |
|
|
142
|
-
|
|
143
|
-
### 4.2 Copy Template
|
|
144
|
-
|
|
145
|
-
1. Read template: `speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md`
|
|
146
|
-
2. Replace top-level placeholders: `{Feature Name}`, `{Feature ID}`, etc.
|
|
147
|
-
3. **Create document** using `create_file` with template content
|
|
148
|
-
4. Verify complete section structure exists
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
## Step 5: Fill Sections Using search_replace
|
|
153
|
-
|
|
154
|
-
Map data sources to template sections:
|
|
155
|
-
|
|
156
|
-
| Template Section | Data Source |
|
|
157
|
-
|------------------|-------------|
|
|
158
|
-
| Feature Overview | `.feature-analysis.md` Feature Information + summary |
|
|
159
|
-
| Function Breakdown | `.feature-analysis.md` Function Breakdown |
|
|
160
|
-
| Frontend Design | `.feature-design-data.md` Frontend Design |
|
|
161
|
-
| Backend Design | `.feature-design-data.md` Backend Design |
|
|
162
|
-
| Data Model | `.feature-design-data.md` Data Model |
|
|
163
|
-
| Business Rules | `.feature-design-data.md` Business Rules |
|
|
164
|
-
| Cross-Module Interactions | `.feature-design-data.md` Cross-Module (if applicable) |
|
|
165
|
-
|
|
166
|
-
**Rules:**
|
|
167
|
-
- Use `search_replace` for each section individually
|
|
168
|
-
- Preserve all section titles and numbering
|
|
169
|
-
- No applicable content → replace placeholder with "N/A"
|
|
170
|
-
- Legacy Master-Sub: repeat Step 4+5 for each sub-spec
|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
|
-
## Step 6: Mermaid Diagram Compliance
|
|
175
|
-
|
|
176
|
-
Verify all Mermaid diagrams follow compatibility rules:
|
|
177
|
-
|
|
178
|
-
- Use only basic node definitions: `A[text content]`
|
|
179
|
-
- No HTML tags (e.g., `<br/>`)
|
|
180
|
-
- No nested subgraphs
|
|
181
|
-
- No `direction` keyword
|
|
182
|
-
- No `style` definitions
|
|
183
|
-
- Standard `graph TB/LR` or `sequenceDiagram` syntax only
|
|
184
|
-
|
|
185
|
-
Reference: `speccrew-workspace/docs/rules/mermaid-rule.md`
|
|
186
|
-
|
|
187
|
-
---
|
|
188
|
-
|
|
189
|
-
## Step 7: Update Checkpoints
|
|
190
|
-
|
|
191
|
-
Update `.checkpoints.json`:
|
|
192
|
-
- Set `feature_spec_review.passed = true`
|
|
193
|
-
- Set `confirmed_at` timestamp
|
|
194
|
-
- Preserve existing checkpoint states
|
|
195
|
-
|
|
196
|
-
---
|
|
197
|
-
|
|
198
|
-
# Reference Guides
|
|
199
|
-
|
|
200
|
-
## Legacy Mode Backward Compatibility
|
|
201
|
-
|
|
202
|
-
When `feature_id` is NOT provided:
|
|
203
|
-
|
|
204
|
-
**Single Feature Spec:**
|
|
205
|
-
```
|
|
206
|
-
02.feature-design/[feature-name]-feature-spec.md
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
**Master-Sub Feature Specs:**
|
|
210
|
-
```
|
|
211
|
-
02.feature-design/
|
|
212
|
-
├── [feature-name]-feature-spec.md # Master (overview + cross-module)
|
|
213
|
-
├── [feature-name]-sub-[module1]-spec.md # Sub: Module 1
|
|
214
|
-
└── [feature-name]-sub-[module2]-spec.md # Sub: Module 2
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
Master spec MUST include: overall overview, cross-module diagram, module list, interface contracts.
|
|
218
|
-
|
|
219
|
-
---
|
|
220
|
-
|
|
221
|
-
# Key Rules
|
|
222
|
-
|
|
223
|
-
| Rule | Description |
|
|
224
|
-
|------|-------------|
|
|
225
|
-
| **Template-First** | Copy template before filling content |
|
|
226
|
-
| **search_replace Only** | Never use `create_file` for section updates |
|
|
227
|
-
| **Checkpoint B** | Get user confirmation before writing files |
|
|
228
|
-
| **Mermaid Compliance** | Follow mermaid-rule.md guidelines |
|
|
229
|
-
| **Clear Markers** | Use [EXISTING]/[MODIFIED]/[NEW] consistently |
|
|
230
|
-
|
|
231
|
-
---
|
|
232
|
-
|
|
233
|
-
# Output Checklist
|
|
234
|
-
|
|
235
|
-
- [ ] Both input files verified and read
|
|
236
|
-
- [ ] Design summary built with statistics
|
|
237
|
-
- [ ] Checkpoint B passed (or skipped via flag)
|
|
238
|
-
- [ ] Output path determined
|
|
239
|
-
- [ ] Template copied using `create_file`
|
|
240
|
-
- [ ] All sections filled using `search_replace`
|
|
241
|
-
- [ ] Mermaid diagrams verified compliant
|
|
242
|
-
- [ ] `.checkpoints.json` updated
|
|
243
|
-
- [ ] [Legacy Master-Sub] All sub-specs generated
|