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.
@@ -73,20 +73,23 @@ This skill operates in **strict sequential execution mode**:
73
73
 
74
74
  > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
75
75
 
76
- ```xml
77
- <workflow name="api-knowledge-graph-construction" version="1.0">
78
-
76
+ <workflow id="api-knowledge-graph-construction" version="1.0" status="pending" desc="API knowledge graph construction workflow">
77
+
79
78
  <!-- Input Parameters -->
80
- <input name="api_analysis_path" type="string" required="true" description="Path to the API analysis document"/>
81
- <input name="platform_id" type="string" required="true" description="Target platform identifier"/>
82
- <input name="output_dir" type="string" required="true" description="Output directory for graph data"/>
83
- <input name="module" type="string" required="true" description="Business module name"/>
84
- <input name="fileName" type="string" required="true" description="Controller class name without extension"/>
85
- <input name="sourcePath" type="string" required="true" description="Relative path to source file"/>
86
- <input name="sourceFile" type="string" required="true" description="Source features JSON filename"/>
87
- <input name="language" type="string" required="true" description="Target language for content"/>
88
- <input name="subpath" type="string" required="false" description="Subpath extracted from sourcePath"/>
89
-
79
+ <block type="input" id="I1" desc="API graph construction input parameters">
80
+ <field name="api_analysis_path" required="true" type="string" desc="Path to the API analysis document"/>
81
+ <field name="platform_id" required="true" type="string" desc="Target platform identifier"/>
82
+ <field name="output_dir" required="true" type="string" desc="Output directory for graph data"/>
83
+ <field name="module" required="true" type="string" desc="Business module name"/>
84
+ <field name="fileName" required="true" type="string" desc="Controller class name without extension"/>
85
+ <field name="sourcePath" required="true" type="string" desc="Relative path to source file"/>
86
+ <field name="sourceFile" required="true" type="string" desc="Source features JSON filename"/>
87
+ <field name="language" required="true" type="string" desc="Target language for content"/>
88
+ <field name="subpath" required="false" type="string" desc="Subpath extracted from sourcePath"/>
89
+ <field name="workspace_path" required="true" type="string" desc="Workspace root path"/>
90
+ <field name="sync_state_bizs_dir" required="true" type="string" desc="Sync state directory path"/>
91
+ </block>
92
+
90
93
  <!-- ==================== GLOBAL CONTINUOUS EXECUTION RULES ==================== -->
91
94
  <block type="rule" id="GLOBAL-R1" level="forbidden" desc="Continuous execution constraints — NEVER violate">
92
95
  <field name="text">DO NOT ask user "Should I continue?" or "How would you like to proceed?" during execution</field>
@@ -96,209 +99,290 @@ This skill operates in **strict sequential execution mode**:
96
99
  <field name="text">DO NOT warn about "large number of files" or "this may take a while" — proceed with generation</field>
97
100
  <field name="text">Context window management: if approaching limit, save progress to checkpoint file and resume — do NOT ask user for guidance</field>
98
101
  </block>
99
-
102
+
100
103
  <!-- Step 1: Read API Analysis Document -->
101
- <checkpoint name="step-1-read-document">
102
- <task action="read" target="{{api_analysis_path}}" output="apiAnalysisContent"/>
103
- <task action="parse-endpoints" input="{{apiAnalysisContent}}" output="endpoints"/>
104
- <task action="parse-service-references" input="{{apiAnalysisContent}}" output="serviceReferences"/>
105
- <task action="parse-database-tables" input="{{apiAnalysisContent}}" output="databaseTables"/>
106
- <task action="parse-dtos" input="{{apiAnalysisContent}}" output="dtos"/>
107
- <task action="parse-business-rules" input="{{apiAnalysisContent}}" output="businessRules"/>
108
- <event action="log" message="Step 1 Status: COMPLETED - Read {{api_analysis_path}} ({{lineCount}} lines), Found {{endpoints.count}} endpoints"/>
109
- </checkpoint>
110
-
104
+ <sequence id="S1" name="Step 1: Read Document" status="pending" desc="Read and parse API analysis document">
105
+ <block type="task" id="B1a" action="read-file" desc="Read API analysis document">
106
+ <field name="path" value="${api_analysis_path}"/>
107
+ <field name="output" var="apiAnalysisContent"/>
108
+ </block>
109
+
110
+ <block type="task" id="B1b" action="analyze" desc="Parse endpoints">
111
+ <field name="content" value="${apiAnalysisContent}"/>
112
+ <field name="output" var="endpoints"/>
113
+ </block>
114
+
115
+ <block type="task" id="B1c" action="analyze" desc="Parse service references">
116
+ <field name="content" value="${apiAnalysisContent}"/>
117
+ <field name="output" var="serviceReferences"/>
118
+ </block>
119
+
120
+ <block type="task" id="B1d" action="analyze" desc="Parse database tables">
121
+ <field name="content" value="${apiAnalysisContent}"/>
122
+ <field name="output" var="databaseTables"/>
123
+ </block>
124
+
125
+ <block type="task" id="B1e" action="analyze" desc="Parse DTOs">
126
+ <field name="content" value="${apiAnalysisContent}"/>
127
+ <field name="output" var="dtos"/>
128
+ </block>
129
+
130
+ <block type="task" id="B1f" action="analyze" desc="Parse business rules">
131
+ <field name="content" value="${apiAnalysisContent}"/>
132
+ <field name="output" var="businessRules"/>
133
+ </block>
134
+
135
+ <block type="checkpoint" id="CP1" name="step-1-read-document" desc="Document read checkpoint">
136
+ <field name="verify" value="${apiAnalysisContent} != null"/>
137
+ </block>
138
+
139
+ <block type="event" id="E1" action="log" level="info" desc="Log step 1 completion">
140
+ Step 1 Status: COMPLETED - Read ${api_analysis_path}, Found ${endpoints.length} endpoints
141
+ </block>
142
+ </sequence>
143
+
111
144
  <!-- Step 2: Extract Graph Nodes -->
112
- <checkpoint name="step-2-extract-nodes">
145
+ <sequence id="S2" name="Step 2: Extract Nodes" status="pending" desc="Extract graph nodes from API analysis">
113
146
  <!-- API Endpoint Nodes -->
114
- <loop over="{{endpoints.list}}" as="endpoint">
115
- <task action="construct-node" type="api" id="api-{{module}}-{{endpoint.name}}"
116
- name="{{endpoint.displayName}}" module="{{module}}"
117
- sourcePath="{{sourcePath}}" documentPath="{{api_analysis_path}}"
118
- description="{{endpoint.description}}"
119
- metadata-method="{{endpoint.method}}" metadata-path="{{endpoint.path}}"
120
- metadata-permissions="{{endpoint.permissions}}"
121
- output="apiNodes[]"/>
122
- </loop>
147
+ <block type="loop" id="L2a" over="${endpoints}" as="endpoint" desc="Construct API nodes">
148
+ <block type="task" id="B2a" action="analyze" desc="Construct API node">
149
+ <field name="type" value="api"/>
150
+ <field name="id" value="api-${module}-${endpoint.name}"/>
151
+ <field name="name" value="${endpoint.displayName}"/>
152
+ <field name="module" value="${module}"/>
153
+ <field name="sourcePath" value="${sourcePath}"/>
154
+ <field name="documentPath" value="${api_analysis_path}"/>
155
+ <field name="description" value="${endpoint.description}"/>
156
+ <field name="metadata-method" value="${endpoint.method}"/>
157
+ <field name="metadata-path" value="${endpoint.path}"/>
158
+ <field name="metadata-permissions" value="${endpoint.permissions}"/>
159
+ <field name="output" var="apiNodes"/>
160
+ </block>
161
+ </block>
162
+
123
163
  <!-- Service Nodes -->
124
- <loop over="{{serviceReferences.list}}" as="service">
125
- <task action="construct-node" type="service" id="service-{{module}}-{{service.name}}"
126
- name="{{service.className}}" module="{{module}}"
127
- sourcePath="{{service.sourcePath}}" documentPath="{{api_analysis_path}}"
128
- description="{{service.description}}"
129
- metadata-methods="{{service.methods}}"
130
- output="serviceNodes[]"/>
131
- </loop>
164
+ <block type="loop" id="L2b" over="${serviceReferences}" as="service" desc="Construct service nodes">
165
+ <block type="task" id="B2b" action="analyze" desc="Construct service node">
166
+ <field name="type" value="service"/>
167
+ <field name="id" value="service-${module}-${service.name}"/>
168
+ <field name="name" value="${service.className}"/>
169
+ <field name="module" value="${module}"/>
170
+ <field name="sourcePath" value="${service.sourcePath}"/>
171
+ <field name="documentPath" value="${api_analysis_path}"/>
172
+ <field name="description" value="${service.description}"/>
173
+ <field name="metadata-methods" value="${service.methods}"/>
174
+ <field name="output" var="serviceNodes"/>
175
+ </block>
176
+ </block>
177
+
132
178
  <!-- Table Nodes -->
133
- <loop over="{{databaseTables.list}}" as="table">
134
- <task action="construct-node" type="table" id="table-{{module}}-{{table.name}}"
135
- name="{{table.tableName}}" module="{{module}}"
136
- sourcePath="" documentPath="{{api_analysis_path}}"
137
- description="{{table.description}}"
138
- metadata-fields="{{table.fields}}" metadata-indexes="{{table.indexes}}"
139
- output="tableNodes[]"/>
140
- </loop>
179
+ <block type="loop" id="L2c" over="${databaseTables}" as="table" desc="Construct table nodes">
180
+ <block type="task" id="B2c" action="analyze" desc="Construct table node">
181
+ <field name="type" value="table"/>
182
+ <field name="id" value="table-${module}-${table.name}"/>
183
+ <field name="name" value="${table.tableName}"/>
184
+ <field name="module" value="${module}"/>
185
+ <field name="sourcePath" value=""/>
186
+ <field name="documentPath" value="${api_analysis_path}"/>
187
+ <field name="description" value="${table.description}"/>
188
+ <field name="metadata-fields" value="${table.fields}"/>
189
+ <field name="metadata-indexes" value="${table.indexes}"/>
190
+ <field name="output" var="tableNodes"/>
191
+ </block>
192
+ </block>
193
+
141
194
  <!-- DTO Nodes -->
142
- <loop over="{{dtos.list}}" as="dto">
143
- <task action="construct-node" type="dto" id="dto-{{module}}-{{dto.name}}"
144
- name="{{dto.className}}" module="{{module}}"
145
- sourcePath="{{dto.sourcePath}}" documentPath="{{api_analysis_path}}"
146
- description="{{dto.description}}"
147
- metadata-fields="{{dto.fields}}" metadata-validation="{{dto.validation}}"
148
- output="dtoNodes[]"/>
149
- </loop>
150
- <event action="log" message="Step 2 Status: COMPLETED - Extracted {{nodeCount}} graph nodes ({{apiNodes.count}} APIs, {{serviceNodes.count}} services, {{tableNodes.count}} tables, {{dtoNodes.count}} DTOs)"/>
151
- </checkpoint>
152
-
195
+ <block type="loop" id="L2d" over="${dtos}" as="dto" desc="Construct DTO nodes">
196
+ <block type="task" id="B2d" action="analyze" desc="Construct DTO node">
197
+ <field name="type" value="dto"/>
198
+ <field name="id" value="dto-${module}-${dto.name}"/>
199
+ <field name="name" value="${dto.className}"/>
200
+ <field name="module" value="${module}"/>
201
+ <field name="sourcePath" value="${dto.sourcePath}"/>
202
+ <field name="documentPath" value="${api_analysis_path}"/>
203
+ <field name="description" value="${dto.description}"/>
204
+ <field name="metadata-fields" value="${dto.fields}"/>
205
+ <field name="metadata-validation" value="${dto.validation}"/>
206
+ <field name="output" var="dtoNodes"/>
207
+ </block>
208
+ </block>
209
+
210
+ <block type="checkpoint" id="CP2" name="step-2-extract-nodes" desc="Nodes extracted checkpoint">
211
+ <field name="verify" value="${apiNodes.length} > 0 OR ${serviceNodes.length} > 0"/>
212
+ </block>
213
+
214
+ <block type="event" id="E2" action="log" level="info" desc="Log step 2 completion">
215
+ Step 2 Status: COMPLETED - Extracted graph nodes (${apiNodes.length} APIs, ${serviceNodes.length} services, ${tableNodes.length} tables, ${dtoNodes.length} DTOs)
216
+ </block>
217
+ </sequence>
218
+
153
219
  <!-- Step 3: Extract Graph Edges -->
154
- <checkpoint name="step-3-extract-edges">
220
+ <sequence id="S3" name="Step 3: Extract Edges" status="pending" desc="Extract graph edges from API analysis">
155
221
  <!-- API to Table Edges (operates) -->
156
- <loop over="{{endpoints.list}}" as="endpoint">
157
- <loop over="{{endpoint.tablesAccessed}}" as="tableRef">
158
- <task action="construct-edge" source="api-{{module}}-{{endpoint.name}}"
159
- target="table-{{module}}-{{tableRef.tableName}}" type="operates"
160
- metadata-operation="{{tableRef.operation}}"
161
- metadata-description="{{tableRef.description}}"
162
- output="operatesEdges[]"/>
163
- </loop>
164
- </loop>
222
+ <block type="loop" id="L3a" over="${endpoints}" as="endpoint" desc="Construct operates edges">
223
+ <block type="loop" id="L3a1" over="${endpoint.tablesAccessed}" as="tableRef" desc="Construct operates edge">
224
+ <block type="task" id="B3a" action="analyze" desc="Construct operates edge">
225
+ <field name="source" value="api-${module}-${endpoint.name}"/>
226
+ <field name="target" value="table-${module}-${tableRef.tableName}"/>
227
+ <field name="type" value="operates"/>
228
+ <field name="metadata-operation" value="${tableRef.operation}"/>
229
+ <field name="metadata-description" value="${tableRef.description}"/>
230
+ <field name="output" var="operatesEdges"/>
231
+ </block>
232
+ </block>
233
+ </block>
234
+
165
235
  <!-- API to Service Edges (invokes) -->
166
- <loop over="{{endpoints.list}}" as="endpoint">
167
- <loop over="{{endpoint.servicesInvoked}}" as="serviceRef">
168
- <task action="construct-edge" source="api-{{module}}-{{endpoint.name}}"
169
- target="service-{{module}}-{{serviceRef.serviceName}}" type="invokes"
170
- metadata-method="{{serviceRef.method}}"
171
- metadata-description="{{serviceRef.description}}"
172
- output="invokesEdges[]"/>
173
- </loop>
174
- </loop>
236
+ <block type="loop" id="L3b" over="${endpoints}" as="endpoint" desc="Construct invokes edges">
237
+ <block type="loop" id="L3b1" over="${endpoint.servicesInvoked}" as="serviceRef" desc="Construct invokes edge">
238
+ <block type="task" id="B3b" action="analyze" desc="Construct invokes edge">
239
+ <field name="source" value="api-${module}-${endpoint.name}"/>
240
+ <field name="target" value="service-${module}-${serviceRef.serviceName}"/>
241
+ <field name="type" value="invokes"/>
242
+ <field name="metadata-method" value="${serviceRef.method}"/>
243
+ <field name="metadata-description" value="${serviceRef.description}"/>
244
+ <field name="output" var="invokesEdges"/>
245
+ </block>
246
+ </block>
247
+ </block>
248
+
175
249
  <!-- API to DTO Edges (references) -->
176
- <loop over="{{endpoints.list}}" as="endpoint">
177
- <loop over="{{endpoint.dtosUsed}}" as="dtoRef">
178
- <task action="construct-edge" source="api-{{module}}-{{endpoint.name}}"
179
- target="dto-{{module}}-{{dtoRef.dtoName}}" type="references"
180
- metadata-usage="{{dtoRef.usage}}"
181
- metadata-description="{{dtoRef.description}}"
182
- output="referencesEdges[]"/>
183
- </loop>
184
- </loop>
250
+ <block type="loop" id="L3c" over="${endpoints}" as="endpoint" desc="Construct references edges">
251
+ <block type="loop" id="L3c1" over="${endpoint.dtosUsed}" as="dtoRef" desc="Construct references edge">
252
+ <block type="task" id="B3c" action="analyze" desc="Construct references edge">
253
+ <field name="source" value="api-${module}-${endpoint.name}"/>
254
+ <field name="target" value="dto-${module}-${dtoRef.dtoName}"/>
255
+ <field name="type" value="references"/>
256
+ <field name="metadata-usage" value="${dtoRef.usage}"/>
257
+ <field name="metadata-description" value="${dtoRef.description}"/>
258
+ <field name="output" var="referencesEdges"/>
259
+ </block>
260
+ </block>
261
+ </block>
262
+
185
263
  <!-- Service to Service Edges (depends-on) -->
186
- <loop over="{{serviceReferences.list}}" as="service">
187
- <loop over="{{service.dependencies}}" as="dep">
188
- <task action="construct-edge" source="service-{{module}}-{{service.name}}"
189
- target="service-{{module}}-{{dep.serviceName}}" type="depends-on"
190
- metadata-description="{{dep.description}}"
191
- output="dependsOnEdges[]"/>
192
- </loop>
193
- </loop>
264
+ <block type="loop" id="L3d" over="${serviceReferences}" as="service" desc="Construct depends-on edges">
265
+ <block type="loop" id="L3d1" over="${service.dependencies}" as="dep" desc="Construct depends-on edge">
266
+ <block type="task" id="B3d" action="analyze" desc="Construct depends-on edge">
267
+ <field name="source" value="service-${module}-${service.name}"/>
268
+ <field name="target" value="service-${module}-${dep.serviceName}"/>
269
+ <field name="type" value="depends-on"/>
270
+ <field name="metadata-description" value="${dep.description}"/>
271
+ <field name="output" var="dependsOnEdges"/>
272
+ </block>
273
+ </block>
274
+ </block>
275
+
194
276
  <!-- DTO to Table Edges (maps-to) -->
195
- <loop over="{{dtos.list}}" as="dto">
196
- <loop over="{{dto.mappedTables}}" as="mappedTable">
197
- <task action="construct-edge" source="dto-{{module}}-{{dto.name}}"
198
- target="table-{{module}}-{{mappedTable.tableName}}" type="maps-to"
199
- metadata-description="{{mappedTable.description}}"
200
- output="mapsToEdges[]"/>
201
- </loop>
202
- </loop>
203
- <event action="log" message="Step 3 Status: COMPLETED - Extracted {{edgeCount}} graph edges"/>
204
- </checkpoint>
205
-
277
+ <block type="loop" id="L3e" over="${dtos}" as="dto" desc="Construct maps-to edges">
278
+ <block type="loop" id="L3e1" over="${dto.mappedTables}" as="mappedTable" desc="Construct maps-to edge">
279
+ <block type="task" id="B3e" action="analyze" desc="Construct maps-to edge">
280
+ <field name="source" value="dto-${module}-${dto.name}"/>
281
+ <field name="target" value="table-${module}-${mappedTable.tableName}"/>
282
+ <field name="type" value="maps-to"/>
283
+ <field name="metadata-description" value="${mappedTable.description}"/>
284
+ <field name="output" var="mapsToEdges"/>
285
+ </block>
286
+ </block>
287
+ </block>
288
+
289
+ <block type="checkpoint" id="CP3" name="step-3-extract-edges" desc="Edges extracted checkpoint">
290
+ <field name="verify" value="${operatesEdges.length} >= 0"/>
291
+ </block>
292
+
293
+ <block type="event" id="E3" action="log" level="info" desc="Log step 3 completion">
294
+ Step 3 Status: COMPLETED - Extracted graph edges (${operatesEdges.length + invokesEdges.length + referencesEdges.length + dependsOnEdges.length + mapsToEdges.length} total)
295
+ </block>
296
+ </sequence>
297
+
206
298
  <!-- Step 4: Write Graph JSON -->
207
- <checkpoint name="step-4-write-graph-json" verify="valid-json-structure">
208
- <task action="calculate-marker-filename" module="{{module}}" subpath="{{subpath}}"
209
- fileName="{{fileName}}" output="markerFilename"/>
210
- <task action="write" target="{{output_dir}}/{{markerFilename}}.graph.json">
211
- <content>
212
- {
213
- "module": "{{module}}",
214
- "nodes": [
215
- {{#each apiNodes}}
216
- {{this}}{{#unless @last}},{{/unless}}
217
- {{/each}},
218
- {{#each serviceNodes}}
219
- {{this}}{{#unless @last}},{{/unless}}
220
- {{/each}},
221
- {{#each tableNodes}}
222
- {{this}}{{#unless @last}},{{/unless}}
223
- {{/each}},
224
- {{#each dtoNodes}}
225
- {{this}}{{#unless @last}},{{/unless}}
226
- {{/each}}
227
- ],
228
- "edges": [
229
- {{#each operatesEdges}}
230
- {{this}}{{#unless @last}},{{/unless}}
231
- {{/each}},
232
- {{#each invokesEdges}}
233
- {{this}}{{#unless @last}},{{/unless}}
234
- {{/each}},
235
- {{#each referencesEdges}}
236
- {{this}}{{#unless @last}},{{/unless}}
237
- {{/each}},
238
- {{#each dependsOnEdges}}
239
- {{this}}{{#unless @last}},{{/unless}}
240
- {{/each}},
241
- {{#each mapsToEdges}}
242
- {{this}}{{#unless @last}},{{/unless}}
243
- {{/each}}
244
- ]
245
- }
246
- </content>
247
- </task>
248
- <event action="log" message="Step 4 Status: COMPLETED - Graph JSON written to {{output_dir}}/{{markerFilename}}.graph.json ({{fileSize}} bytes)"/>
249
- </checkpoint>
250
-
299
+ <sequence id="S4" name="Step 4: Write Graph JSON" status="pending" desc="Write graph JSON file">
300
+ <block type="task" id="B4a" action="analyze" desc="Calculate marker filename">
301
+ <field name="module" value="${module}"/>
302
+ <field name="subpath" value="${subpath}"/>
303
+ <field name="fileName" value="${fileName}"/>
304
+ <field name="output" var="markerFilename"/>
305
+ </block>
306
+
307
+ <block type="task" id="B4b" action="write-file" desc="Write graph JSON">
308
+ <field name="path" value="${output_dir}/${markerFilename}.graph.json"/>
309
+ <field name="content" desc="Graph JSON with nodes and edges arrays"/>
310
+ <field name="note">Write valid JSON with module field, nodes array, and edges array</field>
311
+ </block>
312
+
313
+ <block type="checkpoint" id="CP4" name="step-4-write-graph-json" desc="Graph JSON written checkpoint">
314
+ <field name="verify" value="valid-json-structure"/>
315
+ </block>
316
+
317
+ <block type="event" id="E4" action="log" level="info" desc="Log step 4 completion">
318
+ Step 4 Status: COMPLETED - Graph JSON written to ${output_dir}/${markerFilename}.graph.json
319
+ </block>
320
+ </sequence>
321
+
251
322
  <!-- Step 5: Write Graph Completion Marker -->
252
- <checkpoint name="step-5-write-marker" verify="valid-marker-structure">
253
- <task action="write" target="{{output_dir}}/{{markerFilename}}.graph-done.json">
254
- <content>
255
- {
256
- "fileName": "{{fileName}}",
257
- "module": "{{module}}",
258
- "marker": "graph_completed",
259
- "graphFile": "{{markerFilename}}.graph.json",
260
- "nodeCount": {{node_count}},
261
- "edgeCount": {{edge_count}},
262
- "status": "completed"
263
- }
264
- </content>
265
- </task>
266
- <event action="log" message="Step 5 Status: COMPLETED - Graph completion marker written to {{output_dir}}/{{markerFilename}}.graph-done.json"/>
267
- </checkpoint>
268
-
323
+ <sequence id="S5" name="Step 5: Write Marker" status="pending" desc="Write completion marker">
324
+ <block type="task" id="B5" action="write-file" desc="Write graph-done marker">
325
+ <field name="path" value="${output_dir}/${markerFilename}.graph-done.json"/>
326
+ <field name="content" desc="Marker JSON with fileName, module, marker, graphFile, nodeCount, edgeCount, status"/>
327
+ </block>
328
+
329
+ <block type="checkpoint" id="CP5" name="step-5-write-marker" desc="Marker written checkpoint">
330
+ <field name="verify" value="valid-marker-structure"/>
331
+ </block>
332
+
333
+ <block type="event" id="E5" action="log" level="info" desc="Log step 5 completion">
334
+ Step 5 Status: COMPLETED - Graph completion marker written to ${output_dir}/${markerFilename}.graph-done.json
335
+ </block>
336
+ </sequence>
337
+
269
338
  <!-- Step 6: Report Results -->
270
- <checkpoint name="step-6-report-results">
271
- <gateway mode="exclusive">
272
- <branch condition="{{success}}">
273
- <output name="status" from="success"/>
274
- <output name="module" from="{{module}}"/>
275
- <output name="fileName" from="{{fileName}}"/>
276
- <output name="graphFile" from="{{output_dir}}/{{markerFilename}}.graph.json"/>
277
- <output name="nodeCount" from="{{node_count}}"/>
278
- <output name="edgeCount" from="{{edge_count}}"/>
279
- <output name="message" from="Generated graph data with {{node_count}} nodes and {{edge_count}} edges"/>
280
- <event action="log" message="Step 6 Status: COMPLETED - Graph construction success: Generated graph data with {{node_count}} nodes and {{edge_count}} edges"/>
339
+ <sequence id="S6" name="Step 6: Report Results" status="pending" desc="Report graph construction results">
340
+ <block type="gateway" id="G6" mode="exclusive" desc="Determine result status">
341
+ <branch test="${success} == true" name="Success">
342
+ <block type="event" id="E6a" action="log" level="info" desc="Log success">
343
+ Step 6 Status: COMPLETED - Graph construction success: Generated graph data with ${node_count} nodes and ${edge_count} edges
344
+ </block>
281
345
  </branch>
282
- <branch condition="{{failure}}">
283
- <output name="status" from="failed"/>
284
- <output name="module" from="{{module}}"/>
285
- <output name="fileName" from="{{fileName}}"/>
286
- <output name="message" from="{{error_message}}"/>
287
- <event action="log" message="Step 6 Status: COMPLETED - Graph construction failed: {{error_message}}"/>
346
+ <branch test="${success} == false" name="Failure">
347
+ <block type="event" id="E6b" action="log" level="error" desc="Log failure">
348
+ Step 6 Status: COMPLETED - Graph construction failed: ${error_message}
349
+ </block>
288
350
  </branch>
289
- </gateway>
290
- </checkpoint>
291
-
351
+ </block>
352
+ </sequence>
353
+
354
+ <!-- Output Block -->
355
+ <block type="output" id="O1" desc="API graph construction output results">
356
+ <field name="status" from="${success}"/>
357
+ <field name="module" from="${module}"/>
358
+ <field name="fileName" from="${fileName}"/>
359
+ <field name="graphFile" from="${output_dir}/${markerFilename}.graph.json"/>
360
+ <field name="nodeCount" from="${node_count}"/>
361
+ <field name="edgeCount" from="${edge_count}"/>
362
+ <field name="message" value="Generated graph data with ${node_count} nodes and ${edge_count} edges"/>
363
+ </block>
364
+
292
365
  <!-- Constraints -->
293
- <rule level="mandatory" description="Single Document Input - This skill processes ONE API analysis document at a time"/>
294
- <rule level="mandatory" description="JSON Format - All output files MUST be valid JSON"/>
295
- <rule level="mandatory" description="Module Field - The root-level module field is MANDATORY in graph JSON"/>
296
- <rule level="mandatory" description="Node Uniqueness - Each node ID must be unique within the graph"/>
297
- <rule level="mandatory" description="Edge Validity - Edge source/target must reference existing node IDs"/>
298
- <rule level="mandatory" description="Path Format - Use relative paths, NEVER absolute paths in JSON content"/>
299
-
366
+ <block type="rule" id="R1" level="mandatory" desc="Single document input">
367
+ <field name="text">This skill processes ONE API analysis document at a time</field>
368
+ </block>
369
+ <block type="rule" id="R2" level="mandatory" desc="JSON format">
370
+ <field name="text">All output files MUST be valid JSON</field>
371
+ </block>
372
+ <block type="rule" id="R3" level="mandatory" desc="Module field">
373
+ <field name="text">The root-level module field is MANDATORY in graph JSON</field>
374
+ </block>
375
+ <block type="rule" id="R4" level="mandatory" desc="Node uniqueness">
376
+ <field name="text">Each node ID must be unique within the graph</field>
377
+ </block>
378
+ <block type="rule" id="R5" level="mandatory" desc="Edge validity">
379
+ <field name="text">Edge source/target must reference existing node IDs</field>
380
+ </block>
381
+ <block type="rule" id="R6" level="mandatory" desc="Path format">
382
+ <field name="text">Use relative paths, NEVER absolute paths in JSON content</field>
383
+ </block>
384
+
300
385
  </workflow>
301
- ```
302
386
 
303
387
  ## Node ID Naming Convention
304
388