speccrew 0.2.7 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.speccrew/agents/speccrew-feature-designer.md +220 -27
- package/.speccrew/agents/speccrew-system-designer.md +237 -31
- package/.speccrew/agents/speccrew-system-developer.md +44 -10
- package/.speccrew/skills/speccrew-dev-backend/SKILL.md +15 -1
- package/.speccrew/skills/speccrew-dev-desktop/SKILL.md +36 -7
- package/.speccrew/skills/speccrew-dev-review/SKILL.md +16 -7
- package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +150 -35
- package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +140 -18
- package/.speccrew/skills/speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md +4 -1
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +29 -15
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +51 -6
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +18 -20
- package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +7 -10
- package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +19 -23
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +151 -153
- package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +23 -63
- package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +32 -68
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +6 -2
- package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +32 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/PRD-TEMPLATE.md +16 -1
- package/.speccrew/skills/speccrew-sd-backend/SKILL.md +33 -6
- package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +25 -5
- package/.speccrew/skills/speccrew-test-case-design/SKILL.md +17 -0
- package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +20 -3
- package/.speccrew/skills/speccrew-test-execute/SKILL.md +8 -0
- package/package.json +1 -1
|
@@ -23,7 +23,20 @@ tools: Read, Write, Glob, Grep
|
|
|
23
23
|
|
|
24
24
|
## Step 1: Read Input
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
### Input Parameters
|
|
27
|
+
|
|
28
|
+
| Parameter | Required | Description |
|
|
29
|
+
|-----------|----------|-------------|
|
|
30
|
+
| `feature_id` | Optional | Feature 唯一标识符,如 `F-CRM-01`(向后兼容:不传则使用当前逻辑) |
|
|
31
|
+
| `feature_name` | Optional | Feature 名称,如 `customer-list`(向后兼容:不传则使用当前逻辑) |
|
|
32
|
+
|
|
33
|
+
### Input Files
|
|
34
|
+
|
|
35
|
+
1. **Feature Spec 文档**:
|
|
36
|
+
- **新格式(推荐)**:`speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/{feature-id}-{feature-name}-feature-spec.md`
|
|
37
|
+
- **旧格式(向后兼容)**:`speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/[feature-name]-feature-spec.md`
|
|
38
|
+
- 优先检查新格式,不存在则回退到旧格式
|
|
39
|
+
|
|
27
40
|
2. API Contract template: `speccrew-fd-api-contract/templates/API-CONTRACT-TEMPLATE.md`
|
|
28
41
|
3. System architecture (API specification part): Refer to project tech-stack-mappings.json for API naming conventions
|
|
29
42
|
|
|
@@ -53,9 +66,11 @@ Complete definition for each API:
|
|
|
53
66
|
### 4a Copy Template to Document Path
|
|
54
67
|
|
|
55
68
|
1. **Read the template file**: `templates/API-CONTRACT-TEMPLATE.md`
|
|
56
|
-
2. **Replace top-level placeholders** (feature name, date, etc.)
|
|
69
|
+
2. **Replace top-level placeholders** (feature name, date, feature_id if provided, etc.)
|
|
57
70
|
3. **Create the document** using `create_file`:
|
|
58
|
-
-
|
|
71
|
+
- **新格式(当提供了 feature_id 时)**:`speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/{feature-id}-{feature-name}-api-contract.md`
|
|
72
|
+
- 示例:`F-CRM-01-customer-list-api-contract.md`
|
|
73
|
+
- **旧格式(向后兼容,未提供 feature_id 时)**:`speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/[feature-name]-api-contract.md`
|
|
59
74
|
- Content: Template with top-level placeholders replaced
|
|
60
75
|
4. **Verify**: Document has complete section structure ready for filling
|
|
61
76
|
|
|
@@ -80,8 +95,42 @@ For each API, locate its section anchor in the template and use `search_replace`
|
|
|
80
95
|
|
|
81
96
|
## Step 5: Joint Confirmation
|
|
82
97
|
|
|
83
|
-
After both documents (Feature Spec + API Contract) are ready, request confirmation
|
|
98
|
+
After both documents (Feature Spec + API Contract) are ready, request user confirmation:
|
|
84
99
|
|
|
100
|
+
**Conditional Confirmation Logic:**
|
|
101
|
+
```
|
|
102
|
+
IF feature_id is provided THEN
|
|
103
|
+
→ Execute Feature-granular confirmation (情况 A)
|
|
104
|
+
ELSE
|
|
105
|
+
→ Execute Module-level confirmation (情况 B)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**情况 A:提供了 feature_id(Feature 粒度确认)**
|
|
109
|
+
```
|
|
110
|
+
Feature 设计阶段交付物已准备就绪:
|
|
111
|
+
|
|
112
|
+
📋 Feature 信息:
|
|
113
|
+
- Feature ID: {feature_id}
|
|
114
|
+
- Feature 名称: {feature_name}
|
|
115
|
+
|
|
116
|
+
📄 文档清单:
|
|
117
|
+
- Feature Spec: speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/{feature-id}-{feature-name}-feature-spec.md
|
|
118
|
+
- API Contract: speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/{feature-id}-{feature-name}-api-contract.md
|
|
119
|
+
|
|
120
|
+
请确认以下关键点:
|
|
121
|
+
1. 当前 Feature 的技术方案是否可行?
|
|
122
|
+
2. API 定义是否满足前端需求?
|
|
123
|
+
3. 数据模型设计是否合理?
|
|
124
|
+
|
|
125
|
+
⚠️ 确认后,API Contract 将成为前后端协作的唯一基准。
|
|
126
|
+
在设计/开发阶段只读引用,不允许修改。
|
|
127
|
+
如需变更,必须返回此阶段重新确认。
|
|
128
|
+
|
|
129
|
+
✅ 当前仅确认单个 Feature 的交付物。
|
|
130
|
+
全局阶段状态(02_feature_design)将在所有 Feature 完成后由 Feature Designer Agent 统一更新。
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**情况 B:未提供 feature_id(向后兼容,模块级确认)**
|
|
85
134
|
```
|
|
86
135
|
Feature design phase deliverables are ready:
|
|
87
136
|
- Feature Spec: speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/[feature-name]-feature-spec.md
|
|
@@ -103,20 +152,20 @@ After confirmation, you can start frontend and backend Designer Agents separatel
|
|
|
103
152
|
|
|
104
153
|
After user confirms Joint Confirmation:
|
|
105
154
|
|
|
106
|
-
###
|
|
155
|
+
### 6a: Update Checkpoints File
|
|
107
156
|
|
|
108
|
-
|
|
157
|
+
Update the `.checkpoints.json` file to record confirmation status.
|
|
158
|
+
|
|
159
|
+
Write/Update `.checkpoints.json`:
|
|
109
160
|
|
|
110
161
|
- Path: `speccrew-workspace/iterations/{iteration-id}/02.feature-design/.checkpoints.json`
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"confirmed_at": "..."
|
|
119
|
-
},
|
|
162
|
+
|
|
163
|
+
**情况 A:提供了 feature_id(Feature 粒度)**
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"stage": "02_feature_design",
|
|
167
|
+
"feature_checkpoints": {
|
|
168
|
+
"{feature_id}": {
|
|
120
169
|
"feature_spec_review": {
|
|
121
170
|
"passed": true,
|
|
122
171
|
"confirmed_at": "..."
|
|
@@ -124,43 +173,109 @@ Write/Update `.checkpoints.json`:
|
|
|
124
173
|
"api_contract_joint": {
|
|
125
174
|
"passed": true,
|
|
126
175
|
"confirmed_at": "{current_timestamp}",
|
|
127
|
-
"description": "API contract joint confirmation passed"
|
|
176
|
+
"description": "API contract joint confirmation passed for {feature_id}"
|
|
128
177
|
}
|
|
129
178
|
}
|
|
179
|
+
},
|
|
180
|
+
"checkpoints": {
|
|
181
|
+
"function_decomposition": {
|
|
182
|
+
"passed": true,
|
|
183
|
+
"confirmed_at": "..."
|
|
184
|
+
}
|
|
130
185
|
}
|
|
131
|
-
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
- 使用 `feature_checkpoints.{feature_id}` 作为 key 存储单个 Feature 的状态
|
|
190
|
+
- 保留原有的 `checkpoints` 用于全局检查点
|
|
191
|
+
- Log: "✅ Checkpoint (api_contract_joint) passed and recorded for Feature {feature_id}"
|
|
192
|
+
|
|
193
|
+
**情况 B:未提供 feature_id(向后兼容,模块级)**
|
|
194
|
+
```json
|
|
195
|
+
{
|
|
196
|
+
"stage": "02_feature_design",
|
|
197
|
+
"checkpoints": {
|
|
198
|
+
"function_decomposition": {
|
|
199
|
+
"passed": true,
|
|
200
|
+
"confirmed_at": "..."
|
|
201
|
+
},
|
|
202
|
+
"feature_spec_review": {
|
|
203
|
+
"passed": true,
|
|
204
|
+
"confirmed_at": "..."
|
|
205
|
+
},
|
|
206
|
+
"api_contract_joint": {
|
|
207
|
+
"passed": true,
|
|
208
|
+
"confirmed_at": "{current_timestamp}",
|
|
209
|
+
"description": "API contract joint confirmation passed"
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
```
|
|
132
214
|
|
|
133
215
|
- Preserve existing checkpoint statuses when updating
|
|
134
216
|
- Log: "✅ Checkpoint (api_contract_joint) passed and recorded"
|
|
135
217
|
|
|
136
|
-
###
|
|
218
|
+
### 6b: Update Workflow Progress
|
|
137
219
|
|
|
138
|
-
Update `WORKFLOW-PROGRESS.json` to
|
|
220
|
+
Update `WORKFLOW-PROGRESS.json` to reflect current feature/module status.
|
|
139
221
|
|
|
140
222
|
- Path: `speccrew-workspace/iterations/{iteration-id}/WORKFLOW-PROGRESS.json`
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
"
|
|
151
|
-
"
|
|
152
|
-
"
|
|
153
|
-
|
|
223
|
+
|
|
224
|
+
**情况 A:提供了 feature_id(Feature 粒度)**
|
|
225
|
+
```json
|
|
226
|
+
{
|
|
227
|
+
"current_stage": "02_feature_design",
|
|
228
|
+
"stages": {
|
|
229
|
+
"02_feature_design": {
|
|
230
|
+
"status": "in_progress",
|
|
231
|
+
"features": {
|
|
232
|
+
"{feature_id}": {
|
|
233
|
+
"status": "confirmed",
|
|
234
|
+
"completed_at": "{current_timestamp}",
|
|
235
|
+
"confirmed_at": "{current_timestamp}",
|
|
236
|
+
"outputs": [
|
|
237
|
+
"02.feature-design/{feature-id}-{feature-name}-feature-spec.md",
|
|
238
|
+
"02.feature-design/{feature-id}-{feature-name}-api-contract.md"
|
|
239
|
+
]
|
|
240
|
+
}
|
|
154
241
|
}
|
|
155
242
|
}
|
|
156
243
|
}
|
|
157
|
-
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
- **重要**:单个 Feature 完成时,**不修改** `02_feature_design.status`(保持 `in_progress`)
|
|
248
|
+
- **重要**:**不修改** `current_stage`(保持 `02_feature_design`)
|
|
249
|
+
- 仅在 `stages.02_feature_design.features.{feature_id}` 中记录该 Feature 的完成状态
|
|
250
|
+
- Log: "✅ Feature {feature_id} API Contract confirmed. Feature Designer Agent will update global stage status when all features are completed."
|
|
251
|
+
|
|
252
|
+
**情况 B:未提供 feature_id(向后兼容,模块级)**
|
|
253
|
+
```json
|
|
254
|
+
{
|
|
255
|
+
"current_stage": "03_system_design",
|
|
256
|
+
"stages": {
|
|
257
|
+
"02_feature_design": {
|
|
258
|
+
"status": "confirmed",
|
|
259
|
+
"completed_at": "{current_timestamp}",
|
|
260
|
+
"confirmed_at": "{current_timestamp}",
|
|
261
|
+
"outputs": [
|
|
262
|
+
"02.feature-design/[feature-name]-feature-spec.md",
|
|
263
|
+
"02.feature-design/[feature-name]-api-contract.md"
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
```
|
|
158
269
|
|
|
159
270
|
- Set `02_feature_design.status` to `confirmed`
|
|
160
271
|
- Set `current_stage` to `03_system_design`
|
|
161
272
|
- Record all output file paths
|
|
162
273
|
- Log: "✅ Stage 02_feature_design confirmed. Ready for System Design phase."
|
|
163
274
|
|
|
275
|
+
**关于全局状态管理的说明**:
|
|
276
|
+
> Feature 粒度的 API Contract 完成后,全局阶段状态(`02_feature_design.status` 和 `current_stage`)**不由本 Skill 更新**。
|
|
277
|
+
> 全局状态由 **Feature Designer Agent** 统一管理,当检测到所有 Feature 都完成时,统一更新为 `confirmed` 并推进到下一阶段。
|
|
278
|
+
|
|
164
279
|
### 6.3 Backward Compatibility
|
|
165
280
|
|
|
166
281
|
If `WORKFLOW-PROGRESS.json` does not exist:
|
|
@@ -175,5 +290,5 @@ If `WORKFLOW-PROGRESS.json` does not exist:
|
|
|
175
290
|
- [ ] Each API has complete request/response structure definition
|
|
176
291
|
- [ ] URL naming conforms to backend architecture specifications
|
|
177
292
|
- [ ] Error code list is complete
|
|
178
|
-
- [ ] File has been written to correct path
|
|
179
|
-
- [ ] Summary of both documents has been shown to user and confirmation requested
|
|
293
|
+
- [ ] File has been written to correct path (with proper naming convention based on feature_id)
|
|
294
|
+
- [ ] Summary of both documents has been shown to user and confirmation requested (including Feature ID if applicable)
|
|
@@ -24,14 +24,36 @@ tools: Read, Write, Glob, Grep
|
|
|
24
24
|
|
|
25
25
|
## Step 1: Read PRD Input
|
|
26
26
|
|
|
27
|
+
### 1.1 Input Parameters
|
|
28
|
+
|
|
29
|
+
The skill receives the following parameters from the calling agent:
|
|
30
|
+
|
|
31
|
+
| Parameter | Required | Description |
|
|
32
|
+
|-----------|----------|-------------|
|
|
33
|
+
| `feature_id` | No | Feature identifier (e.g., `F-CRM-01`). If not provided, processes entire PRD (backward compatibility) |
|
|
34
|
+
| `feature_name` | No | Feature name in English (e.g., `customer-list`). Used for file naming |
|
|
35
|
+
| `feature_type` | No | `Page+API` or `API-only`. `API-only` skips frontend design steps |
|
|
36
|
+
| `iteration_id` | No | Current iteration identifier. Paths come from `prd_path`/`output_path`; `iteration_id` is used only for progress messages when available |
|
|
37
|
+
| `prd_path` | Yes | Path to the Sub-PRD document |
|
|
38
|
+
|
|
39
|
+
### 1.2 Read PRD
|
|
40
|
+
|
|
27
41
|
Read in order:
|
|
28
42
|
|
|
29
|
-
1. **Current iteration PRD**: `speccrew-workspace/iterations/{number}-{type}-{name}/01.product-requirement/[
|
|
43
|
+
1. **Current iteration PRD**: `{prd_path}` (typically `speccrew-workspace/iterations/{number}-{type}-{name}/01.product-requirement/[module-name]-prd.md`)
|
|
30
44
|
2. **Feature spec template**: `speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md`
|
|
31
45
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
### 1.3 Focus on Specific Feature (when feature_id provided)
|
|
47
|
+
|
|
48
|
+
If `feature_id` is provided:
|
|
49
|
+
- Locate the specific Feature in PRD Section 3.4 "Feature Breakdown"
|
|
50
|
+
- Extract only the user stories and requirements related to this Feature
|
|
51
|
+
- Ignore other Features in the same PRD
|
|
52
|
+
- Use the Feature's scope to guide function breakdown
|
|
53
|
+
|
|
54
|
+
### 1.4 Backward Compatibility (when feature_id not provided)
|
|
55
|
+
|
|
56
|
+
If `feature_id` is NOT provided, process entire PRD using legacy mode. For Master-Sub PRD structure, read master PRD and all sub PRDs. See Reference Guides for detailed behavior.
|
|
35
57
|
|
|
36
58
|
## Step 2: Load System Knowledge
|
|
37
59
|
|
|
@@ -77,6 +99,25 @@ If cross-module relationships need analysis, use `speccrew-knowledge-graph-query
|
|
|
77
99
|
|
|
78
100
|
Break down PRD functional requirements into implementable system functions.
|
|
79
101
|
|
|
102
|
+
### 3.1 Feature-Based Decomposition (when feature_id provided)
|
|
103
|
+
|
|
104
|
+
When processing a single Feature:
|
|
105
|
+
|
|
106
|
+
1. **Extract Feature Scope**: From PRD Section 3.4, locate the specific Feature by `feature_id`
|
|
107
|
+
2. **Identify Related User Stories**: Extract only user stories mapped to this Feature
|
|
108
|
+
3. **Decompose into Functions**: Break down into 3-8 focused Functions (not 10-20)
|
|
109
|
+
4. **Check feature_type**:
|
|
110
|
+
- If `feature_type = API-only`: Mark for backend-only design (skip frontend in Step 5)
|
|
111
|
+
- If `feature_type = Page+API`: Include both frontend and backend design
|
|
112
|
+
|
|
113
|
+
### 3.2 Full PRD Decomposition (backward compatibility)
|
|
114
|
+
|
|
115
|
+
When `feature_id` is NOT provided (legacy mode):
|
|
116
|
+
- Decompose entire PRD into all required Functions
|
|
117
|
+
- May result in 10-20 Functions for complex modules
|
|
118
|
+
|
|
119
|
+
### 3.3 Function Analysis
|
|
120
|
+
|
|
80
121
|
For each function, identify:
|
|
81
122
|
|
|
82
123
|
| Aspect | Analysis Content |
|
|
@@ -132,14 +173,28 @@ After user confirms the function breakdown:
|
|
|
132
173
|
|
|
133
174
|
## Step 4: Determine Output Structure
|
|
134
175
|
|
|
135
|
-
|
|
176
|
+
### 4.1 Single Feature Output (when feature_id provided)
|
|
177
|
+
|
|
178
|
+
When processing a single Feature:
|
|
179
|
+
|
|
180
|
+
| Output | Description |
|
|
181
|
+
|--------|-------------|
|
|
182
|
+
| **Single File** | One Feature Spec document for this Feature only |
|
|
183
|
+
| **File Naming** | `[feature-id]-[feature-name]-feature-spec.md` |
|
|
184
|
+
| **Example** | `F-CRM-01-customer-list-feature-spec.md` |
|
|
185
|
+
|
|
186
|
+
**No Master-Sub structure** for single Feature mode.
|
|
187
|
+
|
|
188
|
+
### 4.2 Legacy Output (backward compatibility)
|
|
189
|
+
|
|
190
|
+
When `feature_id` is NOT provided:
|
|
136
191
|
|
|
137
192
|
| PRD Structure | Feature Spec Structure |
|
|
138
193
|
|---------------|------------------------|
|
|
139
194
|
| **Single PRD** | Single Feature Spec |
|
|
140
195
|
| **Master-Sub PRD** | Master Feature Spec + Sub Feature Specs (one per module) |
|
|
141
196
|
|
|
142
|
-
|
|
197
|
+
#### Master Feature Spec Structure (Legacy)
|
|
143
198
|
|
|
144
199
|
```
|
|
145
200
|
02.feature-design/
|
|
@@ -164,6 +219,18 @@ Based on PRD structure, determine feature spec output structure:
|
|
|
164
219
|
|
|
165
220
|
## Step 5: Frontend Design (Per Function)
|
|
166
221
|
|
|
222
|
+
### 5.0 Conditional Execution Based on feature_type
|
|
223
|
+
|
|
224
|
+
**Execution Logic:**
|
|
225
|
+
```
|
|
226
|
+
IF feature_type = "Page+API" THEN
|
|
227
|
+
→ Execute Step 5 (Full frontend design)
|
|
228
|
+
IF feature_type = "API-only" THEN
|
|
229
|
+
→ Skip Step 5 entirely (No frontend design needed)
|
|
230
|
+
IF feature_type is NOT provided THEN
|
|
231
|
+
→ Execute Step 5 (backward compatibility)
|
|
232
|
+
```
|
|
233
|
+
|
|
167
234
|
**Multi-Platform Rule**: If multiple frontend platforms are identified, repeat the frontend design (5.1 UI Prototype + 5.2 Interface Elements + 5.3 Interaction Flow) for EACH platform. Use platform-specific section headers:
|
|
168
235
|
|
|
169
236
|
| Platforms | Section Structure |
|
|
@@ -173,6 +240,8 @@ Based on PRD structure, determine feature spec output structure:
|
|
|
173
240
|
|
|
174
241
|
**Mobile-specific wireframe patterns:**
|
|
175
242
|
|
|
243
|
+
> **Note**: These are ASCII wireframe design specifications, NOT actual template files in the `templates/` directory.
|
|
244
|
+
|
|
176
245
|
```
|
|
177
246
|
Pattern M-A: Card List (replaces PC table list)
|
|
178
247
|
+----------------------------------+
|
|
@@ -418,17 +487,15 @@ Frontend Components: {count} pages/components
|
|
|
418
487
|
Backend Interfaces: {count} APIs
|
|
419
488
|
Data Entities: {count} new, {count} modified
|
|
420
489
|
|
|
421
|
-
|
|
422
|
-
- Master Feature Spec: {filename}
|
|
423
|
-
- Sub Feature Specs: {list of filenames}
|
|
490
|
+
Output File: {filename}
|
|
424
491
|
```
|
|
425
492
|
|
|
426
493
|
**Ask user to confirm:**
|
|
427
|
-
1. Is the frontend prototype appropriate for user needs?
|
|
494
|
+
1. Is the frontend prototype appropriate for user needs? (if applicable)
|
|
428
495
|
2. Is the backend logic flow correct and complete?
|
|
429
496
|
3. Is the data model reasonable and extensible?
|
|
430
497
|
4. Are all business rules and constraints captured?
|
|
431
|
-
5. **[Master-Sub]** Is the module breakdown appropriate?
|
|
498
|
+
5. **[Legacy Master-Sub]** Is the module breakdown appropriate?
|
|
432
499
|
|
|
433
500
|
### Checkpoint B Progress Update
|
|
434
501
|
|
|
@@ -466,6 +533,19 @@ After user confirms the complete feature spec:
|
|
|
466
533
|
|
|
467
534
|
### 10.1 Determine Output Paths
|
|
468
535
|
|
|
536
|
+
#### Single Feature Mode (when feature_id provided)
|
|
537
|
+
|
|
538
|
+
```
|
|
539
|
+
speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/{feature-id}-{feature-name}-feature-spec.md
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
**Naming Rules:**
|
|
543
|
+
- `feature-id`: As provided in input (e.g., `F-CRM-01`)
|
|
544
|
+
- `feature-name`: Converted to kebab-case (lowercase with hyphens)
|
|
545
|
+
- **Example**: `F-CRM-01-customer-list-feature-spec.md`
|
|
546
|
+
|
|
547
|
+
#### Legacy Mode (backward compatibility)
|
|
548
|
+
|
|
469
549
|
**Single Feature Spec:**
|
|
470
550
|
```
|
|
471
551
|
speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/[feature-name]-feature-spec.md
|
|
@@ -517,7 +597,7 @@ Fill sections sequentially using `search_replace` for each content block:
|
|
|
517
597
|
| **Business Rules** | Permissions, validation, business logic rules |
|
|
518
598
|
| **Cross-Module Interactions** | **[If applicable]** Interface contracts between modules |
|
|
519
599
|
|
|
520
|
-
For Master-Sub specs, repeat Step 10.2a + 10.2b for each sub-spec document.
|
|
600
|
+
For legacy Master-Sub specs (when feature_id not provided), repeat Step 10.2a + 10.2b for each sub-spec document.
|
|
521
601
|
|
|
522
602
|
### 10.3 Mermaid Diagram Requirements
|
|
523
603
|
|
|
@@ -631,6 +711,44 @@ After each worker completes:
|
|
|
631
711
|
|
|
632
712
|
5. Log progress: "📊 Dispatch progress: {completed}/{total} completed, {failed} failed, {pending} pending"
|
|
633
713
|
|
|
714
|
+
---
|
|
715
|
+
|
|
716
|
+
# Reference Guides
|
|
717
|
+
|
|
718
|
+
## Backward Compatibility Details (Legacy Mode)
|
|
719
|
+
|
|
720
|
+
When `feature_id` is NOT provided, the skill operates in legacy mode:
|
|
721
|
+
|
|
722
|
+
### Master-Sub PRD Structure
|
|
723
|
+
|
|
724
|
+
If master PRD exists, also read all sub PRDs:
|
|
725
|
+
- Master PRD: `[feature-name]-prd.md`
|
|
726
|
+
- Sub PRDs: `[feature-name]-sub-[module1].md`, `[feature-name]-sub-[module2].md`, etc.
|
|
727
|
+
|
|
728
|
+
### Output Structure (Legacy)
|
|
729
|
+
|
|
730
|
+
**Single Feature Spec:**
|
|
731
|
+
```
|
|
732
|
+
speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/[feature-name]-feature-spec.md
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
**Master-Sub Feature Specs:**
|
|
736
|
+
```
|
|
737
|
+
02.feature-design/
|
|
738
|
+
├── [feature-name]-feature-spec.md # Master Feature Spec (overview + cross-module)
|
|
739
|
+
├── [feature-name]-sub-[module1]-spec.md # Sub Feature Spec: Module 1
|
|
740
|
+
├── [feature-name]-sub-[module2]-spec.md # Sub Feature Spec: Module 2
|
|
741
|
+
```
|
|
742
|
+
|
|
743
|
+
**Master Feature Spec MUST include:**
|
|
744
|
+
- Overall feature overview and goals
|
|
745
|
+
- Cross-module interaction diagram
|
|
746
|
+
- Module list with scope boundaries
|
|
747
|
+
- Cross-module interface contracts
|
|
748
|
+
- Shared data structures
|
|
749
|
+
|
|
750
|
+
---
|
|
751
|
+
|
|
634
752
|
# Key Rules
|
|
635
753
|
|
|
636
754
|
| Rule | Description |
|
|
@@ -645,22 +763,26 @@ After each worker completes:
|
|
|
645
763
|
# Checklist
|
|
646
764
|
|
|
647
765
|
- [ ] PRD has been read, all P0 requirements covered
|
|
648
|
-
- [ ] **[
|
|
766
|
+
- [ ] **[Single Feature Mode]** Feature ID and name parameters received
|
|
767
|
+
- [ ] **[Single Feature Mode]** Only related Feature content extracted from PRD
|
|
768
|
+
- [ ] **[Legacy Mode]** All sub PRDs have been read (if master-sub structure)
|
|
649
769
|
- [ ] System overview loaded for context
|
|
650
770
|
- [ ] Related module overviews loaded
|
|
651
771
|
- [ ] **[Cross-module]** Knowledge graph queried for relationship analysis
|
|
652
772
|
- [ ] Function breakdown completed with [EXISTING]/[MODIFIED]/[NEW] markers
|
|
773
|
+
- [ ] **[Single Feature Mode]** 3-8 focused Functions defined
|
|
653
774
|
- [ ] Checkpoint A passed: function breakdown confirmed with user
|
|
654
|
-
- [ ] Output structure determined (single
|
|
655
|
-
- [ ] Frontend design
|
|
775
|
+
- [ ] Output structure determined (single file for Feature mode)
|
|
776
|
+
- [ ] **[API-only]** Frontend design step skipped correctly
|
|
777
|
+
- [ ] **[Page+API]** Frontend design includes ASCII wireframes and interaction flows
|
|
656
778
|
- [ ] **[Multi-platform]** Each frontend platform has separate wireframes and interaction flows
|
|
657
779
|
- [ ] Backend design includes interface list and logic flows
|
|
658
780
|
- [ ] Data model includes new entities and modifications to existing
|
|
659
781
|
- [ ] Business rules and constraints documented
|
|
660
782
|
- [ ] Checkpoint B passed: complete feature spec confirmed with user
|
|
661
|
-
- [ ] **[Master-Sub]** Master spec includes cross-module overview and contracts
|
|
662
|
-
- [ ] **[Master-Sub]** Each sub spec covers exactly one module
|
|
783
|
+
- [ ] **[Legacy Master-Sub]** Master spec includes cross-module overview and contracts
|
|
784
|
+
- [ ] **[Legacy Master-Sub]** Each sub spec covers exactly one module
|
|
663
785
|
- [ ] All Mermaid diagrams follow mermaid-rule.md
|
|
664
786
|
- [ ] No specific technology decisions included
|
|
665
|
-
- [ ] Files written to correct paths
|
|
787
|
+
- [ ] Files written to correct paths with proper naming (`{feature-id}-{feature-name}-feature-spec.md`)
|
|
666
788
|
- [ ] API contract skill called after writing
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
|
|
13
13
|
| Item | Description |
|
|
14
14
|
|------|-------------|
|
|
15
|
+
| Feature ID | {Feature ID, e.g., F-CRM-01} |
|
|
15
16
|
| Feature Name | {Feature Name} |
|
|
17
|
+
| Feature Type | {Page+API / API-only} |
|
|
18
|
+
| Source PRD | {Link to Sub-PRD document} |
|
|
16
19
|
| Module | {Module Name} |
|
|
17
20
|
| Core Function | {1-3 sentences describing core feature value} |
|
|
18
21
|
| Target Users | {Describe target user groups} |
|
|
@@ -20,7 +23,7 @@
|
|
|
20
23
|
|
|
21
24
|
### 1.2 Feature Scope
|
|
22
25
|
|
|
23
|
-
<!-- AI-NOTE: Check all items that this specification covers -->
|
|
26
|
+
<!-- AI-NOTE: This specification covers a SINGLE Feature (business operation unit), not the entire module. Check all items that this specification covers. -->
|
|
24
27
|
|
|
25
28
|
- [ ] {Function 1} - Frontend prototype + Interaction flow + Backend interface + Data definition
|
|
26
29
|
- [ ] {Function 2} - Frontend prototype + Interaction flow + Backend interface + Data definition
|
|
@@ -30,9 +30,8 @@ Analyze one specific API controller from source code, extract all business featu
|
|
|
30
30
|
| `{{platform_type}}` | string | Platform type | `"admin-api"`, `"app-api"` |
|
|
31
31
|
| `{{platform_subtype}}` | string | Platform subtype | `"spring-boot"`, `"java"` |
|
|
32
32
|
| `{{tech_stack}}` | array | Platform tech stack | `["java", "spring-boot", "mybatis-plus"]` |
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
| `{{language}}` | string | **REQUIRED** - Target language for generated content | `"zh"`, `"en"` |
|
|
33
|
+
|
|
34
|
+
> **Note**: Additional parameters for completion markers (`completed_dir`, `sourceFile`, `language`) are defined in Step 7 and Language Adaptation section.
|
|
36
35
|
|
|
37
36
|
## Language Adaptation
|
|
38
37
|
|
|
@@ -129,8 +128,14 @@ graph TB
|
|
|
129
128
|
**Step 1 Status: 🔄 IN PROGRESS**
|
|
130
129
|
|
|
131
130
|
1. **Check Analysis Status:**
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
```
|
|
132
|
+
IF {{analyzed}} == true THEN
|
|
133
|
+
Output "Step 1 Status: ⏭️ SKIPPED (already analyzed)"
|
|
134
|
+
Skip to Step 6 with status="skipped"
|
|
135
|
+
ELSE
|
|
136
|
+
Proceed to next step
|
|
137
|
+
END IF
|
|
138
|
+
```
|
|
134
139
|
|
|
135
140
|
2. **Read the appropriate template based on tech stack:**
|
|
136
141
|
- Java/Spring Boot: Read `templates/FEATURE-DETAIL-TEMPLATE.md`
|
|
@@ -216,13 +221,8 @@ Each public API endpoint in the controller = one feature.
|
|
|
216
221
|
- Document ALL public API endpoints with their HTTP methods and paths
|
|
217
222
|
- For **internal service methods**: only record references, do not document as separate features
|
|
218
223
|
- Document business flows for each API endpoint: request validation → business logic → data persistence → response
|
|
219
|
-
- **
|
|
220
|
-
|
|
221
|
-
- No parentheses `()` in node text (e.g., use `validate request` instead of `validate()`)
|
|
222
|
-
- No HTML tags like `<br/>`
|
|
223
|
-
- No `style` definitions
|
|
224
|
-
- No nested `subgraph`
|
|
225
|
-
- No special characters in node text
|
|
224
|
+
- **Read Configuration**: Read `speccrew-workspace/docs/rules/mermaid-rule.md` for Mermaid diagram guidelines
|
|
225
|
+
- **Generate Mermaid flowcharts** following the configuration (see [Reference Guides > Mermaid Guide](#mermaid-guide) for quick reference)
|
|
226
226
|
- Use `{{language}}` for all extracted content naming
|
|
227
227
|
|
|
228
228
|
**Example Code Analysis:**
|
|
@@ -846,12 +846,15 @@ Or in case of failure:
|
|
|
846
846
|
|
|
847
847
|
**⚠️ MANDATORY - This step MUST be executed. The task is NOT complete until marker files are written.**
|
|
848
848
|
|
|
849
|
-
|
|
849
|
+
Write analysis results to marker files for dispatch batch processing.
|
|
850
|
+
|
|
851
|
+
**Input Parameters (from dispatch):**
|
|
852
|
+
- `{{completed_dir}}` - **REQUIRED** - Marker files output directory (e.g., `speccrew-workspace/knowledges/base/sync-state/knowledge-bizs/completed`)
|
|
853
|
+
- `{{sourceFile}}` - **REQUIRED** - Source features JSON file name (e.g., `features-admin-api.json`)
|
|
854
|
+
- `{{language}}` - **REQUIRED** - Target language for content (see Language Adaptation section)
|
|
850
855
|
|
|
851
856
|
**Prerequisites:**
|
|
852
857
|
- Step 6 completed successfully
|
|
853
|
-
- `{{completed_dir}}` - Marker files output directory (e.g., `speccrew-workspace/knowledges/base/sync-state/knowledge-bizs/completed`)
|
|
854
|
-
- `{{sourceFile}}` - Source features JSON file name
|
|
855
858
|
|
|
856
859
|
> **ASSUMPTION**: The `completed_dir` directory already exists (pre-created by dispatch Stage 2). If write fails, report error — do NOT attempt to create directories.
|
|
857
860
|
|
|
@@ -1103,6 +1106,17 @@ Before writing the graph.json file, verify:
|
|
|
1103
1106
|
|
|
1104
1107
|
## Reference Guides
|
|
1105
1108
|
|
|
1109
|
+
### Mermaid Guide
|
|
1110
|
+
|
|
1111
|
+
When generating Mermaid diagrams, follow these compatibility guidelines from `speccrew-workspace/docs/rules/mermaid-rule.md`:
|
|
1112
|
+
|
|
1113
|
+
- Use `graph TB` or `graph LR` syntax (not `flowchart`)
|
|
1114
|
+
- No parentheses `()` in node text
|
|
1115
|
+
- No HTML tags like `<br/>`
|
|
1116
|
+
- No `style` definitions
|
|
1117
|
+
- No nested `subgraph`
|
|
1118
|
+
- No special characters in node text
|
|
1119
|
+
|
|
1106
1120
|
### Business Flow Diagram Guidelines
|
|
1107
1121
|
|
|
1108
1122
|
When generating business flow diagrams in feature documents, follow these principles:
|