speccrew 0.7.74 → 0.7.76
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 +4 -647
- package/.speccrew/agents/speccrew-product-manager.md +5 -480
- package/.speccrew/agents/speccrew-system-deployer.md +6 -457
- package/.speccrew/agents/speccrew-system-developer.md +9 -913
- package/.speccrew/agents/speccrew-test-manager.md +403 -1112
- package/.speccrew/skills/speccrew-agentflow-manager/SKILL.md +6 -149
- package/.speccrew/skills/speccrew-deploy-build/SKILL.md +2 -59
- package/.speccrew/skills/speccrew-deploy-migrate/SKILL.md +2 -64
- package/.speccrew/skills/speccrew-deploy-smoke-test/SKILL.md +2 -75
- package/.speccrew/skills/speccrew-deploy-startup/SKILL.md +2 -70
- package/.speccrew/skills/speccrew-dev-backend/SKILL.md +2 -381
- package/.speccrew/skills/speccrew-dev-desktop-electron/SKILL.md +2 -369
- package/.speccrew/skills/speccrew-dev-desktop-tauri/SKILL.md +2 -362
- package/.speccrew/skills/speccrew-dev-frontend/SKILL.md +2 -304
- package/.speccrew/skills/speccrew-dev-mobile/SKILL.md +2 -294
- package/.speccrew/skills/speccrew-dev-review-backend/SKILL.md +2 -204
- package/.speccrew/skills/speccrew-dev-review-desktop/SKILL.md +2 -173
- package/.speccrew/skills/speccrew-dev-review-frontend/SKILL.md +2 -169
- package/.speccrew/skills/speccrew-dev-review-mobile/SKILL.md +2 -173
- package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +2 -251
- package/.speccrew/skills/speccrew-fd-feature-analyze/SKILL.md +2 -254
- package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +2 -748
- package/.speccrew/skills/speccrew-feature-designer-orchestration/SKILL.md +6 -105
- package/.speccrew/skills/speccrew-get-timestamp/SKILL.md +6 -33
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +3 -138
- package/.speccrew/skills/speccrew-knowledge-bizs-api-graph/SKILL.md +3 -283
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +3 -1014
- package/.speccrew/skills/speccrew-knowledge-bizs-identify-entries/SKILL.md +4 -343
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +4 -235
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/SKILL.md +6 -72
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +3 -534
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-graph/SKILL.md +3 -432
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/SKILL.md +4 -391
- package/.speccrew/skills/speccrew-knowledge-graph-query/SKILL.md +3 -98
- package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +3 -92
- package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +3 -181
- package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +3 -148
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +3 -330
- package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +6 -159
- package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +3 -142
- package/.speccrew/skills/speccrew-knowledge-techs-generate-quality/SKILL.md +3 -568
- package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +3 -180
- package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +3 -154
- package/.speccrew/skills/speccrew-knowledge-techs-init/SKILL.md +3 -176
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +3 -135
- package/.speccrew/skills/speccrew-pm-knowledge-detector/SKILL.md +4 -88
- package/.speccrew/skills/speccrew-pm-module-initializer/SKILL.md +4 -178
- package/.speccrew/skills/speccrew-pm-module-matcher/SKILL.md +3 -102
- package/.speccrew/skills/speccrew-pm-phase0-init/SKILL.md +5 -78
- package/.speccrew/skills/speccrew-pm-phase1-knowledge-check/SKILL.md +5 -85
- package/.speccrew/skills/speccrew-pm-phase2-complexity-assess/SKILL.md +4 -100
- package/.speccrew/skills/speccrew-pm-phase5-subprd-dispatch/SKILL.md +14 -106
- package/.speccrew/skills/speccrew-pm-phase6-verify-confirm/SKILL.md +7 -84
- package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +6 -66
- package/.speccrew/skills/speccrew-pm-requirement-assess/SKILL.md +4 -96
- package/.speccrew/skills/speccrew-pm-requirement-clarify/SKILL.md +4 -131
- package/.speccrew/skills/speccrew-pm-requirement-model/SKILL.md +6 -79
- package/.speccrew/skills/speccrew-pm-requirement-simple/SKILL.md +4 -76
- package/.speccrew/skills/speccrew-pm-sub-prd-generate/SKILL.md +3 -281
- package/.speccrew/skills/speccrew-product-manager-orchestration/SKILL.md +6 -165
- package/.speccrew/skills/speccrew-system-deployer-orchestration/SKILL.md +6 -79
- package/.speccrew/skills/speccrew-system-designer-orchestration/SKILL.md +2 -35
- package/.speccrew/skills/speccrew-system-developer-orchestration/SKILL.md +6 -98
- package/.speccrew/skills/speccrew-task-worker-execution/SKILL.md +6 -94
- package/.speccrew/skills/speccrew-team-leader-routing/SKILL.md +6 -79
- package/.speccrew/skills/speccrew-test-case-design/SKILL.md +2 -58
- package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +2 -61
- package/.speccrew/skills/speccrew-test-manager-orchestration/SKILL.md +6 -94
- package/.speccrew/skills/speccrew-test-reporter/SKILL.md +2 -102
- package/.speccrew/skills/speccrew-test-runner/SKILL.md +3 -121
- package/package.json +1 -1
|
@@ -4,399 +4,12 @@ description: Extract and aggregate UI design patterns (page types, components, l
|
|
|
4
4
|
tools: Read, Write
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
Extract and aggregate **UI design patterns** from bizs pipeline analyzed feature documents using XML workflow blocks. Through cross-module clustering analysis, identify common page types, component patterns, and layout patterns, then output them to the techs knowledge base `ui-style-patterns/` subdirectory.
|
|
10
|
-
|
|
11
|
-
## Language Adaptation
|
|
12
|
-
|
|
13
|
-
**CRITICAL**: All generated documents must match the user's language. Detect the language from the user's input and generate content accordingly.
|
|
14
|
-
|
|
15
|
-
- User writes in 中文 → Generate Chinese documents, use `language: "zh"`
|
|
16
|
-
- User writes in English → Generate English documents, use `language: "en"`
|
|
17
|
-
- User writes in other languages → Use appropriate language code
|
|
18
|
-
|
|
19
|
-
**All generated pattern documents must be in the language specified by the `language` parameter.**
|
|
20
|
-
|
|
21
|
-
## Trigger Scenarios
|
|
22
|
-
|
|
23
|
-
- Called by `speccrew-knowledge-bizs-dispatch` Stage 3.5 (after Module Summarize, before System Summary)
|
|
7
|
+
# Trigger Scenarios
|
|
8
|
+
- Called by speccrew-knowledge-bizs-dispatch Stage 3.5
|
|
24
9
|
- "Extract UI patterns from bizs features"
|
|
25
10
|
- "Aggregate UI design patterns"
|
|
26
11
|
|
|
27
|
-
## Input
|
|
28
|
-
|
|
29
|
-
| Variable | Description | Required |
|
|
30
|
-
|----------|-------------|----------|
|
|
31
|
-
| `platform_id` | Platform identifier (e.g., web-vue, mobile-uniapp), used to locate output directory | Yes |
|
|
32
|
-
| `platform_type` | Platform type (web, mobile, desktop), only execute for frontend platforms | Yes |
|
|
33
|
-
| `feature_docs_path` | Completed feature documents base path, e.g., `speccrew-workspace/knowledges/bizs/{platform-type}/{module}/features/` | Yes |
|
|
34
|
-
| `features_manifest_path` | Path to features-{platform}.json, used to get completed feature list | Yes |
|
|
35
|
-
| `module_overviews_path` | **Parent directory** containing all module overview subdirectories. Example: `knowledges/bizs/web-vue/` (this directory contains `system/system-overview.md`, `user/user-overview.md`, etc.). **NOT** a specific module directory like `knowledges/bizs/web-vue/system/`. | Yes |
|
|
36
|
-
| `output_path` | Output directory, e.g., `speccrew-workspace/knowledges/techs/{platform_id}/ui-style-patterns/` | Yes |
|
|
37
|
-
| `language` | User language code | Yes |
|
|
38
|
-
|
|
39
|
-
## Output
|
|
40
|
-
|
|
41
|
-
> **Directory Separation**: This skill outputs to `ui-style-patterns/` (NOT `ui-style/`).
|
|
42
|
-
> - `ui-style/` is managed by techs pipeline (framework-level design system, existing components/pages)
|
|
43
|
-
> - `ui-style-patterns/` is managed by bizs pipeline (business pattern aggregation from feature docs)
|
|
44
|
-
> This separation prevents file conflicts between the two pipelines.
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
{output_path}/
|
|
48
|
-
├── page-types/ # Page type pattern documents
|
|
49
|
-
│ ├── {pattern-name}.md
|
|
50
|
-
│ └── ...
|
|
51
|
-
├── components/ # Component pattern documents
|
|
52
|
-
│ ├── {pattern-name}.md
|
|
53
|
-
│ └── ...
|
|
54
|
-
└── layouts/ # Layout pattern documents
|
|
55
|
-
├── {pattern-name}.md
|
|
56
|
-
└── ...
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Absolute Constraints
|
|
60
|
-
|
|
61
|
-
> **These rules apply to ALL document generation steps. Violation = task failure.**
|
|
62
|
-
|
|
63
|
-
1. **FORBIDDEN: `create_file` for pattern documents** — NEVER use `create_file` to write pattern documents. Each document MUST be created by copying the appropriate template then filling sections with `search_replace`.
|
|
64
|
-
|
|
65
|
-
2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire document content in a single operation. Always use targeted `search_replace` on specific sections.
|
|
66
|
-
|
|
67
|
-
3. **MANDATORY: Template-first workflow** — Copy template MUST execute before filling sections for every pattern document.
|
|
68
|
-
|
|
69
12
|
## AgentFlow Definition
|
|
70
|
-
|
|
71
13
|
<!-- @agentflow: SKILL.xml -->
|
|
72
|
-
|
|
73
|
-
>
|
|
74
|
-
|
|
75
|
-
<!-- ============================================================
|
|
76
|
-
Input Parameters Definition
|
|
77
|
-
============================================================ -->
|
|
78
|
-
<block type="input" id="I1" desc="Workflow input parameters">
|
|
79
|
-
<field name="platform_id" required="true" type="string" desc="Platform identifier (e.g., web-vue, mobile-uniapp)"/>
|
|
80
|
-
<field name="platform_type" required="true" type="string" desc="Platform type (web, mobile, desktop)"/>
|
|
81
|
-
<field name="feature_docs_path" required="true" type="string" desc="Completed feature documents base path"/>
|
|
82
|
-
<field name="features_manifest_path" required="true" type="string" desc="Path to features-{platform}.json"/>
|
|
83
|
-
<field name="module_overviews_path" required="true" type="string" desc="Parent directory containing all module overview subdirectories"/>
|
|
84
|
-
<field name="output_path" required="true" type="string" desc="Output directory for pattern documents"/>
|
|
85
|
-
<field name="language" required="true" type="string" desc="User language code"/>
|
|
86
|
-
</block>
|
|
87
|
-
|
|
88
|
-
<!-- ============================================================
|
|
89
|
-
Global Constraints
|
|
90
|
-
============================================================ -->
|
|
91
|
-
<block type="rule" id="R1" level="forbidden" desc="Document generation constraints">
|
|
92
|
-
<field name="text">Using create_file to write pattern documents directly</field>
|
|
93
|
-
<field name="text">Full-file rewrite of pattern documents</field>
|
|
94
|
-
</block>
|
|
95
|
-
|
|
96
|
-
<block type="rule" id="R2" level="mandatory" desc="Document generation requirements">
|
|
97
|
-
<field name="text">Copy template MUST execute before filling sections for every pattern document</field>
|
|
98
|
-
<field name="text">All generated pattern documents must be in the specified language</field>
|
|
99
|
-
</block>
|
|
100
|
-
|
|
101
|
-
<!-- ============================================================
|
|
102
|
-
Global Continuous Execution Rules
|
|
103
|
-
============================================================ -->
|
|
104
|
-
<block type="rule" id="GLOBAL-R1" level="forbidden" desc="Continuous execution constraints — NEVER violate">
|
|
105
|
-
<field name="text">DO NOT ask user "Should I continue?" or "How would you like to proceed?" during execution</field>
|
|
106
|
-
<field name="text">DO NOT offer options like "Full execution / Partial / Stop" — always execute ALL tasks to completion</field>
|
|
107
|
-
<field name="text">DO NOT suggest "Due to context window limits, let me pause" — complete current task, use checkpoint for resumption</field>
|
|
108
|
-
<field name="text">DO NOT estimate workload and suggest breaking it into phases — execute ALL items in sequence</field>
|
|
109
|
-
<field name="text">DO NOT warn about "large number of files" or "this may take a while" — proceed with generation</field>
|
|
110
|
-
<field name="text">Context window management: if approaching limit, save progress to checkpoint file and resume — do NOT ask user for guidance</field>
|
|
111
|
-
</block>
|
|
112
|
-
|
|
113
|
-
<!-- ============================================================
|
|
114
|
-
Gateway: Platform Type Check
|
|
115
|
-
============================================================ -->
|
|
116
|
-
<block type="gateway" id="G1" mode="exclusive" desc="Check platform type for UI pattern extraction">
|
|
117
|
-
<branch test="${platform_type} NOT IN ['web', 'mobile', 'desktop']" name="Backend platform">
|
|
118
|
-
<block type="event" id="E1" action="log" level="info" desc="Log skip reason">
|
|
119
|
-
<field name="message">Skipping skill: backend platforms do not have UI patterns</field>
|
|
120
|
-
</block>
|
|
121
|
-
<block type="task" id="B1" action="analyze" desc="Return skip status">
|
|
122
|
-
<field name="status" value="skipped"/>
|
|
123
|
-
<field name="reason" value="Backend platform does not have UI patterns"/>
|
|
124
|
-
<field name="output" var="summary"/>
|
|
125
|
-
</block>
|
|
126
|
-
</branch>
|
|
127
|
-
<branch test="${platform_type} IN ['web', 'mobile', 'desktop']" name="UI platform">
|
|
128
|
-
|
|
129
|
-
<!-- ============================================================
|
|
130
|
-
Step 1: Load Features Manifest
|
|
131
|
-
============================================================ -->
|
|
132
|
-
<sequence id="S1" name="Step 1: Load Features Manifest" status="pending" desc="Read features manifest to identify completed features">
|
|
133
|
-
<block type="task" id="B2" action="read-file" desc="Read features manifest file">
|
|
134
|
-
<field name="path" value="${features_manifest_path}"/>
|
|
135
|
-
<field name="output" var="featuresManifest"/>
|
|
136
|
-
</block>
|
|
137
|
-
|
|
138
|
-
<block type="task" id="B3" action="analyze" desc="Filter completed features">
|
|
139
|
-
<field name="input" value="${featuresManifest}"/>
|
|
140
|
-
<field name="filter" value="status === 'completed'"/>
|
|
141
|
-
<field name="collect" value="featureId, module, documentPath"/>
|
|
142
|
-
<field name="output" var="completed_features"/>
|
|
143
|
-
</block>
|
|
144
|
-
</sequence>
|
|
145
|
-
|
|
146
|
-
<!-- ============================================================
|
|
147
|
-
Gateway: Check Completed Features
|
|
148
|
-
============================================================ -->
|
|
149
|
-
<block type="gateway" id="G2" mode="guard" desc="Check if completed features exist">
|
|
150
|
-
<branch test="${completed_features.length} > 0" name="Has completed features">
|
|
151
|
-
|
|
152
|
-
<!-- Step 1.5: Create Output Directory -->
|
|
153
|
-
<block type="task" id="B4" action="run-script" desc="Create output directory structure">
|
|
154
|
-
<field name="command">node -e "require('fs').mkdirSync('${output_path}/page-types', {recursive:true}); require('fs').mkdirSync('${output_path}/components', {recursive:true}); require('fs').mkdirSync('${output_path}/layouts', {recursive:true})"</field>
|
|
155
|
-
</block>
|
|
156
|
-
|
|
157
|
-
<!-- ============================================================
|
|
158
|
-
Step 2: Read Feature Documents
|
|
159
|
-
============================================================ -->
|
|
160
|
-
<sequence id="S2" name="Step 2: Read Feature Documents" status="pending" desc="Extract UI information from feature documents">
|
|
161
|
-
<block type="task" id="B5" action="analyze" desc="Extract UI-related information from feature documents">
|
|
162
|
-
<field name="input" value="${completed_features}"/>
|
|
163
|
-
<field name="feature_docs_path" value="${feature_docs_path}"/>
|
|
164
|
-
<field name="extract_section" value="Interface Prototype"/>
|
|
165
|
-
<field name="extract_items" value="ASCII wireframe diagrams, layout regions"/>
|
|
166
|
-
<field name="extract_section_2" value="Page Elements Table"/>
|
|
167
|
-
<field name="extract_items_2" value="Component names, types, responsibilities, interactions"/>
|
|
168
|
-
<field name="extract_section_3" value="Business Flow Description"/>
|
|
169
|
-
<field name="extract_items_3" value="User interaction sequences, navigation patterns"/>
|
|
170
|
-
<field name="output" var="ui_extracted_data"/>
|
|
171
|
-
</block>
|
|
172
|
-
</sequence>
|
|
173
|
-
|
|
174
|
-
<!-- ============================================================
|
|
175
|
-
Step 3: Read Module Overviews
|
|
176
|
-
============================================================ -->
|
|
177
|
-
<sequence id="S3" name="Step 3: Read Module Overviews" status="pending" desc="Gather module-level context">
|
|
178
|
-
<block type="task" id="B6" action="analyze" desc="Read module overview files for context">
|
|
179
|
-
<field name="glob_pattern" value="${module_overviews_path}/*/module-overview.md"/>
|
|
180
|
-
<field name="extract_items" value="Common page structures, Shared components, Navigation patterns"/>
|
|
181
|
-
<field name="output" var="module_context"/>
|
|
182
|
-
</block>
|
|
183
|
-
</sequence>
|
|
184
|
-
|
|
185
|
-
<!-- Checkpoint: Data Collection Complete -->
|
|
186
|
-
<block type="checkpoint" id="CP1" name="data-collection-complete" desc="Data collection complete">
|
|
187
|
-
<field name="file" value="${output_path}/.progress.json"/>
|
|
188
|
-
<field name="verify" value="${ui_extracted_data} != null AND ${module_context} != null"/>
|
|
189
|
-
</block>
|
|
190
|
-
|
|
191
|
-
<!-- ============================================================
|
|
192
|
-
Step 4: Cross-Module Clustering Analysis
|
|
193
|
-
============================================================ -->
|
|
194
|
-
<sequence id="S4" name="Step 4: Cross-Module Clustering Analysis" status="pending" desc="Identify recurring UI patterns">
|
|
195
|
-
<block type="task" id="B7" action="analyze" desc="Perform cross-module clustering analysis">
|
|
196
|
-
<field name="input" value="${ui_extracted_data}"/>
|
|
197
|
-
<field name="module_context" value="${module_context}"/>
|
|
198
|
-
<field name="clustering_approach" value="Dynamic discovery - Agent automatically identifies and categorizes pattern types based on actual analysis results"/>
|
|
199
|
-
<field name="note" value="Templates only standardize output format, do not limit pattern types"/>
|
|
200
|
-
<field name="categories_page_types" value="Pages with similar structure and purpose (e.g., list-page, form-page, detail-page, tree-list-page, dashboard-page, wizard-page)"/>
|
|
201
|
-
<field name="categories_component_patterns" value="Reusable component combinations (e.g., search-filter-bar, data-table-pagination, modal-form, drawer-detail, tab-panel)"/>
|
|
202
|
-
<field name="categories_layout_patterns" value="Repeating structural layouts (e.g., sidebar-content, topbar-sidebar-content, full-screen)"/>
|
|
203
|
-
<field name="recognition_frequency" value="Pattern appears in 2+ features (stronger signal if across different modules)"/>
|
|
204
|
-
<field name="recognition_similarity" value="Structural similarity in ASCII wireframes"/>
|
|
205
|
-
<field name="recognition_semantic" value="Similar business purpose and interaction flow"/>
|
|
206
|
-
<field name="output" var="identified_patterns"/>
|
|
207
|
-
</block>
|
|
208
|
-
</sequence>
|
|
209
|
-
|
|
210
|
-
<!-- ============================================================
|
|
211
|
-
Gateway: Check Identified Patterns
|
|
212
|
-
============================================================ -->
|
|
213
|
-
<block type="gateway" id="G3" mode="exclusive" desc="Check if patterns were identified">
|
|
214
|
-
<branch test="${identified_patterns.length} == 0" name="No patterns">
|
|
215
|
-
<block type="event" id="E2" action="log" level="warn" desc="Log no patterns">
|
|
216
|
-
<field name="message">No patterns identified from feature documents</field>
|
|
217
|
-
</block>
|
|
218
|
-
<block type="task" id="B8" action="analyze" desc="Return empty result">
|
|
219
|
-
<field name="status" value="completed"/>
|
|
220
|
-
<field name="platform_id" value="${platform_id}"/>
|
|
221
|
-
<field name="patterns_page_types" value='{"count": 0, "files": []}'/>
|
|
222
|
-
<field name="patterns_components" value='{"count": 0, "files": []}'/>
|
|
223
|
-
<field name="patterns_layouts" value='{"count": 0, "files": []}'/>
|
|
224
|
-
<field name="total_patterns" value="0"/>
|
|
225
|
-
<field name="output_path" value="${output_path}"/>
|
|
226
|
-
<field name="output" var="summary"/>
|
|
227
|
-
</block>
|
|
228
|
-
</branch>
|
|
229
|
-
<branch test="${identified_patterns.length} > 0" name="Has patterns">
|
|
230
|
-
|
|
231
|
-
<!-- ============================================================
|
|
232
|
-
Step 5: Generate Pattern Documents
|
|
233
|
-
============================================================ -->
|
|
234
|
-
<block type="loop" id="L1" over="${identified_patterns}" as="pattern" desc="Generate pattern documents">
|
|
235
|
-
|
|
236
|
-
<!-- 5.1 Template Selection -->
|
|
237
|
-
<block type="gateway" id="G4" mode="exclusive" desc="Select template based on pattern category">
|
|
238
|
-
<branch test="${pattern.category} == 'page-types'" name="Page type">
|
|
239
|
-
<block type="task" id="B9" action="analyze" desc="Select page type template">
|
|
240
|
-
<field name="template_path" value="./templates/PAGE-TYPE-TEMPLATE.md"/>
|
|
241
|
-
<field name="output_directory" value="${output_path}/page-types/"/>
|
|
242
|
-
<field name="output" var="selected_template"/>
|
|
243
|
-
</block>
|
|
244
|
-
</branch>
|
|
245
|
-
<branch test="${pattern.category} == 'components'" name="Component pattern">
|
|
246
|
-
<block type="task" id="B10" action="analyze" desc="Select component pattern template">
|
|
247
|
-
<field name="template_path" value="./templates/COMPONENT-PATTERN-TEMPLATE.md"/>
|
|
248
|
-
<field name="output_directory" value="${output_path}/components/"/>
|
|
249
|
-
<field name="output" var="selected_template"/>
|
|
250
|
-
</block>
|
|
251
|
-
</branch>
|
|
252
|
-
<branch test="${pattern.category} == 'layouts'" name="Layout pattern">
|
|
253
|
-
<block type="task" id="B11" action="analyze" desc="Select layout pattern template">
|
|
254
|
-
<field name="template_path" value="./templates/LAYOUT-PATTERN-TEMPLATE.md"/>
|
|
255
|
-
<field name="output_directory" value="${output_path}/layouts/"/>
|
|
256
|
-
<field name="output" var="selected_template"/>
|
|
257
|
-
</block>
|
|
258
|
-
</branch>
|
|
259
|
-
</block>
|
|
260
|
-
|
|
261
|
-
<!-- 5.2 Copy Template to Document Path -->
|
|
262
|
-
<block type="task" id="B12" action="run-script" desc="Copy template to output path">
|
|
263
|
-
<field name="template" value="${selected_template}"/>
|
|
264
|
-
<field name="filename_format" value="kebab-case (e.g., list-page.md, search-filter-bar.md, sidebar-content.md)"/>
|
|
265
|
-
<field name="output_path" value="${selected_template.output_directory}/${pattern.name}.md"/>
|
|
266
|
-
<field name="output" var="document_path"/>
|
|
267
|
-
</block>
|
|
268
|
-
|
|
269
|
-
<!-- 5.3 Fill Sections Using search_replace -->
|
|
270
|
-
<block type="task" id="B13" action="analyze" desc="Fill pattern document sections">
|
|
271
|
-
<field name="document_path" value="${document_path}"/>
|
|
272
|
-
<field name="pattern" value="${pattern}"/>
|
|
273
|
-
<field name="language" value="${language}"/>
|
|
274
|
-
<field name="constraint_forbidden" value="Using create_file to rewrite the entire document"/>
|
|
275
|
-
<field name="constraint_mandatory" value="Use search_replace to fill each section individually"/>
|
|
276
|
-
<field name="constraint_sections" value="All section titles MUST be preserved"/>
|
|
277
|
-
<field name="content_ascii_wireframes" value="Must be generalized versions (not direct copies from specific features)"/>
|
|
278
|
-
<field name="content_instance_references" value="Must use relative paths to reference actual feature documents"/>
|
|
279
|
-
<field name="mermaid_rule" value="Follow speccrew-workspace/docs/rules/mermaid-rule.md rules"/>
|
|
280
|
-
<field name="mermaid_syntax" value="Use graph TB/LR syntax only"/>
|
|
281
|
-
<field name="mermaid_no_br" value="No br/ tags, no style definitions, no nested subgraph"/>
|
|
282
|
-
<field name="mermaid_no_direction" value="No direction keyword, no special symbols"/>
|
|
283
|
-
<field name="output" var="filled_document"/>
|
|
284
|
-
</block>
|
|
285
|
-
|
|
286
|
-
<!-- Checkpoint: Pattern Document Generated -->
|
|
287
|
-
<block type="checkpoint" id="CP2" name="pattern-document-generated" desc="Pattern document generated">
|
|
288
|
-
<field name="file" value="${output_path}/.progress.json"/>
|
|
289
|
-
<field name="verify" value="file_exists(${document_path}) AND document_has_all_sections(${document_path})"/>
|
|
290
|
-
</block>
|
|
291
|
-
|
|
292
|
-
</block>
|
|
293
|
-
|
|
294
|
-
<!-- Step 6: Return Summary -->
|
|
295
|
-
<block type="task" id="B14" action="analyze" desc="Generate summary of pattern documents">
|
|
296
|
-
<field name="collect_files" value="All generated file paths"/>
|
|
297
|
-
<field name="collect_counts" value="Pattern counts by category"/>
|
|
298
|
-
<field name="output" var="summary"/>
|
|
299
|
-
</block>
|
|
300
|
-
|
|
301
|
-
</branch>
|
|
302
|
-
</block>
|
|
303
|
-
|
|
304
|
-
</branch>
|
|
305
|
-
<branch test="${completed_features.length} == 0" name="No completed features">
|
|
306
|
-
<block type="event" id="E3" action="log" level="warn" desc="Log no features">
|
|
307
|
-
<field name="message">No completed features found - returning empty result</field>
|
|
308
|
-
</block>
|
|
309
|
-
<block type="task" id="B15" action="analyze" desc="Return empty summary">
|
|
310
|
-
<field name="status" value="completed"/>
|
|
311
|
-
<field name="platform_id" value="${platform_id}"/>
|
|
312
|
-
<field name="patterns_page_types" value='{"count": 0, "files": []}'/>
|
|
313
|
-
<field name="patterns_components" value='{"count": 0, "files": []}'/>
|
|
314
|
-
<field name="patterns_layouts" value='{"count": 0, "files": []}'/>
|
|
315
|
-
<field name="total_patterns" value="0"/>
|
|
316
|
-
<field name="output_path" value="${output_path}"/>
|
|
317
|
-
<field name="output" var="summary"/>
|
|
318
|
-
</block>
|
|
319
|
-
</branch>
|
|
320
|
-
</block>
|
|
321
|
-
|
|
322
|
-
</branch>
|
|
323
|
-
</block>
|
|
324
|
-
|
|
325
|
-
<!-- ============================================================
|
|
326
|
-
Output Results
|
|
327
|
-
============================================================ -->
|
|
328
|
-
<block type="output" id="O1" desc="Workflow output results">
|
|
329
|
-
<field name="final_summary" from="${summary}" type="object" desc="Summary of generated pattern documents with file list and counts"/>
|
|
330
|
-
</block>
|
|
331
|
-
|
|
332
|
-
</workflow>
|
|
333
|
-
|
|
334
|
-
## Generation Rules
|
|
335
|
-
|
|
336
|
-
1. **Pattern Quality**:
|
|
337
|
-
- Each pattern must have clear applicable scenarios
|
|
338
|
-
- Generalized ASCII wireframe (not feature-specific)
|
|
339
|
-
- At least 2 instance references (from same or different modules)
|
|
340
|
-
|
|
341
|
-
2. **Template Compliance**:
|
|
342
|
-
- All sections from template must be filled
|
|
343
|
-
- Instance reference paths must be relative and valid
|
|
344
|
-
|
|
345
|
-
3. **Mermaid Compliance**:
|
|
346
|
-
- Follow all rules in `mermaid-rule.md`
|
|
347
|
-
- Use basic `graph TB` or `graph LR` syntax
|
|
348
|
-
- No prohibited syntax elements
|
|
349
|
-
|
|
350
|
-
4. **Language Consistency**:
|
|
351
|
-
- All content in the specified `language`
|
|
352
|
-
- Template section headers remain in English
|
|
353
|
-
- Content text matches user language
|
|
354
|
-
|
|
355
|
-
## Error Handling
|
|
356
|
-
|
|
357
|
-
| Scenario | Handling |
|
|
358
|
-
|----------|----------|
|
|
359
|
-
| No completed features | Return empty result, log warning |
|
|
360
|
-
| No patterns identified | Return empty result, log message |
|
|
361
|
-
| Template not found | Use default structure, log warning |
|
|
362
|
-
| Feature document missing | Skip feature, continue with others |
|
|
363
|
-
|
|
364
|
-
## Checklist
|
|
365
|
-
|
|
366
|
-
- [ ] Step 1: Features manifest loaded, completed features identified
|
|
367
|
-
- [ ] Step 2: All completed feature documents read
|
|
368
|
-
- [ ] Step 3: All module overviews read
|
|
369
|
-
- [ ] Step 4: Cross-module clustering analysis completed
|
|
370
|
-
- [ ] Step 5: Pattern documents generated with correct templates
|
|
371
|
-
- [ ] Step 5: File naming follows kebab-case convention
|
|
372
|
-
- [ ] Step 5: ASCII wireframes are generalized versions
|
|
373
|
-
- [ ] Step 5: Instance references use relative paths
|
|
374
|
-
- [ ] Step 5: Mermaid diagrams follow mermaid-rule.md
|
|
375
|
-
- [ ] Step 6: Summary returned with file list
|
|
376
|
-
|
|
377
|
-
## Return
|
|
378
|
-
|
|
379
|
-
After completion, return a summary object to the caller:
|
|
380
|
-
|
|
381
|
-
```json
|
|
382
|
-
{
|
|
383
|
-
"status": "completed",
|
|
384
|
-
"platform_id": "web-vue",
|
|
385
|
-
"patterns": {
|
|
386
|
-
"page_types": {
|
|
387
|
-
"count": 3,
|
|
388
|
-
"files": ["page-types/list-page.md", "page-types/form-page.md", "page-types/detail-page.md"]
|
|
389
|
-
},
|
|
390
|
-
"components": {
|
|
391
|
-
"count": 2,
|
|
392
|
-
"files": ["components/search-filter-bar.md", "components/modal-form.md"]
|
|
393
|
-
},
|
|
394
|
-
"layouts": {
|
|
395
|
-
"count": 1,
|
|
396
|
-
"files": ["layouts/sidebar-content.md"]
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
|
-
"total_patterns": 6,
|
|
400
|
-
"output_path": "speccrew-workspace/knowledges/techs/web-vue/ui-style-patterns/"
|
|
401
|
-
}
|
|
402
|
-
```
|
|
14
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: speccrew-workspace/docs/rules/agentflow-spec.md
|
|
15
|
+
> Then read and execute the XML workflow in SKILL.xml block-by-block as the authoritative execution plan.
|
|
@@ -4,107 +4,12 @@ description: Query the knowledge graph to find nodes, edges, relationships, and
|
|
|
4
4
|
tools: Bash
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
Query the knowledge graph stored in `speccrew-workspace/knowledges/bizs/graph/` to find nodes, edges, and trace relationships. This skill wraps `graph-query.js` script for all read operations.
|
|
10
|
-
|
|
11
|
-
## Trigger Scenarios
|
|
12
|
-
|
|
7
|
+
# Trigger Scenarios
|
|
13
8
|
- "Find all APIs in module {module}"
|
|
14
9
|
- "What pages call API {apiId}?"
|
|
15
10
|
- "Show impact analysis for table {tableId}"
|
|
16
|
-
- "Search for entities related to {keyword}"
|
|
17
|
-
- "Trace upstream dependencies of {nodeId}"
|
|
18
|
-
- "Get all edges for node {nodeId}"
|
|
19
|
-
|
|
20
|
-
## User
|
|
21
|
-
|
|
22
|
-
Any Agent (speccrew-task-worker, speccrew-knowledge-dispatch, or other agents)
|
|
23
|
-
|
|
24
|
-
## Input Variables
|
|
25
|
-
|
|
26
|
-
| Variable | Type | Description | Example |
|
|
27
|
-
|----------|------|-------------|---------|
|
|
28
|
-
| `{{action}}` | string | Query action to perform | `"get-node"`, `"query-nodes"`, `"get-edges"`, `"search"`, `"trace-upstream"`, `"trace-downstream"` |
|
|
29
|
-
| `{{id}}` | string | Node ID (for get-node, trace-*) | `"api-system-user-list"` |
|
|
30
|
-
| `{{module}}` | string | Filter by module (for query-nodes, search) | `"system"`, `"trade"` |
|
|
31
|
-
| `{{type}}` | string | Filter by node type (for query-nodes, search) | `"api"`, `"page"`, `"table"` |
|
|
32
|
-
| `{{keyword}}` | string | Search keyword (for search) | `"user"`, `"order"` |
|
|
33
|
-
| `{{direction}}` | string | Edge direction (for get-edges) | `"in"`, `"out"`, `"both"` |
|
|
34
|
-
| `{{depth}}` | number | Trace depth (for trace-*) | `2`, `3` |
|
|
35
|
-
| `{{graphRoot}}` | string | Path to graph root directory | `"speccrew-workspace/knowledges/bizs/graph"` |
|
|
36
|
-
|
|
37
|
-
## Output Variables
|
|
38
|
-
|
|
39
|
-
| Variable | Type | Description |
|
|
40
|
-
|----------|------|-------------|
|
|
41
|
-
| `{{status}}` | string | Query result: `"success"` or `"not-found"` |
|
|
42
|
-
| `{{resultCount}}` | number | Number of results returned |
|
|
43
|
-
| `{{data}}` | object/array | Query result data |
|
|
44
|
-
|
|
45
|
-
## Output
|
|
46
|
-
|
|
47
|
-
**Return Value (JSON format):**
|
|
48
|
-
```json
|
|
49
|
-
{
|
|
50
|
-
"status": "success",
|
|
51
|
-
"action": "query-nodes",
|
|
52
|
-
"resultCount": 5,
|
|
53
|
-
"data": [
|
|
54
|
-
{
|
|
55
|
-
"id": "api-system-user-list",
|
|
56
|
-
"type": "api",
|
|
57
|
-
"name": "List Users API",
|
|
58
|
-
"module": "system",
|
|
59
|
-
"sourcePath": "yudao-module-system/.../UserController.java",
|
|
60
|
-
"description": "Paginated query of system users"
|
|
61
|
-
}
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
```
|
|
65
11
|
|
|
66
12
|
## AgentFlow Definition
|
|
67
|
-
|
|
68
13
|
<!-- @agentflow: SKILL.xml -->
|
|
69
|
-
|
|
70
|
-
>
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## Common Query Patterns
|
|
75
|
-
|
|
76
|
-
| Scenario | Action | Parameters | Agent Use Case |
|
|
77
|
-
|----------|--------|-----------|---------------|
|
|
78
|
-
| Page → API | `get-edges` | nodeId=page-*, direction=out | UI agent: which APIs does this page use |
|
|
79
|
-
| API → Table | `get-edges` | nodeId=api-*, direction=out | Dev: which tables does this API touch |
|
|
80
|
-
| Table Impact | `trace-upstream` | id=table-*, depth=3 | Assess schema change impact |
|
|
81
|
-
| Module Overview | `query-nodes` | module=system | Generate module summary |
|
|
82
|
-
| Cross-Module Deps | `get-edges` | direction=out, filter cross-module | Inter-module dependency analysis |
|
|
83
|
-
| Keyword Search | `search` | keyword=user, type=api | Find all user-related APIs |
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
## Script Reference
|
|
88
|
-
|
|
89
|
-
Scripts location: `scripts/graph-query.js` (relative to this skill directory)
|
|
90
|
-
|
|
91
|
-
| Action | Parameters | Returns |
|
|
92
|
-
|--------|-----------|---------|
|
|
93
|
-
| `get-node` | `--id <id> --graphRoot <root>` | Single node JSON |
|
|
94
|
-
| `query-nodes` | `[--module <m>] [--type <t>] --graphRoot <root>` | Node array |
|
|
95
|
-
| `get-edges` | `--nodeId <id> --direction <in\|out\|both> --graphRoot <root>` | Edge array |
|
|
96
|
-
| `search` | `--keyword <kw> [--type <t>] [--module <m>] --graphRoot <root>` | Node array |
|
|
97
|
-
| `trace-upstream` | `--id <id> [--depth <n>] --graphRoot <root>` | Node + Edge tree |
|
|
98
|
-
| `trace-downstream` | `--id <id> [--depth <n>] --graphRoot <root>` | Node + Edge tree |
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## Checklist
|
|
103
|
-
|
|
104
|
-
- [ ] `{{action}}` is one of: `get-node`, `query-nodes`, `get-edges`, `search`, `trace-upstream`, `trace-downstream`
|
|
105
|
-
- [ ] `{{graphRoot}}` path is correct (`speccrew-workspace/knowledges/bizs/graph`)
|
|
106
|
-
- [ ] For `get-node` / `trace-*`: `{{id}}` follows `{type}-{module}-{name}` format
|
|
107
|
-
- [ ] For `get-edges`: `{{direction}}` is one of `in`, `out`, `both`
|
|
108
|
-
- [ ] For `trace-*`: `{{depth}}` is a positive integer (default: 2)
|
|
109
|
-
- [ ] Script executed with Node.js (`node graph-query.js`)
|
|
110
|
-
- [ ] Result JSON parsed and used by calling agent
|
|
14
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: speccrew-workspace/docs/rules/agentflow-spec.md
|
|
15
|
+
> Then read and execute the XML workflow in SKILL.xml block-by-block as the authoritative execution plan.
|
|
@@ -4,101 +4,12 @@ description: Write, update, and initialize knowledge graph data (nodes, edges, i
|
|
|
4
4
|
tools: Bash
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
Write graph data (nodes and edges) to the knowledge graph storage. This skill wraps `graph-write.js` script to perform all write operations on `speccrew-workspace/knowledges/bizs/graph/`.
|
|
10
|
-
|
|
11
|
-
## Trigger Scenarios
|
|
12
|
-
|
|
7
|
+
# Trigger Scenarios
|
|
13
8
|
- "Write graphData from skill analysis result to graph"
|
|
14
9
|
- "Initialize graph structure for module {module}"
|
|
15
10
|
- "Batch add nodes and edges for module {module}"
|
|
16
|
-
- "Update node {nodeId} in graph"
|
|
17
|
-
- "Remove node {nodeId} from graph"
|
|
18
|
-
|
|
19
|
-
## User
|
|
20
|
-
|
|
21
|
-
Dispatch Agent (speccrew-knowledge-dispatch)
|
|
22
|
-
|
|
23
|
-
## Input Variables
|
|
24
|
-
|
|
25
|
-
| Variable | Type | Description | Example |
|
|
26
|
-
|----------|------|-------------|---------|
|
|
27
|
-
| `{{action}}` | string | Write action to perform | `"batch-write"`, `"init-module"`, `"update-node"`, `"remove-node"` |
|
|
28
|
-
| `{{platformId}}` | string | Platform identifier for directory segregation | `"backend-fastapi"`, `"backend-spring"`, `"web-vue"`, `"mobile-uniapp"` |
|
|
29
|
-
| `{{module}}` | string | Target business module | `"system"`, `"trade"`, `"infra"` |
|
|
30
|
-
| `{{graphData}}` | object | Graph data from skill output (for batch-write) | `{ "nodes": [...], "edges": [...] }` |
|
|
31
|
-
| `{{nodeId}}` | string | Node ID (for update-node / remove-node) | `"api-system-user-list"` |
|
|
32
|
-
| `{{nodeData}}` | object | Updated node data (for update-node) | `{ "description": "..." }` |
|
|
33
|
-
| `{{graphRoot}}` | string | Path to graph root directory | `"speccrew-workspace/knowledges/bizs/graph"` |
|
|
34
|
-
|
|
35
|
-
## Output Variables
|
|
36
|
-
|
|
37
|
-
| Variable | Type | Description |
|
|
38
|
-
|----------|------|-------------|
|
|
39
|
-
| `{{status}}` | string | Operation result: `"success"` or `"failed"` |
|
|
40
|
-
| `{{nodesWritten}}` | number | Number of nodes written |
|
|
41
|
-
| `{{edgesWritten}}` | number | Number of edges written |
|
|
42
|
-
| `{{message}}` | string | Summary message |
|
|
43
|
-
|
|
44
|
-
## Output
|
|
45
|
-
|
|
46
|
-
**Return Value (JSON format):**
|
|
47
|
-
```json
|
|
48
|
-
{
|
|
49
|
-
"status": "success",
|
|
50
|
-
"action": "batch-write",
|
|
51
|
-
"module": "system",
|
|
52
|
-
"nodesWritten": 5,
|
|
53
|
-
"edgesWritten": 8,
|
|
54
|
-
"message": "Successfully wrote 5 nodes and 8 edges to system module"
|
|
55
|
-
}
|
|
56
|
-
```
|
|
57
11
|
|
|
58
12
|
## AgentFlow Definition
|
|
59
|
-
|
|
60
13
|
<!-- @agentflow: SKILL.xml -->
|
|
61
|
-
|
|
62
|
-
>
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## Script Reference
|
|
67
|
-
|
|
68
|
-
Scripts location: `scripts/graph-write.js` (relative to this skill directory)
|
|
69
|
-
|
|
70
|
-
| Action | Parameters | Description |
|
|
71
|
-
|--------|-----------|-------------|
|
|
72
|
-
| `batch-write` | `--platformId <p> --module <m> --file <path> --graphRoot <root>` | Batch write nodes and edges from temp file |
|
|
73
|
-
| `add-nodes` | `--platformId <p> --module <m> --file <path> --graphRoot <root>` | Batch add/replace nodes from temp file |
|
|
74
|
-
| `add-edges` | `--platformId <p> --module <m> --file <path> --graphRoot <root>` | Batch add/replace edges from temp file |
|
|
75
|
-
| `update-node` | `--platformId <p> --id <id> --data <json> --graphRoot <root>` | Update existing node fields |
|
|
76
|
-
| `remove-node` | `--platformId <p> --id <id> --graphRoot <root>` | Remove node and connected edges |
|
|
77
|
-
| `init-module` | `--platformId <p> --module <m> --graphRoot <root>` | Initialize empty module files |
|
|
78
|
-
| `rebuild-index` | `--graphRoot <root>` | Rebuild global index from all module files |
|
|
79
|
-
| `update-meta` | `--graphRoot <root>` | Recalculate and update graph-meta.json stats |
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## Cross-Module Edge Handling
|
|
84
|
-
|
|
85
|
-
When edges have `source` and `target` nodes belonging to different modules:
|
|
86
|
-
- The script automatically detects cross-module edges
|
|
87
|
-
- Cross-module edges are stored in `{{graphRoot}}/edges/{{platformId}}/cross-module.json`
|
|
88
|
-
- Module membership is determined by the node ID prefix (e.g., `api-system-*` → module `system`)
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## Checklist
|
|
93
|
-
|
|
94
|
-
- [ ] `{{action}}` is one of: `batch-write`, `init-module`, `update-node`, `remove-node`
|
|
95
|
-
- [ ] `{{platformId}}` is provided (required for all write actions)
|
|
96
|
-
- [ ] `{{graphRoot}}` path is correct (`speccrew-workspace/knowledges/bizs/graph`)
|
|
97
|
-
- [ ] For `batch-write`: `{{graphData}}` contains valid `nodes` and `edges` arrays
|
|
98
|
-
- [ ] For `batch-write`: temp file created and cleaned up after write
|
|
99
|
-
- [ ] For `init-module`: module directory files created successfully under `nodes/{{platformId}}/` and `edges/{{platformId}}/`
|
|
100
|
-
- [ ] For `update-node` / `remove-node`: `{{nodeId}}` follows `{type}-{module}-{name}` format
|
|
101
|
-
- [ ] Script executed with Node.js (`graph-write.js`)
|
|
102
|
-
- [ ] Index and metadata updated after write operations
|
|
103
|
-
- [ ] Cross-module edges correctly routed to `edges/{{platformId}}/cross-module.json`
|
|
104
|
-
- [ ] Return JSON with `{{status}}`, `{{nodesWritten}}`, `{{edgesWritten}}`, `{{message}}`
|
|
14
|
+
> **REQUIRED**: Before executing this workflow, read the XML workflow specification: speccrew-workspace/docs/rules/agentflow-spec.md
|
|
15
|
+
> Then read and execute the XML workflow in SKILL.xml block-by-block as the authoritative execution plan.
|