speccrew 0.6.43 → 0.6.44

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.
@@ -46,23 +46,28 @@ This skill automatically adapts to the user's input language. All documentation
46
46
 
47
47
  > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
48
48
 
49
- ```xml
50
- <workflow name="ui-knowledge-graph-construction" version="1.0">
51
-
52
- <!-- Input Parameters -->
53
- <input name="feature" type="object" required="true" description="Complete feature object from features.json"/>
54
- <input name="fileName" type="string" required="true" description="Feature file name without extension"/>
55
- <input name="sourcePath" type="string" required="true" description="Relative path to source file"/>
56
- <input name="documentPath" type="string" required="true" description="Path to generated documentation"/>
57
- <input name="module" type="string" required="true" description="Business module name"/>
58
- <input name="platform_type" type="string" required="true" description="Platform type"/>
59
- <input name="platform_subtype" type="string" required="true" description="Platform subtype"/>
60
- <input name="completed_dir" type="string" required="true" description="Marker files output directory"/>
61
- <input name="sourceFile" type="string" required="true" description="Source features JSON file name"/>
62
- <input name="status" type="string" required="true" default="success" description="Analysis status from UI analysis"/>
63
- <input name="analysisNotes" type="string" required="true" default="" description="Analysis notes from UI analysis"/>
64
-
65
- <!-- ==================== GLOBAL CONTINUOUS EXECUTION RULES ==================== -->
49
+ <workflow id="ui-knowledge-graph-construction" version="1.0" status="pending" desc="Construct graph data from UI analysis results">
50
+
51
+ <!-- ============================================================
52
+ Input Parameters Definition
53
+ ============================================================ -->
54
+ <block type="input" id="I1" desc="Workflow input parameters">
55
+ <field name="feature" required="true" type="object" desc="Complete feature object from features.json"/>
56
+ <field name="fileName" required="true" type="string" desc="Feature file name without extension"/>
57
+ <field name="sourcePath" required="true" type="string" desc="Relative path to source file"/>
58
+ <field name="documentPath" required="true" type="string" desc="Path to generated documentation"/>
59
+ <field name="module" required="true" type="string" desc="Business module name"/>
60
+ <field name="platform_type" required="true" type="string" desc="Platform type"/>
61
+ <field name="platform_subtype" required="true" type="string" desc="Platform subtype"/>
62
+ <field name="completed_dir" required="true" type="string" desc="Marker files output directory"/>
63
+ <field name="sourceFile" required="true" type="string" desc="Source features JSON file name"/>
64
+ <field name="status" required="false" type="string" default="success" desc="Analysis status from UI analysis"/>
65
+ <field name="analysisNotes" required="false" type="string" default="" desc="Analysis notes from UI analysis"/>
66
+ </block>
67
+
68
+ <!-- ============================================================
69
+ Global Continuous Execution Rules
70
+ ============================================================ -->
66
71
  <block type="rule" id="GLOBAL-R1" level="forbidden" desc="Continuous execution constraints — NEVER violate">
67
72
  <field name="text">DO NOT ask user "Should I continue?" or "How would you like to proceed?" during execution</field>
68
73
  <field name="text">DO NOT offer options like "Full execution / Partial / Stop" — always execute ALL tasks to completion</field>
@@ -71,133 +76,230 @@ This skill automatically adapts to the user's input language. All documentation
71
76
  <field name="text">DO NOT warn about "large number of files" or "this may take a while" — proceed with generation</field>
72
77
  <field name="text">Context window management: if approaching limit, save progress to checkpoint file and resume — do NOT ask user for guidance</field>
73
78
  </block>
74
-
75
- <!-- Step 1: Read Source File -->
76
- <checkpoint name="step-1-read-source">
77
- <task action="read" target="{{sourcePath}}" output="sourceContent"/>
78
- <task action="extract-api-imports" input="{{sourceContent}}" output="apiImports"/>
79
- <task action="extract-component-usage" input="{{sourceContent}}" output="componentUsage"/>
80
- <task action="extract-navigation-patterns" input="{{sourceContent}}" output="navigationPatterns"/>
81
- <event action="log" message="Step 1 Status: COMPLETED - Read {{sourcePath}}, found {{apiImports.count}} APIs, {{componentUsage.count}} components, {{navigationPatterns.count}} navigations"/>
82
- </checkpoint>
83
-
84
- <!-- Step 2: Construct Graph Nodes -->
85
- <checkpoint name="step-2-construct-nodes">
86
- <task action="construct-node" type="page" id="page-{{module}}-{{fileName}}"
87
- name="{{fileName}}" module="{{module}}"
88
- sourcePath="{{sourcePath}}" documentPath="{{documentPath}}"
89
- context-route="{{extractedRoute}}" context-components="{{componentUsage.list}}"
90
- context-platform="{{platform_type}}-{{platform_subtype}}"
91
- output="pageNode"/>
92
- <loop over="{{componentUsage.list}}" as="component">
93
- <task action="construct-node" type="component" id="component-{{module}}-{{component.name}}"
94
- name="{{component.name}}" module="{{module}}"
95
- sourcePath="{{component.path}}" documentPath="{{documentPath}}"
96
- context-props="{{component.props}}" context-events="{{component.events}}"
97
- output="componentNodes[]"/>
98
- </loop>
99
- <event action="log" message="Step 2 Status: COMPLETED - Constructed {{nodeCount}} nodes"/>
100
- </checkpoint>
101
-
102
- <!-- Step 3: Construct Graph Edges -->
103
- <checkpoint name="step-3-construct-edges">
79
+
80
+ <!-- ============================================================
81
+ Step 1: Read Source File
82
+ ============================================================ -->
83
+ <sequence id="S1" name="Step 1: Read Source File" status="pending" desc="Read source file and extract components">
84
+ <block type="task" id="B1" action="read-file" desc="Read source file content">
85
+ <field name="path" value="${sourcePath}"/>
86
+ <field name="output" var="sourceContent"/>
87
+ </block>
88
+
89
+ <block type="task" id="B2" action="analyze" desc="Extract API imports from source content">
90
+ <field name="input" value="${sourceContent}"/>
91
+ <field name="output" var="apiImports"/>
92
+ </block>
93
+
94
+ <block type="task" id="B3" action="analyze" desc="Extract component usage from source content">
95
+ <field name="input" value="${sourceContent}"/>
96
+ <field name="output" var="componentUsage"/>
97
+ </block>
98
+
99
+ <block type="task" id="B4" action="analyze" desc="Extract navigation patterns from source content">
100
+ <field name="input" value="${sourceContent}"/>
101
+ <field name="output" var="navigationPatterns"/>
102
+ </block>
103
+
104
+ <block type="event" id="E1" action="log" level="info" desc="Log Step 1 completion">
105
+ Step 1 Status: COMPLETED - Read ${sourcePath}, found ${apiImports.count} APIs, ${componentUsage.count} components, ${navigationPatterns.count} navigations
106
+ </block>
107
+
108
+ <block type="checkpoint" id="CP1" name="step-1-read-source" desc="Source file read complete">
109
+ <field name="file" value="${completed_dir}/.progress.json"/>
110
+ <field name="verify" value="${sourceContent} != null"/>
111
+ </block>
112
+ </sequence>
113
+
114
+ <!-- ============================================================
115
+ Step 2: Construct Graph Nodes
116
+ ============================================================ -->
117
+ <sequence id="S2" name="Step 2: Construct Graph Nodes" status="pending" desc="Build page and component nodes">
118
+ <block type="task" id="B5" action="analyze" desc="Construct page node">
119
+ <field name="type" value="page"/>
120
+ <field name="id" value="page-${module}-${fileName}"/>
121
+ <field name="name" value="${fileName}"/>
122
+ <field name="module" value="${module}"/>
123
+ <field name="sourcePath" value="${sourcePath}"/>
124
+ <field name="documentPath" value="${documentPath}"/>
125
+ <field name="context_route" value="${extractedRoute}"/>
126
+ <field name="context_components" value="${componentUsage.list}"/>
127
+ <field name="context_platform" value="${platform_type}-${platform_subtype}"/>
128
+ <field name="output" var="pageNode"/>
129
+ </block>
130
+
131
+ <block type="loop" id="L1" over="${componentUsage.list}" as="component" desc="Construct component nodes">
132
+ <block type="task" id="B6" action="analyze" desc="Construct component node for ${component.name}">
133
+ <field name="type" value="component"/>
134
+ <field name="id" value="component-${module}-${component.name}"/>
135
+ <field name="name" value="${component.name}"/>
136
+ <field name="module" value="${module}"/>
137
+ <field name="sourcePath" value="${component.path}"/>
138
+ <field name="documentPath" value="${documentPath}"/>
139
+ <field name="context_props" value="${component.props}"/>
140
+ <field name="context_events" value="${component.events}"/>
141
+ <field name="output" var="componentNodes[]" append="true"/>
142
+ </block>
143
+ </block>
144
+
145
+ <block type="event" id="E2" action="log" level="info" desc="Log Step 2 completion">
146
+ Step 2 Status: COMPLETED - Constructed ${nodeCount} nodes
147
+ </block>
148
+
149
+ <block type="checkpoint" id="CP2" name="step-2-construct-nodes" desc="Graph nodes constructed">
150
+ <field name="file" value="${completed_dir}/.progress.json"/>
151
+ <field name="verify" value="${nodeCount} > 0"/>
152
+ </block>
153
+ </sequence>
154
+
155
+ <!-- ============================================================
156
+ Step 3: Construct Graph Edges
157
+ ============================================================ -->
158
+ <sequence id="S3" name="Step 3: Construct Graph Edges" status="pending" desc="Build API call, navigation, and component usage edges">
104
159
  <!-- API Call Edges -->
105
- <loop over="{{apiImports.list}}" as="api">
106
- <task action="construct-edge" source="page-{{module}}-{{fileName}}"
107
- target="api-{{api.module}}-{{api.name}}" type="calls"
108
- metadata-trigger="{{api.trigger}}" metadata-method="{{api.method}}"
109
- metadata-context="{{api.context}}"
110
- output="apiEdges[]"/>
111
- </loop>
160
+ <block type="loop" id="L2" over="${apiImports.list}" as="api" desc="Construct API call edges">
161
+ <block type="task" id="B7" action="analyze" desc="Construct calls edge for ${api.name}">
162
+ <field name="source" value="page-${module}-${fileName}"/>
163
+ <field name="target" value="api-${api.module}-${api.name}"/>
164
+ <field name="type" value="calls"/>
165
+ <field name="metadata_trigger" value="${api.trigger}"/>
166
+ <field name="metadata_method" value="${api.method}"/>
167
+ <field name="metadata_context" value="${api.context}"/>
168
+ <field name="output" var="apiEdges[]" append="true"/>
169
+ </block>
170
+ </block>
171
+
112
172
  <!-- Navigation Edges -->
113
- <loop over="{{navigationPatterns.list}}" as="nav">
114
- <task action="construct-edge" source="page-{{module}}-{{fileName}}"
115
- target="page-{{nav.targetModule}}-{{nav.targetPage}}" type="navigates-to"
116
- metadata-trigger="{{nav.trigger}}" metadata-method="{{nav.method}}"
117
- output="navEdges[]"/>
118
- </loop>
173
+ <block type="loop" id="L3" over="${navigationPatterns.list}" as="nav" desc="Construct navigation edges">
174
+ <block type="task" id="B8" action="analyze" desc="Construct navigates-to edge">
175
+ <field name="source" value="page-${module}-${fileName}"/>
176
+ <field name="target" value="page-${nav.targetModule}-${nav.targetPage}"/>
177
+ <field name="type" value="navigates-to"/>
178
+ <field name="metadata_trigger" value="${nav.trigger}"/>
179
+ <field name="metadata_method" value="${nav.method}"/>
180
+ <field name="output" var="navEdges[]" append="true"/>
181
+ </block>
182
+ </block>
183
+
119
184
  <!-- Component Usage Edges -->
120
- <loop over="{{componentUsage.list}}" as="comp">
121
- <task action="construct-edge" source="page-{{module}}-{{fileName}}"
122
- target="component-{{module}}-{{comp.name}}" type="uses"
123
- metadata-context="{{comp.usageContext}}"
124
- output="useEdges[]"/>
125
- </loop>
126
- <event action="log" message="Step 3 Status: COMPLETED - Constructed {{edgeCount}} edges ({{apiEdges.count}} API calls, {{navEdges.count}} navigations, {{useEdges.count}} component uses)"/>
127
- </checkpoint>
128
-
129
- <!-- Step 4: Write Graph JSON -->
130
- <checkpoint name="step-4-write-graph-json" verify="valid-json-structure">
131
- <task action="calculate-marker-filename" module="{{module}}" subpath="{{extractSubpath sourcePath}}"
132
- fileName="{{fileName}}" output="markerFilename"/>
133
- <task action="write" target="{{completed_dir}}/{{markerFilename}}.graph.json">
134
- <content>
185
+ <block type="loop" id="L4" over="${componentUsage.list}" as="comp" desc="Construct component usage edges">
186
+ <block type="task" id="B9" action="analyze" desc="Construct uses edge for ${comp.name}">
187
+ <field name="source" value="page-${module}-${fileName}"/>
188
+ <field name="target" value="component-${module}-${comp.name}"/>
189
+ <field name="type" value="uses"/>
190
+ <field name="metadata_context" value="${comp.usageContext}"/>
191
+ <field name="output" var="useEdges[]" append="true"/>
192
+ </block>
193
+ </block>
194
+
195
+ <block type="event" id="E3" action="log" level="info" desc="Log Step 3 completion">
196
+ Step 3 Status: COMPLETED - Constructed ${edgeCount} edges (${apiEdges.count} API calls, ${navEdges.count} navigations, ${useEdges.count} component uses)
197
+ </block>
198
+
199
+ <block type="checkpoint" id="CP3" name="step-3-construct-edges" desc="Graph edges constructed">
200
+ <field name="file" value="${completed_dir}/.progress.json"/>
201
+ <field name="verify" value="${edgeCount} >= 0"/>
202
+ </block>
203
+ </sequence>
204
+
205
+ <!-- ============================================================
206
+ Step 4: Write Graph JSON
207
+ ============================================================ -->
208
+ <sequence id="S4" name="Step 4: Write Graph JSON" status="pending" desc="Generate and write graph data file">
209
+ <block type="task" id="B10" action="analyze" desc="Calculate marker filename">
210
+ <field name="module" value="${module}"/>
211
+ <field name="subpath" value="${extractSubpath sourcePath}"/>
212
+ <field name="fileName" value="${fileName}"/>
213
+ <field name="output" var="markerFilename"/>
214
+ </block>
215
+
216
+ <block type="task" id="B11" action="write-file" desc="Write graph JSON file">
217
+ <field name="path" value="${completed_dir}/${markerFilename}.graph.json"/>
218
+ <field name="content_json">
135
219
  {
136
- "module": "{{module}}",
220
+ "module": "${module}",
137
221
  "nodes": [
138
- {{pageNode}},
139
- {{#each componentNodes}}
140
- {{this}}{{#unless @last}},{{/unless}}
141
- {{/each}}
222
+ ${pageNode},
223
+ ${componentNodes}
142
224
  ],
143
225
  "edges": [
144
- {{#each apiEdges}}
145
- {{this}}{{#unless @last}},{{/unless}}
146
- {{/each}},
147
- {{#each navEdges}}
148
- {{this}}{{#unless @last}},{{/unless}}
149
- {{/each}},
150
- {{#each useEdges}}
151
- {{this}}{{#unless @last}},{{/unless}}
152
- {{/each}}
226
+ ${apiEdges},
227
+ ${navEdges},
228
+ ${useEdges}
153
229
  ]
154
230
  }
155
- </content>
156
- </task>
157
- <event action="log" message="Step 4 Status: COMPLETED - Graph JSON written to {{completed_dir}}/{{markerFilename}}.graph.json"/>
158
- </checkpoint>
159
-
160
- <!-- Step 5: Write Completion Marker -->
161
- <checkpoint name="step-5-write-marker" verify="valid-marker-structure">
162
- <task action="write" target="{{completed_dir}}/{{markerFilename}}.graph-done.json">
163
- <content>
231
+ </field>
232
+ </block>
233
+
234
+ <block type="event" id="E4" action="log" level="info" desc="Log Step 4 completion">
235
+ Step 4 Status: COMPLETED - Graph JSON written to ${completed_dir}/${markerFilename}.graph.json
236
+ </block>
237
+
238
+ <block type="checkpoint" id="CP4" name="step-4-write-graph-json" desc="Graph JSON written">
239
+ <field name="file" value="${completed_dir}/.progress.json"/>
240
+ <field name="verify" value="valid-json-structure"/>
241
+ </block>
242
+ </sequence>
243
+
244
+ <!-- ============================================================
245
+ Step 5: Write Completion Marker
246
+ ============================================================ -->
247
+ <sequence id="S5" name="Step 5: Write Completion Marker" status="pending" desc="Generate and write completion marker file">
248
+ <block type="task" id="B12" action="write-file" desc="Write graph completion marker">
249
+ <field name="path" value="${completed_dir}/${markerFilename}.graph-done.json"/>
250
+ <field name="content_json">
164
251
  {
165
- "fileName": "{{fileName}}",
166
- "sourcePath": "{{sourcePath}}",
167
- "sourceFile": "{{sourceFile}}",
168
- "module": "{{module}}",
169
- "documentPath": "{{documentPath}}",
252
+ "fileName": "${fileName}",
253
+ "sourcePath": "${sourcePath}",
254
+ "sourceFile": "${sourceFile}",
255
+ "module": "${module}",
256
+ "documentPath": "${documentPath}",
170
257
  "marker": "graph_completed",
171
- "graphFile": "{{markerFilename}}.graph.json",
172
- "nodeCount": {{nodeCount}},
173
- "edgeCount": {{edgeCount}},
174
- "status": "{{status}}",
175
- "analysisNotes": "{{analysisNotes}}"
258
+ "graphFile": "${markerFilename}.graph.json",
259
+ "nodeCount": ${nodeCount},
260
+ "edgeCount": ${edgeCount},
261
+ "status": "${status}",
262
+ "analysisNotes": "${analysisNotes}"
176
263
  }
177
- </content>
178
- </task>
179
- <event action="log" message="Step 5 Status: COMPLETED - Graph completion marker written to {{completed_dir}}/{{markerFilename}}.graph-done.json"/>
180
- </checkpoint>
181
-
182
- <!-- Output Results -->
183
- <output name="status" from="success"/>
184
- <output name="module" from="{{module}}"/>
185
- <output name="fileName" from="{{fileName}}"/>
186
- <output name="graphFile" from="{{completed_dir}}/{{markerFilename}}.graph.json"/>
187
- <output name="nodeCount" from="{{nodeCount}}"/>
188
- <output name="edgeCount" from="{{edgeCount}}"/>
189
- <output name="message" from="Generated graph data with {{nodeCount}} nodes and {{edgeCount}} edges"/>
190
-
191
- <!-- Constraints -->
192
- <rule level="mandatory" description="100% API coverage - ALL imported API functions MUST be represented as calls edges"/>
193
- <rule level="mandatory" description="Valid JSON format - Both .graph.json and .graph-done.json MUST be valid JSON"/>
194
- <rule level="mandatory" description="Root-level module field - .graph.json MUST include module at root level"/>
195
- <rule level="mandatory" description="Correct filename pattern - Use {module}-{subpath}-{fileName} composite naming"/>
196
- <rule level="mandatory" description="No file extension in fileName - The fileName field in .graph-done.json MUST NOT include extension"/>
197
- <rule level="mandatory" description="documentPath as N/A - Use N/A when no document exists, never empty string"/>
198
-
264
+ </field>
265
+ </block>
266
+
267
+ <block type="event" id="E5" action="log" level="info" desc="Log Step 5 completion">
268
+ Step 5 Status: COMPLETED - Graph completion marker written to ${completed_dir}/${markerFilename}.graph-done.json
269
+ </block>
270
+
271
+ <block type="checkpoint" id="CP5" name="step-5-write-marker" desc="Completion marker written">
272
+ <field name="file" value="${completed_dir}/.progress.json"/>
273
+ <field name="verify" value="valid-marker-structure"/>
274
+ </block>
275
+ </sequence>
276
+
277
+ <!-- ============================================================
278
+ Output Results
279
+ ============================================================ -->
280
+ <block type="output" id="O1" desc="Workflow output results">
281
+ <field name="status" from="success" type="string" desc="Execution status"/>
282
+ <field name="module" from="${module}" type="string" desc="Module name"/>
283
+ <field name="fileName" from="${fileName}" type="string" desc="Feature file name"/>
284
+ <field name="graphFile" from="${completed_dir}/${markerFilename}.graph.json" type="string" desc="Graph JSON file path"/>
285
+ <field name="nodeCount" from="${nodeCount}" type="number" desc="Number of nodes constructed"/>
286
+ <field name="edgeCount" from="${edgeCount}" type="number" desc="Number of edges constructed"/>
287
+ <field name="message" from="Generated graph data with ${nodeCount} nodes and ${edgeCount} edges" type="string" desc="Summary message"/>
288
+ </block>
289
+
290
+ <!-- ============================================================
291
+ Constraints
292
+ ============================================================ -->
293
+ <block type="rule" id="R1" level="mandatory" desc="Graph data constraints">
294
+ <field name="text">100% API coverage - ALL imported API functions MUST be represented as calls edges</field>
295
+ <field name="text">Valid JSON format - Both .graph.json and .graph-done.json MUST be valid JSON</field>
296
+ <field name="text">Root-level module field - .graph.json MUST include module at root level</field>
297
+ <field name="text">Correct filename pattern - Use {module}-{subpath}-{fileName} composite naming</field>
298
+ <field name="text">No file extension in fileName - The fileName field in .graph-done.json MUST NOT include extension</field>
299
+ <field name="text">documentPath as N/A - Use N/A when no document exists, never empty string</field>
300
+ </block>
301
+
199
302
  </workflow>
200
- ```
201
303
 
202
304
  ## Node Structure Reference
203
305