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.
@@ -60,21 +60,19 @@ flowchart TD
60
60
 
61
61
  > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
62
62
 
63
- <workflow>
64
- <!-- Input Block: Define workflow inputs -->
65
- <input name="modules_path" type="string" required="true" />
66
- <input name="output_path" type="string" required="true" />
67
- <input name="language" type="string" required="true" />
68
-
69
- <!-- Prerequisites Verification -->
70
- <event action="log" level="info">Starting system summarization workflow</event>
71
-
72
- <!-- Edge Case Rules -->
73
- <rule level="note">Empty modules directory: Generate skeleton with warning status if no *-overview.md files found</rule>
74
- <rule level="note">Incomplete module overviews: Use available data and mark gaps with <!-- DATA INCOMPLETE --></rule>
75
- <rule level="note">Same module name from different platforms: Treat as separate modules with platform annotation</rule>
63
+ <workflow id="system-summarize-main" status="pending" version="1.0" desc="System summarization workflow">
64
+ <!-- ============================================================
65
+ Input Parameters Definition
66
+ ============================================================ -->
67
+ <block type="input" id="I1" desc="System summarization input parameters">
68
+ <field name="modules_path" required="true" type="string" desc="Path to modules directory"/>
69
+ <field name="output_path" required="true" type="string" desc="Output path for system-overview.md"/>
70
+ <field name="language" required="true" type="string" desc="Target language for generated content"/>
71
+ </block>
76
72
 
77
- <!-- ==================== GLOBAL CONTINUOUS EXECUTION RULES ==================== -->
73
+ <!-- ============================================================
74
+ Global Continuous Execution Rules
75
+ ============================================================ -->
78
76
  <block type="rule" id="GLOBAL-R1" level="forbidden" desc="Continuous execution constraints — NEVER violate">
79
77
  <field name="text">DO NOT ask user "Should I continue?" or "How would you like to proceed?" during execution</field>
80
78
  <field name="text">DO NOT offer options like "Full execution / Partial / Stop" — always execute ALL tasks to completion</field>
@@ -84,377 +82,453 @@ flowchart TD
84
82
  <field name="text">Context window management: if approaching limit, save progress to checkpoint file and resume — do NOT ask user for guidance</field>
85
83
  </block>
86
84
 
85
+ <!-- ============================================================
86
+ Edge Case Rules
87
+ ============================================================ -->
88
+ <block type="rule" id="R-NOTE1" level="note" desc="Edge case handling">
89
+ <field name="text">Empty modules directory: Generate skeleton with warning status if no *-overview.md files found</field>
90
+ </block>
91
+ <block type="rule" id="R-NOTE2" level="note" desc="Incomplete data handling">
92
+ <field name="text">Incomplete module overviews: Use available data and mark gaps with <!-- DATA INCOMPLETE --></field>
93
+ </block>
94
+ <block type="rule" id="R-NOTE3" level="note" desc="Module name conflict handling">
95
+ <field name="text">Same module name from different platforms: Treat as separate modules with platform annotation</field>
96
+ </block>
97
+
98
+ <!-- Prerequisites Verification -->
99
+ <block type="event" id="E1" action="log" level="info" desc="Log workflow start">
100
+ Starting system summarization workflow
101
+ </block>
102
+
87
103
  <!-- Step 0: Read System Overview Template -->
88
- <task name="read_template" action="run-skill" skill="Read">
89
- <param name="file_path">../speccrew-knowledge-system-summarize/templates/SYSTEM-OVERVIEW-TEMPLATE.md</param>
90
- <output name="template_content" />
91
- </task>
104
+ <block type="task" id="B0" action="run-skill" desc="Read system overview template">
105
+ <field name="skill">Read</field>
106
+ <field name="file_path" value="../speccrew-knowledge-system-summarize/templates/SYSTEM-OVERVIEW-TEMPLATE.md"/>
107
+ <field name="output" var="template_content"/>
108
+ </block>
92
109
 
93
110
  <!-- Checkpoint: Template loaded -->
94
- <checkpoint name="template_loaded" verify="template_content != null" />
111
+ <block type="checkpoint" id="CP0" name="template_loaded" desc="Template loaded successfully">
112
+ <field name="verify" value="${template_content} != null"/>
113
+ </block>
95
114
 
96
115
  <!-- Step 1: Discover All Modules -->
97
- <task name="discover_modules" action="run-skill" skill="Glob">
98
- <param name="pattern">{{modules_path}}/**/*-overview.md</param>
99
- <output name="module_files" />
100
- </task>
116
+ <block type="task" id="B1" action="run-skill" desc="Discover all module overview files">
117
+ <field name="skill">Glob</field>
118
+ <field name="pattern" value="${modules_path}/**/*-overview.md"/>
119
+ <field name="output" var="module_files"/>
120
+ </block>
101
121
 
102
122
  <!-- Gateway: Handle empty modules directory -->
103
- <gateway name="check_modules" mode="exclusive">
104
- <branch condition="module_files.length == 0">
105
- <event action="log" level="warning">No module overview files found in {{modules_path}}</event>
106
- <task name="generate_skeleton" action="run-script">
107
- <param name="script">generate-skeleton.js</param>
108
- <param name="template">{{template_content}}</param>
109
- <output name="skeleton_doc" />
110
- </task>
111
- <task name="write_skeleton" action="run-skill" skill="Write">
112
- <param name="file_path">{{output_path}}/system-overview.md</param>
113
- <param name="content">{{skeleton_doc}}</param>
114
- </task>
115
- <output name="status" from="warning" />
116
- <event action="signal">workflow_complete_with_warning</event>
123
+ <block type="gateway" id="G1" mode="exclusive" desc="Check if modules discovered">
124
+ <branch test="${module_files.length} == 0" name="No modules">
125
+ <block type="event" id="E2" action="log" level="warning" desc="Log no modules found">
126
+ No module overview files found in ${modules_path}
127
+ </block>
128
+ <block type="task" id="B2" action="run-script" desc="Generate skeleton document">
129
+ <field name="script" value="generate-skeleton.js"/>
130
+ <field name="template" value="${template_content}"/>
131
+ <field name="output" var="skeleton_doc"/>
132
+ </block>
133
+ <block type="task" id="B3" action="run-skill" desc="Write skeleton document">
134
+ <field name="skill">Write</field>
135
+ <field name="file_path" value="${output_path}/system-overview.md"/>
136
+ <field name="content" value="${skeleton_doc}"/>
137
+ </block>
138
+ <block type="output" id="O-early" desc="Early output for empty case">
139
+ <field name="status" value="warning"/>
140
+ </block>
141
+ <block type="event" id="E3" action="signal" desc="Signal workflow complete">
142
+ <field name="signal" value="workflow_complete_with_warning"/>
143
+ </block>
117
144
  </branch>
118
- <branch condition="module_files.length > 0">
119
- <event action="log" level="info">Discovered {{module_files.length}} module overview files</event>
145
+ <branch test="${module_files.length} > 0" name="Modules found">
146
+ <block type="event" id="E4" action="log" level="info" desc="Log modules discovered">
147
+ Discovered ${module_files.length} module overview files
148
+ </block>
120
149
  </branch>
121
- </gateway>
150
+ </block>
122
151
 
123
152
  <!-- Extract platform types from paths -->
124
- <loop name="extract_platforms" over="module_files" as="module_file">
125
- <task name="parse_platform" action="run-script">
126
- <param name="script">extract-platform.js</param>
127
- <param name="file_path">{{module_file}}</param>
128
- <output name="platform_info" />
129
- </task>
130
- </loop>
153
+ <block type="loop" id="L1" over="${module_files}" as="module_file" desc="Extract platform types from paths">
154
+ <block type="task" id="B4" action="run-script" desc="Parse platform from file path">
155
+ <field name="script" value="extract-platform.js"/>
156
+ <field name="file_path" value="${module_file}"/>
157
+ <field name="output" var="platform_info"/>
158
+ </block>
159
+ </block>
131
160
 
132
161
  <!-- Checkpoint: Modules discovered -->
133
- <checkpoint name="modules_discovered" verify="module_files.length > 0" />
162
+ <block type="checkpoint" id="CP1" name="modules_discovered" desc="Modules discovery complete">
163
+ <field name="verify" value="${module_files.length} > 0"/>
164
+ </block>
134
165
 
135
166
  <!-- Step 2: Read All Module Overviews -->
136
- <loop name="read_modules" over="module_files" as="module_file">
137
- <task name="read_module" action="run-skill" skill="Read">
138
- <param name="file_path">{{module_file}}</param>
139
- <output name="module_content" />
140
- </task>
141
- <task name="extract_module_info" action="run-script">
142
- <param name="script">extract-module-info.js</param>
143
- <param name="content">{{module_content}}</param>
144
- <param name="file_path">{{module_file}}</param>
145
- <output name="module_info" />
146
- </task>
147
- </loop>
167
+ <block type="loop" id="L2" over="${module_files}" as="module_file" desc="Read all module overview files">
168
+ <block type="task" id="B5" action="run-skill" desc="Read module overview">
169
+ <field name="skill">Read</field>
170
+ <field name="file_path" value="${module_file}"/>
171
+ <field name="output" var="module_content"/>
172
+ </block>
173
+ <block type="task" id="B6" action="run-script" desc="Extract module info">
174
+ <field name="script" value="extract-module-info.js"/>
175
+ <field name="content" value="${module_content}"/>
176
+ <field name="file_path" value="${module_file}"/>
177
+ <field name="output" var="module_info"/>
178
+ </block>
179
+ </block>
148
180
 
149
181
  <!-- Checkpoint: Module info extracted -->
150
- <checkpoint name="modules_read" verify="module_infos.length == module_files.length" />
182
+ <block type="checkpoint" id="CP2" name="modules_read" desc="All modules read successfully">
183
+ <field name="verify" value="${module_infos.length} == ${module_files.length}"/>
184
+ </block>
151
185
 
152
186
  <!-- Step 3: Build Module Index -->
153
- <task name="build_index" action="run-script">
154
- <param name="script">build-module-index.js</param>
155
- <param name="modules">{{module_infos}}</param>
156
- <output name="module_index" />
157
- </task>
187
+ <block type="task" id="B7" action="run-script" desc="Build module index">
188
+ <field name="script" value="build-module-index.js"/>
189
+ <field name="modules" value="${module_infos}"/>
190
+ <field name="output" var="module_index"/>
191
+ </block>
158
192
 
159
193
  <!-- Create index table rows -->
160
- <loop name="create_index_rows" over="module_infos" as="module_info">
161
- <task name="create_index_row" action="run-script">
162
- <param name="script">create-index-row.js</param>
163
- <param name="module">{{module_info}}</param>
164
- <param name="language">{{language}}</param>
165
- <output name="index_row" />
166
- </task>
167
- </loop>
194
+ <block type="loop" id="L3" over="${module_infos}" as="module_info" desc="Create index table rows">
195
+ <block type="task" id="B8" action="run-script" desc="Create index row">
196
+ <field name="script" value="create-index-row.js"/>
197
+ <field name="module" value="${module_info}"/>
198
+ <field name="language" value="${language}"/>
199
+ <field name="output" var="index_row"/>
200
+ </block>
201
+ </block>
168
202
 
169
203
  <!-- Checkpoint: Index built -->
170
- <checkpoint name="index_built" verify="module_index != null" />
204
+ <block type="checkpoint" id="CP3" name="index_built" desc="Module index built">
205
+ <field name="verify" value="${module_index} != null"/>
206
+ </block>
171
207
 
172
208
  <!-- Step 4: Build Dependency Graph -->
173
- <task name="extract_dependencies" action="run-script">
174
- <param name="script">extract-all-dependencies.js</param>
175
- <param name="modules">{{module_infos}}</param>
176
- <output name="all_dependencies" />
177
- </task>
209
+ <block type="task" id="B9" action="run-script" desc="Extract all dependencies">
210
+ <field name="script" value="extract-all-dependencies.js"/>
211
+ <field name="modules" value="${module_infos}"/>
212
+ <field name="output" var="all_dependencies"/>
213
+ </block>
178
214
 
179
215
  <!-- Classify dependencies -->
180
- <loop name="classify_dependencies" over="all_dependencies" as="dependency">
181
- <gateway name="dep_type" mode="exclusive">
182
- <branch condition="dependency.type == 'internal'">
183
- <output name="internal_deps" append="{{dependency}}" />
216
+ <block type="loop" id="L4" over="${all_dependencies}" as="dependency" desc="Classify dependencies by type">
217
+ <block type="gateway" id="G2" mode="exclusive" desc="Classify dependency type">
218
+ <branch test="${dependency.type} == 'internal'" name="Internal dependency">
219
+ <block type="output" id="O-int" desc="Add to internal deps">
220
+ <field name="internal_deps" append="${dependency}"/>
221
+ </block>
184
222
  </branch>
185
- <branch condition="dependency.type == 'external'">
186
- <output name="external_deps" append="{{dependency}}" />
223
+ <branch test="${dependency.type} == 'external'" name="External dependency">
224
+ <block type="output" id="O-ext" desc="Add to external deps">
225
+ <field name="external_deps" append="${dependency}"/>
226
+ </block>
187
227
  </branch>
188
- <branch condition="dependency.type == 'cross_platform'">
189
- <output name="cross_platform_deps" append="{{dependency}}" />
228
+ <branch test="${dependency.type} == 'cross_platform'" name="Cross-platform dependency">
229
+ <block type="output" id="O-cross" desc="Add to cross-platform deps">
230
+ <field name="cross_platform_deps" append="${dependency}"/>
231
+ </block>
190
232
  </branch>
191
- </gateway>
192
- </loop>
233
+ </block>
234
+ </block>
193
235
 
194
236
  <!-- Build directed graph -->
195
- <task name="build_dependency_graph" action="run-script">
196
- <param name="script">build-dep-graph.js</param>
197
- <param name="internal_deps">{{internal_deps}}</param>
198
- <param name="cross_platform_deps">{{cross_platform_deps}}</param>
199
- <output name="dependency_graph" />
200
- </task>
237
+ <block type="task" id="B10" action="run-script" desc="Build dependency graph">
238
+ <field name="script" value="build-dep-graph.js"/>
239
+ <field name="internal_deps" value="${internal_deps}"/>
240
+ <field name="cross_platform_deps" value="${cross_platform_deps}"/>
241
+ <field name="output" var="dependency_graph"/>
242
+ </block>
201
243
 
202
244
  <!-- Generate Mermaid diagram -->
203
- <task name="generate_mermaid_deps" action="run-script">
204
- <param name="script">generate-mermaid-diagram.js</param>
205
- <param name="graph">{{dependency_graph}}</param>
206
- <param name="diagram_type">graph LR</param>
207
- <output name="mermaid_deps" />
208
- </task>
245
+ <block type="task" id="B11" action="run-script" desc="Generate Mermaid dependency diagram">
246
+ <field name="script" value="generate-mermaid-diagram.js"/>
247
+ <field name="graph" value="${dependency_graph}"/>
248
+ <field name="diagram_type" value="graph LR"/>
249
+ <field name="output" var="mermaid_deps"/>
250
+ </block>
209
251
 
210
252
  <!-- Checkpoint: Dependency graph built -->
211
- <checkpoint name="deps_built" verify="dependency_graph.nodes.length > 0" />
253
+ <block type="checkpoint" id="CP4" name="deps_built" desc="Dependency graph built">
254
+ <field name="verify" value="${dependency_graph.nodes.length} > 0"/>
255
+ </block>
212
256
 
213
257
  <!-- Step 5: Identify Business Domains -->
214
- <task name="extract_domains" action="run-script">
215
- <param name="script">extract-domains.js</param>
216
- <param name="modules">{{module_infos}}</param>
217
- <output name="business_domains" />
218
- </task>
258
+ <block type="task" id="B12" action="run-script" desc="Extract business domains">
259
+ <field name="script" value="extract-domains.js"/>
260
+ <field name="modules" value="${module_infos}"/>
261
+ <field name="output" var="business_domains"/>
262
+ </block>
219
263
 
220
264
  <!-- Group modules by domain -->
221
- <loop name="group_by_domain" over="business_domains" as="domain">
222
- <task name="find_domain_modules" action="run-script">
223
- <param name="script">find-domain-modules.js</param>
224
- <param name="domain">{{domain}}</param>
225
- <param name="modules">{{module_infos}}</param>
226
- <output name="domain_modules" />
227
- </task>
228
- </loop>
265
+ <block type="loop" id="L5" over="${business_domains}" as="domain" desc="Group modules by domain">
266
+ <block type="task" id="B13" action="run-script" desc="Find domain modules">
267
+ <field name="script" value="find-domain-modules.js"/>
268
+ <field name="domain" value="${domain}"/>
269
+ <field name="modules" value="${module_infos}"/>
270
+ <field name="output" var="domain_modules"/>
271
+ </block>
272
+ </block>
229
273
 
230
274
  <!-- Generate domain diagram -->
231
- <task name="generate_domain_diagram" action="run-script">
232
- <param name="script">generate-domain-diagram.js</param>
233
- <param name="domains">{{business_domains}}</param>
234
- <param name="module_groups">{{domain_module_groups}}</param>
235
- <output name="domain_diagram" />
236
- </task>
275
+ <block type="task" id="B14" action="run-script" desc="Generate domain diagram">
276
+ <field name="script" value="generate-domain-diagram.js"/>
277
+ <field name="domains" value="${business_domains}"/>
278
+ <field name="module_groups" value="${domain_module_groups}"/>
279
+ <field name="output" var="domain_diagram"/>
280
+ </block>
237
281
 
238
282
  <!-- Checkpoint: Domains identified -->
239
- <checkpoint name="domains_identified" verify="business_domains.length > 0" />
283
+ <block type="checkpoint" id="CP5" name="domains_identified" desc="Business domains identified">
284
+ <field name="verify" value="${business_domains.length} > 0"/>
285
+ </block>
240
286
 
241
287
  <!-- Step 6: Identify End-to-End Flows -->
242
- <task name="analyze_flows" action="run-script">
243
- <param name="script">analyze-cross-module-flows.js</param>
244
- <param name="dependencies">{{all_dependencies}}</param>
245
- <param name="modules">{{module_infos}}</param>
246
- <output name="end_to_end_flows" />
247
- </task>
288
+ <block type="task" id="B15" action="run-script" desc="Analyze cross-module flows">
289
+ <field name="script" value="analyze-cross-module-flows.js"/>
290
+ <field name="dependencies" value="${all_dependencies}"/>
291
+ <field name="modules" value="${module_infos}"/>
292
+ <field name="output" var="end_to_end_flows"/>
293
+ </block>
248
294
 
249
295
  <!-- Create flow-module mapping matrix -->
250
- <loop name="build_flow_matrix" over="end_to_end_flows" as="flow">
251
- <task name="map_flow_modules" action="run-script">
252
- <param name="script">map-flow-modules.js</param>
253
- <param name="flow">{{flow}}</param>
254
- <param name="modules">{{module_infos}}</param>
255
- <output name="flow_mapping" />
256
- </task>
257
- </loop>
296
+ <block type="loop" id="L6" over="${end_to_end_flows}" as="flow" desc="Build flow-module matrix">
297
+ <block type="task" id="B16" action="run-script" desc="Map flow to modules">
298
+ <field name="script" value="map-flow-modules.js"/>
299
+ <field name="flow" value="${flow}"/>
300
+ <field name="modules" value="${module_infos}"/>
301
+ <field name="output" var="flow_mapping"/>
302
+ </block>
303
+ </block>
258
304
 
259
305
  <!-- Checkpoint: Flows identified -->
260
- <checkpoint name="flows_identified" verify="end_to_end_flows.length >= 0" />
306
+ <block type="checkpoint" id="CP6" name="flows_identified" desc="End-to-end flows identified">
307
+ <field name="verify" value="${end_to_end_flows.length} >= 0"/>
308
+ </block>
261
309
 
262
310
  <!-- Step 7: Generate system-overview.md -->
263
311
  <!-- Phase A: Skeleton Construction -->
264
- <task name="count_modules" action="run-script">
265
- <param name="script">count-items.js</param>
266
- <param name="items">{{module_infos}}</param>
267
- <output name="module_count" />
268
- </task>
269
-
270
- <task name="count_flows" action="run-script">
271
- <param name="script">count-items.js</param>
272
- <param name="items">{{end_to_end_flows}}</param>
273
- <output name="flow_count" />
274
- </task>
275
-
276
- <task name="count_integrations" action="run-script">
277
- <param name="script">count-items.js</param>
278
- <param name="items">{{external_deps}}</param>
279
- <output name="integration_count" />
280
- </task>
312
+ <block type="task" id="B17" action="run-script" desc="Count modules">
313
+ <field name="script" value="count-items.js"/>
314
+ <field name="items" value="${module_infos}"/>
315
+ <field name="output" var="module_count"/>
316
+ </block>
317
+
318
+ <block type="task" id="B18" action="run-script" desc="Count flows">
319
+ <field name="script" value="count-items.js"/>
320
+ <field name="items" value="${end_to_end_flows}"/>
321
+ <field name="output" var="flow_count"/>
322
+ </block>
323
+
324
+ <block type="task" id="B19" action="run-script" desc="Count integrations">
325
+ <field name="script" value="count-items.js"/>
326
+ <field name="items" value="${external_deps}"/>
327
+ <field name="output" var="integration_count"/>
328
+ </block>
281
329
 
282
330
  <!-- Read tech stack mappings -->
283
- <task name="read_tech_mappings" action="run-skill" skill="Read">
284
- <param name="file_path">speccrew-workspace/docs/configs/tech-stack-mappings.json</param>
285
- <output name="tech_mappings" />
286
- </task>
331
+ <block type="task" id="B20" action="run-skill" desc="Read tech stack mappings">
332
+ <field name="skill">Read</field>
333
+ <field name="file_path" value="speccrew-workspace/docs/configs/tech-stack-mappings.json"/>
334
+ <field name="output" var="tech_mappings"/>
335
+ </block>
287
336
 
288
337
  <!-- Read Mermaid rules -->
289
- <task name="read_mermaid_rules" action="run-skill" skill="Read">
290
- <param name="file_path">speccrew-workspace/docs/rules/mermaid-rule.md</param>
291
- <output name="mermaid_rules" />
292
- </task>
338
+ <block type="task" id="B21" action="run-skill" desc="Read Mermaid rules">
339
+ <field name="skill">Read</field>
340
+ <field name="file_path" value="speccrew-workspace/docs/rules/mermaid-rule.md"/>
341
+ <field name="output" var="mermaid_rules"/>
342
+ </block>
293
343
 
294
344
  <!-- Get timestamp via script -->
295
- <task name="get_timestamp" action="run-script" description="Get current timestamp">
296
- <run-script script="scripts/get-timestamp.js" output="timestamp" />
297
- </task>
345
+ <block type="task" id="B22" action="run-script" desc="Get current timestamp">
346
+ <field name="script" value="scripts/get-timestamp.js"/>
347
+ <field name="output" var="timestamp"/>
348
+ </block>
298
349
 
299
350
  <!-- Gateway: Fallback for timestamp -->
300
- <gateway name="check_timestamp" mode="exclusive">
301
- <branch condition="timestamp == null">
302
- <task name="fallback_timestamp" action="run-script">
303
- <param name="script">get-system-time.js</param>
304
- <output name="timestamp" />
305
- </task>
306
- <event action="log" level="warning">Using system fallback timestamp</event>
351
+ <block type="gateway" id="G3" mode="exclusive" desc="Check timestamp">
352
+ <branch test="${timestamp} == null" name="No timestamp">
353
+ <block type="task" id="B23" action="run-script" desc="Get system fallback timestamp">
354
+ <field name="script" value="get-system-time.js"/>
355
+ <field name="output" var="timestamp"/>
356
+ </block>
357
+ <block type="event" id="E5" action="log" level="warning" desc="Log fallback">
358
+ Using system fallback timestamp
359
+ </block>
307
360
  </branch>
308
- </gateway>
361
+ </block>
309
362
 
310
363
  <!-- Determine technology stack -->
311
- <task name="determine_tech_stack" action="run-script">
312
- <param name="script">determine-tech-stack.js</param>
313
- <param name="platforms">{{extracted_platforms}}</param>
314
- <param name="mappings">{{tech_mappings}}</param>
315
- <output name="tech_stack" />
316
- </task>
364
+ <block type="task" id="B24" action="run-script" desc="Determine tech stack">
365
+ <field name="script" value="determine-tech-stack.js"/>
366
+ <field name="platforms" value="${extracted_platforms}"/>
367
+ <field name="mappings" value="${tech_mappings}"/>
368
+ <field name="output" var="tech_stack"/>
369
+ </block>
317
370
 
318
371
  <!-- Create skeleton structure -->
319
- <task name="create_skeleton" action="run-script">
320
- <param name="script">create-system-skeleton.js</param>
321
- <param name="template">{{template_content}}</param>
322
- <param name="module_count">{{module_count}}</param>
323
- <param name="flow_count">{{flow_count}}</param>
324
- <param name="integration_count">{{integration_count}}</param>
325
- <param name="timestamp">{{timestamp}}</param>
326
- <param name="tech_stack">{{tech_stack}}</param>
327
- <param name="language">{{language}}</param>
328
- <output name="document_skeleton" />
329
- </task>
372
+ <block type="task" id="B25" action="run-script" desc="Create document skeleton">
373
+ <field name="script" value="create-system-skeleton.js"/>
374
+ <field name="template" value="${template_content}"/>
375
+ <field name="module_count" value="${module_count}"/>
376
+ <field name="flow_count" value="${flow_count}"/>
377
+ <field name="integration_count" value="${integration_count}"/>
378
+ <field name="timestamp" value="${timestamp}"/>
379
+ <field name="tech_stack" value="${tech_stack}"/>
380
+ <field name="language" value="${language}"/>
381
+ <field name="output" var="document_skeleton"/>
382
+ </block>
330
383
 
331
384
  <!-- Rule: Skeleton must be complete before filling -->
332
- <rule level="mandatory">DO NOT start filling content until the complete skeleton is verified</rule>
385
+ <block type="rule" id="R-MAND1" level="mandatory" desc="Skeleton completion rule">
386
+ <field name="text">DO NOT start filling content until the complete skeleton is verified</field>
387
+ </block>
333
388
 
334
389
  <!-- Checkpoint: Skeleton ready -->
335
- <checkpoint name="skeleton_ready" verify="document_skeleton != null AND document_skeleton.contains('[TO BE FILLED]')" />
390
+ <block type="checkpoint" id="CP7" name="skeleton_ready" desc="Document skeleton ready">
391
+ <field name="verify" value="${document_skeleton} != null AND ${document_skeleton}.contains('[TO BE FILLED]')"/>
392
+ </block>
336
393
 
337
394
  <!-- Phase B: Content Filling -->
338
395
  <!-- Fill Index and Overview section -->
339
- <task name="fill_index_section" action="run-script">
340
- <param name="script">fill-index-section.js</param>
341
- <param name="skeleton">{{document_skeleton}}</param>
342
- <param name="timestamp">{{timestamp}}</param>
343
- <param name="tech_stack">{{tech_stack}}</param>
344
- <param name="statistics">{{aggregated_stats}}</param>
345
- <param name="module_index">{{module_index}}</param>
346
- <output name="filled_index" />
347
- </task>
396
+ <block type="task" id="B26" action="run-script" desc="Fill index section">
397
+ <field name="script" value="fill-index-section.js"/>
398
+ <field name="skeleton" value="${document_skeleton}"/>
399
+ <field name="timestamp" value="${timestamp}"/>
400
+ <field name="tech_stack" value="${tech_stack}"/>
401
+ <field name="statistics" value="${aggregated_stats}"/>
402
+ <field name="module_index" value="${module_index}"/>
403
+ <field name="output" var="filled_index"/>
404
+ </block>
348
405
 
349
406
  <!-- Fill Section 1: System Overview -->
350
- <task name="fill_system_overview" action="run-script">
351
- <param name="script">fill-system-overview.js</param>
352
- <param name="skeleton">{{filled_index}}</param>
353
- <param name="modules">{{module_infos}}</param>
354
- <param name="language">{{language}}</param>
355
- <output name="filled_section1" />
356
- </task>
407
+ <block type="task" id="B27" action="run-script" desc="Fill system overview section">
408
+ <field name="script" value="fill-system-overview.js"/>
409
+ <field name="skeleton" value="${filled_index}"/>
410
+ <field name="modules" value="${module_infos}"/>
411
+ <field name="language" value="${language}"/>
412
+ <field name="output" var="filled_section1"/>
413
+ </block>
357
414
 
358
415
  <!-- Fill Section 2: Module Topology -->
359
- <task name="fill_module_topology" action="run-script">
360
- <param name="script">fill-module-topology.js</param>
361
- <param name="skeleton">{{filled_section1}}</param>
362
- <param name="domain_diagram">{{domain_diagram}}</param>
363
- <param name="dependency_graph">{{dependency_graph}}</param>
364
- <param name="mermaid_deps">{{mermaid_deps}}</param>
365
- <param name="module_index">{{module_index}}</param>
366
- <param name="language">{{language}}</param>
367
- <output name="filled_section2" />
368
- </task>
416
+ <block type="task" id="B28" action="run-script" desc="Fill module topology section">
417
+ <field name="script" value="fill-module-topology.js"/>
418
+ <field name="skeleton" value="${filled_section1}"/>
419
+ <field name="domain_diagram" value="${domain_diagram}"/>
420
+ <field name="dependency_graph" value="${dependency_graph}"/>
421
+ <field name="mermaid_deps" value="${mermaid_deps}"/>
422
+ <field name="module_index" value="${module_index}"/>
423
+ <field name="language" value="${language}"/>
424
+ <field name="output" var="filled_section2"/>
425
+ </block>
369
426
 
370
427
  <!-- Fill Section 3: End-to-End Business Flows -->
371
- <task name="fill_business_flows" action="run-script">
372
- <param name="script">fill-business-flows.js</param>
373
- <param name="skeleton">{{filled_section2}}</param>
374
- <param name="flows">{{end_to_end_flows}}</param>
375
- <param name="flow_mappings">{{flow_mappings}}</param>
376
- <param name="modules">{{module_infos}}</param>
377
- <param name="language">{{language}}</param>
378
- <output name="filled_section3" />
379
- </task>
428
+ <block type="task" id="B29" action="run-script" desc="Fill business flows section">
429
+ <field name="script" value="fill-business-flows.js"/>
430
+ <field name="skeleton" value="${filled_section2}"/>
431
+ <field name="flows" value="${end_to_end_flows}"/>
432
+ <field name="flow_mappings" value="${flow_mappings}"/>
433
+ <field name="modules" value="${module_infos}"/>
434
+ <field name="language" value="${language}"/>
435
+ <field name="output" var="filled_section3"/>
436
+ </block>
380
437
 
381
438
  <!-- Fill Section 4: System Boundaries and Integration -->
382
- <task name="fill_system_boundaries" action="run-script">
383
- <param name="script">fill-system-boundaries.js</param>
384
- <param name="skeleton">{{filled_section3}}</param>
385
- <param name="external_deps">{{external_deps}}</param>
386
- <param name="language">{{language}}</param>
387
- <output name="filled_section4" />
388
- </task>
439
+ <block type="task" id="B30" action="run-script" desc="Fill system boundaries section">
440
+ <field name="script" value="fill-system-boundaries.js"/>
441
+ <field name="skeleton" value="${filled_section3}"/>
442
+ <field name="external_deps" value="${external_deps}"/>
443
+ <field name="language" value="${language}"/>
444
+ <field name="output" var="filled_section4"/>
445
+ </block>
389
446
 
390
447
  <!-- Fill Section 5: Requirement Assessment Guide -->
391
- <task name="fill_assessment_guide" action="run-script">
392
- <param name="script">fill-assessment-guide.js</param>
393
- <param name="skeleton">{{filled_section4}}</param>
394
- <param name="language">{{language}}</param>
395
- <output name="filled_section5" />
396
- </task>
448
+ <block type="task" id="B31" action="run-script" desc="Fill assessment guide section">
449
+ <field name="script" value="fill-assessment-guide.js"/>
450
+ <field name="skeleton" value="${filled_section4}"/>
451
+ <field name="language" value="${language}"/>
452
+ <field name="output" var="filled_section5"/>
453
+ </block>
397
454
 
398
455
  <!-- Error Handler for document writing -->
399
- <error-handler>
456
+ <block type="error-handler" id="EH1" desc="Document write error handling">
400
457
  <try>
401
458
  <!-- Step 7a: Prepare Document -->
402
- <task name="write_document" action="run-skill" skill="Write">
403
- <param name="file_path">{{output_path}}/system-overview.md</param>
404
- <param name="content">{{filled_section5}}</param>
405
- </task>
459
+ <block type="task" id="B32" action="run-skill" desc="Write document to file">
460
+ <field name="skill">Write</field>
461
+ <field name="file_path" value="${output_path}/system-overview.md"/>
462
+ <field name="content" value="${filled_section5}"/>
463
+ </block>
406
464
  </try>
407
- <catch error="write_error">
408
- <event action="log" level="error">Failed to write system overview: {{write_error.message}}</event>
409
- <output name="status" from="failed" />
465
+ <catch error-type="write_error">
466
+ <block type="event" id="E6" action="log" level="error" desc="Log write error">
467
+ Failed to write system overview: ${write_error.message}
468
+ </block>
469
+ <block type="output" id="O-err" desc="Error output">
470
+ <field name="status" value="failed"/>
471
+ </block>
410
472
  </catch>
411
473
  <finally>
412
- <event action="log" level="info">Document write operation completed</event>
474
+ <block type="event" id="E7" action="log" level="info" desc="Log write complete">
475
+ Document write operation completed
476
+ </block>
413
477
  </finally>
414
- </error-handler>
478
+ </block>
415
479
 
416
480
  <!-- Rule: Critical constraints -->
417
- <rule level="forbidden">FORBIDDEN: create_file for documents - Document MUST be created by copying template then filling with search_replace</rule>
418
- <rule level="forbidden">FORBIDDEN: Full-file rewrite - Always use targeted search_replace on specific sections</rule>
419
- <rule level="mandatory">MANDATORY: Template-first workflow - Step 7a MUST execute before Step 7b</rule>
481
+ <block type="rule" id="R-FORB1" level="forbidden" desc="Document creation constraint">
482
+ <field name="text">FORBIDDEN: create_file for documents - Document MUST be created by copying template then filling with search_replace</field>
483
+ </block>
484
+ <block type="rule" id="R-FORB2" level="forbidden" desc="Full rewrite constraint">
485
+ <field name="text">FORBIDDEN: Full-file rewrite - Always use targeted search_replace on specific sections</field>
486
+ </block>
487
+ <block type="rule" id="R-MAND2" level="mandatory" desc="Template-first constraint">
488
+ <field name="text">MANDATORY: Template-first workflow - Step 7a MUST execute before Step 7b</field>
489
+ </block>
420
490
 
421
491
  <!-- Checkpoint: Document generated -->
422
- <checkpoint name="document_generated" verify="output_file_exists == true" />
492
+ <block type="checkpoint" id="CP8" name="document_generated" desc="Document generated successfully">
493
+ <field name="verify" value="${output_file_exists} == true"/>
494
+ </block>
423
495
 
424
496
  <!-- Step 8: Report Results -->
425
- <task name="calculate_metrics" action="run-script">
426
- <param name="script">calculate-metrics.js</param>
427
- <param name="modules">{{module_infos}}</param>
428
- <param name="platforms">{{extracted_platforms}}</param>
429
- <output name="metrics" />
430
- </task>
431
-
432
- <task name="generate_report" action="run-script">
433
- <param name="script">generate-system-report.js</param>
434
- <param name="module_count">{{module_count}}</param>
435
- <param name="entity_count">{{metrics.entity_count}}</param>
436
- <param name="api_count">{{metrics.api_count}}</param>
437
- <param name="dependency_count">{{all_dependencies.length}}</param>
438
- <param name="flow_count">{{flow_count}}</param>
439
- <output name="completion_report" />
440
- </task>
497
+ <block type="task" id="B33" action="run-script" desc="Calculate metrics">
498
+ <field name="script" value="calculate-metrics.js"/>
499
+ <field name="modules" value="${module_infos}"/>
500
+ <field name="platforms" value="${extracted_platforms}"/>
501
+ <field name="output" var="metrics"/>
502
+ </block>
503
+
504
+ <block type="task" id="B34" action="run-script" desc="Generate system report">
505
+ <field name="script" value="generate-system-report.js"/>
506
+ <field name="module_count" value="${module_count}"/>
507
+ <field name="entity_count" value="${metrics.entity_count}"/>
508
+ <field name="api_count" value="${metrics.api_count}"/>
509
+ <field name="dependency_count" value="${all_dependencies.length}"/>
510
+ <field name="flow_count" value="${flow_count}"/>
511
+ <field name="output" var="completion_report"/>
512
+ </block>
441
513
 
442
514
  <!-- Event: Log completion -->
443
- <event action="log" level="info">
515
+ <block type="event" id="E8" action="log" level="info" desc="Log completion summary">
444
516
  System summarization completed:
445
- - Modules Processed: {{module_count}}
446
- - Entities Aggregated: {{metrics.entity_count}}
447
- - APIs Counted: {{metrics.api_count}}
448
- - Dependencies Mapped: {{all_dependencies.length}}
449
- - Business Flows Identified: {{flow_count}}
517
+ - Modules Processed: ${module_count}
518
+ - Entities Aggregated: ${metrics.entity_count}
519
+ - APIs Counted: ${metrics.api_count}
520
+ - Dependencies Mapped: ${all_dependencies.length}
521
+ - Business Flows Identified: ${flow_count}
450
522
  - Output: system-overview.md (complete)
451
523
  - Status: success
452
- </event>
524
+ </block>
453
525
 
454
526
  <!-- Output Block: Define workflow outputs -->
455
- <output name="status" from="success" />
456
- <output name="output_file" from="system-overview.md" />
457
- <output name="message" from="System summarization completed with {{module_count}} modules processed" />
527
+ <block type="output" id="O1" desc="System summarization results">
528
+ <field name="status" value="success"/>
529
+ <field name="output_file" value="system-overview.md"/>
530
+ <field name="message" value="System summarization completed with ${module_count} modules processed"/>
531
+ </block>
458
532
  </workflow>
459
533
 
460
534
  ## Constraints