speccrew 0.5.13 → 0.5.16
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-team-leader.md +60 -4
- package/.speccrew/agents/speccrew-test-manager.md +361 -37
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +63 -626
- package/.speccrew/skills/speccrew-knowledge-bizs-api-graph/SKILL.md +505 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +165 -31
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +63 -728
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-graph/SKILL.md +389 -0
- package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +26 -0
- package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +27 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +185 -21
- package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +134 -883
- package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +36 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-quality/SKILL.md +414 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +35 -0
- package/.speccrew/skills/speccrew-test-reporter/SKILL.md +297 -0
- package/.speccrew/skills/{speccrew-test-execute → speccrew-test-reporter}/templates/BUG-REPORT-TEMPLATE.md +24 -1
- package/.speccrew/skills/{speccrew-test-execute → speccrew-test-reporter}/templates/TEST-REPORT-TEMPLATE.md +8 -1
- package/.speccrew/skills/{speccrew-test-execute → speccrew-test-runner}/SKILL.md +142 -104
- package/.speccrew/skills/speccrew-test-runner/templates/TEST-EXECUTION-RESULT-TEMPLATE.md +80 -0
- package/lib/utils.js +1 -0
- package/package.json +1 -1
|
@@ -31,8 +31,6 @@ Analyze one specific UI feature from source code, extract business functionality
|
|
|
31
31
|
| `{{platform_subtype}}` | string | Platform subtype | `"vue"`, `"react"` |
|
|
32
32
|
| `{{tech_stack}}` | array | Platform tech stack | `["vue", "typescript"]` |
|
|
33
33
|
| `{{language}}` | string | **REQUIRED** - Target language for generated content | `"zh"`, `"en"` |
|
|
34
|
-
| `{{completed_dir}}` | string | Marker files output directory | `"speccrew-workspace/knowledges/base/sync-state/knowledge-bizs/completed"` |
|
|
35
|
-
| `{{sourceFile}}` | string | Source features JSON file name | `"features-web-vue.json"` |
|
|
36
34
|
|
|
37
35
|
## Language Adaptation
|
|
38
36
|
|
|
@@ -57,8 +55,6 @@ Analyze one specific UI feature from source code, extract business functionality
|
|
|
57
55
|
|
|
58
56
|
**Generated Files (MANDATORY - Task is NOT complete until all files are written):**
|
|
59
57
|
1. `{{documentPath}}` - Feature documentation file
|
|
60
|
-
2. `{{completed_dir}}/{module}-{subpath}-{fileName}.done.json` - Completion status marker
|
|
61
|
-
3. `{{completed_dir}}/{module}-{subpath}-{fileName}.graph.json` - Graph data marker
|
|
62
58
|
|
|
63
59
|
**Return Value (JSON format):**
|
|
64
60
|
```json
|
|
@@ -76,7 +72,7 @@ Analyze one specific UI feature from source code, extract business functionality
|
|
|
76
72
|
}
|
|
77
73
|
```
|
|
78
74
|
|
|
79
|
-
|
|
75
|
+
> **Note**: Graph data construction (nodes, edges, marker files) is handled by `speccrew-knowledge-bizs-ui-graph` Skill. This Skill only generates feature documentation.
|
|
80
76
|
|
|
81
77
|
## Workflow
|
|
82
78
|
|
|
@@ -95,8 +91,7 @@ graph TB
|
|
|
95
91
|
Step4 --> Step5a[Step 5a Copy Template to Document Path]
|
|
96
92
|
Step5a --> Step5b[Step 5b Fill Each Section Using search_replace]
|
|
97
93
|
Step5b --> Step6[Step 6 Report Results]
|
|
98
|
-
Step6 -->
|
|
99
|
-
Step7 --> End([End])
|
|
94
|
+
Step6 --> End([End])
|
|
100
95
|
```
|
|
101
96
|
|
|
102
97
|
---
|
|
@@ -118,7 +113,7 @@ graph TB
|
|
|
118
113
|
2. **Read the appropriate template based on platform type:**
|
|
119
114
|
|
|
120
115
|
**Template Selection:**
|
|
121
|
-
|
|
116
|
+
|
|
122
117
|
| Platform Type | Template File | Description |
|
|
123
118
|
|--------------|---------------|-------------|
|
|
124
119
|
| Web (Vue/React/Angular) | `templates/FEATURE-DETAIL-TEMPLATE-UI.md` | Default/Generic web template |
|
|
@@ -174,94 +169,43 @@ graph TB
|
|
|
174
169
|
|------------------|------------------------|--------|
|
|
175
170
|
| 1. Content Overview | Feature name, document path, source path, description | `{{fileName}}`, `{{documentPath}}`, `{{sourcePath}}` |
|
|
176
171
|
| 2. Interface Prototype | Main page and embedded modals ASCII wireframes, element descriptions | Component template, JSX/Vue template |
|
|
177
|
-
| 3. Business Flow | Page initialization, component events (onClick/onChange/etc), timer/websocket, page close flows
|
|
178
|
-
| 4. Data Field Definition | Page state fields, form fields with validation
|
|
179
|
-
| 5. References | APIs, shared methods, shared components, other pages
|
|
172
|
+
| 3. Business Flow | Page initialization, component events (onClick/onChange/etc), timer/websocket, page close flows | Event handlers, lifecycle hooks, timers |
|
|
173
|
+
| 4. Data Field Definition | Page state fields, form fields with validation | State definitions, form schemas, v-model bindings |
|
|
174
|
+
| 5. References | APIs, shared methods, shared components, other pages | API calls, imports, navigation |
|
|
180
175
|
| 6. Business Rules | Permission rules, business logic rules, validation rules | Code logic, comments |
|
|
181
|
-
| 7. Notes and Additional Info | Compatibility, pending confirmations, extension notes
|
|
176
|
+
| 7. Notes and Additional Info | Compatibility, pending confirmations, extension notes | Full source analysis |
|
|
182
177
|
|
|
183
178
|
**Enhanced Analysis Requirements:**
|
|
184
179
|
|
|
185
180
|
#### A. API Call Sequence Analysis (MUST include in Section 3 Business Flow)
|
|
186
181
|
|
|
187
|
-
For EVERY business flow that involves multiple API calls,
|
|
182
|
+
For EVERY business flow that involves multiple API calls, analyze:
|
|
188
183
|
- Whether API calls are executed **serially** or **in parallel** (Promise.all vs sequential await)
|
|
189
|
-
- The timing logic inside `try/catch/finally` blocks
|
|
184
|
+
- The timing logic inside `try/catch/finally` blocks
|
|
190
185
|
- Whether **race conditions** exist between multiple API calls
|
|
191
186
|
- If one API fails, whether subsequent APIs will still execute
|
|
192
187
|
|
|
193
|
-
Add a
|
|
194
|
-
```markdown
|
|
195
|
-
**时序分析**:
|
|
196
|
-
- getUserRoleList 和 getSimpleRoleList 为串行调用
|
|
197
|
-
- formLoading 在 finally 中恢复,但 getSimpleRoleList 在 finally 之外执行
|
|
198
|
-
- ⚠️ 竞态风险:getUserRoleList 失败时,getSimpleRoleList 仍会执行
|
|
199
|
-
```
|
|
200
|
-
If a flow only has a single API call, SHOULD still note "单一 API 调用,无竞态风险" for clarity.
|
|
188
|
+
Add a **Sequence Analysis** note block after each multi-API flow.
|
|
201
189
|
|
|
202
190
|
#### B. Boundary Scenario Flows (MUST include in Section 3 Business Flow)
|
|
203
191
|
|
|
204
|
-
|
|
192
|
+
Document key boundary scenarios:
|
|
205
193
|
- **Empty data / empty list**: What is displayed when API returns empty results?
|
|
206
|
-
- **Error / exception branches**: What happens on API failure, network timeout
|
|
207
|
-
- **State reset / cleanup**: When and how is form/state reset
|
|
208
|
-
- **Concurrent operation scenarios**: What happens on rapid consecutive clicks
|
|
209
|
-
|
|
210
|
-
Document these as additional sub-sections or a dedicated **边界场景 / Boundary Scenarios** table within the relevant flow:
|
|
211
|
-
```markdown
|
|
212
|
-
**边界场景**:
|
|
213
|
-
| 场景 | 触发条件 | 处理方式 |
|
|
214
|
-
|------|----------|----------|
|
|
215
|
-
| 空列表 | API 返回 data=[] | 展示空状态提示 |
|
|
216
|
-
| API 失败 | 网络超时/服务端报错 | ElMessage 提示错误信息 |
|
|
217
|
-
| 状态重置 | 关闭弹窗 | resetForm() 清空所有字段 |
|
|
218
|
-
| 重复提交 | 按钮未 disable | ⚠️ 存在重复提交风险 |
|
|
219
|
-
```
|
|
220
|
-
If no boundary scenarios are identifiable from code, SHOULD explicitly state "无明显边界场景处理".
|
|
194
|
+
- **Error / exception branches**: What happens on API failure, network timeout?
|
|
195
|
+
- **State reset / cleanup**: When and how is form/state reset?
|
|
196
|
+
- **Concurrent operation scenarios**: What happens on rapid consecutive clicks?
|
|
221
197
|
|
|
222
198
|
#### C. Data Binding Relationship (MUST include in Section 4 Data Field Definition)
|
|
223
199
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
**Data Binding Mapping Table** — for each reactive field, trace its full binding chain:
|
|
227
|
-
|
|
228
|
-
```markdown
|
|
229
|
-
**数据绑定映射**:
|
|
230
|
-
| 字段 | UI 绑定 | 数据流向 | 同步时机 |
|
|
231
|
-
|------|---------|----------|----------|
|
|
232
|
-
| formData.roleIds | `<el-transfer v-model>` | 组件内部 ↔ formData | 用户操作穿梭框时实时同步 |
|
|
233
|
-
| roleList | `<el-transfer :data>` | API → roleList | 弹窗打开时一次性加载 |
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
**Reactive Dependency Chain** — document all `watch` and `computed` dependencies:
|
|
237
|
-
```markdown
|
|
238
|
-
**响应式依赖链**:
|
|
239
|
-
- watch(props.userId) → 触发 getUserRoleList() → 更新 formData.roleIds
|
|
240
|
-
- computed: 无
|
|
241
|
-
```
|
|
242
|
-
If the component has no `watch` or `computed`, MUST explicitly state "无响应式依赖(无 watch / computed)".
|
|
200
|
+
**Data Binding Mapping Table** — trace full binding chain for each reactive field.
|
|
201
|
+
**Reactive Dependency Chain** — document all `watch` and `computed` dependencies.
|
|
243
202
|
|
|
244
203
|
#### D. Performance and Scalability Analysis (MUST include in Section 7 Notes)
|
|
245
204
|
|
|
246
|
-
|
|
247
|
-
- **
|
|
248
|
-
- **
|
|
249
|
-
- **
|
|
250
|
-
- **Pending confirmations (design questions)**: SHOULD raise questions about design reasonability and suggest improvements
|
|
251
|
-
|
|
252
|
-
Example format:
|
|
253
|
-
```markdown
|
|
254
|
-
### 7.x 性能与可扩展性考量
|
|
255
|
-
|
|
256
|
-
- ⚠️ **全量加载风险**:getSimpleRoleList 全量加载角色列表,角色数量大时存在性能隐患
|
|
257
|
-
- ⚠️ **UI 渲染风险**:el-transfer 组件在角色数量超过 500 条时渲染性能明显下降
|
|
258
|
-
- **可扩展性限制**:当前设计不支持角色分页搜索
|
|
259
|
-
|
|
260
|
-
**待确认事项**:
|
|
261
|
-
- [ ] 是否需要对角色列表增加搜索过滤功能?
|
|
262
|
-
- [ ] 是否应将全量加载改为分页 + 搜索模式以支持大规模角色场景?
|
|
263
|
-
```
|
|
264
|
-
If no obvious performance risks exist, SHOULD explicitly note "当前数据规模下无明显性能风险".
|
|
205
|
+
- **Full-load performance risks**: Dropdowns/selectors that load ALL records without pagination
|
|
206
|
+
- **Large-data UI performance risks**: UI component behavior under large datasets
|
|
207
|
+
- **Scalability limitations**: Hardcoded assumptions that limit extensibility
|
|
208
|
+
- **Pending confirmations**: Design questions and improvement suggestions
|
|
265
209
|
|
|
266
210
|
**Output:** "Step 2 Status: ✅ COMPLETED - Read {{sourcePath}} ({{lineCount}} lines), Analyzed {{componentCount}} components, {{eventCount}} events"
|
|
267
211
|
|
|
@@ -284,10 +228,7 @@ Each user interaction or page initialization in the feature file = one business
|
|
|
284
228
|
- Only add reference links in Section 5.4 (Other Pages) or 5.3 (Shared Components)
|
|
285
229
|
- DO NOT draw wireframes for them
|
|
286
230
|
- DO NOT analyze their internal implementation
|
|
287
|
-
- Document ALL business flows: page init, component events
|
|
288
|
-
- **MUST analyze API call sequences**: identify serial vs parallel calls, try/catch/finally timing, race conditions
|
|
289
|
-
- **MUST document boundary scenarios**: empty data, error branches, state reset, concurrent operations
|
|
290
|
-
- For APIs and shared methods in flowcharts: show name, type, and main function only (no deep analysis)
|
|
231
|
+
- Document ALL business flows: page init, component events, timers, websocket, page close
|
|
291
232
|
- **Read Configuration**: Read `speccrew-workspace/docs/rules/mermaid-rule.md` for Mermaid diagram guidelines
|
|
292
233
|
- **Generate Mermaid flowcharts** following the configuration:
|
|
293
234
|
- Use `graph TB` or `graph LR` syntax (not `flowchart`)
|
|
@@ -297,83 +238,7 @@ Each user interaction or page initialization in the feature file = one business
|
|
|
297
238
|
- No nested `subgraph`
|
|
298
239
|
- Use `{{language}}` for all extracted content naming
|
|
299
240
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
While analyzing the feature, simultaneously extract graph nodes and edges:
|
|
303
|
-
|
|
304
|
-
**Nodes to Extract:**
|
|
305
|
-
|
|
306
|
-
| Node Type | Source | ID Format | Context Fields |
|
|
307
|
-
|-----------|--------|-----------|----------------|
|
|
308
|
-
| `page` | The analyzed page/screen | `page-{module}-{name}` | `route`, `components`, `events`, `platform` |
|
|
309
|
-
| `component` | Embedded or local components used | `component-{module}-{name}` | `props`, `events`, `slots` |
|
|
310
|
-
|
|
311
|
-
**Edges to Extract:**
|
|
312
|
-
|
|
313
|
-
| Edge Type | Direction | When to Create |
|
|
314
|
-
|-----------|-----------|----------------|
|
|
315
|
-
| `calls` | page → api | Page calls an API endpoint (from API service imports / HTTP requests) |
|
|
316
|
-
| `navigates-to` | page → page | Page navigates to another page (router.push, link, etc.) |
|
|
317
|
-
| `uses` | page → component | Page uses a shared/local component |
|
|
318
|
-
|
|
319
|
-
**CRITICAL - API Extraction Requirements (100% Coverage Mandatory):**
|
|
320
|
-
|
|
321
|
-
To ensure complete API coverage in the graph data, you MUST follow these requirements:
|
|
322
|
-
|
|
323
|
-
1. **Extract ALL Imported API Functions:**
|
|
324
|
-
- Scan the entire source file for ALL `import { ... } from '@/api/...'` or similar API import statements
|
|
325
|
-
- EVERY function imported from API modules MUST be extracted as a `calls` edge
|
|
326
|
-
- Do NOT filter or select only "main" or "core" APIs - include ALL of them
|
|
327
|
-
|
|
328
|
-
2. **API Call Categories to Cover:**
|
|
329
|
-
| Category | Examples | Where to Look |
|
|
330
|
-
|----------|----------|---------------|
|
|
331
|
-
| Page Initialization | `getList`, `getDetail`, `getPage` | `onMounted`, `created`, `useEffect` |
|
|
332
|
-
| Data Query | `getUserList`, `searchOrders` | Search forms, filter changes |
|
|
333
|
-
| Create Operations | `createUser`, `addOrder` | Form submission handlers |
|
|
334
|
-
| Update Operations | `updateUser`, `editOrder` | Edit form submissions |
|
|
335
|
-
| **Status Update** | `updateUserStatus`, `toggleEnable`, `setActive` | Status switch handlers, toggle buttons |
|
|
336
|
-
| **Special Operations** | `resetPassword`, `exportData`, `importData`, `batchDelete` | Action buttons, toolbar buttons |
|
|
337
|
-
| Delete Operations | `deleteUser`, `removeOrder` | Delete confirmation handlers |
|
|
338
|
-
| Dictionary/Options | `getDictList`, `getOptions` | Dropdown initialization |
|
|
339
|
-
|
|
340
|
-
3. **How to Identify API Calls:**
|
|
341
|
-
- Look for: `import { func1, func2 } from '@/api/xxx'` statements
|
|
342
|
-
- Look for: Direct API function calls in event handlers (`@click="handleSubmit"` → `handleSubmit()` calls API)
|
|
343
|
-
- Look for: API calls in lifecycle hooks (Vue: `onMounted`, React: `useEffect`)
|
|
344
|
-
- Look for: API calls in watch/computed setters
|
|
345
|
-
|
|
346
|
-
4. **API Coverage Verification Checklist:**
|
|
347
|
-
- [ ] List ALL imported API functions from the source file
|
|
348
|
-
- [ ] For each imported API, verify there is a corresponding `calls` edge
|
|
349
|
-
- [ ] Check event handlers (button clicks, form submits) for API calls
|
|
350
|
-
- [ ] Check lifecycle hooks for initialization API calls
|
|
351
|
-
- [ ] Check status toggles, action buttons for special operation APIs
|
|
352
|
-
- [ ] Verify no imported API is left unmapped
|
|
353
|
-
|
|
354
|
-
5. **Edge Metadata Requirements:**
|
|
355
|
-
- `trigger`: Event name (e.g., "onClick", "onMounted", "onSubmit")
|
|
356
|
-
- `method`: The API function name being called
|
|
357
|
-
- `context`: Brief description of when/why this API is called
|
|
358
|
-
|
|
359
|
-
**Node ID Naming Convention:**
|
|
360
|
-
```
|
|
361
|
-
{type}-{module}-{name}
|
|
362
|
-
Examples:
|
|
363
|
-
page-system-user-list
|
|
364
|
-
page-system-user-detail
|
|
365
|
-
component-system-user-form
|
|
366
|
-
component-shared-delete-confirm
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
**IMPORTANT:**
|
|
370
|
-
- `module` comes from `{{module}}` input variable
|
|
371
|
-
- `name` should be a short, readable slug derived from the page/component name
|
|
372
|
-
- Each node must include `sourcePath` and `documentPath` (if applicable)
|
|
373
|
-
- For `calls` edges: the `target` is the API node ID (format `api-{module}-{name}`), which will be matched with api-analyze output
|
|
374
|
-
- Edge `metadata` should include trigger info (event name, lifecycle hook, etc.)
|
|
375
|
-
|
|
376
|
-
**Output:** "Step 3 Status: ✅ COMPLETED - Extracted {{wireframeCount}} wireframes, {{flowCount}} business flows, {{nodeCount}} graph nodes, {{edgeCount}} graph edges"
|
|
241
|
+
**Output:** "Step 3 Status: ✅ COMPLETED - Extracted {{wireframeCount}} wireframes, {{flowCount}} business flows"
|
|
377
242
|
|
|
378
243
|
### Step 4: Find Referencing Pages
|
|
379
244
|
|
|
@@ -390,7 +255,7 @@ Search other page files in the codebase to find which pages reference/navigate t
|
|
|
390
255
|
| Field | Description |
|
|
391
256
|
|-------|-------------|
|
|
392
257
|
| Page Name | Name of the page that references this page |
|
|
393
|
-
| Function Description | How/why it references this page
|
|
258
|
+
| Function Description | How/why it references this page |
|
|
394
259
|
| Source Path | Relative path to the referencing page source file |
|
|
395
260
|
| Document Path | Path to the referencing page's generated document |
|
|
396
261
|
|
|
@@ -417,31 +282,19 @@ Search other page files in the codebase to find which pages reference/navigate t
|
|
|
417
282
|
|
|
418
283
|
2. **Read the Selected Template File:**
|
|
419
284
|
- Read the template file content from the skill's templates directory
|
|
420
|
-
- Example path: `d:/dev/speccrew/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI.md`
|
|
421
285
|
|
|
422
286
|
3. **Replace Top-Level Placeholders:**
|
|
423
287
|
|
|
424
|
-
Replace the following placeholders in the template content:
|
|
425
|
-
|
|
426
288
|
| Placeholder | Replacement | Example |
|
|
427
289
|
|-------------|-------------|---------|
|
|
428
|
-
| `{Feature Name}` | Human-readable feature name
|
|
429
|
-
| `{documentPath}` | `{{documentPath}}` input variable | `"speccrew-workspace/knowledges/bizs/web-vue
|
|
290
|
+
| `{Feature Name}` | Human-readable feature name | `"用户管理列表"` |
|
|
291
|
+
| `{documentPath}` | `{{documentPath}}` input variable | `"speccrew-workspace/knowledges/bizs/web-vue/..."` |
|
|
430
292
|
| `{sourcePath}` | `{{sourcePath}}` input variable | `"frontend-web/src/views/system/user/index.vue"` |
|
|
431
293
|
| `{Date}` | Current date | `"2026-04-04"` |
|
|
432
294
|
| `{FeatureFile}.vue` | `{{fileName}}` with appropriate extension | `"index.vue"` |
|
|
433
295
|
|
|
434
296
|
4. **Write the Document Using create_file:**
|
|
435
|
-
|
|
436
297
|
Use `create_file` to write the placeholder-replaced template content to `{{documentPath}}`.
|
|
437
|
-
|
|
438
|
-
**Example:**
|
|
439
|
-
```
|
|
440
|
-
create_file(
|
|
441
|
-
file_path: "{{documentPath}}",
|
|
442
|
-
file_content: "<template content with top-level placeholders replaced>"
|
|
443
|
-
)
|
|
444
|
-
```
|
|
445
298
|
|
|
446
299
|
**Pre-write Checklist:**
|
|
447
300
|
- [ ] Template file selected based on `{{platform_type}}`
|
|
@@ -460,7 +313,7 @@ Search other page files in the codebase to find which pages reference/navigate t
|
|
|
460
313
|
**Objective:** Fill each section of the copied template document using `search_replace`, preserving section structure.
|
|
461
314
|
|
|
462
315
|
**CRITICAL Rules:**
|
|
463
|
-
- ⚠️ **NEVER use `create_file` to rewrite the entire document**
|
|
316
|
+
- ⚠️ **NEVER use `create_file` to rewrite the entire document**
|
|
464
317
|
- ⚠️ **ALWAYS use `search_replace` to update specific sections**
|
|
465
318
|
- ⚠️ **Section titles and numbering MUST be preserved**
|
|
466
319
|
- ⚠️ **If a section has no corresponding information, replace placeholder content with "N/A"**
|
|
@@ -468,254 +321,38 @@ Search other page files in the codebase to find which pages reference/navigate t
|
|
|
468
321
|
**Section Filling Order:**
|
|
469
322
|
|
|
470
323
|
#### 1. Section 1 - Content Overview
|
|
471
|
-
|
|
472
|
-
**Anchor:** The `description:` line under Section 1 header
|
|
473
|
-
|
|
474
|
-
**Operation:** Replace the placeholder description with actual feature description:
|
|
475
|
-
|
|
476
|
-
```markdown
|
|
477
|
-
# Before (template)
|
|
478
|
-
description: Feature overview.
|
|
479
|
-
|
|
480
|
-
# After (filled)
|
|
481
|
-
description: 用户管理列表页面,提供用户查询、新增、编辑、删除、状态切换等功能。
|
|
482
|
-
```
|
|
483
|
-
|
|
484
|
-
**search_replace Example:**
|
|
485
|
-
```
|
|
486
|
-
original_text: "description: Feature overview."
|
|
487
|
-
new_text: "description: 用户管理列表页面,提供用户查询、新增、编辑、删除、状态切换等功能。"
|
|
488
|
-
```
|
|
489
|
-
|
|
490
|
-
---
|
|
324
|
+
Replace the placeholder description with actual feature description.
|
|
491
325
|
|
|
492
326
|
#### 2. Section 2 - Interface Prototype
|
|
493
|
-
|
|
494
|
-
**Anchor:** The ASCII wireframe block under each `### 2.x` subsection
|
|
495
|
-
|
|
496
|
-
**Operation:** Replace the example ASCII wireframe with actual wireframe drawn in Step 3
|
|
497
|
-
|
|
498
|
-
**search_replace Example:**
|
|
499
|
-
```
|
|
500
|
-
original_text: |
|
|
501
|
-
```
|
|
502
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
503
|
-
│ [Page Title] {e.g., Product Management List} │
|
|
504
|
-
├─────────────────────────────────────────────────────────────┤
|
|
505
|
-
... (entire example wireframe block)
|
|
506
|
-
└─────────────────────────────────────────────────────────────┘
|
|
507
|
-
```
|
|
508
|
-
|
|
509
|
-
new_text: |
|
|
510
|
-
```
|
|
511
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
512
|
-
│ 用户管理 │
|
|
513
|
-
├─────────────────────────────────────────────────────────────┤
|
|
514
|
-
│ 昵称: [________] 用户名: [________] 状态: [全部 ▼] │
|
|
515
|
-
│ [查询] [重置] [新增] │
|
|
516
|
-
...
|
|
517
|
-
```
|
|
518
|
-
```
|
|
519
|
-
|
|
520
|
-
**For Interface Element Description table:**
|
|
521
|
-
- Replace each example row with actual element descriptions
|
|
522
|
-
- Use `search_replace` to replace the entire table content
|
|
523
|
-
|
|
524
|
-
---
|
|
327
|
+
Replace the example ASCII wireframe with actual wireframe drawn in Step 3.
|
|
525
328
|
|
|
526
329
|
#### 3. Section 3 - Business Flow
|
|
527
|
-
|
|
528
|
-
**Anchors:** Each `### 3.x` and `#### 3.x.x` subsection with its Mermaid diagram
|
|
529
|
-
|
|
530
|
-
**Operation:** Replace example Mermaid diagrams with actual flow diagrams from Step 3
|
|
531
|
-
|
|
532
|
-
**Required Flow Types (from template):**
|
|
533
|
-
- `3.1` Page Initialization Flow
|
|
534
|
-
- `3.2.x` Component Event Flows (onClick, onChange, etc.)
|
|
535
|
-
- `3.3.x` Timer/WebSocket Flows (if applicable)
|
|
536
|
-
- `3.4` Page Close/Cleanup Flow (if applicable)
|
|
537
|
-
|
|
538
|
-
**search_replace Example:**
|
|
539
|
-
```
|
|
540
|
-
original_text: |
|
|
541
|
-
```mermaid
|
|
542
|
-
graph TB
|
|
543
|
-
Start([Page Load]) --> Init[Initialize Page State]
|
|
544
|
-
Init --> CheckParams[Parse URL Parameters]
|
|
545
|
-
... (example flow)
|
|
546
|
-
```
|
|
547
|
-
|
|
548
|
-
new_text: |
|
|
549
|
-
```mermaid
|
|
550
|
-
graph TB
|
|
551
|
-
Start([页面加载]) --> Init[初始化页面状态]
|
|
552
|
-
Init --> GetUserList[获取用户列表]
|
|
553
|
-
GetUserList --> API1[API getUserList - 查询API - 获取用户列表]
|
|
554
|
-
...
|
|
555
|
-
```
|
|
556
|
-
```
|
|
557
|
-
|
|
558
|
-
**Flow Description Table:** Replace the example table with actual step descriptions
|
|
559
|
-
|
|
560
|
-
**Referenced Items Table:** Replace with actual API/method references
|
|
561
|
-
|
|
562
|
-
**MANDATORY Additions for Section 3:**
|
|
563
|
-
|
|
564
|
-
After each multi-API flow, add **时序分析 / Sequence Analysis**:
|
|
565
|
-
|
|
566
|
-
```markdown
|
|
567
|
-
**时序分析**:
|
|
568
|
-
- getUserRoleList 和 getSimpleRoleList 为串行调用
|
|
569
|
-
- formLoading 在 finally 中恢复
|
|
570
|
-
- ⚠️ 竞态风险:getUserRoleList 失败时,getSimpleRoleList 仍会执行
|
|
571
|
-
```
|
|
572
|
-
|
|
573
|
-
After flow descriptions, add **边界场景 / Boundary Scenarios** table:
|
|
574
|
-
|
|
575
|
-
```markdown
|
|
576
|
-
**边界场景**:
|
|
577
|
-
| 场景 | 触发条件 | 处理方式 |
|
|
578
|
-
|------|----------|----------|
|
|
579
|
-
| 空列表 | API 返回 data=[] | 展示空状态提示 |
|
|
580
|
-
| API 失败 | 网络超时/服务端报错 | ElMessage 提示错误信息 |
|
|
581
|
-
| 状态重置 | 关闭弹窗 | resetForm() 清空所有字段 |
|
|
582
|
-
```
|
|
583
|
-
|
|
584
|
-
---
|
|
330
|
+
Replace example Mermaid diagrams with actual flow diagrams from Step 3. Add **Sequence Analysis** and **Boundary Scenarios** tables.
|
|
585
331
|
|
|
586
332
|
#### 4. Section 4 - Data Field Definition
|
|
587
|
-
|
|
588
|
-
**Anchors:**
|
|
589
|
-
- `### 4.1 Page State Fields` table
|
|
590
|
-
- `### 4.2 Form Fields` table
|
|
591
|
-
|
|
592
|
-
**Operation:** Replace example field rows with actual field definitions from Step 2 analysis
|
|
593
|
-
|
|
594
|
-
**search_replace Example:**
|
|
595
|
-
```
|
|
596
|
-
original_text: |
|
|
597
|
-
| Field Name | Field Type | Description | Source |
|
|
598
|
-
|------------|------------|-------------|--------|
|
|
599
|
-
| {Field 1} | String/Number/Boolean/Array/Object | {Description} | [Source]({pathPrefix}{sourcePath}) |
|
|
600
|
-
| {Field 2} | String | {Description} | [Source]({pathPrefix}{sourcePath}) |
|
|
601
|
-
|
|
602
|
-
new_text: |
|
|
603
|
-
| Field Name | Field Type | Description | Source |
|
|
604
|
-
|------------|------------|-------------|--------|
|
|
605
|
-
| userList | Array | 用户列表数据 | [Source](../../../../../../frontend-web/src/views/system/user/index.vue) |
|
|
606
|
-
| loading | Boolean | 列表加载状态 | [Source](../../../../../../frontend-web/src/views/system/user/index.vue) |
|
|
607
|
-
| queryParams | Object | 查询参数对象 | [Source](../../../../../../frontend-web/src/views/system/user/index.vue) |
|
|
608
|
-
```
|
|
609
|
-
|
|
610
|
-
> **Note**: The example above assumes `documentPath` has 8 levels (e.g., `speccrew-workspace/knowledges/bizs/web-vue3/src/views/system/user/index.md`), so `{pathPrefix}` = `../../../../../../`. Adjust the number of `../` based on actual `documentPath` depth.
|
|
611
|
-
|
|
612
|
-
**MANDATORY Additions for Section 4:**
|
|
613
|
-
|
|
614
|
-
After the field tables, add **数据绑定映射 / Data Binding Mapping** table:
|
|
615
|
-
|
|
616
|
-
```markdown
|
|
617
|
-
**数据绑定映射**:
|
|
618
|
-
| 字段 | UI 绑定 | 数据流向 | 同步时机 |
|
|
619
|
-
|------|---------|----------|----------|
|
|
620
|
-
| formData.roleIds | `<el-transfer v-model>` | 组件内部 ↔ formData | 用户操作穿梭框时实时同步 |
|
|
621
|
-
| roleList | `<el-transfer :data>` | API → roleList | 弹窗打开时一次性加载 |
|
|
622
|
-
```
|
|
623
|
-
|
|
624
|
-
Add **响应式依赖链 / Reactive Dependency Chain**:
|
|
625
|
-
|
|
626
|
-
```markdown
|
|
627
|
-
**响应式依赖链**:
|
|
628
|
-
- watch(props.userId) → 触发 getUserRoleList() → 更新 formData.roleIds
|
|
629
|
-
- computed: 无
|
|
630
|
-
```
|
|
631
|
-
|
|
632
|
-
---
|
|
333
|
+
Replace example field rows with actual field definitions. Add **Data Binding Mapping** and **Reactive Dependency Chain**.
|
|
633
334
|
|
|
634
335
|
#### 5. Section 5 - References
|
|
635
|
-
|
|
636
|
-
**Anchors:** Tables under `### 5.1` through `### 5.5`
|
|
637
|
-
|
|
638
|
-
**Operation:** Replace each reference table with actual references found in analysis
|
|
639
|
-
|
|
640
|
-
**Subsections to Fill:**
|
|
641
|
-
- `5.1 APIs` — All API functions imported and called
|
|
642
|
-
- `5.2 Frontend Shared Methods` — Utility functions used
|
|
643
|
-
- `5.3 Shared Components` — External components used
|
|
644
|
-
- `5.4 Other Pages (This Page References)` — Pages navigated to
|
|
645
|
-
- `5.5 Referenced By (Other Pages Reference This Page)` — From Step 4 results
|
|
646
|
-
|
|
647
|
-
**search_replace Example:**
|
|
648
|
-
```
|
|
649
|
-
original_text: |
|
|
650
|
-
| API Name | Type | Main Function | Source | Document Path |
|
|
651
|
-
|----------|------|---------------|--------|---------------|
|
|
652
|
-
| {API Name} | Query/Mutation | {Brief description} | [Source]({pathPrefix}{apiSourcePath}) | [API Doc]({pathPrefix}apis/{api-name}.md) |
|
|
653
|
-
|
|
654
|
-
new_text: |
|
|
655
|
-
| API Name | Type | Main Function | Source | Document Path |
|
|
656
|
-
|----------|------|---------------|--------|---------------|
|
|
657
|
-
| getUserList | Query | 获取用户列表 | [Source](../../../../../../frontend-web/src/api/system/user.ts) | [API Doc](../../../../../../apis/system/user/getUserList.md) |
|
|
658
|
-
| updateUserStatus | Mutation | 更新用户状态 | [Source](../../../../../../frontend-web/src/api/system/user.ts) | [API Doc](../../../../../../apis/system/user/updateUserStatus.md) |
|
|
659
|
-
```
|
|
660
|
-
|
|
661
|
-
> **Note**: The example above assumes `documentPath` has 8 levels (e.g., `speccrew-workspace/knowledges/bizs/web-vue3/src/views/system/user/index.md`), so `{pathPrefix}` = `../../../../../../`. Adjust the number of `../` based on actual `documentPath` depth.
|
|
662
|
-
|
|
663
|
-
---
|
|
336
|
+
Fill all reference tables (APIs, Shared Methods, Shared Components, Other Pages, Referenced By).
|
|
664
337
|
|
|
665
338
|
#### 6. Section 6 - Business Rule Constraints
|
|
666
|
-
|
|
667
|
-
**Anchors:** Tables and lists under `### 6.1`, `### 6.2`, `### 6.3`
|
|
668
|
-
|
|
669
|
-
**Operation:** Replace with actual business rules extracted from code
|
|
670
|
-
|
|
671
|
-
**Subsections to Fill:**
|
|
672
|
-
- `6.1 Permission Rules` — Role/permission requirements
|
|
673
|
-
- `6.2 Business Logic Rules` — Domain rules and constraints
|
|
674
|
-
- `6.3 Validation Rules` — Form validation rules
|
|
675
|
-
|
|
676
|
-
---
|
|
339
|
+
Fill permission rules, business logic rules, and validation rules.
|
|
677
340
|
|
|
678
341
|
#### 7. Section 7 - Notes and Additional Information
|
|
679
|
-
|
|
680
|
-
**Anchors:** Content under `### 7.1`, `### 7.2`, `### 7.3`
|
|
681
|
-
|
|
682
|
-
**Operation:** Replace with actual notes from analysis
|
|
683
|
-
|
|
684
|
-
**MANDATORY Addition for Section 7:**
|
|
685
|
-
|
|
686
|
-
Add **性能与可扩展性考量** subsection:
|
|
687
|
-
|
|
688
|
-
```markdown
|
|
689
|
-
### 7.x 性能与可扩展性考量
|
|
690
|
-
|
|
691
|
-
- ⚠️ **全量加载风险**:getSimpleRoleList 全量加载角色列表,角色数量大时存在性能隐患
|
|
692
|
-
- ⚠️ **UI 渲染风险**:el-transfer 组件在角色数量超过 500 条时渲染性能明显下降
|
|
693
|
-
- **可扩展性限制**:当前设计不支持角色分页搜索
|
|
694
|
-
|
|
695
|
-
**待确认事项**:
|
|
696
|
-
- [ ] 是否需要对角色列表增加搜索过滤功能?
|
|
697
|
-
- [ ] 是否应将全量加载改为分页 + 搜索模式?
|
|
698
|
-
```
|
|
699
|
-
|
|
700
|
-
---
|
|
342
|
+
Fill notes and add **Performance and Scalability Analysis** subsection.
|
|
701
343
|
|
|
702
344
|
**Section Filling Checklist:**
|
|
703
345
|
- [ ] Section 1: Content Overview — description filled
|
|
704
346
|
- [ ] Section 2: Interface Prototype — ASCII wireframes replaced
|
|
705
347
|
- [ ] Section 2: Interface Element Description table filled
|
|
706
|
-
- [ ] Section 3
|
|
707
|
-
- [ ] Section 3
|
|
708
|
-
- [ ] Section 3:
|
|
709
|
-
- [ ] Section
|
|
710
|
-
- [ ] Section 4
|
|
711
|
-
- [ ] Section
|
|
712
|
-
- [ ] Section
|
|
713
|
-
- [ ] Section
|
|
714
|
-
- [ ] Section 5.1-5.4: All reference tables filled
|
|
715
|
-
- [ ] Section 5.5: Referenced By table filled (from Step 4)
|
|
716
|
-
- [ ] Section 6.1-6.3: All business rules tables filled
|
|
717
|
-
- [ ] Section 7.1-7.3: Notes filled
|
|
718
|
-
- [ ] Section 7: **Performance and scalability analysis** added
|
|
348
|
+
- [ ] Section 3: All flows — diagrams and descriptions filled
|
|
349
|
+
- [ ] Section 3: API call sequence analysis added
|
|
350
|
+
- [ ] Section 3: Boundary scenarios documented
|
|
351
|
+
- [ ] Section 4: Page State Fields and Form Fields tables filled
|
|
352
|
+
- [ ] Section 4: Data binding mapping and reactive dependency chain added
|
|
353
|
+
- [ ] Section 5: All reference tables filled
|
|
354
|
+
- [ ] Section 6: All business rules tables filled
|
|
355
|
+
- [ ] Section 7: Notes and performance analysis filled
|
|
719
356
|
|
|
720
357
|
**Output:** "Step 5b Status: ✅ COMPLETED - All sections filled using search_replace"
|
|
721
358
|
|
|
@@ -727,38 +364,15 @@ Add **性能与可扩展性考量** subsection:
|
|
|
727
364
|
✅ **ALWAYS use relative paths** — Markdown links work correctly
|
|
728
365
|
|
|
729
366
|
**Dynamic Path Calculation:**
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
- Count the number of directory separators in `{{documentPath}}` from project root
|
|
734
|
-
- Example: `speccrew-workspace/knowledges/bizs/web-vue3/src/views/system/user/index.md` = 8 levels
|
|
735
|
-
- Example: `speccrew-workspace/knowledges/bizs/mobile-uniapp/bpm/category-form-index.md` = 5 levels
|
|
736
|
-
|
|
737
|
-
2. **Generate the path prefix:**
|
|
738
|
-
- For each level in `documentPath`, add one `../`
|
|
739
|
-
- Example: 5 levels → `../../../../../`
|
|
740
|
-
- Example: 8 levels → `../../../../../../`
|
|
741
|
-
|
|
742
|
-
3. **Construct the final link:**
|
|
743
|
-
- Source link: `[Source]({pathPrefix}{sourcePath})`
|
|
744
|
-
- Document link: `[Doc]({pathPrefix}{documentPath})`
|
|
745
|
-
|
|
746
|
-
**Source Traceability Format:**
|
|
747
|
-
Use relative path from current document to source file:
|
|
748
|
-
- Format: `[Source]({pathPrefix}{sourcePath})`
|
|
749
|
-
- Example for 5-level depth: `[Source](../../../../../yudao-ui/yudao-ui-admin-vue3/src/views/system/user/index.vue)`
|
|
750
|
-
- Example for 8-level depth: `[Source](../../../../../../yudao-ui/yudao-ui-admin-vue3/src/views/system/user/index.vue)`
|
|
751
|
-
|
|
752
|
-
**Document Link Format:**
|
|
753
|
-
Use relative path from current document:
|
|
754
|
-
- Format: `[Doc]({pathPrefix}{documentPath})`
|
|
755
|
-
- Example for 5-level depth: `[Doc](../../../../../speccrew-workspace/knowledges/bizs/web-vue3/src/views/system/user/index.md)`
|
|
367
|
+
1. Count the number of directory separators in `{{documentPath}}` from project root
|
|
368
|
+
2. For each level, add one `../`
|
|
369
|
+
3. Construct the final link: `[Source]({pathPrefix}{sourcePath})`
|
|
756
370
|
|
|
757
371
|
### Step 6: Report Results
|
|
758
372
|
|
|
759
373
|
**Step 6 Status: 🔄 IN PROGRESS**
|
|
760
374
|
|
|
761
|
-
Return analysis result summary
|
|
375
|
+
Return analysis result summary:
|
|
762
376
|
|
|
763
377
|
```json
|
|
764
378
|
{
|
|
@@ -775,309 +389,30 @@ Return analysis result summary to dispatch:
|
|
|
775
389
|
}
|
|
776
390
|
```
|
|
777
391
|
|
|
778
|
-
Or in case of failure:
|
|
779
|
-
|
|
780
|
-
```json
|
|
781
|
-
{
|
|
782
|
-
"status": "{{status}}",
|
|
783
|
-
"feature": {
|
|
784
|
-
"fileName": "{{fileName}}",
|
|
785
|
-
"sourcePath": "{{sourcePath}}"
|
|
786
|
-
},
|
|
787
|
-
"message": "{{message}}"
|
|
788
|
-
}
|
|
789
|
-
```
|
|
790
|
-
|
|
791
|
-
---
|
|
792
|
-
|
|
793
|
-
### Step 7: Write Completion Markers
|
|
794
|
-
|
|
795
|
-
**Step 7 Status: 🔄 IN PROGRESS**
|
|
796
|
-
|
|
797
|
-
**⚠️ MANDATORY - This step MUST be executed. The task is NOT complete until marker files are written.**
|
|
798
|
-
|
|
799
|
-
After analysis is complete, write the results to marker files for dispatch to process.
|
|
800
|
-
|
|
801
|
-
**Prerequisites:**
|
|
802
|
-
- Step 6 completed successfully
|
|
803
|
-
- `{{completed_dir}}` - Marker files output directory (e.g., `speccrew-workspace/knowledges/base/sync-state/knowledge-bizs/completed`)
|
|
804
|
-
- `{{sourceFile}}` - Source features JSON file name
|
|
805
|
-
|
|
806
|
-
> **ASSUMPTION**: The `completed_dir` directory already exists (pre-created by dispatch Stage 2). If write fails, report error — do NOT attempt to create directories.
|
|
807
|
-
|
|
808
|
-
### Pre-write Checklist (VERIFY before writing each file):
|
|
809
|
-
- [ ] Filename follows `{module}-{subpath}-{fileName}` pattern (see naming convention below)
|
|
810
|
-
- [ ] File content is valid JSON (not empty)
|
|
811
|
-
- [ ] All required fields are present and non-empty
|
|
812
|
-
- [ ] File is written with UTF-8 encoding
|
|
813
|
-
|
|
814
|
-
**Actions:**
|
|
815
|
-
|
|
816
|
-
**Pre-write Verification (MUST check before writing):**
|
|
817
|
-
- [ ] `.done.json` JSON: `fileName` does NOT contain file extension
|
|
818
|
-
- [ ] `.done.json` JSON: `sourceFile` matches `features-{platform}.json` pattern
|
|
819
|
-
- [ ] `.done.json` JSON: `module` field is present and non-empty
|
|
820
|
-
- [ ] `.graph.json` JSON: root-level `module` field is present (MANDATORY)
|
|
821
|
-
- [ ] `.graph.json` JSON: `nodes` and `edges` are arrays (can be empty)
|
|
822
|
-
- [ ] Both files: valid JSON (no trailing commas, all strings quoted)
|
|
823
|
-
|
|
824
|
-
---
|
|
825
|
-
|
|
826
|
-
### **CRITICAL - Marker File Naming Convention (STRICT RULES)**
|
|
827
|
-
|
|
828
|
-
**✅ CORRECT Format - MUST USE:**
|
|
829
|
-
```
|
|
830
|
-
{completed_dir}/{module}-{subpath}-{fileName}.done.json ← Completion status marker (JSON format)
|
|
831
|
-
{completed_dir}/{module}-{subpath}-{fileName}.graph.json ← Graph data marker (JSON format)
|
|
832
|
-
```
|
|
833
|
-
|
|
834
|
-
**Naming Rule Explanation:**
|
|
835
|
-
|
|
836
|
-
The marker filename MUST follow the composite naming pattern `{module}-{subpath}-{fileName}` to prevent conflicts between same-named source files.
|
|
837
|
-
|
|
838
|
-
**How to Extract Each Component from `{{sourcePath}}`:**
|
|
839
|
-
|
|
840
|
-
1. **module**: Use `{{module}}` input variable directly (e.g., `system`, `trade`, `bpm`)
|
|
841
|
-
|
|
842
|
-
2. **subpath**: Extract the middle path between the platform source root and the file name:
|
|
843
|
-
- Remove the top-level directory prefix (e.g., `yudao-ui/yudao-ui-admin-vue3/src/views/`)
|
|
844
|
-
- Remove the file name at the end
|
|
845
|
-
- Replace path separators (`/`) with hyphens (`-`)
|
|
846
|
-
- If the file is at the module root directory, subpath will be empty → omit from filename
|
|
847
|
-
|
|
848
|
-
3. **fileName**: Use `{{fileName}}` input variable (file name WITHOUT extension)
|
|
849
|
-
|
|
850
|
-
**Examples:**
|
|
851
|
-
|
|
852
|
-
| sourcePath | module | subpath | fileName | Marker Filename |
|
|
853
|
-
|------------|--------|---------|----------|-----------------|
|
|
854
|
-
| `yudao-ui/yudao-ui-admin-vue3/src/views/system/notify/message/index.vue` | `system` | `notify-message` | `index` | `system-notify-message-index.done.json` |
|
|
855
|
-
| `yudao-ui/yudao-ui-admin-vue3/src/views/system/user/index.vue` | `system` | `user` | `index` | `system-user-index.done.json` |
|
|
856
|
-
| `yudao-ui/yudao-ui-admin-vue3/src/views/bpm/process-instance/index.vue` | `bpm` | `process-instance` | `index` | `bpm-process-instance-index.done.json` |
|
|
857
|
-
|
|
858
|
-
**Special Case - Empty subpath:**
|
|
859
|
-
- If the file is directly in the module root directory (no subpath), use format: `{module}-{fileName}.done.json`
|
|
860
|
-
- Example: `yudao-ui/yudao-ui-admin-vue3/src/views/system/index.vue` → `system-index.done.json`
|
|
861
|
-
|
|
862
|
-
**Full Path Examples:**
|
|
863
|
-
- `d:/dev/speccrew/speccrew-workspace/knowledges/base/sync-state/knowledge-bizs/completed/system-notify-message-index.done.json`
|
|
864
|
-
- `d:/dev/speccrew/speccrew-workspace/knowledges/base/sync-state/knowledge-bizs/completed/system-user-index.graph.json`
|
|
865
|
-
|
|
866
|
-
**❌ WRONG Format - NEVER USE:**
|
|
867
|
-
```
|
|
868
|
-
{fileName}.done.json ← WRONG: missing module and subpath (causes conflicts)
|
|
869
|
-
{fileName}.graph.json ← WRONG: missing module and subpath (causes conflicts)
|
|
870
|
-
{module}-{fileName}.done.json ← WRONG: missing subpath (may still conflict)
|
|
871
|
-
{fileName}.completed.json ← WRONG extension
|
|
872
|
-
{fileName}.done ← WRONG extension (missing .json)
|
|
873
|
-
{fileName}_done.json ← WRONG separator and extension
|
|
874
|
-
```
|
|
875
|
-
|
|
876
|
-
**❌ WRONG Filename Examples - NEVER USE:**
|
|
877
|
-
- `index.done.json` - WRONG: missing module and subpath (conflicts with other `index.vue` files)
|
|
878
|
-
- `system-index.done.json` - WRONG: missing subpath (if file is in `system/notify/message/`)
|
|
879
|
-
- `index.completed.json` - WRONG: uses `.completed.json` instead of `.done.json`
|
|
880
|
-
- `index_done.json` - WRONG: uses underscore and wrong extension
|
|
881
|
-
|
|
882
|
-
---
|
|
883
|
-
|
|
884
|
-
### **CRITICAL - Path Format Rules (STRICT RULES)**
|
|
885
|
-
|
|
886
|
-
**Path Variables:**
|
|
887
|
-
- `{{completed_dir}}` - Absolute path to marker files directory (passed from dispatch)
|
|
888
|
-
- `{{sourcePath}}` - Relative path to source file (from features JSON)
|
|
889
|
-
- `{{documentPath}}` - Relative path to generated document (from features JSON)
|
|
890
|
-
|
|
891
|
-
**Path Format Requirements:**
|
|
892
|
-
|
|
893
|
-
| Field | Format | Example |
|
|
894
|
-
|-------|--------|---------|
|
|
895
|
-
| `sourcePath` in `.done` | Project-root-relative path | `yudao-ui/yudao-ui-admin-uniapp/src/pages/bpm/index.vue` |
|
|
896
|
-
| `documentPath` in `.done` | Relative path (as-is from input) | `speccrew-workspace/knowledges/bizs/web-vue/src/views/system/user/index.md` |
|
|
897
|
-
| `sourcePath` in `.graph.json` nodes | Project-root-relative path | `yudao-ui/yudao-ui-admin-uniapp/src/pages/bpm/index.vue` |
|
|
898
|
-
| `documentPath` in `.graph.json` nodes | Relative path (as-is from input) | `speccrew-workspace/knowledges/bizs/web-vue/src/views/system/user/index.md` |
|
|
899
|
-
|
|
900
|
-
**⚠️ CRITICAL - sourcePath Validation Rules:**
|
|
901
|
-
- `sourcePath` MUST be a project-root-relative path (e.g., `yudao-ui/yudao-ui-admin-uniapp/src/pages/bpm/index.vue`, `yudao-module-system/src/main/java/.../UserController.java`)
|
|
902
|
-
- NEVER use platform-source-relative short paths (e.g., `pages/bpm/index.vue`, `pages-bpm/category/index.vue`, `controller/admin/user/UserController.java`)
|
|
903
|
-
- Exception: `node_modules/` and third-party library paths are kept as-is (e.g., `node_modules/wot-design-uni/components/wd-icon/wd-icon.vue`)
|
|
904
|
-
|
|
905
|
-
**⚠️ CRITICAL - documentPath Rules:**
|
|
906
|
-
- When no corresponding document exists for a component/API, `documentPath` MUST be `"N/A"`
|
|
907
|
-
- NEVER use empty string `""` for `documentPath` — this causes downstream processing issues
|
|
908
|
-
|
|
909
|
-
**⚠️ CRITICAL: NEVER convert relative paths to absolute paths in the JSON content!**
|
|
910
|
-
|
|
911
|
-
**Correct vs Wrong Example:**
|
|
912
|
-
```json
|
|
913
|
-
// ✅ CORRECT - .done file content:
|
|
914
|
-
{
|
|
915
|
-
"fileName": "index",
|
|
916
|
-
"sourcePath": "yudao-ui/yudao-ui-admin-uniapp/src/pages/bpm/index.vue",
|
|
917
|
-
"sourceFile": "features-web-vue.json",
|
|
918
|
-
"module": "system",
|
|
919
|
-
"status": "success",
|
|
920
|
-
"analysisNotes": "Successfully analyzed user management page"
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
// ❌ WRONG - .done file content (DO NOT DO THIS):
|
|
924
|
-
{
|
|
925
|
-
"fileName": "index",
|
|
926
|
-
"sourcePath": "d:/dev/project/yudao-ui/yudao-ui-admin-uniapp/src/pages/bpm/index.vue", ← WRONG: absolute path
|
|
927
|
-
"sourceFile": "features-web-vue.json",
|
|
928
|
-
"module": "system",
|
|
929
|
-
"status": "success"
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
// ❌ WRONG - documentPath empty string (DO NOT DO THIS):
|
|
933
|
-
{
|
|
934
|
-
"fileName": "index",
|
|
935
|
-
"sourcePath": "yudao-ui/yudao-ui-admin-uniapp/src/pages/bpm/index.vue",
|
|
936
|
-
"documentPath": "", ← WRONG: use "N/A" when no document exists
|
|
937
|
-
"sourceFile": "features-web-vue.json",
|
|
938
|
-
"module": "system",
|
|
939
|
-
"status": "success"
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
// ✅ CORRECT - documentPath N/A when no document:
|
|
943
|
-
{
|
|
944
|
-
"fileName": "index",
|
|
945
|
-
"sourcePath": "yudao-ui/yudao-ui-admin-uniapp/src/pages/bpm/index.vue",
|
|
946
|
-
"documentPath": "N/A",
|
|
947
|
-
"sourceFile": "features-web-vue.json",
|
|
948
|
-
"module": "system",
|
|
949
|
-
"status": "success"
|
|
950
|
-
}
|
|
951
|
-
```
|
|
952
|
-
|
|
953
392
|
---
|
|
954
393
|
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
> **🚨 CRITICAL - JSON FORMAT MANDATORY**: The `.done.json` file **MUST** be valid JSON. Writing plain text, status messages, or progress updates into this file is **STRICTLY FORBIDDEN**.
|
|
958
|
-
>
|
|
959
|
-
> **❌ FORBIDDEN - NEVER DO THIS:**
|
|
960
|
-
> ```
|
|
961
|
-
> Scanning files...
|
|
962
|
-
> Analysis complete
|
|
963
|
-
> ```
|
|
964
|
-
>
|
|
965
|
-
> **✅ CORRECT - ONLY VALID JSON:**
|
|
966
|
-
> ```json
|
|
967
|
-
> {"fileName": "index", "status": "success", ...}
|
|
968
|
-
> ```
|
|
969
|
-
|
|
970
|
-
Use the Write tool to create file at `{{completed_dir}}/{module}-{subpath}-{fileName}.done.json`:
|
|
971
|
-
|
|
972
|
-
**Full path example:** `d:/dev/speccrew/speccrew-workspace/knowledges/base/sync-state/knowledge-bizs/completed/system-notify-message-index.done.json`
|
|
973
|
-
|
|
974
|
-
**Complete JSON Template (ALL fields required):**
|
|
975
|
-
```json
|
|
976
|
-
{
|
|
977
|
-
"fileName": "{{fileName}}",
|
|
978
|
-
"sourcePath": "{{sourcePath}}",
|
|
979
|
-
"sourceFile": "{{sourceFile}}",
|
|
980
|
-
"module": "{{module}}",
|
|
981
|
-
"documentPath": "{{documentPath}}",
|
|
982
|
-
"status": "{{status}}",
|
|
983
|
-
"analysisNotes": "{{message}}"
|
|
984
|
-
}
|
|
985
|
-
```
|
|
986
|
-
|
|
987
|
-
**Field Descriptions:**
|
|
988
|
-
| Field | Required | Description | Example |
|
|
989
|
-
|-------|----------|-------------|---------|
|
|
990
|
-
| `fileName` | ✅ YES | Feature file name **WITHOUT extension** | `"index"` |
|
|
991
|
-
| `sourcePath` | ✅ YES | Relative path to source file | `"frontend-web/src/views/system/user/index.vue"` |
|
|
992
|
-
| `sourceFile` | ✅ YES | Source features JSON filename | `"features-web-vue.json"` |
|
|
993
|
-
| `module` | ✅ YES | Business module name | `"system"` |
|
|
994
|
-
| `documentPath` | ✅ YES | Path to generated document (same as Step 5a) | `"speccrew-workspace/knowledges/bizs/web-vue/src/views/system/user/index.md"` |
|
|
995
|
-
| `status` | ✅ YES | Analysis status | `"success"`, `"partial"`, or `"failed"` |
|
|
996
|
-
| `analysisNotes` | ✅ YES | Summary message | `"Successfully analyzed user management page"` |
|
|
997
|
-
|
|
998
|
-
> **⚠️ CRITICAL - fileName Field Rules:**
|
|
999
|
-
> - The `fileName` field MUST contain only the feature file name **WITHOUT file extension**
|
|
1000
|
-
> - ✅ CORRECT: `"fileName": "index"`
|
|
1001
|
-
> - ✅ CORRECT: `"fileName": "UserForm"`
|
|
1002
|
-
> - ❌ WRONG: `"fileName": "index.vue"` (includes extension)
|
|
1003
|
-
> - ❌ WRONG: `"fileName": "UserForm.tsx"` (includes extension)
|
|
1004
|
-
|
|
1005
|
-
> **⚠️ CRITICAL**: The `sourceFile` field is MANDATORY. It MUST be the features JSON filename (e.g., `features-web-vue.json`). Missing this field will cause pipeline failure.
|
|
1006
|
-
|
|
1007
|
-
> **⚠️ CRITICAL**: The `documentPath` field is MANDATORY. It MUST match the `{{documentPath}}` variable from Step 5a. This is used to verify the document was created successfully.
|
|
1008
|
-
|
|
1009
|
-
⚠️ **CRITICAL NAMING RULE:** Filename MUST be `{module}-{subpath}-{fileName}.done.json` to prevent conflicts between same-named files.
|
|
1010
|
-
- ✅ CORRECT: `system-notify-message-index.done.json` (full composite naming)
|
|
1011
|
-
- ✅ CORRECT: `system-user-index.done.json` (full composite naming)
|
|
1012
|
-
- ✅ CORRECT: `bpm-index.done.json` (when subpath is empty, file at module root)
|
|
1013
|
-
- ❌ WRONG: `index.done.json` (missing module and subpath - will conflict)
|
|
1014
|
-
- ❌ WRONG: `index.done` (missing .json extension)
|
|
1015
|
-
- ❌ WRONG: `system-index.done.json` (missing subpath when file is in nested directory)
|
|
1016
|
-
|
|
1017
|
-
⚠️ **CRITICAL:** The file MUST contain valid JSON content. Empty files or files with only whitespace will cause processing failures.
|
|
1018
|
-
|
|
1019
|
-
2. **Write .graph.json file (MANDATORY):**
|
|
1020
|
-
|
|
1021
|
-
> **⚠️ CRITICAL FORMAT REQUIREMENT**: The `.graph.json` file MUST be valid JSON and **MUST include the root-level `module` field**. Do NOT rely on scripts to infer the module from `.done` file - the `module` field MUST be explicitly present at the root level of `.graph.json`.
|
|
1022
|
-
|
|
1023
|
-
Use the Write tool to create file at `{{completed_dir}}/{module}-{subpath}-{fileName}.graph.json`:
|
|
1024
|
-
|
|
1025
|
-
**Full path example:** `d:/dev/speccrew/speccrew-workspace/knowledges/base/sync-state/knowledge-bizs/completed/system-notify-message-index.graph.json`
|
|
1026
|
-
|
|
1027
|
-
```json
|
|
1028
|
-
{
|
|
1029
|
-
"module": "{{module}}",
|
|
1030
|
-
"nodes": [
|
|
1031
|
-
{
|
|
1032
|
-
"id": "page-{{module}}-{{feature-name}}",
|
|
1033
|
-
"type": "page",
|
|
1034
|
-
"name": "<display name>",
|
|
1035
|
-
"module": "{{module}}",
|
|
1036
|
-
"sourcePath": "{{sourcePath}}",
|
|
1037
|
-
"documentPath": "{{documentPath}}",
|
|
1038
|
-
"description": "...",
|
|
1039
|
-
"tags": [...],
|
|
1040
|
-
"keywords": [...],
|
|
1041
|
-
"context": { "route": "...", "components": [...] }
|
|
1042
|
-
}
|
|
1043
|
-
],
|
|
1044
|
-
"edges": [
|
|
1045
|
-
{
|
|
1046
|
-
"source": "page-...",
|
|
1047
|
-
"target": "api-... or component-...",
|
|
1048
|
-
"type": "calls|uses|navigates-to",
|
|
1049
|
-
"metadata": { "trigger": "...", "method": "..." }
|
|
1050
|
-
}
|
|
1051
|
-
]
|
|
1052
|
-
}
|
|
1053
|
-
```
|
|
1054
|
-
|
|
1055
|
-
> **⚠️ CRITICAL - module Field Requirement:**
|
|
1056
|
-
> - The `.graph.json` file **MUST** have a root-level `module` field
|
|
1057
|
-
> - Do NOT assume scripts will fall back to reading from `.done` file
|
|
1058
|
-
> - Missing `module` field will cause the graph merge pipeline to reject this file
|
|
394
|
+
## Task Completion Report
|
|
1059
395
|
|
|
1060
|
-
|
|
1061
|
-
- ✅ CORRECT: `system-notify-message-index.graph.json` (full composite naming)
|
|
1062
|
-
- ✅ CORRECT: `system-user-index.graph.json` (full composite naming)
|
|
1063
|
-
- ✅ CORRECT: `bpm-index.graph.json` (when subpath is empty, file at module root)
|
|
1064
|
-
- ❌ WRONG: `index.graph.json` (missing module and subpath - will conflict)
|
|
1065
|
-
- ❌ WRONG: `dict-index.graph.json` (using old featureId format)
|
|
1066
|
-
- ❌ WRONG: `system-index.graph.json` (missing subpath when file is in nested directory)
|
|
396
|
+
When the task is complete, report the following:
|
|
1067
397
|
|
|
1068
|
-
|
|
398
|
+
**Status:** `success` | `partial` | `failed`
|
|
1069
399
|
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
- [ ] Each `calls` edge has proper metadata with trigger information
|
|
1076
|
-
- [ ] No API import is left without a corresponding edge
|
|
400
|
+
**Summary:**
|
|
401
|
+
- Feature analyzed: `{{feature_name}}`
|
|
402
|
+
- Document generated: `{{documentPath}}`
|
|
403
|
+
- Platform: `{{platform_type}}/{{platform_subtype}}`
|
|
404
|
+
- Module: `{{module}}`
|
|
1077
405
|
|
|
1078
|
-
**
|
|
406
|
+
**Files Generated:**
|
|
407
|
+
- `{{documentPath}}` - Feature documentation
|
|
1079
408
|
|
|
1080
|
-
**
|
|
409
|
+
**Note:** Graph data construction (nodes, edges, marker files) is handled by `speccrew-knowledge-bizs-ui-graph` Skill.
|
|
1081
410
|
|
|
1082
|
-
|
|
411
|
+
## Constraints
|
|
1083
412
|
|
|
413
|
+
1. **DO NOT analyze files outside the specified `{{sourcePath}}`**
|
|
414
|
+
2. **DO NOT generate separate documents for embedded components**
|
|
415
|
+
3. **All content MUST be in the language specified by `{{language}}`**
|
|
416
|
+
4. **Use `search_replace` for section filling, NEVER rewrite entire document**
|
|
417
|
+
5. **Mermaid diagrams MUST follow the rules in `mermaid-rule.md`**
|
|
418
|
+
6. **All links MUST use relative paths, NEVER `file://` protocol**
|