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.
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze-xml/SKILL.md +495 -477
- package/.speccrew/skills/speccrew-knowledge-bizs-api-graph-xml/SKILL.md +281 -197
- package/.speccrew/skills/speccrew-knowledge-bizs-identify-entries-xml/SKILL.md +134 -144
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze-xml/SKILL.md +316 -377
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-graph-xml/SKILL.md +233 -131
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract-xml/SKILL.md +221 -209
- package/.speccrew/skills/speccrew-knowledge-module-summarize-xml/SKILL.md +291 -255
- package/.speccrew/skills/speccrew-knowledge-system-summarize-xml/SKILL.md +355 -281
- package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions-xml/SKILL.md +722 -627
- package/.speccrew/skills/speccrew-knowledge-techs-generate-xml/SKILL.md +195 -117
- package/.speccrew/skills/speccrew-knowledge-techs-index-xml/SKILL.md +151 -99
- package/.speccrew/skills/speccrew-knowledge-techs-init-xml/SKILL.md +201 -99
- package/package.json +1 -1
|
@@ -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
|
-
<!--
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
<!--
|
|
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
|
|
89
|
-
<
|
|
90
|
-
<
|
|
91
|
-
|
|
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"
|
|
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
|
|
98
|
-
<
|
|
99
|
-
<
|
|
100
|
-
|
|
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
|
|
104
|
-
<branch
|
|
105
|
-
<event action="log" level="warning"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
<
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
|
119
|
-
<event action="log" level="info"
|
|
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
|
-
</
|
|
150
|
+
</block>
|
|
122
151
|
|
|
123
152
|
<!-- Extract platform types from paths -->
|
|
124
|
-
<loop
|
|
125
|
-
<task
|
|
126
|
-
<
|
|
127
|
-
<
|
|
128
|
-
<
|
|
129
|
-
</
|
|
130
|
-
</
|
|
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"
|
|
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
|
|
137
|
-
<task
|
|
138
|
-
<
|
|
139
|
-
<
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
<
|
|
144
|
-
<
|
|
145
|
-
<
|
|
146
|
-
|
|
147
|
-
|
|
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"
|
|
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
|
|
154
|
-
<
|
|
155
|
-
<
|
|
156
|
-
<
|
|
157
|
-
</
|
|
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
|
|
161
|
-
<task
|
|
162
|
-
<
|
|
163
|
-
<
|
|
164
|
-
<
|
|
165
|
-
<
|
|
166
|
-
</
|
|
167
|
-
</
|
|
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"
|
|
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
|
|
174
|
-
<
|
|
175
|
-
<
|
|
176
|
-
<
|
|
177
|
-
</
|
|
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
|
|
181
|
-
<gateway
|
|
182
|
-
<branch
|
|
183
|
-
<output
|
|
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
|
|
186
|
-
<output
|
|
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
|
|
189
|
-
<output
|
|
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
|
-
</
|
|
192
|
-
</
|
|
233
|
+
</block>
|
|
234
|
+
</block>
|
|
193
235
|
|
|
194
236
|
<!-- Build directed graph -->
|
|
195
|
-
<task
|
|
196
|
-
<
|
|
197
|
-
<
|
|
198
|
-
<
|
|
199
|
-
<
|
|
200
|
-
</
|
|
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
|
|
204
|
-
<
|
|
205
|
-
<
|
|
206
|
-
<
|
|
207
|
-
<
|
|
208
|
-
</
|
|
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"
|
|
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
|
|
215
|
-
<
|
|
216
|
-
<
|
|
217
|
-
<
|
|
218
|
-
</
|
|
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
|
|
222
|
-
<task
|
|
223
|
-
<
|
|
224
|
-
<
|
|
225
|
-
<
|
|
226
|
-
<
|
|
227
|
-
</
|
|
228
|
-
</
|
|
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
|
|
232
|
-
<
|
|
233
|
-
<
|
|
234
|
-
<
|
|
235
|
-
<
|
|
236
|
-
</
|
|
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"
|
|
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
|
|
243
|
-
<
|
|
244
|
-
<
|
|
245
|
-
<
|
|
246
|
-
<
|
|
247
|
-
</
|
|
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
|
|
251
|
-
<task
|
|
252
|
-
<
|
|
253
|
-
<
|
|
254
|
-
<
|
|
255
|
-
<
|
|
256
|
-
</
|
|
257
|
-
</
|
|
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"
|
|
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
|
|
265
|
-
<
|
|
266
|
-
<
|
|
267
|
-
<
|
|
268
|
-
</
|
|
269
|
-
|
|
270
|
-
<task
|
|
271
|
-
<
|
|
272
|
-
<
|
|
273
|
-
<
|
|
274
|
-
</
|
|
275
|
-
|
|
276
|
-
<task
|
|
277
|
-
<
|
|
278
|
-
<
|
|
279
|
-
<
|
|
280
|
-
</
|
|
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
|
|
284
|
-
<
|
|
285
|
-
<
|
|
286
|
-
|
|
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
|
|
290
|
-
<
|
|
291
|
-
<
|
|
292
|
-
|
|
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
|
|
296
|
-
<
|
|
297
|
-
|
|
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
|
|
301
|
-
<branch
|
|
302
|
-
<task
|
|
303
|
-
<
|
|
304
|
-
<
|
|
305
|
-
</
|
|
306
|
-
<event action="log" level="warning"
|
|
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
|
-
</
|
|
361
|
+
</block>
|
|
309
362
|
|
|
310
363
|
<!-- Determine technology stack -->
|
|
311
|
-
<task
|
|
312
|
-
<
|
|
313
|
-
<
|
|
314
|
-
<
|
|
315
|
-
<
|
|
316
|
-
</
|
|
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
|
|
320
|
-
<
|
|
321
|
-
<
|
|
322
|
-
<
|
|
323
|
-
<
|
|
324
|
-
<
|
|
325
|
-
<
|
|
326
|
-
<
|
|
327
|
-
<
|
|
328
|
-
<
|
|
329
|
-
</
|
|
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"
|
|
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"
|
|
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
|
|
340
|
-
<
|
|
341
|
-
<
|
|
342
|
-
<
|
|
343
|
-
<
|
|
344
|
-
<
|
|
345
|
-
<
|
|
346
|
-
<
|
|
347
|
-
</
|
|
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
|
|
351
|
-
<
|
|
352
|
-
<
|
|
353
|
-
<
|
|
354
|
-
<
|
|
355
|
-
<
|
|
356
|
-
</
|
|
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
|
|
360
|
-
<
|
|
361
|
-
<
|
|
362
|
-
<
|
|
363
|
-
<
|
|
364
|
-
<
|
|
365
|
-
<
|
|
366
|
-
<
|
|
367
|
-
<
|
|
368
|
-
</
|
|
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
|
|
372
|
-
<
|
|
373
|
-
<
|
|
374
|
-
<
|
|
375
|
-
<
|
|
376
|
-
<
|
|
377
|
-
<
|
|
378
|
-
<
|
|
379
|
-
</
|
|
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
|
|
383
|
-
<
|
|
384
|
-
<
|
|
385
|
-
<
|
|
386
|
-
<
|
|
387
|
-
<
|
|
388
|
-
</
|
|
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
|
|
392
|
-
<
|
|
393
|
-
<
|
|
394
|
-
<
|
|
395
|
-
<
|
|
396
|
-
</
|
|
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
|
|
403
|
-
<
|
|
404
|
-
<
|
|
405
|
-
|
|
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"
|
|
409
|
-
|
|
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"
|
|
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
|
-
</
|
|
478
|
+
</block>
|
|
415
479
|
|
|
416
480
|
<!-- Rule: Critical constraints -->
|
|
417
|
-
<rule level="forbidden"
|
|
418
|
-
|
|
419
|
-
|
|
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"
|
|
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
|
|
426
|
-
<
|
|
427
|
-
<
|
|
428
|
-
<
|
|
429
|
-
<
|
|
430
|
-
</
|
|
431
|
-
|
|
432
|
-
<task
|
|
433
|
-
<
|
|
434
|
-
<
|
|
435
|
-
<
|
|
436
|
-
<
|
|
437
|
-
<
|
|
438
|
-
<
|
|
439
|
-
<
|
|
440
|
-
</
|
|
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: {
|
|
446
|
-
- Entities Aggregated: {
|
|
447
|
-
- APIs Counted: {
|
|
448
|
-
- Dependencies Mapped: {
|
|
449
|
-
- Business Flows Identified: {
|
|
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
|
-
</
|
|
524
|
+
</block>
|
|
453
525
|
|
|
454
526
|
<!-- Output Block: Define workflow outputs -->
|
|
455
|
-
<output
|
|
456
|
-
|
|
457
|
-
|
|
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
|