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.
Files changed (21) hide show
  1. package/.speccrew/agents/speccrew-team-leader.md +60 -4
  2. package/.speccrew/agents/speccrew-test-manager.md +361 -37
  3. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +63 -626
  4. package/.speccrew/skills/speccrew-knowledge-bizs-api-graph/SKILL.md +505 -0
  5. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +165 -31
  6. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +63 -728
  7. package/.speccrew/skills/speccrew-knowledge-bizs-ui-graph/SKILL.md +389 -0
  8. package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +26 -0
  9. package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +27 -0
  10. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +185 -21
  11. package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +134 -883
  12. package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +36 -0
  13. package/.speccrew/skills/speccrew-knowledge-techs-generate-quality/SKILL.md +414 -0
  14. package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +35 -0
  15. package/.speccrew/skills/speccrew-test-reporter/SKILL.md +297 -0
  16. package/.speccrew/skills/{speccrew-test-execute → speccrew-test-reporter}/templates/BUG-REPORT-TEMPLATE.md +24 -1
  17. package/.speccrew/skills/{speccrew-test-execute → speccrew-test-reporter}/templates/TEST-REPORT-TEMPLATE.md +8 -1
  18. package/.speccrew/skills/{speccrew-test-execute → speccrew-test-runner}/SKILL.md +142 -104
  19. package/.speccrew/skills/speccrew-test-runner/templates/TEST-EXECUTION-RESULT-TEMPLATE.md +80 -0
  20. package/lib/utils.js +1 -0
  21. package/package.json +1 -1
@@ -0,0 +1,389 @@
1
+ ---
2
+ name: speccrew-knowledge-bizs-ui-graph
3
+ description: Constructs knowledge graph data (nodes, edges, relationships) from UI analysis results. Generates graph JSON files and completion markers for the bizs knowledge pipeline.
4
+ tools: Read, Write, Glob, Grep, Bash
5
+ ---
6
+
7
+ # UI Knowledge Graph Constructor
8
+
9
+ > **CRITICAL CONSTRAINT**: DO NOT create temporary scripts, batch files, or workaround code files (`.py`, `.bat`, `.sh`, `.ps1`, etc.) under any circumstances.
10
+
11
+ Construct knowledge graph data (nodes, edges, relationships) from UI feature analysis results and write completion marker files for the bizs knowledge pipeline.
12
+
13
+ ## Trigger Scenarios
14
+
15
+ - "Construct graph data for UI feature {fileName}"
16
+ - "Generate graph nodes and edges from UI analysis"
17
+ - "Write completion markers for feature {fileName}"
18
+
19
+ ## Input Variables
20
+
21
+ | Variable | Type | Description | Example |
22
+ |----------|------|-------------|---------|
23
+ | `{{feature}}` | object | Complete feature object from features.json | - |
24
+ | `{{fileName}}` | string | Feature file name | `"index"`, `"UserForm"` |
25
+ | `{{sourcePath}}` | string | Relative path to source file | `"frontend-web/src/views/system/user/index.vue"` |
26
+ | `{{documentPath}}` | string | Path to generated documentation | `"speccrew-workspace/knowledges/bizs/..."` |
27
+ | `{{module}}` | string | Business module name | `"system"`, `"trade"`, `"_root"` |
28
+ | `{{platform_type}}` | string | Platform type | `"web"`, `"mobile"` |
29
+ | `{{platform_subtype}}` | string | Platform subtype | `"vue"`, `"react"` |
30
+ | `{{completed_dir}}` | string | Marker files output directory | `"speccrew-workspace/knowledges/base/sync-state/knowledge-bizs/completed"` |
31
+ | `{{sourceFile}}` | string | Source features JSON file name | `"features-web-vue.json"` |
32
+ | `{{status}}` | string | Analysis status from UI analysis | `"success"`, `"partial"`, `"failed"` |
33
+ | `{{analysisNotes}}` | string | Analysis notes from UI analysis | `"Successfully analyzed..."` |
34
+
35
+ ## Output
36
+
37
+ **Generated Files (MANDATORY):**
38
+ 1. `{{completed_dir}}/{module}-{subpath}-{fileName}.graph.json` - Graph data with nodes and edges
39
+ 2. `{{completed_dir}}/{module}-{subpath}-{fileName}.graph-done.json` - Graph completion marker
40
+
41
+ ## Workflow
42
+
43
+ ```mermaid
44
+ graph TB
45
+ Start([Start]) --> Step1[Step 1 Read Source File]
46
+ Step1 --> Step2[Step 2 Construct Graph Nodes]
47
+ Step2 --> Step3[Step 3 Construct Graph Edges]
48
+ Step3 --> Step4[Step 4 Write Graph JSON]
49
+ Step4 --> Step5[Step 5 Write Completion Marker]
50
+ Step5 --> End([End])
51
+ ```
52
+
53
+ ---
54
+
55
+ ### Step 1: Read Source File
56
+
57
+ **Step 1 Status: 🔄 IN PROGRESS**
58
+
59
+ 1. **Locate and Read the source file:**
60
+ - Use `{{sourcePath}}` as the relative file path from project root
61
+ - Read the feature file content to extract API imports, component usage, and navigation patterns
62
+
63
+ 2. **Extract API imports:**
64
+ - Scan for `import { ... } from '@/api/...'` or similar API import statements
65
+ - List ALL imported API functions
66
+
67
+ 3. **Extract component usage:**
68
+ - Scan for component registrations and usage in templates
69
+ - Identify shared/local components used
70
+
71
+ 4. **Extract navigation patterns:**
72
+ - Scan for `router.push`, `router.replace`, `<router-link>`, `navigate()` calls
73
+ - Identify target pages for navigation
74
+
75
+ **Output:** "Step 1 Status: ✅ COMPLETED - Read {{sourcePath}}, found {{apiCount}} APIs, {{componentCount}} components, {{navCount}} navigations"
76
+
77
+ ---
78
+
79
+ ### Step 2: Construct Graph Nodes
80
+
81
+ **Step 2 Status: 🔄 IN PROGRESS**
82
+
83
+ Construct nodes for the analyzed UI feature.
84
+
85
+ **Node Types to Construct:**
86
+
87
+ | Node Type | Source | ID Format | Context Fields |
88
+ |-----------|--------|-----------|----------------|
89
+ | `page` | The analyzed page/screen | `page-{module}-{name}` | `route`, `components`, `events`, `platform` |
90
+ | `component` | Embedded or local components | `component-{module}-{name}` | `props`, `events`, `slots` |
91
+
92
+ **Node Structure:**
93
+
94
+ ```json
95
+ {
96
+ "id": "page-{module}-{feature-name}",
97
+ "type": "page",
98
+ "name": "<display name>",
99
+ "module": "{{module}}",
100
+ "sourcePath": "{{sourcePath}}",
101
+ "documentPath": "{{documentPath}}",
102
+ "description": "...",
103
+ "tags": [...],
104
+ "keywords": [...],
105
+ "context": {
106
+ "route": "...",
107
+ "components": [...],
108
+ "platform": "{{platform_type}}-{{platform_subtype}}"
109
+ }
110
+ }
111
+ ```
112
+
113
+ **Node ID Naming Convention:**
114
+
115
+ ```
116
+ {type}-{module}-{name}
117
+
118
+ Examples:
119
+ page-system-user-list
120
+ page-system-user-detail
121
+ component-system-user-form
122
+ component-shared-delete-confirm
123
+ ```
124
+
125
+ **IMPORTANT:**
126
+ - `module` comes from `{{module}}` input variable
127
+ - `name` should be a short, readable slug derived from the page/component name
128
+ - Each node must include `sourcePath` and `documentPath`
129
+ - For pages, include route information and used components in context
130
+
131
+ **Output:** "Step 2 Status: ✅ COMPLETED - Constructed {{nodeCount}} nodes"
132
+
133
+ ---
134
+
135
+ ### Step 3: Construct Graph Edges
136
+
137
+ **Step 3 Status: 🔄 IN PROGRESS**
138
+
139
+ Construct edges representing relationships between the UI feature and other entities.
140
+
141
+ **Edge Types to Construct:**
142
+
143
+ | Edge Type | Direction | When to Create |
144
+ |-----------|-----------|----------------|
145
+ | `calls` | page → api | Page calls an API endpoint |
146
+ | `navigates-to` | page → page | Page navigates to another page |
147
+ | `uses` | page → component | Page uses a shared/local component |
148
+
149
+ **Edge Structure:**
150
+
151
+ ```json
152
+ {
153
+ "source": "page-{module}-{name}",
154
+ "target": "api-{module}-{api-name}",
155
+ "type": "calls",
156
+ "metadata": {
157
+ "trigger": "onClick|onMounted|onSubmit|...",
158
+ "method": "getUserList",
159
+ "context": "Page initialization - load user list"
160
+ }
161
+ }
162
+ ```
163
+
164
+ **CRITICAL - API Coverage Requirements (100% Coverage Mandatory):**
165
+
166
+ 1. **Extract ALL Imported API Functions:**
167
+ - Scan the entire source file for ALL API import statements
168
+ - EVERY function imported from API modules MUST be extracted as a `calls` edge
169
+
170
+ 2. **API Call Categories to Cover:**
171
+
172
+ | Category | Examples | Where to Look |
173
+ |----------|----------|---------------|
174
+ | Page Initialization | `getList`, `getDetail`, `getPage` | `onMounted`, `created`, `useEffect` |
175
+ | Data Query | `getUserList`, `searchOrders` | Search forms, filter changes |
176
+ | Create Operations | `createUser`, `addOrder` | Form submission handlers |
177
+ | Update Operations | `updateUser`, `editOrder` | Edit form submissions |
178
+ | Status Update | `updateUserStatus`, `toggleEnable` | Status switch handlers |
179
+ | Special Operations | `resetPassword`, `exportData`, `importData` | Action buttons |
180
+ | Delete Operations | `deleteUser`, `removeOrder` | Delete confirmation handlers |
181
+ | Dictionary/Options | `getDictList`, `getOptions` | Dropdown initialization |
182
+
183
+ 3. **How to Identify API Calls:**
184
+ - Look for: `import { func1, func2 } from '@/api/xxx'` statements
185
+ - Look for: Direct API function calls in event handlers
186
+ - Look for: API calls in lifecycle hooks (Vue: `onMounted`, React: `useEffect`)
187
+ - Look for: API calls in watch/computed setters
188
+
189
+ 4. **API Coverage Verification Checklist:**
190
+ - [ ] List ALL imported API functions from the source file
191
+ - [ ] For each imported API, verify there is a corresponding `calls` edge
192
+ - [ ] Check event handlers for API calls
193
+ - [ ] Check lifecycle hooks for initialization API calls
194
+ - [ ] Check status toggles, action buttons for special operation APIs
195
+ - [ ] Verify no imported API is left unmapped
196
+
197
+ 5. **Edge Metadata Requirements:**
198
+ - `trigger`: Event name (e.g., "onClick", "onMounted", "onSubmit")
199
+ - `method`: The API function name being called
200
+ - `context`: Brief description of when/why this API is called
201
+
202
+ **Target Node ID Format for APIs:**
203
+ - `api-{module}-{name}` (will be matched with api-analyze output)
204
+
205
+ **Output:** "Step 3 Status: ✅ COMPLETED - Constructed {{edgeCount}} edges ({{apiEdgeCount}} API calls, {{navEdgeCount}} navigations, {{useEdgeCount}} component uses)"
206
+
207
+ ---
208
+
209
+ ### Step 4: Write Graph JSON
210
+
211
+ **Step 4 Status: 🔄 IN PROGRESS**
212
+
213
+ Write the graph data to the `.graph.json` marker file.
214
+
215
+ **Marker File Naming Convention:**
216
+
217
+ ```
218
+ {completed_dir}/{module}-{subpath}-{fileName}.graph.json
219
+ ```
220
+
221
+ **Naming Rule Explanation:**
222
+
223
+ The marker filename MUST follow the composite naming pattern `{module}-{subpath}-{fileName}` to prevent conflicts between same-named source files.
224
+
225
+ **How to Extract Each Component from `{{sourcePath}}`:**
226
+
227
+ 1. **module**: Use `{{module}}` input variable directly (e.g., `system`, `trade`, `bpm`)
228
+
229
+ 2. **subpath**: Extract the middle path between the platform source root and the file name:
230
+ - Remove the top-level directory prefix (e.g., `yudao-ui/yudao-ui-admin-vue3/src/views/`)
231
+ - Remove the file name at the end
232
+ - Replace path separators (`/`) with hyphens (`-`)
233
+ - If the file is at the module root directory, subpath will be empty → omit from filename
234
+
235
+ 3. **fileName**: Use `{{fileName}}` input variable (file name WITHOUT extension)
236
+
237
+ **Examples:**
238
+
239
+ | sourcePath | module | subpath | fileName | Marker Filename |
240
+ |------------|--------|---------|----------|-----------------|
241
+ | `yudao-ui/.../system/notify/message/index.vue` | `system` | `notify-message` | `index` | `system-notify-message-index.graph.json` |
242
+ | `yudao-ui/.../system/user/index.vue` | `system` | `user` | `index` | `system-user-index.graph.json` |
243
+ | `yudao-ui/.../bpm/process-instance/index.vue` | `bpm` | `process-instance` | `index` | `bpm-process-instance-index.graph.json` |
244
+
245
+ **Special Case - Empty subpath:**
246
+ - If the file is directly in the module root directory: `{module}-{fileName}.graph.json`
247
+ - Example: `yudao-ui/.../system/index.vue` → `system-index.graph.json`
248
+
249
+ **Complete JSON Structure:**
250
+
251
+ ```json
252
+ {
253
+ "module": "{{module}}",
254
+ "nodes": [
255
+ {
256
+ "id": "page-{{module}}-{{feature-name}}",
257
+ "type": "page",
258
+ "name": "<display name>",
259
+ "module": "{{module}}",
260
+ "sourcePath": "{{sourcePath}}",
261
+ "documentPath": "{{documentPath}}",
262
+ "description": "...",
263
+ "tags": [...],
264
+ "keywords": [...],
265
+ "context": { "route": "...", "components": [...] }
266
+ }
267
+ ],
268
+ "edges": [
269
+ {
270
+ "source": "page-...",
271
+ "target": "api-...",
272
+ "type": "calls",
273
+ "metadata": { "trigger": "...", "method": "..." }
274
+ }
275
+ ]
276
+ }
277
+ ```
278
+
279
+ > **⚠️ CRITICAL - module Field Requirement:**
280
+ > - The `.graph.json` file **MUST** have a root-level `module` field
281
+ > - Missing `module` field will cause the graph merge pipeline to reject this file
282
+
283
+ **Pre-write Verification:**
284
+ - [ ] Filename follows `{module}-{subpath}-{fileName}.graph.json` pattern
285
+ - [ ] JSON is valid (no trailing commas, all strings quoted)
286
+ - [ ] Root-level `module` field is present
287
+ - [ ] `nodes` and `edges` are arrays
288
+ - [ ] ALL imported API functions are represented as `calls` edges
289
+
290
+ **Output:** "Step 4 Status: ✅ COMPLETED - Graph JSON written to {{completed_dir}}/{marker-filename}.graph.json"
291
+
292
+ ---
293
+
294
+ ### Step 5: Write Graph Completion Marker
295
+
296
+ **Step 5 Status: 🔄 IN PROGRESS**
297
+
298
+ Write the `.graph-done.json` completion marker file to signal successful graph data generation.
299
+
300
+ **Marker File Path:**
301
+
302
+ ```
303
+ {completed_dir}/{module}-{subpath}-{fileName}.graph-done.json
304
+ ```
305
+
306
+ **Complete JSON Template (ALL fields required):**
307
+
308
+ ```json
309
+ {
310
+ "fileName": "{{fileName}}",
311
+ "sourcePath": "{{sourcePath}}",
312
+ "sourceFile": "{{sourceFile}}",
313
+ "module": "{{module}}",
314
+ "documentPath": "{{documentPath}}",
315
+ "marker": "graph_completed",
316
+ "graphFile": "{module}-{subpath}-{fileName}.graph.json",
317
+ "nodeCount": {{node_count}},
318
+ "edgeCount": {{edge_count}},
319
+ "status": "{{status}}",
320
+ "analysisNotes": "{{analysisNotes}}"
321
+ }
322
+ ```
323
+
324
+ **Field Descriptions:**
325
+
326
+ | Field | Required | Description | Example |
327
+ |-------|----------|-------------|---------|
328
+ | `fileName` | ✅ YES | Feature file name **WITHOUT extension** | `"index"` |
329
+ | `sourcePath` | ✅ YES | Relative path to source file | `"frontend-web/src/views/system/user/index.vue"` |
330
+ | `sourceFile` | ✅ YES | Source features JSON filename | `"features-web-vue.json"` |
331
+ | `module` | ✅ YES | Business module name | `"system"` |
332
+ | `documentPath` | ✅ YES | Path to generated document | `"speccrew-workspace/knowledges/..."` |
333
+ | `marker` | ✅ YES | Fixed marker type | `"graph_completed"` |
334
+ | `graphFile` | ✅ YES | Corresponding graph JSON filename | `"system-notify-message-index.graph.json"` |
335
+ | `nodeCount` | ✅ YES | Number of nodes in graph | `5` |
336
+ | `edgeCount` | ✅ YES | Number of edges in graph | `12` |
337
+ | `status` | ✅ YES | Analysis status | `"success"`, `"partial"`, or `"failed"` |
338
+ | `analysisNotes` | ✅ YES | Summary message | `"Successfully analyzed..."` |
339
+
340
+ > **⚠️ CRITICAL - fileName Field Rules:**
341
+ > - The `fileName` field MUST contain only the feature file name **WITHOUT file extension**
342
+ > - ✅ CORRECT: `"fileName": "index"`
343
+ > - ❌ WRONG: `"fileName": "index.vue"` (includes extension)
344
+
345
+ > **⚠️ CRITICAL - sourcePath Validation:**
346
+ > - `sourcePath` MUST be a project-root-relative path
347
+ > - NEVER use platform-source-relative short paths
348
+
349
+ > **⚠️ CRITICAL - documentPath Rules:**
350
+ > - When no corresponding document exists, `documentPath` MUST be `"N/A"`
351
+ > - NEVER use empty string `""` for `documentPath`
352
+
353
+ **Pre-write Verification:**
354
+ - [ ] Filename follows `{module}-{subpath}-{fileName}.graph-done.json` pattern
355
+ - [ ] JSON is valid
356
+ - [ ] `fileName` does NOT contain file extension
357
+ - [ ] `sourceFile` matches `features-{platform}.json` pattern
358
+ - [ ] `module` field is present and non-empty
359
+ - [ ] `documentPath` is `"N/A"` when no document exists (not empty string)
360
+ - [ ] `nodeCount` and `edgeCount` match actual graph data
361
+
362
+ **Output:** "Step 5 Status: ✅ COMPLETED - Graph completion marker written to {{completed_dir}}/{marker-filename}.graph-done.json"
363
+
364
+ ---
365
+
366
+ ## Task Completion Report
367
+
368
+ When the task is complete, report the following:
369
+
370
+ **Status:** `success` | `partial` | `failed`
371
+
372
+ **Summary:**
373
+ - Feature: `{{fileName}}`
374
+ - Module: `{{module}}`
375
+ - Nodes constructed: `{{nodeCount}}`
376
+ - Edges constructed: `{{edgeCount}}`
377
+
378
+ **Files Generated:**
379
+ - `{{completed_dir}}/{marker-filename}.graph.json`
380
+ - `{{completed_dir}}/{marker-filename}.graph-done.json`
381
+
382
+ ## Constraints
383
+
384
+ 1. **100% API coverage** - ALL imported API functions MUST be represented as `calls` edges
385
+ 2. **Valid JSON format** - Both `.graph.json` and `.graph-done.json` MUST be valid JSON
386
+ 3. **Root-level module field** - `.graph.json` MUST include `module` at root level
387
+ 4. **Correct filename pattern** - Use `{module}-{subpath}-{fileName}` composite naming
388
+ 5. **No file extension in fileName** - The `fileName` field in `.graph-done.json` MUST NOT include extension
389
+ 6. **documentPath as N/A** - Use `"N/A"` when no document exists, never empty string
@@ -326,6 +326,32 @@ Frontend (React): `[OrderDetail.tsx](../../../../../src/pages/order/OrderDetail.
326
326
 
327
327
  ---
328
328
 
329
+ ## Task Completion Report
330
+
331
+ Upon completion, output the following structured report:
332
+
333
+ ```json
334
+ {
335
+ "status": "success | partial | failed",
336
+ "skill": "speccrew-knowledge-module-summarize",
337
+ "output_files": [
338
+ "{module_path}/{module_name}-overview.md"
339
+ ],
340
+ "summary": "Module overview completed with entities, dependencies, and business rules extracted from {feature_count} features",
341
+ "metrics": {
342
+ "modules_processed": 1,
343
+ "documents_generated": 1,
344
+ "features_covered": 0
345
+ },
346
+ "errors": [],
347
+ "next_steps": [
348
+ "Run speccrew-knowledge-system-summarize to aggregate all modules into system overview"
349
+ ]
350
+ }
351
+ ```
352
+
353
+ ---
354
+
329
355
  ## Checklist
330
356
 
331
357
  - [ ] Step 1: Prerequisites read (template, initial overview, feature details)
@@ -364,6 +364,33 @@ Aggregate source file references from all module overview documents:
364
364
 
365
365
  ---
366
366
 
367
+ ## Task Completion Report
368
+
369
+ Upon completion, output the following structured report:
370
+
371
+ ```json
372
+ {
373
+ "status": "success | partial | failed",
374
+ "skill": "speccrew-knowledge-system-summarize",
375
+ "output_files": [
376
+ "{output_path}/system-overview.md"
377
+ ],
378
+ "summary": "System overview generated from {module_count} modules across {platform_count} platforms",
379
+ "metrics": {
380
+ "platforms_covered": 0,
381
+ "modules_summarized": 0,
382
+ "system_overview_generated": true
383
+ },
384
+ "errors": [],
385
+ "next_steps": [
386
+ "Review system-overview.md for completeness",
387
+ "Run speccrew-pm-requirement-assess if requirement assessment is needed"
388
+ ]
389
+ }
390
+ ```
391
+
392
+ ---
393
+
367
394
  ## Checklist
368
395
 
369
396
  - [ ] All {{module_name}}-overview.md files discovered