speccrew 0.7.30 → 0.7.31
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.
- package/.speccrew/agents/speccrew-feature-designer.md +46 -141
- package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +162 -42
- package/.speccrew/skills/speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md +22 -1
- package/.speccrew/skills/speccrew-fd-feature-design/workflow.agentflow.xml +204 -74
- package/.speccrew/skills/speccrew-feature-designer-orchestration/workflow.agentflow.xml +17 -88
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ You are in the **second stage** of the complete engineering closed loop:
|
|
|
13
13
|
|
|
14
14
|
Your core task is to **bridge requirements and implementation**: based on the user scenarios described in the PRD, design the system's UI prototypes, interaction flows, backend processing logic, and data access schemes, without delving into specific technical implementation details.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
## Quick Reference — Execution Flow
|
|
17
17
|
|
|
18
18
|
```
|
|
19
19
|
Phase 0: Stage Gate
|
|
@@ -26,18 +26,12 @@ Phase 2: Load Feature List
|
|
|
26
26
|
└── Read .prd-feature-list.json → Verify structure
|
|
27
27
|
└── Write .checkpoints.json → HARD STOP (user confirms Feature List)
|
|
28
28
|
↓
|
|
29
|
-
Phase 3: Feature Design
|
|
30
|
-
└──
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
│ └── Output: .feature-analysis.md per Feature
|
|
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
|
|
29
|
+
Phase 3: Feature Design (Unified Analysis + Design)
|
|
30
|
+
└── 1 Feature? → Direct skill invocation (with Checkpoint A & B)
|
|
31
|
+
└── 2+ Features? → Batch dispatch workers (6/batch, skip_analysis_checkpoint=true)
|
|
32
|
+
└── Output: {feature-id}-{feature-name}-feature-spec.md per Feature
|
|
38
33
|
└── 3c: Confirm (HARD STOP for multi-Feature)
|
|
39
|
-
└──
|
|
40
|
-
└── 2+ Features? → Agent presents batch summary → HARD STOP
|
|
34
|
+
└── Agent presents batch summary → HARD STOP
|
|
41
35
|
↓
|
|
42
36
|
Phase 4: API Contract Generation
|
|
43
37
|
└── Dispatch API Contract workers (same batch pattern)
|
|
@@ -53,8 +47,7 @@ Phase 4: API Contract Generation
|
|
|
53
47
|
| Phase 0 | STAGE GATE | PRD must be confirmed before starting. If not → STOP |
|
|
54
48
|
| Phase 2 | HARD STOP | Feature List must be confirmed by user before Phase 3 |
|
|
55
49
|
| Phase 2 | FILE REQUIRED | `.prd-feature-list.json` must exist. If missing → STOP |
|
|
56
|
-
| Phase
|
|
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 |
|
|
50
|
+
| Phase 3 | SKILL-ONLY | Design workers MUST use speccrew-fd-feature-design skill. Agent MUST NOT design features or write Feature Spec documents itself |
|
|
58
51
|
| Phase 3c | HARD STOP (multi) | For 2+ Features: Agent MUST present batch summary and wait for user confirmation after Feature Specs are generated |
|
|
59
52
|
| Phase 4 | SKILL-ONLY | API Contract workers MUST use speccrew-fd-api-contract skill |
|
|
60
53
|
| Phase 4 | HARD STOP | Joint Confirmation must be confirmed by user before finalizing |
|
|
@@ -82,13 +75,11 @@ This agent MAY directly create/modify ONLY the following files:
|
|
|
82
75
|
|
|
83
76
|
### FORBIDDEN Actions (When Features ≥ 2)
|
|
84
77
|
|
|
85
|
-
1. ❌ DO NOT invoke `speccrew-fd-feature-
|
|
86
|
-
2. ❌ DO NOT invoke `speccrew-fd-
|
|
87
|
-
3. ❌ DO NOT
|
|
88
|
-
4. ❌ DO NOT generate `.
|
|
89
|
-
5. ❌ DO NOT
|
|
90
|
-
6. ❌ DO NOT generate `.api-contract.md` files yourself
|
|
91
|
-
7. ❌ DO NOT create any document content as fallback if worker fails
|
|
78
|
+
1. ❌ DO NOT invoke `speccrew-fd-feature-design` skill directly
|
|
79
|
+
2. ❌ DO NOT invoke `speccrew-fd-api-contract` skill directly
|
|
80
|
+
3. ❌ DO NOT generate `.feature-spec.md` files yourself
|
|
81
|
+
4. ❌ DO NOT generate `.api-contract.md` files yourself
|
|
82
|
+
5. ❌ DO NOT create any document content as fallback if worker fails
|
|
92
83
|
|
|
93
84
|
### Violation Recovery
|
|
94
85
|
|
|
@@ -172,7 +163,7 @@ This agent MUST execute tasks continuously without unnecessary interruptions.
|
|
|
172
163
|
> - When resuming, read DISPATCH-PROGRESS.json and continue from where you left off
|
|
173
164
|
>
|
|
174
165
|
> **Phase Transition Rule:**
|
|
175
|
-
> Phase
|
|
166
|
+
> Phase 4 CANNOT start until DISPATCH-PROGRESS.json shows counts.pending == 0 for Phase 3.
|
|
176
167
|
> This is a programmatic check, not a suggestion.
|
|
177
168
|
|
|
178
169
|
## ABORT CONDITIONS
|
|
@@ -181,7 +172,7 @@ This agent MUST execute tasks continuously without unnecessary interruptions.
|
|
|
181
172
|
|
|
182
173
|
1. **Skill Invocation Failure**: Any skill call returns error → STOP. Do NOT generate content manually.
|
|
183
174
|
2. **Script Execution Failure**: `node ... update-progress.js` fails → STOP. Do NOT manually create/edit JSON files.
|
|
184
|
-
3. **Missing Intermediate Artifacts**:
|
|
175
|
+
3. **Missing Intermediate Artifacts**: Feature Spec output missing before Phase 4 → STOP.
|
|
185
176
|
4. **User Rejection**: User rejects Feature List, batch design summary, or Joint Confirmation → STOP, ask for specific revision requirements.
|
|
186
177
|
5. **Worker Batch Failure**: If >50% workers in a batch fail → STOP entire batch, report to user.
|
|
187
178
|
|
|
@@ -462,7 +453,7 @@ When involving related business domains, read `{workspace_path}/knowledges/bizs/
|
|
|
462
453
|
- Technical architecture documents (handled by speccrew-system-designer)
|
|
463
454
|
- Code conventions (handled by speccrew-system-designer/speccrew-dev)
|
|
464
455
|
|
|
465
|
-
## Phase 3: Feature Design
|
|
456
|
+
## Phase 3: Feature Design (Unified Analysis + Design)
|
|
466
457
|
|
|
467
458
|
> ⚠️ **WORKER ENFORCEMENT REMINDER:**
|
|
468
459
|
> Multiple items detected → MUST dispatch speccrew-task-worker.
|
|
@@ -476,16 +467,23 @@ When involving related business domains, read `{workspace_path}/knowledges/bizs/
|
|
|
476
467
|
> - ❌ "I'll demonstrate the workflow with a few examples first"
|
|
477
468
|
>
|
|
478
469
|
> **MANDATORY:** Process ALL features where status = "pending". No exceptions.
|
|
479
|
-
> Phase
|
|
470
|
+
> Phase 4 CANNOT start until Phase 3 counts.pending == 0.
|
|
480
471
|
|
|
481
472
|
> ⚠️ **MANDATORY RULES FOR PHASE 3:**
|
|
482
473
|
> 1. **DO NOT ask user which strategy to use** — the strategy is determined by Phase 2 extraction results.
|
|
483
474
|
> 2. **DO NOT invoke skills directly** when there are multiple Features. You MUST dispatch `speccrew-task-worker` agents.
|
|
484
|
-
> 3. **Dispatch granularity is PER FEATURE, not per module.** Each Feature gets its own worker
|
|
475
|
+
> 3. **Dispatch granularity is PER FEATURE, not per module.** Each Feature gets its own worker.
|
|
485
476
|
> 4. **DO NOT generate Feature Spec documents yourself.** Your role is to DISPATCH workers.
|
|
486
|
-
> 5. **Phase
|
|
487
|
-
|
|
488
|
-
|
|
477
|
+
> 5. **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.
|
|
478
|
+
|
|
479
|
+
**Purpose**: Transform PRD requirements into complete Feature Spec documents in a single pass (unified analysis + design + document generation).
|
|
480
|
+
|
|
481
|
+
**Skill**: `speccrew-fd-feature-design/SKILL.md`
|
|
482
|
+
|
|
483
|
+
> 🛑 **PHASE 3 MANDATORY COMPLETION RULE**
|
|
484
|
+
> You MUST process ALL features with status = "pending".
|
|
485
|
+
> DO NOT skip any feature regardless of total count.
|
|
486
|
+
> DO NOT proceed to Phase 4 until Phase 3 counts.pending == 0.
|
|
489
487
|
|
|
490
488
|
### Prepare Task List for Dispatch
|
|
491
489
|
|
|
@@ -550,22 +548,11 @@ Before initializing DISPATCH-PROGRESS.json, extract feature IDs from `.prd-featu
|
|
|
550
548
|
|
|
551
549
|
---
|
|
552
550
|
|
|
553
|
-
###
|
|
554
|
-
|
|
555
|
-
**Purpose**: Decompose PRD requirements into implementable functions with system relationship markers.
|
|
556
|
-
|
|
557
|
-
**Skill**: `speccrew-fd-feature-analyze/SKILL.md`
|
|
558
|
-
|
|
559
|
-
> 🛑 **PHASE 3a MANDATORY COMPLETION RULE**
|
|
560
|
-
> You MUST process ALL features with status = "pending".
|
|
561
|
-
> DO NOT skip any feature regardless of total count.
|
|
562
|
-
> DO NOT proceed to Phase 3b until Phase 3a counts.pending == 0.
|
|
563
|
-
|
|
564
|
-
#### Single Feature (Direct Invocation)
|
|
551
|
+
### Single Feature (Direct Invocation)
|
|
565
552
|
|
|
566
553
|
If only **1 Feature** in registry:
|
|
567
554
|
|
|
568
|
-
- Skill path: `speccrew-fd-feature-
|
|
555
|
+
- Skill path: `speccrew-fd-feature-design/SKILL.md`
|
|
569
556
|
- Parameters:
|
|
570
557
|
- `prd_path`: Path to the Sub-PRD document
|
|
571
558
|
- `feature_id`: Feature ID (e.g., `F-CRM-01`)
|
|
@@ -573,94 +560,14 @@ If only **1 Feature** in registry:
|
|
|
573
560
|
- `feature_type`: `Page+API` or `API-only`
|
|
574
561
|
- `iteration_id`: Current iteration identifier
|
|
575
562
|
- `frontend_platforms`: List of frontend platforms from techs-manifest
|
|
576
|
-
-
|
|
577
|
-
|
|
578
|
-
#### Multiple Features (Worker Dispatch)
|
|
579
|
-
|
|
580
|
-
If **2+ Features** in registry:
|
|
581
|
-
|
|
582
|
-
> ⚠️ **DISPATCH PROMPT FORMAT REMINDER:**
|
|
583
|
-
> When dispatching Workers, the prompt MUST contain ONLY skill path + context data parameters.
|
|
584
|
-
> DO NOT include "执行要求", step sequences, or output directives.
|
|
585
|
-
> Worker will read the skill's workflow.agentflow.xml for its execution plan.
|
|
586
|
-
> See: MANDATORY: Worker Dispatch Prompt Format section above.
|
|
587
|
-
|
|
588
|
-
1. **Initialize DISPATCH-PROGRESS.json**:
|
|
589
|
-
|
|
590
|
-
> ⚠️ Use `--tasks-file` instead of `--tasks` to avoid PowerShell JSON parsing issues.
|
|
591
|
-
|
|
592
|
-
```bash
|
|
593
|
-
# Step 1: Write tasks JSON to temp file inside iteration directory
|
|
594
|
-
# Create .tasks-temp.json with the task array content
|
|
595
|
-
# Step 2: Initialize with --tasks-file
|
|
596
|
-
node {update_progress_script} init --file {iterations_dir}/{iteration}/02.feature-design/DISPATCH-PROGRESS.json --stage 02_feature_design_analyze --tasks-file {iterations_dir}/{iteration}/02.feature-design/.tasks-temp.json
|
|
597
|
-
# Step 3: Delete .tasks-temp.json after successful init
|
|
598
|
-
```
|
|
599
|
-
|
|
600
|
-
Example `.tasks-temp.json` content:
|
|
601
|
-
```json
|
|
602
|
-
[{"id":"F-CRM-01"},{"id":"F-CRM-02"},{"id":"F-CRM-03"}]
|
|
603
|
-
```
|
|
604
|
-
|
|
605
|
-
2. **Dispatch Workers** (batch of 6):
|
|
606
|
-
- Each worker receives:
|
|
607
|
-
- `skill_path`: `speccrew-fd-feature-analyze/SKILL.md`
|
|
608
|
-
- `context`:
|
|
609
|
-
- `workspace_path`: **Absolute path to speccrew-workspace directory** (MANDATORY for update-progress.js execution)
|
|
610
|
-
- `prd_path`: Path to Sub-PRD
|
|
611
|
-
- `feature_id`: Feature ID
|
|
612
|
-
- `feature_name`: Feature name — **MUST be the exact value from .checkpoints.json, used verbatim for output filename**
|
|
613
|
-
- `feature_type`: `Page+API` or `API-only`
|
|
614
|
-
- `iteration_id`: Current iteration
|
|
615
|
-
- `frontend_platforms`: Platform list
|
|
616
|
-
- `skip_checkpoint`: `true` (batch mode skips per-feature confirmation)
|
|
617
|
-
|
|
618
|
-
3. **Wait for batch completion**, update progress per worker
|
|
619
|
-
|
|
620
|
-
4. **All completed**: Agent presents function breakdown summary → **HARD STOP**
|
|
621
|
-
- Display summary table: Feature ID | Function Count | [EXISTING] | [MODIFIED] | [NEW]
|
|
622
|
-
- Ask user: "Does this function breakdown align with your understanding?"
|
|
623
|
-
- Wait for explicit confirmation before proceeding to Phase 3b
|
|
563
|
+
- `output_path`: `{iterations_dir}/{iteration}/02.feature-design/{feature-id}-{feature-name}-feature-spec.md`
|
|
564
|
+
- Checkpoint A & B handled inside skill (analysis confirmation + design confirmation)
|
|
624
565
|
|
|
625
|
-
**Output**: One
|
|
566
|
+
**Output**: One `{feature-id}-{feature-name}-feature-spec.md` per Feature
|
|
626
567
|
|
|
627
568
|
---
|
|
628
569
|
|
|
629
|
-
###
|
|
630
|
-
|
|
631
|
-
**Purpose**: Transform function decomposition into complete Feature Spec documents in a single pass (design + document generation).
|
|
632
|
-
**Prerequisite**: All Phase 3a outputs exist (`.feature-analysis.md` for each Feature)
|
|
633
|
-
|
|
634
|
-
### Phase 3b PRE-CONDITION (MANDATORY)
|
|
635
|
-
|
|
636
|
-
Before starting Phase 3b, MUST verify:
|
|
637
|
-
1. Read DISPATCH-PROGRESS.json for Phase 3a
|
|
638
|
-
2. Check: counts.pending == 0 AND counts.completed == counts.total
|
|
639
|
-
3. If NOT met: DO NOT proceed. Return to Phase 3a and process remaining features.
|
|
640
|
-
|
|
641
|
-
> 🛑 **PHASE 3b MANDATORY COMPLETION RULE**
|
|
642
|
-
> You MUST process ALL features with status = "pending".
|
|
643
|
-
> DO NOT skip any feature regardless of total count.
|
|
644
|
-
> DO NOT proceed to Phase 4 until Phase 3b counts.pending == 0.
|
|
645
|
-
|
|
646
|
-
**Skill**: `speccrew-fd-feature-design/SKILL.md`
|
|
647
|
-
|
|
648
|
-
#### Single Feature (Direct Invocation)
|
|
649
|
-
|
|
650
|
-
If only **1 Feature** in registry:
|
|
651
|
-
|
|
652
|
-
- Skill path: `speccrew-fd-feature-design/SKILL.md`
|
|
653
|
-
- Parameters:
|
|
654
|
-
- `feature_analysis_path`: Path to `.feature-analysis.md` from Phase 3a
|
|
655
|
-
- `prd_path`: Path to Sub-PRD
|
|
656
|
-
- `feature_id`: Feature ID
|
|
657
|
-
- `feature_name`: Feature name
|
|
658
|
-
- `feature_type`: `Page+API` or `API-only`
|
|
659
|
-
- `frontend_platforms`: Platform list
|
|
660
|
-
- `output_path`: `{iterations_dir}/{iteration}/02.feature-design/{feature-id}-{feature-name}-feature-spec.md`
|
|
661
|
-
- Checkpoint B handled inside skill (user confirmation before writing)
|
|
662
|
-
|
|
663
|
-
#### Multiple Features (Worker Dispatch)
|
|
570
|
+
### Multiple Features (Worker Dispatch)
|
|
664
571
|
|
|
665
572
|
> ⚠️ **DISPATCH PROMPT FORMAT REMINDER:**
|
|
666
573
|
> When dispatching Workers, the prompt MUST contain ONLY skill path + context data parameters.
|
|
@@ -668,7 +575,7 @@ If only **1 Feature** in registry:
|
|
|
668
575
|
> Worker will read the skill's workflow.agentflow.xml for its execution plan.
|
|
669
576
|
> See: MANDATORY: Worker Dispatch Prompt Format section above.
|
|
670
577
|
|
|
671
|
-
1. **Initialize DISPATCH-PROGRESS.json
|
|
578
|
+
1. **Initialize DISPATCH-PROGRESS.json**:
|
|
672
579
|
|
|
673
580
|
> ⚠️ Use `--tasks-file` instead of `--tasks` to avoid PowerShell JSON parsing issues.
|
|
674
581
|
|
|
@@ -690,14 +597,14 @@ If only **1 Feature** in registry:
|
|
|
690
597
|
- `skill_path`: `speccrew-fd-feature-design/SKILL.md`
|
|
691
598
|
- `context`:
|
|
692
599
|
- `workspace_path`: **Absolute path to speccrew-workspace directory** (MANDATORY for update-progress.js execution)
|
|
693
|
-
- `feature_analysis_path`: Path to `.feature-analysis.md`
|
|
694
600
|
- `prd_path`: Path to Sub-PRD
|
|
695
601
|
- `feature_id`: Feature ID
|
|
696
602
|
- `feature_name`: Feature name — **MUST be the exact value from .checkpoints.json, used verbatim for output filename**
|
|
697
603
|
- `feature_type`: `Page+API` or `API-only`
|
|
604
|
+
- `iteration_id`: Current iteration
|
|
698
605
|
- `frontend_platforms`: Platform list
|
|
699
606
|
- `output_path`: Path for final spec
|
|
700
|
-
- `
|
|
607
|
+
- `skip_analysis_checkpoint`: `true` (batch mode — skips Checkpoint A, proceeds directly to design)
|
|
701
608
|
|
|
702
609
|
3. **Wait for batch completion**, update progress per worker
|
|
703
610
|
|
|
@@ -768,32 +675,30 @@ Total Features: {N}
|
|
|
768
675
|
|
|
769
676
|
### Phase 3 Error Handling
|
|
770
677
|
|
|
771
|
-
When any worker
|
|
678
|
+
When any worker reports failure:
|
|
772
679
|
|
|
773
|
-
1. **
|
|
774
|
-
|
|
775
|
-
2. **Update status**: Set the failed feature's status in `.checkpoints.json`:
|
|
680
|
+
1. **Update status**:
|
|
776
681
|
```bash
|
|
777
|
-
node {update_progress_script} update-task --file {iterations_dir}/{iteration}/02.feature-design/DISPATCH-PROGRESS.json --task-id {feature_id} --status failed --error "
|
|
682
|
+
node {update_progress_script} update-task --file {iterations_dir}/{iteration}/02.feature-design/DISPATCH-PROGRESS.json --task-id {feature_id} --status failed --error "{error_message}"
|
|
778
683
|
```
|
|
779
684
|
|
|
780
|
-
|
|
685
|
+
2. **Continue batch**: Do NOT stop entire batch for single failure. Complete remaining workers.
|
|
781
686
|
|
|
782
|
-
|
|
687
|
+
3. **Report to user**:
|
|
783
688
|
```
|
|
784
|
-
📊 Phase
|
|
689
|
+
📊 Phase 3 (Feature Design) — Batch complete: {success}/{total} succeeded, {failed} failed
|
|
785
690
|
├── ✅ F-SYS-01, F-SYS-02, F-SYS-03, F-SYS-04, F-MEMBER-01
|
|
786
691
|
└── ❌ F-MEMBER-02: [error description]
|
|
787
692
|
|
|
788
693
|
Retry failed features? (yes/skip/abort)
|
|
789
694
|
```
|
|
790
695
|
|
|
791
|
-
|
|
792
|
-
- If user says "yes" → Re-dispatch failed features in next batch
|
|
793
|
-
- If user says "skip" → Mark as `skipped`, continue to
|
|
696
|
+
4. **Retry strategy**:
|
|
697
|
+
- If user says "yes" → Re-dispatch failed features in next batch
|
|
698
|
+
- If user says "skip" → Mark as `skipped`, continue to Phase 3c with partial results
|
|
794
699
|
- If user says "abort" → STOP workflow, report partial results
|
|
795
700
|
|
|
796
|
-
|
|
701
|
+
5. **Batch failure threshold**: If >50% workers in a batch fail → STOP entire workflow, report to user
|
|
797
702
|
|
|
798
703
|
## Phase 4: API Contract Generation
|
|
799
704
|
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: speccrew-fd-feature-design
|
|
3
|
-
description: Feature
|
|
3
|
+
description: Unified Feature Analysis & Design SOP. Performs complete feature analysis (read PRD, load system knowledge, function breakdown with [NEW]/[MODIFIED]/[EXISTING] markers) followed by detailed design (frontend/backend/data) and generates complete Feature Spec document using template-first workflow. Combines analysis and design in a single unified workflow without producing intermediate analysis artifacts. Use when Feature Designer needs to analyze PRD requirements and produce Feature Spec in one pass.
|
|
4
4
|
tools: Read, Write, Glob, Grep, search_replace
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Methodology Foundation
|
|
8
8
|
|
|
9
|
-
ISA-95 Stages
|
|
9
|
+
This skill applies ISA-95 Stages 1-6 as an internal thinking framework:
|
|
10
10
|
|
|
11
|
-
| Stage |
|
|
12
|
-
|
|
13
|
-
| Stage
|
|
14
|
-
| Stage
|
|
15
|
-
| Stage
|
|
11
|
+
| ISA-95 Stage | Phase | Purpose |
|
|
12
|
+
|--------------|-------|---------|
|
|
13
|
+
| Stage 1: Domain Description | Analysis | Understand business context, scope boundaries, glossary |
|
|
14
|
+
| Stage 2: Information Flows | Analysis | Identify data sources, destinations, and cross-module exchanges |
|
|
15
|
+
| Stage 3: Categories of Information | Analysis | Classify data entities and establish information hierarchy |
|
|
16
|
+
| Stage 4: Information Flows | Design | Map cross-module data flows, identify API endpoints |
|
|
17
|
+
| Stage 5: Categories of Information | Design | Classify data entities, build data dictionary |
|
|
18
|
+
| Stage 6: Information Descriptions | Design | Define validation rules, output standards, traceability |
|
|
16
19
|
|
|
17
20
|
> No separate modeling documents. Methodology guides thinking quality.
|
|
18
21
|
|
|
19
22
|
# Trigger Scenarios
|
|
20
23
|
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
+
- PRD has been confirmed, user requests to start feature analysis and design
|
|
25
|
+
- Feature Designer Agent needs to analyze PRD and produce Feature Spec in one pass
|
|
26
|
+
- User asks "Design this feature" or "Analyze and design this requirement"
|
|
24
27
|
|
|
25
28
|
## AgentFlow Definition
|
|
26
29
|
|
|
@@ -30,11 +33,24 @@ ISA-95 Stages 4-6 as internal thinking framework:
|
|
|
30
33
|
|
|
31
34
|
## Workflow
|
|
32
35
|
|
|
36
|
+
**MANDATORY:**
|
|
37
|
+
- **Business Perspective Only** — Feature Analysis is a PURE BUSINESS document. It describes WHAT the system does from a business/user perspective, NOT HOW it's technically implemented.
|
|
38
|
+
- **Mermaid for all diagrams** — ALL business flows, interaction sequences, and cross-function flows MUST use Mermaid syntax (`flowchart TB`, `sequenceDiagram`). Plain text ASCII flowcharts are FORBIDDEN.
|
|
39
|
+
|
|
33
40
|
## Absolute Constraints
|
|
34
41
|
|
|
42
|
+
> **Violation = task failure**
|
|
43
|
+
|
|
35
44
|
**ABORT CONDITIONS:**
|
|
36
|
-
-
|
|
45
|
+
- PRD document missing → HARD STOP
|
|
37
46
|
- Template file missing → HARD STOP
|
|
47
|
+
- System overview missing → HARD STOP
|
|
48
|
+
|
|
49
|
+
1. **FORBIDDEN: Script execution failure** — If `update-progress.js` fails, HARD STOP and report error
|
|
50
|
+
2. **FORBIDDEN: Hand-written `.checkpoints.json`** — ALWAYS use `update-progress.js` script
|
|
51
|
+
3. **FORBIDDEN: Skip Checkpoint A** — User confirmation required before proceeding to design phase (unless `skip_analysis_checkpoint=true`)
|
|
52
|
+
4. **FORBIDDEN: Skip Checkpoint B** — User confirmation required before generating documents (unless `skip_checkpoint=true`)
|
|
53
|
+
5. **FORBIDDEN: Rename features** — Output filename MUST use the exact `feature_name` parameter value. DO NOT translate, abbreviate, paraphrase, or substitute with alternative names found in PRD content. The `feature_name` parameter is the SINGLE SOURCE OF TRUTH for file naming.
|
|
38
54
|
|
|
39
55
|
⛔ **ABSOLUTE PROHIBITION — Phase B Content Filling:**
|
|
40
56
|
- NEVER use `create_file` to rewrite or recreate the document after Step 5 skeleton creation
|
|
@@ -46,45 +62,130 @@ ISA-95 Stages 4-6 as internal thinking framework:
|
|
|
46
62
|
- Template-first workflow — Step 5 (copy template) MUST precede Step 6 (fill content)
|
|
47
63
|
- **Mermaid for all diagrams** — ALL interaction flows, processing logic flows, and cross-function sequences MUST use Mermaid syntax (`sequenceDiagram`, `flowchart TD`). Plain text ASCII flowcharts are FORBIDDEN for these sections. Reference: `speccrew-workspace/docs/rules/mermaid-rule.md`.
|
|
48
64
|
|
|
49
|
-
**NOTE:**
|
|
65
|
+
**NOTE:** Analysis and design process is internal — no intermediate analysis or design-data files are produced.
|
|
50
66
|
|
|
51
67
|
**FORBIDDEN: Rename features** — Output filename MUST use the exact `feature_name` parameter value. DO NOT translate, abbreviate, paraphrase, or substitute with names derived from analysis content. The `feature_name` parameter is the SINGLE SOURCE OF TRUTH for file naming.
|
|
52
68
|
|
|
53
|
-
## Step 0:
|
|
54
|
-
|
|
55
|
-
### Step 0 Input Parameters
|
|
69
|
+
## Step 0: Input Parameters
|
|
56
70
|
|
|
57
71
|
| Parameter | Required | Description |
|
|
58
72
|
|-----------|----------|-------------|
|
|
59
|
-
| `feature_analysis_path` | Yes | Path to `.feature-analysis.md` |
|
|
60
73
|
| `prd_path` | Yes | Path to the Sub-PRD document |
|
|
61
74
|
| `feature_id` | No | Feature identifier (e.g., `F-CRM-01`) |
|
|
62
|
-
| `feature_name` | No | Feature name in English |
|
|
75
|
+
| `feature_name` | No | Feature name in English (e.g., `customer-list`) |
|
|
63
76
|
| `feature_type` | No | `Page+API` or `API-only` |
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
77
|
+
| `iteration_id` | No | Current iteration identifier |
|
|
78
|
+
| `frontend_platforms` | No | List of frontend platforms (auto-discover if not provided) |
|
|
79
|
+
| `skip_analysis_checkpoint` | No | Boolean, default `false`. Skip Checkpoint A if `true` (batch mode) |
|
|
66
80
|
| `skip_checkpoint` | No | Boolean, default `false`. Skip Checkpoint B if `true` (batch mode) |
|
|
81
|
+
| `output_path` | No | Custom output path for Feature Spec (auto-generated if not provided) |
|
|
82
|
+
|
|
83
|
+
## Step 0.1: Read PRD Input
|
|
84
|
+
|
|
85
|
+
### 0.1.1 Read PRD
|
|
86
|
+
|
|
87
|
+
Read the PRD document at `{prd_path}` (typically `speccrew-workspace/iterations/{number}-{type}-{name}/01.product-requirement/[module-name]-prd.md`)
|
|
88
|
+
|
|
89
|
+
### 0.1.2 Focus on Specific Feature (when feature_id provided)
|
|
90
|
+
|
|
91
|
+
If `feature_id` is provided:
|
|
92
|
+
- Locate the specific Feature in PRD Section 3.4 "Feature Breakdown"
|
|
93
|
+
- Extract only the user stories and requirements related to this Feature
|
|
94
|
+
- Ignore other Features in the same PRD
|
|
95
|
+
|
|
96
|
+
### 0.1.3 Backward Compatibility (when feature_id not provided)
|
|
97
|
+
|
|
98
|
+
If `feature_id` is NOT provided, process entire PRD using legacy mode.
|
|
99
|
+
|
|
100
|
+
## Step 0.2: Load System Knowledge
|
|
101
|
+
|
|
102
|
+
### 0.2.1 Read System Overview
|
|
103
|
+
|
|
104
|
+
Read: `speccrew-workspace/knowledges/bizs/system-overview.md`
|
|
105
|
+
|
|
106
|
+
### 0.2.2 Load Related Module Overviews
|
|
107
|
+
|
|
108
|
+
Based on PRD content, identify related modules and read:
|
|
109
|
+
```
|
|
110
|
+
speccrew-workspace/knowledges/bizs/{module-name}/{module-name}-overview.md
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### 0.2.3 Discover Frontend Platforms
|
|
114
|
+
|
|
115
|
+
Read `speccrew-workspace/knowledges/techs/techs-manifest.json` to identify frontend platforms:
|
|
116
|
+
|
|
117
|
+
| Platform Type | Examples |
|
|
118
|
+
|---------------|----------|
|
|
119
|
+
| `web-*` | web-vue, web-react |
|
|
120
|
+
| `mobile-*` | mobile-uniapp, mobile-flutter |
|
|
121
|
+
|
|
122
|
+
- If `frontend_platforms` parameter provided, use that list
|
|
123
|
+
- Otherwise, read techs-manifest.json directly
|
|
67
124
|
|
|
68
|
-
###
|
|
125
|
+
### 0.2.4 Query Knowledge Graph (Optional)
|
|
69
126
|
|
|
70
|
-
|
|
71
|
-
2. Verify Checkpoint A: `function_decomposition.passed == true`
|
|
72
|
-
3. IF not passed → ABORT: `ERROR: Checkpoint A not passed. Run speccrew-fd-feature-analysis first.`
|
|
73
|
-
4. Extract key data:
|
|
74
|
-
- `feature_id`: From analysis file or parameter
|
|
75
|
-
- `feature_name`: From analysis file or parameter
|
|
76
|
-
- `feature_type`: From analysis file or parameter (`Page+API` or `API-only`)
|
|
77
|
-
- `functions[]`: Function breakdown list
|
|
78
|
-
- `platforms[]`: Frontend platforms list
|
|
127
|
+
If cross-module relationships need analysis, use `speccrew-knowledge-graph-query` skill.
|
|
79
128
|
|
|
80
|
-
|
|
129
|
+
## Step 0.3: Function Breakdown
|
|
130
|
+
|
|
131
|
+
Break down PRD functional requirements into implementable system functions.
|
|
132
|
+
|
|
133
|
+
### 0.3.1 Feature-Based Decomposition (when feature_id provided)
|
|
134
|
+
|
|
135
|
+
When processing a single Feature:
|
|
136
|
+
|
|
137
|
+
1. **Extract Feature Scope**: From PRD Section 3.4, locate the specific Feature by `feature_id`
|
|
138
|
+
2. **Identify Related User Stories**: Extract only user stories mapped to this Feature
|
|
139
|
+
3. **Decompose into Functions**: Break down into 3-8 focused Functions
|
|
140
|
+
4. **Check feature_type**: Mark `API-only` for backend-only design
|
|
141
|
+
|
|
142
|
+
### 0.3.2 Full PRD Decomposition (backward compatibility)
|
|
143
|
+
|
|
144
|
+
When `feature_id` is NOT provided (legacy mode):
|
|
145
|
+
- Decompose entire PRD into all required Functions
|
|
146
|
+
- May result in 10-20 Functions for complex modules
|
|
147
|
+
|
|
148
|
+
### 0.3.3 Function Analysis
|
|
149
|
+
|
|
150
|
+
For each function, identify:
|
|
151
|
+
|
|
152
|
+
| Aspect | Analysis Content |
|
|
153
|
+
|--------|------------------|
|
|
154
|
+
| **Frontend Changes** | New pages, components, or modifications to existing UI |
|
|
155
|
+
| **Backend Changes** | New interfaces or modifications to existing logic |
|
|
156
|
+
| **Data Changes** | New data structures or modifications to existing data |
|
|
157
|
+
| **System Relationship** | How this relates to existing system capabilities |
|
|
158
|
+
|
|
159
|
+
### Mark Relationship to Existing System
|
|
160
|
+
|
|
161
|
+
| Marker | Meaning | Example |
|
|
162
|
+
|--------|---------|---------|
|
|
163
|
+
| `[EXISTING]` | Reuse current system capability | `[EXISTING] User authentication system` |
|
|
164
|
+
| `[MODIFIED]` | Enhance/change existing feature | `[MODIFIED] Add validation to user profile form` |
|
|
165
|
+
| `[NEW]` | Create brand new functionality | `[NEW] Order management module` |
|
|
166
|
+
|
|
167
|
+
## Step 0.4: Checkpoint A — Function Breakdown Confirmation
|
|
168
|
+
|
|
169
|
+
**Conditional Execution:** If `skip_analysis_checkpoint=true`, skip user confirmation and proceed to Step 1.
|
|
170
|
+
|
|
171
|
+
If `skip_analysis_checkpoint=false` (default):
|
|
172
|
+
1. Present function breakdown with [EXISTING]/[MODIFIED]/[NEW] markers to user
|
|
173
|
+
2. Ask: "Does this function breakdown align with your understanding of the requirements?"
|
|
174
|
+
3. **HARD STOP** — Wait for user confirmation before proceeding
|
|
175
|
+
|
|
176
|
+
### Checkpoint A Progress Update
|
|
177
|
+
|
|
178
|
+
After user confirms (or if skipped):
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
node speccrew-workspace/scripts/update-progress.js write-checkpoint \
|
|
182
|
+
--file speccrew-workspace/iterations/{iteration_id}/02.feature-design/.checkpoints.json \
|
|
183
|
+
--stage 02_feature_design \
|
|
184
|
+
--checkpoint function_decomposition \
|
|
185
|
+
--passed true
|
|
186
|
+
```
|
|
81
187
|
|
|
82
|
-
|
|
83
|
-
2. Compare with `feature_name` parameter
|
|
84
|
-
3. If different:
|
|
85
|
-
- Log: "⚠️ Name discrepancy: parameter='{feature_name}', analysis='{analysis_name}'"
|
|
86
|
-
- Continue with `feature_name` parameter value for all file naming
|
|
87
|
-
- Use the analysis file's actual content (not its filename) for design work
|
|
188
|
+
Log: "✅ Checkpoint A (function_decomposition) passed and recorded"
|
|
88
189
|
|
|
89
190
|
## Step 1: Frontend Design
|
|
90
191
|
|
|
@@ -379,7 +480,7 @@ Log: "✅ Checkpoint B (feature_design_review) passed and recorded"
|
|
|
379
480
|
### Phase A: Skeleton Construction (BEFORE any content filling)
|
|
380
481
|
|
|
381
482
|
1. Read FEATURE-SPEC-TEMPLATE.md to identify the complete section structure
|
|
382
|
-
2. Count the number of functions from
|
|
483
|
+
2. Count the number of functions from Step 0.3 function breakdown results
|
|
383
484
|
3. For Section 2 Function Details, replicate the template's Function block structure for EACH function:
|
|
384
485
|
- Copy the EXACT template structure (all 4 sub-sections) from FEATURE-SPEC-TEMPLATE.md
|
|
385
486
|
- Create `### 2.1 Function: {function_name}` through `### 2.N Function: {function_name}`
|
|
@@ -467,8 +568,9 @@ This rule has ZERO exceptions. "Document too long" is NOT a valid reason to swit
|
|
|
467
568
|
|
|
468
569
|
| Template Section | Data Source |
|
|
469
570
|
|------------------|-------------|
|
|
470
|
-
|
|
|
471
|
-
| 1.
|
|
571
|
+
| 0. Feature Analysis Summary | Step 0.3 Function Breakdown results (internal memory) |
|
|
572
|
+
| 1. Overview (Basic Information, Feature Scope) | PRD Feature Information + Step 0 analysis summary |
|
|
573
|
+
| 1.3 Relationship to Existing System | Step 0.3 System Relationship markers |
|
|
472
574
|
| 2. Function Details | Step 1 Frontend Design + Step 2 Backend Design results (internal) |
|
|
473
575
|
| 2.1.x Frontend Prototype | Step 1.1 UI Prototype results |
|
|
474
576
|
| 2.1.x Interaction Flow | Step 1.3 Interaction Flow results |
|
|
@@ -556,9 +658,17 @@ Where:
|
|
|
556
658
|
|
|
557
659
|
| Rule | Description |
|
|
558
660
|
|------|-------------|
|
|
661
|
+
| **Business Perspective Only (Analysis)** | Feature Analysis describes business capabilities and functional requirements. Every section must describe WHAT from user/business perspective |
|
|
559
662
|
| No Technology Decisions | Do NOT specify frameworks, databases, technologies |
|
|
560
663
|
| Focus on WHAT not HOW | Describe what system does, not how it's implemented |
|
|
561
664
|
| ASCII Wireframes Only | Use ASCII art for UI prototypes |
|
|
665
|
+
| **FORBIDDEN: Analysis File Paths** | Do NOT include any file paths, code paths, or directory structures (e.g., views/appointment/AppointmentIndex.vue, yudao-module-appointment/...) |
|
|
666
|
+
| **FORBIDDEN: Framework Code in Analysis** | Do NOT include code snippets in any language — no Java classes, SQL DDL/DML, Vue templates, TypeScript API code, HTML markup, annotations (@PreAuthorize, @OperateLog, @TableLogic, @TableName) |
|
|
667
|
+
| **FORBIDDEN: Framework/Library Names in Analysis** | Do NOT reference specific framework/library names as implementation details (MyBatis-Plus, MapStruct, Element Plus, wot-design-uni, ElDatePicker, wd-cell, BaseMapperX, etc.) |
|
|
668
|
+
| **FORBIDDEN: Database Artifacts in Analysis** | Do NOT include database table names (appointment_info), column names (customer_id, staff_id), SQL types (BIGINT, VARCHAR), indexes, or any SQL statements |
|
|
669
|
+
| **FORBIDDEN: Technical Types in Analysis** | Do NOT use programming language types (Long, String, Integer). Use business types: Text, Number, Date, Boolean, Enum, Identifier |
|
|
670
|
+
| **FORBIDDEN: ASCII Diagrams in Analysis** | Do NOT use plain text or ASCII art flowcharts. ALL diagrams MUST use Mermaid syntax |
|
|
671
|
+
| **Mermaid Required** | Use `flowchart TB` for business process flows, `sequenceDiagram` for interaction flows. Reference mermaid-rule.md for syntax compliance |
|
|
562
672
|
| **FORBIDDEN: File Paths** | Do NOT include any file paths, code paths, or directory structures (e.g., src/views/..., yudao-module-base/..., pages/...) |
|
|
563
673
|
| **FORBIDDEN: Framework Code** | Do NOT include actual code snippets in any language — no Java classes, SQL DDL/DML, Vue templates, TypeScript API code, HTML markup |
|
|
564
674
|
| **FORBIDDEN: Framework Names as Implementation** | Do NOT reference specific framework/library names as implementation choices (MyBatis-Plus, Flyway, Element Plus component names like el-button, wot-design-uni widget names like wd-cell) |
|
|
@@ -570,13 +680,23 @@ Where:
|
|
|
570
680
|
| Clear Markers | Use [EXISTING]/[MODIFIED]/[NEW] consistently |
|
|
571
681
|
| Template-First | Copy template before filling content |
|
|
572
682
|
| search_replace Only | Never use create_file for section updates after template copy |
|
|
683
|
+
| Checkpoint A | Get user confirmation on function breakdown before design (unless skipped) |
|
|
573
684
|
| Checkpoint B | Get user confirmation before writing files (unless skipped) |
|
|
574
|
-
| No Intermediate Files |
|
|
685
|
+
| No Intermediate Files | Analysis and design process is internal — do NOT output any intermediate analysis or design-data artifacts |
|
|
575
686
|
|
|
576
687
|
# Checklist
|
|
577
688
|
|
|
578
|
-
- [ ]
|
|
579
|
-
- [ ]
|
|
689
|
+
- [ ] PRD has been read, all P0 requirements covered
|
|
690
|
+
- [ ] **[Single Feature Mode]** Feature ID and name parameters received
|
|
691
|
+
- [ ] **[Single Feature Mode]** Only related Feature content extracted from PRD
|
|
692
|
+
- [ ] **[Legacy Mode]** All sub PRDs have been read (if master-sub structure)
|
|
693
|
+
- [ ] System overview loaded for context
|
|
694
|
+
- [ ] Related module overviews loaded
|
|
695
|
+
- [ ] **[Cross-module]** Knowledge graph queried for relationship analysis
|
|
696
|
+
- [ ] Function breakdown completed with [EXISTING]/[MODIFIED]/[NEW] markers
|
|
697
|
+
- [ ] **[Single Feature Mode]** 3-8 focused Functions defined
|
|
698
|
+
- [ ] Checkpoint A passed: function breakdown confirmed with user (or skipped)
|
|
699
|
+
- [ ] `.checkpoints.json` updated via script for Checkpoint A
|
|
580
700
|
- [ ] All input parameters resolved (feature_id, feature_name, feature_type)
|
|
581
701
|
- [ ] Template file `templates/FEATURE-SPEC-TEMPLATE.md` exists
|
|
582
702
|
- [ ] **[API-only]** Frontend design skipped
|
|
@@ -38,7 +38,7 @@ This Feature Spec is a PURE BUSINESS document describing WHAT the system does, N
|
|
|
38
38
|
|
|
39
39
|
✅ CORRECT (Business):
|
|
40
40
|
Shop List Page — displays all shops with search/filter, includes "Add Shop" button (visible to Admin role only)
|
|
41
|
-
|
|
41
|
+
---
|
|
42
42
|
|
|
43
43
|
> **Applicable Scenario**: System feature specification for a single feature or module
|
|
44
44
|
> **Target Audience**: speccrew-feature-designer, speccrew-designer, speccrew-dev
|
|
@@ -46,6 +46,27 @@ Shop List Page — displays all shops with search/filter, includes "Add Shop" bu
|
|
|
46
46
|
|
|
47
47
|
---
|
|
48
48
|
|
|
49
|
+
## 0. Feature Analysis Summary
|
|
50
|
+
|
|
51
|
+
<!-- AI-NOTE: Auto-populated during unified analyze+design workflow.
|
|
52
|
+
Serves as audit trail for the analysis phase. Can be removed in final delivery.
|
|
53
|
+
DO NOT use this section as substitute for Sections 1-6. -->
|
|
54
|
+
|
|
55
|
+
### 0.1 Function Breakdown
|
|
56
|
+
|
|
57
|
+
| # | Function Name | Type | System Relationship | Related User Stories |
|
|
58
|
+
|---|--------------|------|-------------------|---------------------|
|
|
59
|
+
| 1 | {function_name} | {Page+API/API-only} | {[NEW]/[MODIFIED]/[EXISTING]} | {stories} |
|
|
60
|
+
|
|
61
|
+
### 0.2 Summary Statistics
|
|
62
|
+
|
|
63
|
+
- **Total Functions**: {count}
|
|
64
|
+
- **[NEW]**: {count}
|
|
65
|
+
- **[MODIFIED]**: {count}
|
|
66
|
+
- **[EXISTING]**: {count}
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
49
70
|
## 1. Overview
|
|
50
71
|
|
|
51
72
|
### 1.1 Basic Information
|
|
@@ -5,97 +5,225 @@
|
|
|
5
5
|
Input Parameters Definition
|
|
6
6
|
============================================================ -->
|
|
7
7
|
<block type="input" id="I1" desc="Workflow input parameters">
|
|
8
|
-
<field name="feature_analysis_path" required="true" type="string" desc="Path to .feature-analysis.md"/>
|
|
9
8
|
<field name="prd_path" required="true" type="string" desc="Path to the Sub-PRD document"/>
|
|
10
9
|
<field name="feature_id" required="false" type="string" desc="Feature identifier, e.g., F-CRM-01"/>
|
|
11
|
-
<field name="feature_name" required="false" type="string" desc="Feature name in English"/>
|
|
10
|
+
<field name="feature_name" required="false" type="string" desc="Feature name in English, e.g., customer-list"/>
|
|
12
11
|
<field name="feature_type" required="false" type="string" desc="Page+API or API-only"/>
|
|
12
|
+
<field name="iteration_id" required="true" type="string" desc="Current iteration identifier"/>
|
|
13
13
|
<field name="frontend_platforms" required="false" type="array" desc="List of frontend platforms"/>
|
|
14
|
-
<field name="
|
|
14
|
+
<field name="skip_analysis_checkpoint" required="false" type="boolean" default="false" desc="Skip Checkpoint A if true"/>
|
|
15
15
|
<field name="skip_checkpoint" required="false" type="boolean" default="false" desc="Skip Checkpoint B if true"/>
|
|
16
|
-
<field name="
|
|
16
|
+
<field name="output_path" required="false" type="string" desc="Custom output path (auto-generated if not provided)"/>
|
|
17
17
|
<field name="workspace_path" required="true" type="string" desc="Absolute path to speccrew-workspace"/>
|
|
18
18
|
</block>
|
|
19
19
|
|
|
20
20
|
<!-- ============================================================
|
|
21
21
|
Global Constraints
|
|
22
22
|
============================================================ -->
|
|
23
|
-
<block type="rule" id="R1" level="forbidden" desc="
|
|
23
|
+
<block type="rule" id="R1" level="forbidden" desc="Script execution failure">
|
|
24
|
+
<field name="text">If update-progress.js fails, HARD STOP and report error</field>
|
|
25
|
+
</block>
|
|
26
|
+
|
|
27
|
+
<block type="rule" id="R2" level="forbidden" desc="Hand-written checkpoints">
|
|
28
|
+
<field name="text">ALWAYS use update-progress.js script for .checkpoints.json</field>
|
|
29
|
+
</block>
|
|
30
|
+
|
|
31
|
+
<block type="rule" id="R3" level="forbidden" desc="Skip Checkpoint A">
|
|
32
|
+
<field name="text">User confirmation required before proceeding (unless skip_analysis_checkpoint=true)</field>
|
|
33
|
+
</block>
|
|
34
|
+
|
|
35
|
+
<block type="rule" id="R4" level="forbidden" desc="Skip Checkpoint B">
|
|
36
|
+
<field name="text">User confirmation required before generating (unless skip_checkpoint=true)</field>
|
|
37
|
+
</block>
|
|
38
|
+
|
|
39
|
+
<block type="rule" id="R5" level="forbidden" desc="Rename features">
|
|
40
|
+
<field name="text">Output filename MUST use exact feature_name parameter value</field>
|
|
41
|
+
<field name="text">DO NOT translate, abbreviate, or substitute</field>
|
|
42
|
+
</block>
|
|
43
|
+
|
|
44
|
+
<block type="rule" id="R6" level="mandatory" desc="Business perspective only">
|
|
45
|
+
<field name="text">Feature Analysis is a PURE BUSINESS document</field>
|
|
46
|
+
<field name="text">Describes WHAT the system does, NOT HOW it's implemented</field>
|
|
47
|
+
</block>
|
|
48
|
+
|
|
49
|
+
<block type="rule" id="R7" level="forbidden" desc="Phase B Content Filling">
|
|
24
50
|
<field name="text">NEVER use create_file to rewrite document after skeleton creation</field>
|
|
25
51
|
<field name="text">NEVER abandon search_replace mid-way and switch to create_file</field>
|
|
26
52
|
<field name="text">MUST continue using search_replace for EVERY section</field>
|
|
27
53
|
</block>
|
|
28
54
|
|
|
29
|
-
<block type="rule" id="
|
|
55
|
+
<block type="rule" id="R8" level="mandatory" desc="Template-first workflow">
|
|
30
56
|
<field name="text">Step 5 (copy template) MUST precede Step 6 (fill content)</field>
|
|
31
57
|
</block>
|
|
32
58
|
|
|
33
|
-
<block type="rule" id="
|
|
59
|
+
<block type="rule" id="R9" level="mandatory" desc="Mermaid diagrams">
|
|
34
60
|
<field name="text">ALL interaction flows MUST use Mermaid syntax</field>
|
|
35
61
|
<field name="text">Plain text ASCII flowcharts are FORBIDDEN</field>
|
|
36
62
|
</block>
|
|
37
63
|
|
|
38
|
-
<block type="rule" id="R4" level="forbidden" desc="Rename features">
|
|
39
|
-
<field name="text">Output filename MUST use exact feature_name parameter value</field>
|
|
40
|
-
<field name="text">DO NOT translate, abbreviate, or substitute</field>
|
|
41
|
-
</block>
|
|
42
|
-
|
|
43
64
|
<!-- ============================================================
|
|
44
|
-
|
|
65
|
+
Sequence S0: Feature Analysis
|
|
45
66
|
============================================================ -->
|
|
46
|
-
<sequence id="
|
|
67
|
+
<sequence id="S0" name="Feature Analysis" status="pending" desc="Analyze PRD and produce function decomposition">
|
|
47
68
|
|
|
48
|
-
<!-- Step 0:
|
|
49
|
-
<block type="task" id="
|
|
50
|
-
<field name="path" value="${
|
|
51
|
-
<field name="output" var="
|
|
69
|
+
<!-- Step 0.1: Read PRD -->
|
|
70
|
+
<block type="task" id="B0_1" action="read-file" desc="Read PRD document">
|
|
71
|
+
<field name="path" value="${prd_path}"/>
|
|
72
|
+
<field name="output" var="prd_content"/>
|
|
52
73
|
</block>
|
|
53
74
|
|
|
54
|
-
<!-- Gateway: Validate
|
|
55
|
-
<block type="gateway" id="
|
|
56
|
-
test="${
|
|
57
|
-
<field name="message">
|
|
75
|
+
<!-- Gateway: Validate PRD exists -->
|
|
76
|
+
<block type="gateway" id="G0_1" mode="guard" desc="Verify PRD exists"
|
|
77
|
+
test="${prd_content} != null" fail-action="stop">
|
|
78
|
+
<field name="message">PRD document not found at: ${prd_path}</field>
|
|
58
79
|
</block>
|
|
59
80
|
|
|
60
|
-
<!-- Step 0.2:
|
|
61
|
-
<block type="task" id="
|
|
62
|
-
<field name="
|
|
63
|
-
<field name="
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
81
|
+
<!-- Step 0.2: Load System Knowledge -->
|
|
82
|
+
<block type="task" id="B0_2" action="read-file" desc="Read System Overview">
|
|
83
|
+
<field name="path">${workspace_path}/knowledges/bizs/system-overview.md</field>
|
|
84
|
+
<field name="output" var="system_overview"/>
|
|
85
|
+
</block>
|
|
86
|
+
|
|
87
|
+
<!-- Step 0.3: Load Related Module Overviews -->
|
|
88
|
+
<block type="task" id="B0_3" action="analyze" desc="Identify related modules from PRD">
|
|
89
|
+
<field name="input" value="${prd_content}"/>
|
|
90
|
+
<field name="analysis_rules">
|
|
91
|
+
- Extract module names mentioned in PRD
|
|
92
|
+
- Identify cross-module dependencies
|
|
93
|
+
- List related module overview files to read
|
|
68
94
|
</field>
|
|
69
|
-
<field name="output" var="
|
|
95
|
+
<field name="output" var="related_modules"/>
|
|
70
96
|
</block>
|
|
71
97
|
|
|
72
|
-
<!--
|
|
73
|
-
<block type="
|
|
74
|
-
|
|
75
|
-
|
|
98
|
+
<!-- Loop: Read related module overviews -->
|
|
99
|
+
<block type="loop" id="L0_1" over="${related_modules}" as="module" desc="Read related module overviews">
|
|
100
|
+
<block type="task" id="B0_4" action="read-file" desc="Read module overview">
|
|
101
|
+
<field name="path">${workspace_path}/knowledges/bizs/${module.name}/${module.name}-overview.md</field>
|
|
102
|
+
<field name="output" var="module_overview_${module.name}"/>
|
|
103
|
+
</block>
|
|
76
104
|
</block>
|
|
77
105
|
|
|
78
|
-
<!-- Step 0.
|
|
79
|
-
<block type="
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
106
|
+
<!-- Step 0.4: Discover Frontend Platforms -->
|
|
107
|
+
<block type="gateway" id="G0_2" mode="exclusive" desc="Get frontend platforms">
|
|
108
|
+
<branch test="${frontend_platforms} != null AND ${frontend_platforms.length} > 0" name="Use provided platforms">
|
|
109
|
+
<block type="event" id="E0_1" action="log" level="info" desc="Using provided platforms">
|
|
110
|
+
<field name="message">Using provided frontend platforms: ${frontend_platforms}</field>
|
|
111
|
+
</block>
|
|
112
|
+
</branch>
|
|
113
|
+
<branch default="true" name="Auto-discover from techs-manifest">
|
|
114
|
+
<block type="task" id="B0_5" action="read-file" desc="Read techs manifest">
|
|
115
|
+
<field name="path">${workspace_path}/knowledges/techs/techs-manifest.json</field>
|
|
116
|
+
<field name="output" var="techs_manifest"/>
|
|
117
|
+
</block>
|
|
118
|
+
<block type="task" id="B0_6" action="analyze" desc="Extract frontend platforms">
|
|
119
|
+
<field name="input" value="${techs_manifest}"/>
|
|
120
|
+
<field name="extraction_rules">
|
|
121
|
+
- Filter platforms with type web-* or mobile-*
|
|
122
|
+
- Extract platform identifiers
|
|
123
|
+
</field>
|
|
124
|
+
<field name="output" var="frontend_platforms"/>
|
|
125
|
+
</block>
|
|
126
|
+
</branch>
|
|
127
|
+
</block>
|
|
128
|
+
|
|
129
|
+
<!-- Step 0.5: Function Breakdown -->
|
|
130
|
+
<block type="gateway" id="G0_3" mode="exclusive" desc="Select decomposition mode">
|
|
131
|
+
<branch test="${feature_id} != null" name="Feature-based decomposition">
|
|
132
|
+
<block type="task" id="B0_7" action="analyze" desc="Extract specific Feature from PRD">
|
|
133
|
+
<field name="input" value="${prd_content}"/>
|
|
134
|
+
<field name="feature_id" value="${feature_id}"/>
|
|
135
|
+
<field name="analysis_rules">
|
|
136
|
+
- Locate Feature in PRD Section 3.4 Feature Breakdown
|
|
137
|
+
- Extract only user stories mapped to this Feature
|
|
138
|
+
- Decompose into 3-8 focused Functions
|
|
139
|
+
- Mark API-only if feature_type indicates
|
|
140
|
+
</field>
|
|
141
|
+
<field name="output" var="function_breakdown"/>
|
|
142
|
+
</block>
|
|
143
|
+
</branch>
|
|
144
|
+
<branch default="true" name="Full PRD decomposition">
|
|
145
|
+
<block type="task" id="B0_8" action="analyze" desc="Decompose entire PRD">
|
|
146
|
+
<field name="input" value="${prd_content}"/>
|
|
147
|
+
<field name="analysis_rules">
|
|
148
|
+
- Decompose entire PRD into all required Functions
|
|
149
|
+
- May result in 10-20 Functions for complex modules
|
|
150
|
+
</field>
|
|
151
|
+
<field name="output" var="function_breakdown"/>
|
|
152
|
+
</block>
|
|
153
|
+
</branch>
|
|
154
|
+
</block>
|
|
155
|
+
|
|
156
|
+
<!-- Step 0.6: Analyze Functions with System Markers -->
|
|
157
|
+
<block type="task" id="B0_9" action="analyze" desc="Analyze functions with system relationship markers">
|
|
158
|
+
<field name="input" value="${function_breakdown}">${system_overview}${related_modules}</field>
|
|
159
|
+
<field name="analysis_rules">
|
|
160
|
+
For each function, identify:
|
|
161
|
+
- Frontend Changes: New pages, components, or modifications
|
|
162
|
+
- Backend Changes: New interfaces or modifications
|
|
163
|
+
- Data Changes: New data structures or modifications
|
|
164
|
+
- System Relationship: [EXISTING], [MODIFIED], or [NEW]
|
|
165
|
+
</field>
|
|
166
|
+
<field name="output" var="analyzed_functions"/>
|
|
167
|
+
</block>
|
|
168
|
+
|
|
169
|
+
<!-- Checkpoint A: User Confirmation -->
|
|
170
|
+
<block type="gateway" id="G0_4" mode="exclusive" desc="Handle checkpoint A">
|
|
171
|
+
<branch test="${skip_analysis_checkpoint} == true" name="Skip confirmation">
|
|
172
|
+
<block type="event" id="E0_2" action="log" level="info" desc="Skipping checkpoint A">
|
|
173
|
+
<field name="message">skip_analysis_checkpoint=true, proceeding without user confirmation</field>
|
|
174
|
+
</block>
|
|
175
|
+
</branch>
|
|
176
|
+
<branch default="true" name="Request confirmation">
|
|
177
|
+
<block type="event" id="E0_3" action="confirm" title="Function Breakdown Confirmation - Checkpoint A" type="yesno" desc="Present function breakdown for confirmation">
|
|
178
|
+
<field name="preview">Function Breakdown (Total: ${analyzed_functions.count} functions):
|
|
179
|
+
|
|
180
|
+
${analyzed_functions.summary}
|
|
181
|
+
|
|
182
|
+
System Relationship Markers:
|
|
183
|
+
- [EXISTING]: ${analyzed_functions.existing_count} - Reuse existing capabilities
|
|
184
|
+
- [MODIFIED]: ${analyzed_functions.modified_count} - Enhance existing features
|
|
185
|
+
- [NEW]: ${analyzed_functions.new_count} - Create new functionality
|
|
186
|
+
|
|
187
|
+
Does this function breakdown align with your understanding of the requirements?</field>
|
|
188
|
+
</block>
|
|
189
|
+
</branch>
|
|
190
|
+
</block>
|
|
191
|
+
|
|
192
|
+
<!-- Step 0.7: Update Checkpoint A -->
|
|
193
|
+
<block type="task" id="B0_10" action="run-script" desc="Record checkpoint A passed">
|
|
194
|
+
<field name="command">node "${workspace_path}/scripts/update-progress.js" write-checkpoint --file "${workspace_path}/iterations/${iteration_id}/02.feature-design/.checkpoints.json" --stage 02_feature_design --checkpoint function_decomposition --passed true</field>
|
|
195
|
+
<field name="output" var="checkpoint_a_result"/>
|
|
196
|
+
</block>
|
|
197
|
+
|
|
198
|
+
</sequence>
|
|
199
|
+
|
|
200
|
+
<!-- ============================================================
|
|
201
|
+
Sequence S1: Feature Design
|
|
202
|
+
============================================================ -->
|
|
203
|
+
<sequence id="S1" name="Feature Design" status="pending" desc="Generate Feature Spec from analysis results">
|
|
204
|
+
|
|
205
|
+
<!-- Step 1.0: Prepare analysis results for design -->
|
|
206
|
+
<block type="task" id="B1_0" action="analyze" desc="Prepare analysis data for design phase">
|
|
207
|
+
<field name="input" value="${analyzed_functions}">${prd_content}${feature_id}${feature_name}${feature_type}${frontend_platforms}</field>
|
|
208
|
+
<field name="prepare_rules">
|
|
209
|
+
- Extract feature_id, feature_name, feature_type from parameters or analysis
|
|
210
|
+
- Prepare functions list for design phase
|
|
211
|
+
- Prepare platforms list for design phase
|
|
212
|
+
- Verify Checkpoint A passed status
|
|
85
213
|
</field>
|
|
86
|
-
<field name="output" var="
|
|
214
|
+
<field name="output" var="design_input"/>
|
|
87
215
|
</block>
|
|
88
216
|
|
|
89
217
|
<!-- Step 1: Frontend Design (Conditional) -->
|
|
90
|
-
<block type="gateway" id="
|
|
218
|
+
<block type="gateway" id="G1" mode="exclusive" desc="Conditional frontend design">
|
|
91
219
|
<branch test="${feature_type} == 'API-only'" name="Skip frontend">
|
|
92
220
|
<block type="event" id="E1" action="log" level="info" desc="Skipping frontend design">
|
|
93
221
|
<field name="message">feature_type is API-only, skipping frontend design</field>
|
|
94
222
|
</block>
|
|
95
223
|
</branch>
|
|
96
224
|
<branch default="true" name="Execute frontend design">
|
|
97
|
-
<block type="task" id="
|
|
98
|
-
<field name="input" value="${
|
|
225
|
+
<block type="task" id="B1" action="analyze" desc="Design UI prototypes">
|
|
226
|
+
<field name="input" value="${design_input}">${frontend_platforms}</field>
|
|
99
227
|
<field name="design_rules">
|
|
100
228
|
- Create ASCII wireframes for each platform
|
|
101
229
|
- Use Pattern M-A (Card List), M-B (Mobile Form), M-C (Action Sheet) for mobile
|
|
@@ -104,8 +232,8 @@
|
|
|
104
232
|
<field name="output" var="ui_prototypes"/>
|
|
105
233
|
</block>
|
|
106
234
|
|
|
107
|
-
<block type="task" id="
|
|
108
|
-
<field name="input" value="${
|
|
235
|
+
<block type="task" id="B2" action="analyze" desc="Design interaction flows">
|
|
236
|
+
<field name="input" value="${design_input}">${ui_prototypes}</field>
|
|
109
237
|
<field name="design_rules">
|
|
110
238
|
- Document User Action → Frontend Response → Backend API Call
|
|
111
239
|
- Generate Mermaid sequenceDiagram for each flow
|
|
@@ -114,8 +242,8 @@
|
|
|
114
242
|
<field name="output" var="interaction_flows"/>
|
|
115
243
|
</block>
|
|
116
244
|
|
|
117
|
-
<block type="task" id="
|
|
118
|
-
<field name="input" value="${interaction_flows}">${
|
|
245
|
+
<block type="task" id="B3" action="analyze" desc="Map backend APIs">
|
|
246
|
+
<field name="input" value="${interaction_flows}">${design_input}</field>
|
|
119
247
|
<field name="mapping_rules">
|
|
120
248
|
- Map each frontend action to backend API endpoint
|
|
121
249
|
- Document data exchanged
|
|
@@ -126,8 +254,8 @@
|
|
|
126
254
|
</block>
|
|
127
255
|
|
|
128
256
|
<!-- Step 2: Backend Design -->
|
|
129
|
-
<block type="task" id="
|
|
130
|
-
<field name="input" value="${
|
|
257
|
+
<block type="task" id="B4" action="analyze" desc="Design backend interfaces">
|
|
258
|
+
<field name="input" value="${design_input}">${api_mapping}</field>
|
|
131
259
|
<field name="design_rules">
|
|
132
260
|
- List API/Interface with method and description
|
|
133
261
|
- Document processing logic flow (Mermaid flowchart TD)
|
|
@@ -138,8 +266,8 @@
|
|
|
138
266
|
</block>
|
|
139
267
|
|
|
140
268
|
<!-- Step 3: Data Model and Business Rules -->
|
|
141
|
-
<block type="task" id="
|
|
142
|
-
<field name="input" value="${
|
|
269
|
+
<block type="task" id="B5" action="analyze" desc="Design data model">
|
|
270
|
+
<field name="input" value="${design_input}">${backend_design}</field>
|
|
143
271
|
<field name="design_rules">
|
|
144
272
|
- Define new data structures (field, type, constraints, description)
|
|
145
273
|
- Document modifications to existing structures
|
|
@@ -153,7 +281,7 @@
|
|
|
153
281
|
</block>
|
|
154
282
|
|
|
155
283
|
<!-- Step 4: Checkpoint B -->
|
|
156
|
-
<block type="gateway" id="
|
|
284
|
+
<block type="gateway" id="G2" mode="exclusive" desc="Handle checkpoint B">
|
|
157
285
|
<branch test="${skip_checkpoint} == true" name="Skip confirmation">
|
|
158
286
|
<block type="event" id="E2" action="log" level="info" desc="Skipping checkpoint B">
|
|
159
287
|
<field name="message">skip_checkpoint=true, proceeding without user confirmation</field>
|
|
@@ -164,12 +292,12 @@
|
|
|
164
292
|
<field name="preview">Feature: ${feature_name} (${feature_id})
|
|
165
293
|
|
|
166
294
|
FUNCTIONS DESIGNED
|
|
167
|
-
Total: ${
|
|
295
|
+
Total: ${analyzed_functions.count} functions
|
|
168
296
|
|
|
169
297
|
SYSTEM RELATIONSHIP SUMMARY
|
|
170
|
-
- [EXISTING]: ${
|
|
171
|
-
- [MODIFIED]: ${
|
|
172
|
-
- [NEW]: ${
|
|
298
|
+
- [EXISTING]: ${analyzed_functions.existing_count} - Reuse existing capabilities
|
|
299
|
+
- [MODIFIED]: ${analyzed_functions.modified_count} - Enhance existing features
|
|
300
|
+
- [NEW]: ${analyzed_functions.new_count} - Create new functionality
|
|
173
301
|
|
|
174
302
|
FRONTEND COMPONENTS
|
|
175
303
|
- Platforms: ${frontend_platforms}
|
|
@@ -196,21 +324,21 @@ Please confirm:
|
|
|
196
324
|
</block>
|
|
197
325
|
|
|
198
326
|
<!-- Step 4.3: Update Checkpoint B -->
|
|
199
|
-
<block type="task" id="
|
|
327
|
+
<block type="task" id="B6" action="run-script" desc="Record checkpoint B passed">
|
|
200
328
|
<field name="command">node "${workspace_path}/scripts/update-progress.js" write-checkpoint --file "${workspace_path}/iterations/${iteration_id}/02.feature-design/.checkpoints.json" --stage 02_feature_design --checkpoint feature_design_review --passed true</field>
|
|
201
329
|
<field name="output" var="checkpoint_b_result"/>
|
|
202
330
|
</block>
|
|
203
331
|
|
|
204
332
|
<!-- Step 5: Determine Output Path and Copy Template -->
|
|
205
|
-
<block type="task" id="
|
|
333
|
+
<block type="task" id="B7" action="read-file" desc="Read Feature Spec template">
|
|
206
334
|
<field name="path">speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md</field>
|
|
207
335
|
<field name="output" var="template_content"/>
|
|
208
336
|
</block>
|
|
209
337
|
|
|
210
338
|
<!-- Gateway: Determine output path mode -->
|
|
211
|
-
<block type="gateway" id="
|
|
339
|
+
<block type="gateway" id="G3" mode="exclusive" desc="Determine output path">
|
|
212
340
|
<branch test="${feature_id} != null" name="Single Feature Mode">
|
|
213
|
-
<block type="task" id="
|
|
341
|
+
<block type="task" id="B8" action="generate" desc="Create document from template">
|
|
214
342
|
<field name="template" value="${template_content}"/>
|
|
215
343
|
<field name="placeholders">
|
|
216
344
|
- [Feature Name] → ${feature_name}
|
|
@@ -224,7 +352,7 @@ Please confirm:
|
|
|
224
352
|
</block>
|
|
225
353
|
</branch>
|
|
226
354
|
<branch default="true" name="Legacy Mode">
|
|
227
|
-
<block type="task" id="
|
|
355
|
+
<block type="task" id="B9" action="generate" desc="Create document from template">
|
|
228
356
|
<field name="template" value="${template_content}"/>
|
|
229
357
|
<field name="placeholders">
|
|
230
358
|
- [Feature Name] → ${feature_name}
|
|
@@ -240,8 +368,8 @@ Please confirm:
|
|
|
240
368
|
</block>
|
|
241
369
|
|
|
242
370
|
<!-- Step 6: Fill Sections Using search_replace -->
|
|
243
|
-
<block type="loop" id="L1" over="${
|
|
244
|
-
<block type="task" id="
|
|
371
|
+
<block type="loop" id="L1" over="${analyzed_functions.functions}" as="function" desc="Fill each function section">
|
|
372
|
+
<block type="task" id="B10" action="edit-file" desc="Fill Frontend Prototype section">
|
|
245
373
|
<field name="path">${output_path}</field>
|
|
246
374
|
<field name="operation">search_replace</field>
|
|
247
375
|
<field name="search">#### ${function.id}.1 Frontend Prototype
|
|
@@ -252,7 +380,7 @@ Please confirm:
|
|
|
252
380
|
${ui_prototypes[function.id]}</field>
|
|
253
381
|
</block>
|
|
254
382
|
|
|
255
|
-
<block type="task" id="
|
|
383
|
+
<block type="task" id="B11" action="edit-file" desc="Fill Interaction Flow section">
|
|
256
384
|
<field name="path">${output_path}</field>
|
|
257
385
|
<field name="operation">search_replace</field>
|
|
258
386
|
<field name="search">#### ${function.id}.2 Interaction Flow
|
|
@@ -263,7 +391,7 @@ ${ui_prototypes[function.id]}</field>
|
|
|
263
391
|
${interaction_flows[function.id]}</field>
|
|
264
392
|
</block>
|
|
265
393
|
|
|
266
|
-
<block type="task" id="
|
|
394
|
+
<block type="task" id="B12" action="edit-file" desc="Fill Backend Interface section">
|
|
267
395
|
<field name="path">${output_path}</field>
|
|
268
396
|
<field name="operation">search_replace</field>
|
|
269
397
|
<field name="search">#### ${function.id}.3 Backend Interface
|
|
@@ -274,7 +402,7 @@ ${interaction_flows[function.id]}</field>
|
|
|
274
402
|
${backend_design[function.id]}</field>
|
|
275
403
|
</block>
|
|
276
404
|
|
|
277
|
-
<block type="task" id="
|
|
405
|
+
<block type="task" id="B13" action="edit-file" desc="Fill Data Definition section">
|
|
278
406
|
<field name="path">${output_path}</field>
|
|
279
407
|
<field name="operation">search_replace</field>
|
|
280
408
|
<field name="search">#### ${function.id}.4 Data Definition
|
|
@@ -287,7 +415,7 @@ ${data_model[function.id]}</field>
|
|
|
287
415
|
</block>
|
|
288
416
|
|
|
289
417
|
<!-- Step 7: Mermaid Diagram Compliance -->
|
|
290
|
-
<block type="task" id="
|
|
418
|
+
<block type="task" id="B14" action="analyze" desc="Verify Mermaid compliance">
|
|
291
419
|
<field name="input" value="${output_path}"/>
|
|
292
420
|
<field name="verification_rules">
|
|
293
421
|
- NO style definitions (classDef, style)
|
|
@@ -298,13 +426,13 @@ ${data_model[function.id]}</field>
|
|
|
298
426
|
</block>
|
|
299
427
|
|
|
300
428
|
<!-- Step 8: Update Checkpoint -->
|
|
301
|
-
<block type="task" id="
|
|
429
|
+
<block type="task" id="B15" action="run-script" desc="Record feature spec review checkpoint">
|
|
302
430
|
<field name="command">node "${workspace_path}/scripts/update-progress.js" write-checkpoint --file "${workspace_path}/iterations/${iteration_id}/02.feature-design/.checkpoints.json" --stage 02_feature_design --checkpoint feature_spec_review --passed true</field>
|
|
303
431
|
</block>
|
|
304
432
|
|
|
305
433
|
<!-- Step 9: Update Progress with Metadata -->
|
|
306
|
-
<block type="task" id="
|
|
307
|
-
<field name="command">node "${workspace_path}/scripts/update-progress.js" update-task --file "${workspace_path}/iterations/${iteration_id}/DISPATCH-PROGRESS.json" --task-id "${feature_id}" --status completed --metadata '{"function_count": ${
|
|
434
|
+
<block type="task" id="B16" action="run-script" desc="Update dispatch progress with metadata">
|
|
435
|
+
<field name="command">node "${workspace_path}/scripts/update-progress.js" update-task --file "${workspace_path}/iterations/${iteration_id}/DISPATCH-PROGRESS.json" --task-id "${feature_id}" --status completed --metadata '{"function_count": ${analyzed_functions.count}, "component_count": ${ui_prototypes.component_count}, "api_count": ${backend_design.api_count}, "entity_count": ${data_model.entity_count}}'</field>
|
|
308
436
|
</block>
|
|
309
437
|
|
|
310
438
|
</sequence>
|
|
@@ -314,9 +442,11 @@ ${data_model[function.id]}</field>
|
|
|
314
442
|
============================================================ -->
|
|
315
443
|
<block type="output" id="O1" desc="Workflow output results">
|
|
316
444
|
<field name="feature_spec_path" value="${output_path}" type="string" desc="Path to generated Feature Spec"/>
|
|
317
|
-
<field name="function_count" from="${
|
|
445
|
+
<field name="function_count" from="${analyzed_functions.count}" type="number" desc="Number of functions analyzed and designed"/>
|
|
318
446
|
<field name="api_count" from="${backend_design.api_count}" type="number" desc="Number of APIs defined"/>
|
|
447
|
+
<field name="checkpoint_a_status" value="passed" type="string" desc="Checkpoint A status"/>
|
|
319
448
|
<field name="checkpoint_b_status" value="passed" type="string" desc="Checkpoint B status"/>
|
|
449
|
+
<field name="frontend_platforms" from="${frontend_platforms}" type="array" desc="List of frontend platforms"/>
|
|
320
450
|
</block>
|
|
321
451
|
|
|
322
452
|
</workflow>
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
<branch test="${checkpoints.feature_spec_review.passed} == true" name="Resume from Phase 4">
|
|
50
50
|
<block type="set-variable" id="P0-V1" name="resume_phase" value="4"/>
|
|
51
51
|
</branch>
|
|
52
|
-
<branch test="${checkpoints.function_decomposition.passed} == true" name="Resume from Phase
|
|
53
|
-
<block type="set-variable" id="P0-V2" name="resume_phase" value="
|
|
52
|
+
<branch test="${checkpoints.function_decomposition.passed} == true" name="Resume from Phase 3">
|
|
53
|
+
<block type="set-variable" id="P0-V2" name="resume_phase" value="3"/>
|
|
54
54
|
</branch>
|
|
55
55
|
<branch default="true" name="Resume from Phase 1"/>
|
|
56
56
|
</block>
|
|
@@ -179,29 +179,28 @@
|
|
|
179
179
|
</block>
|
|
180
180
|
</sequence>
|
|
181
181
|
|
|
182
|
-
<!-- ========== Phase 3: Feature Design
|
|
183
|
-
<sequence name="Phase 3: Feature Design
|
|
182
|
+
<!-- ========== Phase 3: Feature Design (Unified Analysis + Design) ========== -->
|
|
183
|
+
<sequence name="Phase 3: Feature Design (Unified Analysis + Design)">
|
|
184
184
|
|
|
185
185
|
<block type="rule" id="P3-R1" level="mandatory" desc="Phase 3 Mandatory Rules">
|
|
186
186
|
<field name="text">DO NOT ask user which strategy to use - strategy determined by Phase 2 extraction</field>
|
|
187
187
|
<field name="text">DO NOT invoke skills directly when 2+ Features - MUST dispatch speccrew-task-worker</field>
|
|
188
188
|
<field name="text">Dispatch granularity is PER FEATURE, not per module</field>
|
|
189
189
|
<field name="text">DO NOT generate Feature Spec documents yourself - role is to DISPATCH workers</field>
|
|
190
|
-
<field name="text">Phase 3a → 3b → 3c is STRICTLY SERIAL</field>
|
|
191
190
|
<field name="text">Feature name is LOCKED after Phase 2 confirmation</field>
|
|
192
191
|
</block>
|
|
193
192
|
|
|
194
|
-
<!-- ==========
|
|
195
|
-
<block type="event" id="P3-E1" action="log" desc="Start Phase
|
|
196
|
-
<field name="message">📊 Phase
|
|
193
|
+
<!-- ========== Unified Feature Design Dispatch ========== -->
|
|
194
|
+
<block type="event" id="P3-E1" action="log" desc="Start Phase 3">
|
|
195
|
+
<field name="message">📊 Phase 3: Feature Design (Unified Analysis + Design)</field>
|
|
197
196
|
</block>
|
|
198
197
|
|
|
199
|
-
<block type="gateway" id="P3-G1" mode="exclusive" desc="Dispatch mode for Phase
|
|
198
|
+
<block type="gateway" id="P3-G1" mode="exclusive" desc="Dispatch mode for Phase 3">
|
|
200
199
|
|
|
201
200
|
<!-- Single Feature: Direct Invocation -->
|
|
202
201
|
<branch test="${dispatch_mode} == 'direct'" name="Direct Invocation">
|
|
203
|
-
<block type="task" id="P3-B1" action="run-skill" status="pending" desc="Invoke feature
|
|
204
|
-
<field name="skill">speccrew-fd-feature-
|
|
202
|
+
<block type="task" id="P3-B1" action="run-skill" status="pending" desc="Invoke feature design skill">
|
|
203
|
+
<field name="skill">speccrew-fd-feature-design</field>
|
|
205
204
|
<field name="context">
|
|
206
205
|
prd_path: ${prd_files[0]}
|
|
207
206
|
feature_id: ${feature_list.modules[0].features[0].feature_id}
|
|
@@ -209,8 +208,9 @@
|
|
|
209
208
|
feature_type: ${feature_list.modules[0].features[0].feature_type}
|
|
210
209
|
iteration_id: ${iteration_path}
|
|
211
210
|
frontend_platforms: ${frontend_platforms}
|
|
211
|
+
output_path: ${iteration_path}/02.feature-design/${feature_id}-${feature_name}-feature-spec.md
|
|
212
212
|
</field>
|
|
213
|
-
<field name="output" var="
|
|
213
|
+
<field name="output" var="design_result"/>
|
|
214
214
|
</block>
|
|
215
215
|
</branch>
|
|
216
216
|
|
|
@@ -225,77 +225,6 @@
|
|
|
225
225
|
|
|
226
226
|
<!-- Initialize DISPATCH-PROGRESS.json -->
|
|
227
227
|
<block type="task" id="P3-B2" action="run-script" status="pending" desc="Initialize dispatch progress">
|
|
228
|
-
<field name="command">node ${workspace_root}/scripts/update-progress.js init --file ${iteration_path}/02.feature-design/DISPATCH-PROGRESS.json --stage 02_feature_design_analyze --tasks-file ${iteration_path}/02.feature-design/.tasks-temp.json</field>
|
|
229
|
-
</block>
|
|
230
|
-
|
|
231
|
-
<!-- MANDATORY: Dispatch prompt must contain ONLY skill path + context data parameters.
|
|
232
|
-
DO NOT include execution instructions, step sequences, or output directives.
|
|
233
|
-
Worker will read skill's workflow.agentflow.xml for execution plan. -->
|
|
234
|
-
<!-- Dispatch Workers in batches of 6 -->
|
|
235
|
-
<block type="loop" id="P3-L1" mode="batch" batch_size="6" desc="Dispatch analyze workers">
|
|
236
|
-
<field name="items" value="${all_features}"/>
|
|
237
|
-
|
|
238
|
-
<block type="task" id="P3-B3" action="dispatch-to-worker" status="pending" desc="Dispatch analyze worker">
|
|
239
|
-
<field name="agent">speccrew-task-worker</field>
|
|
240
|
-
<field name="skill">speccrew-fd-feature-analyze</field>
|
|
241
|
-
<field name="context">
|
|
242
|
-
workspace_path: ${workspace_root}
|
|
243
|
-
prd_path: ${item.prd_path}
|
|
244
|
-
feature_id: ${item.feature_id}
|
|
245
|
-
feature_name: ${item.feature_name}
|
|
246
|
-
feature_type: ${item.feature_type}
|
|
247
|
-
iteration_id: ${iteration_path}
|
|
248
|
-
frontend_platforms: ${frontend_platforms}
|
|
249
|
-
skip_checkpoint: true
|
|
250
|
-
</field>
|
|
251
|
-
</block>
|
|
252
|
-
|
|
253
|
-
<block type="task" id="P3-B4" action="run-script" status="pending" desc="Update worker progress">
|
|
254
|
-
<field name="command">node ${workspace_root}/scripts/update-progress.js update-task --file ${iteration_path}/02.feature-design/DISPATCH-PROGRESS.json --task-id ${item.feature_id} --status ${worker_status}</field>
|
|
255
|
-
</block>
|
|
256
|
-
</block>
|
|
257
|
-
|
|
258
|
-
<!-- All completed: Present summary -->
|
|
259
|
-
<block type="event" id="P3-E2" action="log" desc="Display analyze summary">
|
|
260
|
-
<field name="template">analyze-summary</field>
|
|
261
|
-
<field name="data" value="${analyze_results}"/>
|
|
262
|
-
</block>
|
|
263
|
-
|
|
264
|
-
<block type="event" id="P3-E3" action="confirm" desc="HARD STOP for analyze confirmation">
|
|
265
|
-
<field name="prompt">📊 Phase 3a (Analyze) complete. Does this function breakdown align with your understanding?</field>
|
|
266
|
-
</block>
|
|
267
|
-
</branch>
|
|
268
|
-
</block>
|
|
269
|
-
|
|
270
|
-
<!-- ========== Phase 3b: Design & Generate — Feature Spec Production ========== -->
|
|
271
|
-
<block type="event" id="P3-E4" action="log" desc="Start Phase 3b">
|
|
272
|
-
<field name="message">📊 Phase 3b: Design & Generate — Feature Spec Production</field>
|
|
273
|
-
</block>
|
|
274
|
-
|
|
275
|
-
<block type="gateway" id="P3-G2" mode="exclusive" desc="Dispatch mode for Phase 3b">
|
|
276
|
-
|
|
277
|
-
<!-- Single Feature: Direct Invocation -->
|
|
278
|
-
<branch test="${dispatch_mode} == 'direct'" name="Direct Invocation">
|
|
279
|
-
<block type="task" id="P3-B5" action="run-skill" status="pending" desc="Invoke feature design skill">
|
|
280
|
-
<field name="skill">speccrew-fd-feature-design</field>
|
|
281
|
-
<field name="context">
|
|
282
|
-
feature_analysis_path: ${analyze_result.output_path}
|
|
283
|
-
prd_path: ${prd_files[0]}
|
|
284
|
-
feature_id: ${feature_list.modules[0].features[0].feature_id}
|
|
285
|
-
feature_name: ${feature_list.modules[0].features[0].feature_name}
|
|
286
|
-
feature_type: ${feature_list.modules[0].features[0].feature_type}
|
|
287
|
-
frontend_platforms: ${frontend_platforms}
|
|
288
|
-
output_path: ${iteration_path}/02.feature-design/${feature_id}-${feature_name}-feature-spec.md
|
|
289
|
-
</field>
|
|
290
|
-
<field name="output" var="design_result"/>
|
|
291
|
-
</block>
|
|
292
|
-
</branch>
|
|
293
|
-
|
|
294
|
-
<!-- Multiple Features: Worker Dispatch -->
|
|
295
|
-
<branch test="${dispatch_mode} == 'worker'" name="Worker Dispatch">
|
|
296
|
-
|
|
297
|
-
<!-- Initialize DISPATCH-PROGRESS.json for Design stage -->
|
|
298
|
-
<block type="task" id="P3-B6" action="run-script" status="pending" desc="Initialize design dispatch progress">
|
|
299
228
|
<field name="command">node ${workspace_root}/scripts/update-progress.js init --file ${iteration_path}/02.feature-design/DISPATCH-PROGRESS.json --stage 02_feature_design_spec --tasks-file ${iteration_path}/02.feature-design/.tasks-temp.json</field>
|
|
300
229
|
</block>
|
|
301
230
|
|
|
@@ -303,26 +232,26 @@
|
|
|
303
232
|
DO NOT include execution instructions, step sequences, or output directives.
|
|
304
233
|
Worker will read skill's workflow.agentflow.xml for execution plan. -->
|
|
305
234
|
<!-- Dispatch Workers in batches of 6 -->
|
|
306
|
-
<block type="loop" id="P3-
|
|
235
|
+
<block type="loop" id="P3-L1" mode="batch" batch_size="6" desc="Dispatch design workers">
|
|
307
236
|
<field name="items" value="${all_features}"/>
|
|
308
237
|
|
|
309
|
-
<block type="task" id="P3-
|
|
238
|
+
<block type="task" id="P3-B3" action="dispatch-to-worker" status="pending" desc="Dispatch design worker">
|
|
310
239
|
<field name="agent">speccrew-task-worker</field>
|
|
311
240
|
<field name="skill">speccrew-fd-feature-design</field>
|
|
312
241
|
<field name="context">
|
|
313
242
|
workspace_path: ${workspace_root}
|
|
314
|
-
feature_analysis_path: ${item.analysis_path}
|
|
315
243
|
prd_path: ${item.prd_path}
|
|
316
244
|
feature_id: ${item.feature_id}
|
|
317
245
|
feature_name: ${item.feature_name}
|
|
318
246
|
feature_type: ${item.feature_type}
|
|
247
|
+
iteration_id: ${iteration_path}
|
|
319
248
|
frontend_platforms: ${frontend_platforms}
|
|
320
249
|
output_path: ${iteration_path}/02.feature-design/${item.feature_id}-${item.feature_name}-feature-spec.md
|
|
321
|
-
|
|
250
|
+
skip_analysis_checkpoint: true
|
|
322
251
|
</field>
|
|
323
252
|
</block>
|
|
324
253
|
|
|
325
|
-
<block type="task" id="P3-
|
|
254
|
+
<block type="task" id="P3-B4" action="run-script" status="pending" desc="Update worker progress">
|
|
326
255
|
<field name="command">node ${workspace_root}/scripts/update-progress.js update-task --file ${iteration_path}/02.feature-design/DISPATCH-PROGRESS.json --task-id ${item.feature_id} --status ${worker_status}</field>
|
|
327
256
|
</block>
|
|
328
257
|
</block>
|