speccrew 0.6.42 → 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.
@@ -53,277 +53,323 @@ flowchart TD
53
53
 
54
54
  > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `docs/rules/xml-workflow-spec.md`
55
55
 
56
- <workflow>
56
+ <workflow id="module-summarize" version="1.0" status="pending" desc="Module summarization workflow">
57
+
57
58
  <!-- Input Block: Define workflow inputs -->
58
- <input name="module_name" type="string" required="true" />
59
- <input name="module_path" type="string" required="true" />
60
- <input name="language" type="string" required="true" />
59
+ <block type="input" id="I1" desc="Module summarize input parameters">
60
+ <field name="module_name" required="true" type="string" desc="Module name to summarize"/>
61
+ <field name="module_path" required="true" type="string" desc="Path to module directory"/>
62
+ <field name="language" required="true" type="string" desc="Target language for generated content"/>
63
+ <field name="workspace_path" required="true" type="string" desc="Workspace root path"/>
64
+ <field name="sync_state_bizs_dir" required="true" type="string" desc="Sync state directory path"/>
65
+ </block>
66
+
67
+ <!-- ==================== GLOBAL CONTINUOUS EXECUTION RULES ==================== -->
68
+ <block type="rule" id="GLOBAL-R1" level="forbidden" desc="Continuous execution constraints — NEVER violate">
69
+ <field name="text">DO NOT ask user "Should I continue?" or "How would you like to proceed?" during execution</field>
70
+ <field name="text">DO NOT offer options like "Full execution / Partial / Stop" — always execute ALL tasks to completion</field>
71
+ <field name="text">DO NOT suggest "Due to context window limits, let me pause" — complete current task, use checkpoint for resumption</field>
72
+ <field name="text">DO NOT estimate workload and suggest breaking it into phases — execute ALL items in sequence</field>
73
+ <field name="text">DO NOT warn about "large number of files" or "this may take a while" — proceed with generation</field>
74
+ <field name="text">Context window management: if approaching limit, save progress to checkpoint file and resume — do NOT ask user for guidance</field>
75
+ </block>
61
76
 
62
77
  <!-- Step 1: Read Prerequisites -->
63
- <task name="read_template" action="run-skill" skill="Read">
64
- <param name="file_path">../speccrew-knowledge-module-summarize/templates/MODULE-OVERVIEW-TEMPLATE.md</param>
65
- <output name="template_content" />
66
- </task>
67
-
68
- <task name="read_initial_overview" action="run-skill" skill="Read">
69
- <param name="file_path">{{module_path}}/{{module_name}}-overview.md</param>
70
- <output name="initial_overview" />
71
- </task>
72
-
73
- <task name="discover_features" action="run-skill" skill="Glob">
74
- <param name="pattern">{{module_path}}/features/*.md</param>
75
- <output name="feature_files" />
76
- </task>
77
-
78
- <!-- Loop: Read all feature detail files -->
79
- <loop name="read_features" over="feature_files" as="feature_file">
80
- <task name="read_feature" action="run-skill" skill="Read">
81
- <param name="file_path">{{feature_file}}</param>
82
- <output name="feature_content" />
83
- </task>
84
- </loop>
85
-
86
- <!-- Checkpoint: Verify prerequisites loaded -->
87
- <checkpoint name="prerequisites_loaded" verify="template_content != null AND feature_files != null" />
88
-
89
- <!-- Gateway: Handle edge case - no features found -->
90
- <gateway name="check_features" mode="exclusive">
91
- <branch condition="feature_files.length == 0">
92
- <event action="log" level="warning">No feature documents found for module {{module_name}}</event>
93
- <task name="generate_minimal_overview" action="run-skill" skill="Write">
94
- <param name="file_path">{{module_path}}/{{module_name}}-overview.md</param>
95
- <param name="content">{{minimal_skeleton}}</param>
96
- </task>
97
- <output name="status" from="partial" />
98
- <event action="signal">workflow_complete</event>
99
- </branch>
100
- <branch condition="feature_files.length > 0">
101
- <event action="log" level="info">Found {{feature_files.length}} feature documents</event>
102
- </branch>
103
- </gateway>
78
+ <sequence id="S1" name="Step 1: Read Prerequisites" status="pending" desc="Read template, initial overview, and discover features">
79
+ <block type="task" id="B1a" action="read-file" desc="Read module overview template">
80
+ <field name="path" value="../speccrew-knowledge-module-summarize/templates/MODULE-OVERVIEW-TEMPLATE.md"/>
81
+ <field name="output" var="template_content"/>
82
+ </block>
83
+
84
+ <block type="task" id="B1b" action="read-file" desc="Read initial overview">
85
+ <field name="path" value="${module_path}/${module_name}-overview.md"/>
86
+ <field name="output" var="initial_overview"/>
87
+ </block>
88
+
89
+ <block type="task" id="B1c" action="run-script" desc="Discover feature files">
90
+ <field name="command">Get-ChildItem -Path "${module_path}/features" -Filter "*.md" -File</field>
91
+ <field name="output" var="feature_files"/>
92
+ </block>
93
+
94
+ <!-- Loop: Read all feature detail files -->
95
+ <block type="loop" id="L1" over="${feature_files}" as="feature_file" desc="Read all feature files">
96
+ <block type="task" id="B1d" action="read-file" desc="Read feature file">
97
+ <field name="path" value="${feature_file}"/>
98
+ <field name="output" var="feature_content"/>
99
+ </block>
100
+ </block>
101
+
102
+ <!-- Checkpoint: Verify prerequisites loaded -->
103
+ <block type="checkpoint" id="CP1" name="prerequisites_loaded" desc="Prerequisites loaded checkpoint">
104
+ <field name="verify" value="${template_content} != null AND ${feature_files} != null"/>
105
+ </block>
106
+
107
+ <!-- Gateway: Handle edge case - no features found -->
108
+ <block type="gateway" id="G1" mode="exclusive" desc="Check if features exist">
109
+ <branch test="${feature_files.length} == 0" name="No features">
110
+ <block type="event" id="E1a" action="log" level="warning" desc="No features warning">
111
+ No feature documents found for module ${module_name}
112
+ </block>
113
+ <block type="task" id="B1e" action="write-file" desc="Generate minimal overview">
114
+ <field name="path" value="${module_path}/${module_name}-overview.md"/>
115
+ <field name="content" value="${minimal_skeleton}"/>
116
+ </block>
117
+ <field name="status" value="partial"/>
118
+ <block type="event" id="E1b" action="signal" desc="Signal complete">
119
+ workflow_complete
120
+ </block>
121
+ </branch>
122
+ <branch test="${feature_files.length} > 0" name="Features found">
123
+ <block type="event" id="E1c" action="log" level="info" desc="Features found">
124
+ Found ${feature_files.length} feature documents
125
+ </block>
126
+ </branch>
127
+ </block>
128
+ </sequence>
104
129
 
105
130
  <!-- Step 2: Extract Entities -->
106
- <task name="extract_entities" action="run-script">
107
- <param name="script">extract-entities.js</param>
108
- <param name="inputs">feature_contents</param>
109
- <output name="extracted_entities" />
110
- </task>
111
-
112
- <!-- Loop: Process each entity for deduplication -->
113
- <loop name="process_entities" over="extracted_entities" as="entity">
114
- <task name="aggregate_entity" action="run-script">
115
- <param name="script">aggregate-entity.js</param>
116
- <param name="entity">{{entity}}</param>
117
- <output name="aggregated_entity" />
118
- </task>
119
- </loop>
120
-
121
- <!-- Checkpoint: Entities aggregated -->
122
- <checkpoint name="entities_aggregated" verify="unique_entities.length > 0" />
131
+ <sequence id="S2" name="Step 2: Extract Entities" status="pending" desc="Extract and aggregate entities from features">
132
+ <block type="task" id="B2a" action="analyze" desc="Extract entities">
133
+ <field name="inputs" value="${feature_contents}"/>
134
+ <field name="output" var="extracted_entities"/>
135
+ </block>
136
+
137
+ <!-- Loop: Process each entity for deduplication -->
138
+ <block type="loop" id="L2" over="${extracted_entities}" as="entity" desc="Aggregate entities">
139
+ <block type="task" id="B2b" action="analyze" desc="Aggregate entity">
140
+ <field name="entity" value="${entity}"/>
141
+ <field name="output" var="aggregated_entity"/>
142
+ </block>
143
+ </block>
144
+
145
+ <!-- Checkpoint: Entities aggregated -->
146
+ <block type="checkpoint" id="CP2" name="entities_aggregated" desc="Entities aggregated checkpoint">
147
+ <field name="verify" value="${unique_entities.length} > 0"/>
148
+ </block>
149
+ </sequence>
123
150
 
124
151
  <!-- Step 3: Identify Dependencies -->
125
- <task name="identify_dependencies" action="run-script">
126
- <param name="script">identify-dependencies.js</param>
127
- <param name="inputs">feature_contents</param>
128
- <output name="dependencies" />
129
- </task>
130
-
131
- <!-- Classify dependencies -->
132
- <loop name="classify_deps" over="dependencies" as="dependency">
133
- <gateway name="classify_direction" mode="exclusive">
134
- <branch condition="dependency.direction == 'provides'">
135
- <output name="provided_deps" append="{{dependency}}" />
136
- </branch>
137
- <branch condition="dependency.direction == 'consumes'">
138
- <output name="consumed_deps" append="{{dependency}}" />
139
- </branch>
140
- </gateway>
141
- </loop>
152
+ <sequence id="S3" name="Step 3: Identify Dependencies" status="pending" desc="Identify dependencies from features">
153
+ <block type="task" id="B3a" action="analyze" desc="Identify dependencies">
154
+ <field name="inputs" value="${feature_contents}"/>
155
+ <field name="output" var="dependencies"/>
156
+ </block>
157
+
158
+ <!-- Classify dependencies -->
159
+ <block type="loop" id="L3" over="${dependencies}" as="dependency" desc="Classify dependencies">
160
+ <block type="gateway" id="G3" mode="exclusive" desc="Classify direction">
161
+ <branch test="${dependency.direction} == 'provides'" name="Provides">
162
+ <field name="provided_deps" append="${dependency}"/>
163
+ </branch>
164
+ <branch test="${dependency.direction} == 'consumes'" name="Consumes">
165
+ <field name="consumed_deps" append="${dependency}"/>
166
+ </branch>
167
+ </block>
168
+ </block>
142
169
 
143
- <!-- Checkpoint: Dependencies classified -->
144
- <checkpoint name="dependencies_classified" verify="dependencies != null" />
170
+ <!-- Checkpoint: Dependencies classified -->
171
+ <block type="checkpoint" id="CP3" name="dependencies_classified" desc="Dependencies classified checkpoint">
172
+ <field name="verify" value="${dependencies} != null"/>
173
+ </block>
174
+ </sequence>
145
175
 
146
176
  <!-- Step 4: Summarize Business Rules -->
147
- <task name="extract_rules" action="run-script">
148
- <param name="script">extract-rules.js</param>
149
- <param name="inputs">feature_contents</param>
150
- <output name="business_rules" />
151
- </task>
152
-
153
- <!-- Loop: Associate rules with features -->
154
- <loop name="associate_rules" over="business_rules" as="rule">
155
- <task name="find_rule_source" action="run-script">
156
- <param name="script">find-source-feature.js</param>
157
- <param name="rule">{{rule}}</param>
158
- <param name="features">{{feature_files}}</param>
159
- <output name="rule_with_source" />
160
- </task>
161
- </loop>
162
-
163
- <!-- Checkpoint: Rules collected -->
164
- <checkpoint name="rules_collected" verify="business_rules.length >= 0" />
177
+ <sequence id="S4" name="Step 4: Summarize Rules" status="pending" desc="Extract and associate business rules">
178
+ <block type="task" id="B4a" action="analyze" desc="Extract rules">
179
+ <field name="inputs" value="${feature_contents}"/>
180
+ <field name="output" var="business_rules"/>
181
+ </block>
182
+
183
+ <!-- Loop: Associate rules with features -->
184
+ <block type="loop" id="L4" over="${business_rules}" as="rule" desc="Associate rules">
185
+ <block type="task" id="B4b" action="analyze" desc="Find rule source">
186
+ <field name="rule" value="${rule}"/>
187
+ <field name="features" value="${feature_files}"/>
188
+ <field name="output" var="rule_with_source"/>
189
+ </block>
190
+ </block>
191
+
192
+ <!-- Checkpoint: Rules collected -->
193
+ <block type="checkpoint" id="CP4" name="rules_collected" desc="Rules collected checkpoint">
194
+ <field name="verify" value="${business_rules.length} >= 0"/>
195
+ </block>
196
+ </sequence>
165
197
 
166
198
  <!-- Step 5: Generate Complete MODULE-OVERVIEW.md -->
167
- <!-- Phase A: Skeleton Construction -->
168
- <task name="count_entities" action="run-script">
169
- <param name="script">count-items.js</param>
170
- <param name="items">{{unique_entities}}</param>
171
- <output name="entity_count" />
172
- </task>
173
-
174
- <task name="count_dependencies" action="run-script">
175
- <param name="script">count-items.js</param>
176
- <param name="items">{{dependencies}}</param>
177
- <output name="dependency_count" />
178
- </task>
179
-
180
- <task name="count_flows" action="run-script">
181
- <param name="script">count-flows.js</param>
182
- <param name="features">{{feature_contents}}</param>
183
- <output name="flow_count" />
184
- </task>
185
-
186
- <task name="count_rules" action="run-script">
187
- <param name="script">count-items.js</param>
188
- <param name="items">{{business_rules}}</param>
189
- <output name="rule_count" />
190
- </task>
191
-
192
- <!-- Create skeleton structure -->
193
- <task name="create_skeleton" action="run-script">
194
- <param name="script">create-overview-skeleton.js</param>
195
- <param name="template">{{template_content}}</param>
196
- <param name="entity_count">{{entity_count}}</param>
197
- <param name="dependency_count">{{dependency_count}}</param>
198
- <param name="flow_count">{{flow_count}}</param>
199
- <param name="rule_count">{{rule_count}}</param>
200
- <param name="language">{{language}}</param>
201
- <output name="document_skeleton" />
202
- </task>
203
-
204
- <!-- Rule: Skeleton must be complete before filling -->
205
- <rule level="mandatory">DO NOT start filling content until the complete skeleton is verified</rule>
206
-
207
- <!-- Checkpoint: Skeleton verified -->
208
- <checkpoint name="skeleton_verified" verify="document_skeleton != null AND document_skeleton.contains('[TO BE FILLED]')" />
209
-
210
- <!-- Phase B: Content Filling -->
211
- <!-- Read Mermaid rules -->
212
- <task name="read_mermaid_rules" action="run-skill" skill="Read">
213
- <param name="file_path">speccrew-workspace/docs/rules/mermaid-rule.md</param>
214
- <output name="mermaid_rules" />
215
- </task>
216
-
217
- <!-- Fill Section 3: Business Entities -->
218
- <loop name="fill_entities" over="unique_entities" as="entity">
219
- <task name="fill_entity_row" action="run-script">
220
- <param name="script">fill-entity-row.js</param>
221
- <param name="entity">{{entity}}</param>
222
- <param name="language">{{language}}</param>
223
- <output name="entity_row" />
224
- </task>
225
- </loop>
226
-
227
- <!-- Fill Section 4: Dependencies -->
228
- <loop name="fill_dependencies" over="dependencies" as="dependency">
229
- <task name="fill_dependency_row" action="run-script">
230
- <param name="script">fill-dependency-row.js</param>
231
- <param name="dependency">{{dependency}}</param>
232
- <param name="language">{{language}}</param>
233
- <output name="dependency_row" />
234
- </task>
235
- </loop>
236
-
237
- <!-- Fill Section 5: Core Business Flows -->
238
- <loop name="fill_flows" over="core_flows" as="flow">
239
- <task name="fill_flow_item" action="run-script">
240
- <param name="script">fill-flow-item.js</param>
241
- <param name="flow">{{flow}}</param>
242
- <param name="language">{{language}}</param>
243
- <output name="flow_item" />
244
- </task>
245
- </loop>
246
-
247
- <!-- Fill Section 6: Business Rules -->
248
- <loop name="fill_rules" over="business_rules" as="rule">
249
- <task name="fill_rule_row" action="run-script">
250
- <param name="script">fill-rule-row.js</param>
251
- <param name="rule">{{rule}}</param>
252
- <param name="language">{{language}}</param>
253
- <output name="rule_row" />
254
- </task>
255
- </loop>
256
-
257
- <!-- Error Handler for document writing -->
258
- <error-handler>
259
- <try>
260
- <!-- Write final document -->
261
- <gateway name="check_existing_doc" mode="exclusive">
262
- <branch condition="initial_overview != null">
263
- <!-- Use search_replace for existing document -->
264
- <loop name="replace_sections" over="sections" as="section">
265
- <task name="replace_section" action="run-skill" skill="search_replace">
266
- <param name="file_path">{{module_path}}/{{module_name}}-overview.md</param>
267
- <param name="section">{{section}}</param>
268
- </task>
269
- </loop>
270
- </branch>
271
- <branch condition="initial_overview == null">
272
- <!-- Create new document -->
273
- <task name="write_overview" action="run-skill" skill="Write">
274
- <param name="file_path">{{module_path}}/{{module_name}}-overview.md</param>
275
- <param name="content">{{document_skeleton}}</param>
276
- </task>
277
- </branch>
278
- </gateway>
279
- </try>
280
- <catch error="write_error">
281
- <event action="log" level="error">Failed to write overview document: {{write_error.message}}</event>
282
- <output name="status" from="failed" />
283
- </catch>
284
- <finally>
285
- <event action="log" level="info">Document write operation completed</event>
286
- </finally>
287
- </error-handler>
288
-
289
- <!-- Rule: Content language constraint -->
290
- <rule level="mandatory">ALL generated content MUST be in the language specified by the language parameter</rule>
291
-
292
- <!-- Rule: Forbidden operations -->
293
- <rule level="forbidden">FORBIDDEN: create_file for overview document rewrite - use search_replace instead</rule>
294
- <rule level="forbidden">FORBIDDEN: Full-file rewrite - always use targeted search_replace on specific sections</rule>
295
-
296
- <!-- Checkpoint: Document generated -->
297
- <checkpoint name="document_generated" verify="output_file_exists == true" />
199
+ <sequence id="S5" name="Step 5: Generate Overview" status="pending" desc="Generate complete module overview">
200
+ <!-- Phase A: Skeleton Construction -->
201
+ <block type="task" id="B5a" action="analyze" desc="Count entities">
202
+ <field name="items" value="${unique_entities}"/>
203
+ <field name="output" var="entity_count"/>
204
+ </block>
205
+
206
+ <block type="task" id="B5b" action="analyze" desc="Count dependencies">
207
+ <field name="items" value="${dependencies}"/>
208
+ <field name="output" var="dependency_count"/>
209
+ </block>
210
+
211
+ <block type="task" id="B5c" action="analyze" desc="Count flows">
212
+ <field name="features" value="${feature_contents}"/>
213
+ <field name="output" var="flow_count"/>
214
+ </block>
215
+
216
+ <block type="task" id="B5d" action="analyze" desc="Count rules">
217
+ <field name="items" value="${business_rules}"/>
218
+ <field name="output" var="rule_count"/>
219
+ </block>
220
+
221
+ <!-- Create skeleton structure -->
222
+ <block type="task" id="B5e" action="analyze" desc="Create skeleton">
223
+ <field name="template" value="${template_content}"/>
224
+ <field name="entity_count" value="${entity_count}"/>
225
+ <field name="dependency_count" value="${dependency_count}"/>
226
+ <field name="flow_count" value="${flow_count}"/>
227
+ <field name="rule_count" value="${rule_count}"/>
228
+ <field name="language" value="${language}"/>
229
+ <field name="output" var="document_skeleton"/>
230
+ </block>
231
+
232
+ <!-- Rule: Skeleton must be complete before filling -->
233
+ <block type="rule" id="R1" level="mandatory" desc="Skeleton first">
234
+ <field name="text">DO NOT start filling content until the complete skeleton is verified</field>
235
+ </block>
236
+
237
+ <!-- Checkpoint: Skeleton verified -->
238
+ <block type="checkpoint" id="CP5a" name="skeleton_verified" desc="Skeleton verified checkpoint">
239
+ <field name="verify" value="${document_skeleton} != null AND ${document_skeleton}.contains('[TO BE FILLED]')"/>
240
+ </block>
241
+
242
+ <!-- Phase B: Content Filling -->
243
+ <!-- Read Mermaid rules -->
244
+ <block type="task" id="B5f" action="read-file" desc="Read Mermaid rules">
245
+ <field name="path" value="speccrew-workspace/docs/rules/mermaid-rule.md"/>
246
+ <field name="output" var="mermaid_rules"/>
247
+ </block>
248
+
249
+ <!-- Fill Section 3: Business Entities -->
250
+ <block type="loop" id="L5a" over="${unique_entities}" as="entity" desc="Fill entity rows">
251
+ <block type="task" id="B5g" action="analyze" desc="Fill entity row">
252
+ <field name="entity" value="${entity}"/>
253
+ <field name="language" value="${language}"/>
254
+ <field name="output" var="entity_row"/>
255
+ </block>
256
+ </block>
257
+
258
+ <!-- Fill Section 4: Dependencies -->
259
+ <block type="loop" id="L5b" over="${dependencies}" as="dependency" desc="Fill dependency rows">
260
+ <block type="task" id="B5h" action="analyze" desc="Fill dependency row">
261
+ <field name="dependency" value="${dependency}"/>
262
+ <field name="language" value="${language}"/>
263
+ <field name="output" var="dependency_row"/>
264
+ </block>
265
+ </block>
266
+
267
+ <!-- Fill Section 5: Core Business Flows -->
268
+ <block type="loop" id="L5c" over="${core_flows}" as="flow" desc="Fill flow items">
269
+ <block type="task" id="B5i" action="analyze" desc="Fill flow item">
270
+ <field name="flow" value="${flow}"/>
271
+ <field name="language" value="${language}"/>
272
+ <field name="output" var="flow_item"/>
273
+ </block>
274
+ </block>
275
+
276
+ <!-- Fill Section 6: Business Rules -->
277
+ <block type="loop" id="L5d" over="${business_rules}" as="rule" desc="Fill rule rows">
278
+ <block type="task" id="B5j" action="analyze" desc="Fill rule row">
279
+ <field name="rule" value="${rule}"/>
280
+ <field name="language" value="${language}"/>
281
+ <field name="output" var="rule_row"/>
282
+ </block>
283
+ </block>
284
+
285
+ <!-- Error Handler for document writing -->
286
+ <block type="error-handler" id="EH1" desc="Handle document writing errors">
287
+ <try>
288
+ <!-- Write final document -->
289
+ <block type="gateway" id="G5" mode="exclusive" desc="Check existing document">
290
+ <branch test="${initial_overview} != null" name="Existing document">
291
+ <!-- Use search_replace for existing document -->
292
+ <block type="loop" id="L5e" over="${sections}" as="section" desc="Replace sections">
293
+ <block type="task" id="B5k" action="run-skill" desc="Replace section">
294
+ <field name="skill" value="search_replace"/>
295
+ <field name="file_path" value="${module_path}/${module_name}-overview.md"/>
296
+ <field name="section" value="${section}"/>
297
+ </block>
298
+ </block>
299
+ </branch>
300
+ <branch test="${initial_overview} == null" name="New document">
301
+ <!-- Create new document -->
302
+ <block type="task" id="B5l" action="write-file" desc="Write overview">
303
+ <field name="path" value="${module_path}/${module_name}-overview.md"/>
304
+ <field name="content" value="${document_skeleton}"/>
305
+ </block>
306
+ </branch>
307
+ </block>
308
+ </try>
309
+ <catch error-type="write_error">
310
+ <block type="event" id="EH1-E1" action="log" level="error" desc="Write error">
311
+ Failed to write overview document: ${write_error.message}
312
+ </block>
313
+ <field name="status" value="failed"/>
314
+ </catch>
315
+ <finally>
316
+ <block type="event" id="EH1-E2" action="log" level="info" desc="Write completed">
317
+ Document write operation completed
318
+ </block>
319
+ </finally>
320
+ </block>
321
+
322
+ <!-- Rule: Content language constraint -->
323
+ <block type="rule" id="R2" level="mandatory" desc="Language constraint">
324
+ <field name="text">ALL generated content MUST be in the language specified by the language parameter</field>
325
+ </block>
326
+
327
+ <!-- Rule: Forbidden operations -->
328
+ <block type="rule" id="R3" level="forbidden" desc="No create_file for rewrite">
329
+ <field name="text">FORBIDDEN: create_file for overview document rewrite - use search_replace instead</field>
330
+ </block>
331
+ <block type="rule" id="R4" level="forbidden" desc="No full-file rewrite">
332
+ <field name="text">FORBIDDEN: Full-file rewrite - always use targeted search_replace on specific sections</field>
333
+ </block>
334
+
335
+ <!-- Checkpoint: Document generated -->
336
+ <block type="checkpoint" id="CP5b" name="document_generated" desc="Document generated checkpoint">
337
+ <field name="verify" value="${output_file_exists} == true"/>
338
+ </block>
339
+ </sequence>
298
340
 
299
341
  <!-- Step 6: Report Results -->
300
- <task name="generate_report" action="run-script">
301
- <param name="script">generate-report.js</param>
302
- <param name="module_name">{{module_name}}</param>
303
- <param name="feature_count">{{feature_files.length}}</param>
304
- <param name="entity_count">{{unique_entities.length}}</param>
305
- <param name="dependency_count">{{dependencies.length}}</param>
306
- <param name="rule_count">{{business_rules.length}}</param>
307
- <output name="completion_report" />
308
- </task>
309
-
310
- <!-- Event: Log completion -->
311
- <event action="log" level="info">
312
- Module summarization completed:
313
- - Module: {{module_name}}
314
- - Features Processed: {{feature_files.length}}
315
- - Entities Extracted: {{unique_entities.length}}
316
- - Dependencies Identified: {{dependencies.length}}
317
- - Business Rules Summarized: {{business_rules.length}}
318
- - Output: {{module_name}}-overview.md (complete)
319
- - Status: success
320
- </event>
342
+ <sequence id="S6" name="Step 6: Report Results" status="pending" desc="Generate completion report">
343
+ <block type="task" id="B6" action="analyze" desc="Generate report">
344
+ <field name="module_name" value="${module_name}"/>
345
+ <field name="feature_count" value="${feature_files.length}"/>
346
+ <field name="entity_count" value="${unique_entities.length}"/>
347
+ <field name="dependency_count" value="${dependencies.length}"/>
348
+ <field name="rule_count" value="${business_rules.length}"/>
349
+ <field name="output" var="completion_report"/>
350
+ </block>
351
+
352
+ <!-- Event: Log completion -->
353
+ <block type="event" id="E6" action="log" level="info" desc="Log completion">
354
+ Module summarization completed:
355
+ - Module: ${module_name}
356
+ - Features Processed: ${feature_files.length}
357
+ - Entities Extracted: ${unique_entities.length}
358
+ - Dependencies Identified: ${dependencies.length}
359
+ - Business Rules Summarized: ${business_rules.length}
360
+ - Output: ${module_name}-overview.md (complete)
361
+ - Status: success
362
+ </block>
363
+ </sequence>
321
364
 
322
365
  <!-- Output Block: Define workflow outputs -->
323
- <output name="status" from="success" />
324
- <output name="module_name" from="module_name" />
325
- <output name="output_file" from="{{module_name}}-overview.md" />
326
- <output name="message" from="Module summarization completed with {{feature_files.length}} features processed" />
366
+ <block type="output" id="O1" desc="Module summarize output results">
367
+ <field name="status" value="success"/>
368
+ <field name="module_name" from="${module_name}"/>
369
+ <field name="output_file" from="${module_name}-overview.md"/>
370
+ <field name="message" value="Module summarization completed with ${feature_files.length} features processed"/>
371
+ </block>
372
+
327
373
  </workflow>
328
374
 
329
375
  ## Constraints