speccrew 0.6.28 → 0.6.30
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/agents/speccrew-team-leader-xml.md +415 -0
- package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +18 -3
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze-xml/SKILL.md +643 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-graph-xml/SKILL.md +523 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch-xml/SKILL.md +986 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-identify-entries-xml/SKILL.md +288 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze-xml/SKILL.md +524 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-graph-xml/SKILL.md +343 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract-xml/SKILL.md +385 -0
- package/.speccrew/skills/speccrew-knowledge-module-summarize-xml/SKILL.md +473 -0
- package/.speccrew/skills/speccrew-knowledge-system-summarize-xml/SKILL.md +572 -0
- package/package.json +1 -1
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: speccrew-knowledge-system-summarize-xml
|
|
3
|
+
description: Generate complete system-overview.md by reading all {{module_name}}-overview.md files using XML workflow blocks. Aggregates module information, builds dependency graph, and creates system-level documentation.
|
|
4
|
+
tools: Read, Write, Glob, Skill
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# System Summarize - Complete System Overview (XML Workflow)
|
|
8
|
+
|
|
9
|
+
Read all {{module_name}}-overview.md files, aggregate information to generate complete system-overview.md with module index, topology, and business flows.
|
|
10
|
+
|
|
11
|
+
## Language Adaptation
|
|
12
|
+
|
|
13
|
+
**CRITICAL**: Generate all content in the language specified by the `language` parameter.
|
|
14
|
+
|
|
15
|
+
- `language: "zh"` → Generate all content in 中文
|
|
16
|
+
- `language: "en"` → Generate all content in English
|
|
17
|
+
- Other languages → Use the specified language
|
|
18
|
+
|
|
19
|
+
**All output content (system description, module summaries, flow descriptions) must be in the target language only.**
|
|
20
|
+
|
|
21
|
+
## Trigger Scenarios
|
|
22
|
+
|
|
23
|
+
- "Generate system overview from modules"
|
|
24
|
+
- "Complete system documentation"
|
|
25
|
+
- "Summarize all modules into system view"
|
|
26
|
+
|
|
27
|
+
## User
|
|
28
|
+
|
|
29
|
+
Worker Agent (speccrew-task-worker)
|
|
30
|
+
|
|
31
|
+
## Input
|
|
32
|
+
|
|
33
|
+
| Parameter | Type | Required | Description |
|
|
34
|
+
|-----------|------|----------|-------------|
|
|
35
|
+
| `modules_path` | string | Yes | Path to modules directory (e.g., `speccrew-workspace/knowledges/bizs/`) containing all {{platform_type}}/{{module_name}}/{{module_name}}-overview.md files |
|
|
36
|
+
| `output_path` | string | Yes | Output path for system-overview.md (e.g., `speccrew-workspace/knowledges/bizs/`) |
|
|
37
|
+
| `language` | string | Yes | Target language for generated content (e.g., "zh", "en") |
|
|
38
|
+
|
|
39
|
+
## Output
|
|
40
|
+
|
|
41
|
+
| Output | Path | Description |
|
|
42
|
+
|--------|------|-------------|
|
|
43
|
+
| `system-overview.md` | `{{output_path}}/system-overview.md` | Complete system overview. Example: `speccrew-workspace/knowledges/bizs/system-overview.md` |
|
|
44
|
+
|
|
45
|
+
## Workflow
|
|
46
|
+
|
|
47
|
+
```mermaid
|
|
48
|
+
flowchart TD
|
|
49
|
+
Start([Start]) --> Step0[Step 0: Read System Overview Template]
|
|
50
|
+
Step0 --> Step1[Step 1: Discover All Modules]
|
|
51
|
+
Step1 --> Step2[Step 2: Read All Module Overviews]
|
|
52
|
+
Step2 --> Step3[Step 3: Build Module Index]
|
|
53
|
+
Step3 --> Step4[Step 4: Build Dependency Graph]
|
|
54
|
+
Step4 --> Step5[Step 5: Identify Business Domains]
|
|
55
|
+
Step5 --> Step6[Step 6: Identify End-to-End Flows]
|
|
56
|
+
Step6 --> Step7[Step 7: Generate system-overview.md]
|
|
57
|
+
Step7 --> Step8[Step 8: Report Results]
|
|
58
|
+
Step8 --> End([End])
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
<!--
|
|
62
|
+
== Block Types ==
|
|
63
|
+
input : Workflow input parameters (required=mandatory, default=default value)
|
|
64
|
+
output : Workflow output results (from=data source variable)
|
|
65
|
+
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
66
|
+
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
67
|
+
loop : Iterate over collection (over=collection, as=current item)
|
|
68
|
+
event : Log/confirm/signal (action: log | confirm | signal)
|
|
69
|
+
error-handler : Exception handling (try > catch > finally)
|
|
70
|
+
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
71
|
+
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
72
|
+
-->
|
|
73
|
+
|
|
74
|
+
<workflow>
|
|
75
|
+
<!-- Input Block: Define workflow inputs -->
|
|
76
|
+
<input name="modules_path" type="string" required="true" />
|
|
77
|
+
<input name="output_path" type="string" required="true" />
|
|
78
|
+
<input name="language" type="string" required="true" />
|
|
79
|
+
|
|
80
|
+
<!-- Prerequisites Verification -->
|
|
81
|
+
<event action="log" level="info">Starting system summarization workflow</event>
|
|
82
|
+
|
|
83
|
+
<!-- Edge Case Rules -->
|
|
84
|
+
<rule level="note">Empty modules directory: Generate skeleton with warning status if no *-overview.md files found</rule>
|
|
85
|
+
<rule level="note">Incomplete module overviews: Use available data and mark gaps with <!-- DATA INCOMPLETE --></rule>
|
|
86
|
+
<rule level="note">Same module name from different platforms: Treat as separate modules with platform annotation</rule>
|
|
87
|
+
|
|
88
|
+
<!-- Step 0: Read System Overview Template -->
|
|
89
|
+
<task name="read_template" action="run-skill" skill="Read">
|
|
90
|
+
<param name="file_path">../speccrew-knowledge-system-summarize/templates/SYSTEM-OVERVIEW-TEMPLATE.md</param>
|
|
91
|
+
<output name="template_content" />
|
|
92
|
+
</task>
|
|
93
|
+
|
|
94
|
+
<!-- Checkpoint: Template loaded -->
|
|
95
|
+
<checkpoint name="template_loaded" verify="template_content != null" />
|
|
96
|
+
|
|
97
|
+
<!-- Step 1: Discover All Modules -->
|
|
98
|
+
<task name="discover_modules" action="run-skill" skill="Glob">
|
|
99
|
+
<param name="pattern">{{modules_path}}/**/*-overview.md</param>
|
|
100
|
+
<output name="module_files" />
|
|
101
|
+
</task>
|
|
102
|
+
|
|
103
|
+
<!-- Gateway: Handle empty modules directory -->
|
|
104
|
+
<gateway name="check_modules" mode="exclusive">
|
|
105
|
+
<branch condition="module_files.length == 0">
|
|
106
|
+
<event action="log" level="warning">No module overview files found in {{modules_path}}</event>
|
|
107
|
+
<task name="generate_skeleton" action="run-script">
|
|
108
|
+
<param name="script">generate-skeleton.js</param>
|
|
109
|
+
<param name="template">{{template_content}}</param>
|
|
110
|
+
<output name="skeleton_doc" />
|
|
111
|
+
</task>
|
|
112
|
+
<task name="write_skeleton" action="run-skill" skill="Write">
|
|
113
|
+
<param name="file_path">{{output_path}}/system-overview.md</param>
|
|
114
|
+
<param name="content">{{skeleton_doc}}</param>
|
|
115
|
+
</task>
|
|
116
|
+
<output name="status" from="warning" />
|
|
117
|
+
<event action="signal">workflow_complete_with_warning</event>
|
|
118
|
+
</branch>
|
|
119
|
+
<branch condition="module_files.length > 0">
|
|
120
|
+
<event action="log" level="info">Discovered {{module_files.length}} module overview files</event>
|
|
121
|
+
</branch>
|
|
122
|
+
</gateway>
|
|
123
|
+
|
|
124
|
+
<!-- Extract platform types from paths -->
|
|
125
|
+
<loop name="extract_platforms" over="module_files" as="module_file">
|
|
126
|
+
<task name="parse_platform" action="run-script">
|
|
127
|
+
<param name="script">extract-platform.js</param>
|
|
128
|
+
<param name="file_path">{{module_file}}</param>
|
|
129
|
+
<output name="platform_info" />
|
|
130
|
+
</task>
|
|
131
|
+
</loop>
|
|
132
|
+
|
|
133
|
+
<!-- Checkpoint: Modules discovered -->
|
|
134
|
+
<checkpoint name="modules_discovered" verify="module_files.length > 0" />
|
|
135
|
+
|
|
136
|
+
<!-- Step 2: Read All Module Overviews -->
|
|
137
|
+
<loop name="read_modules" over="module_files" as="module_file">
|
|
138
|
+
<task name="read_module" action="run-skill" skill="Read">
|
|
139
|
+
<param name="file_path">{{module_file}}</param>
|
|
140
|
+
<output name="module_content" />
|
|
141
|
+
</task>
|
|
142
|
+
<task name="extract_module_info" action="run-script">
|
|
143
|
+
<param name="script">extract-module-info.js</param>
|
|
144
|
+
<param name="content">{{module_content}}</param>
|
|
145
|
+
<param name="file_path">{{module_file}}</param>
|
|
146
|
+
<output name="module_info" />
|
|
147
|
+
</task>
|
|
148
|
+
</loop>
|
|
149
|
+
|
|
150
|
+
<!-- Checkpoint: Module info extracted -->
|
|
151
|
+
<checkpoint name="modules_read" verify="module_infos.length == module_files.length" />
|
|
152
|
+
|
|
153
|
+
<!-- Step 3: Build Module Index -->
|
|
154
|
+
<task name="build_index" action="run-script">
|
|
155
|
+
<param name="script">build-module-index.js</param>
|
|
156
|
+
<param name="modules">{{module_infos}}</param>
|
|
157
|
+
<output name="module_index" />
|
|
158
|
+
</task>
|
|
159
|
+
|
|
160
|
+
<!-- Create index table rows -->
|
|
161
|
+
<loop name="create_index_rows" over="module_infos" as="module_info">
|
|
162
|
+
<task name="create_index_row" action="run-script">
|
|
163
|
+
<param name="script">create-index-row.js</param>
|
|
164
|
+
<param name="module">{{module_info}}</param>
|
|
165
|
+
<param name="language">{{language}}</param>
|
|
166
|
+
<output name="index_row" />
|
|
167
|
+
</task>
|
|
168
|
+
</loop>
|
|
169
|
+
|
|
170
|
+
<!-- Checkpoint: Index built -->
|
|
171
|
+
<checkpoint name="index_built" verify="module_index != null" />
|
|
172
|
+
|
|
173
|
+
<!-- Step 4: Build Dependency Graph -->
|
|
174
|
+
<task name="extract_dependencies" action="run-script">
|
|
175
|
+
<param name="script">extract-all-dependencies.js</param>
|
|
176
|
+
<param name="modules">{{module_infos}}</param>
|
|
177
|
+
<output name="all_dependencies" />
|
|
178
|
+
</task>
|
|
179
|
+
|
|
180
|
+
<!-- Classify dependencies -->
|
|
181
|
+
<loop name="classify_dependencies" over="all_dependencies" as="dependency">
|
|
182
|
+
<gateway name="dep_type" mode="exclusive">
|
|
183
|
+
<branch condition="dependency.type == 'internal'">
|
|
184
|
+
<output name="internal_deps" append="{{dependency}}" />
|
|
185
|
+
</branch>
|
|
186
|
+
<branch condition="dependency.type == 'external'">
|
|
187
|
+
<output name="external_deps" append="{{dependency}}" />
|
|
188
|
+
</branch>
|
|
189
|
+
<branch condition="dependency.type == 'cross_platform'">
|
|
190
|
+
<output name="cross_platform_deps" append="{{dependency}}" />
|
|
191
|
+
</branch>
|
|
192
|
+
</gateway>
|
|
193
|
+
</loop>
|
|
194
|
+
|
|
195
|
+
<!-- Build directed graph -->
|
|
196
|
+
<task name="build_dependency_graph" action="run-script">
|
|
197
|
+
<param name="script">build-dep-graph.js</param>
|
|
198
|
+
<param name="internal_deps">{{internal_deps}}</param>
|
|
199
|
+
<param name="cross_platform_deps">{{cross_platform_deps}}</param>
|
|
200
|
+
<output name="dependency_graph" />
|
|
201
|
+
</task>
|
|
202
|
+
|
|
203
|
+
<!-- Generate Mermaid diagram -->
|
|
204
|
+
<task name="generate_mermaid_deps" action="run-script">
|
|
205
|
+
<param name="script">generate-mermaid-diagram.js</param>
|
|
206
|
+
<param name="graph">{{dependency_graph}}</param>
|
|
207
|
+
<param name="diagram_type">graph LR</param>
|
|
208
|
+
<output name="mermaid_deps" />
|
|
209
|
+
</task>
|
|
210
|
+
|
|
211
|
+
<!-- Checkpoint: Dependency graph built -->
|
|
212
|
+
<checkpoint name="deps_built" verify="dependency_graph.nodes.length > 0" />
|
|
213
|
+
|
|
214
|
+
<!-- Step 5: Identify Business Domains -->
|
|
215
|
+
<task name="extract_domains" action="run-script">
|
|
216
|
+
<param name="script">extract-domains.js</param>
|
|
217
|
+
<param name="modules">{{module_infos}}</param>
|
|
218
|
+
<output name="business_domains" />
|
|
219
|
+
</task>
|
|
220
|
+
|
|
221
|
+
<!-- Group modules by domain -->
|
|
222
|
+
<loop name="group_by_domain" over="business_domains" as="domain">
|
|
223
|
+
<task name="find_domain_modules" action="run-script">
|
|
224
|
+
<param name="script">find-domain-modules.js</param>
|
|
225
|
+
<param name="domain">{{domain}}</param>
|
|
226
|
+
<param name="modules">{{module_infos}}</param>
|
|
227
|
+
<output name="domain_modules" />
|
|
228
|
+
</task>
|
|
229
|
+
</loop>
|
|
230
|
+
|
|
231
|
+
<!-- Generate domain diagram -->
|
|
232
|
+
<task name="generate_domain_diagram" action="run-script">
|
|
233
|
+
<param name="script">generate-domain-diagram.js</param>
|
|
234
|
+
<param name="domains">{{business_domains}}</param>
|
|
235
|
+
<param name="module_groups">{{domain_module_groups}}</param>
|
|
236
|
+
<output name="domain_diagram" />
|
|
237
|
+
</task>
|
|
238
|
+
|
|
239
|
+
<!-- Checkpoint: Domains identified -->
|
|
240
|
+
<checkpoint name="domains_identified" verify="business_domains.length > 0" />
|
|
241
|
+
|
|
242
|
+
<!-- Step 6: Identify End-to-End Flows -->
|
|
243
|
+
<task name="analyze_flows" action="run-script">
|
|
244
|
+
<param name="script">analyze-cross-module-flows.js</param>
|
|
245
|
+
<param name="dependencies">{{all_dependencies}}</param>
|
|
246
|
+
<param name="modules">{{module_infos}}</param>
|
|
247
|
+
<output name="end_to_end_flows" />
|
|
248
|
+
</task>
|
|
249
|
+
|
|
250
|
+
<!-- Create flow-module mapping matrix -->
|
|
251
|
+
<loop name="build_flow_matrix" over="end_to_end_flows" as="flow">
|
|
252
|
+
<task name="map_flow_modules" action="run-script">
|
|
253
|
+
<param name="script">map-flow-modules.js</param>
|
|
254
|
+
<param name="flow">{{flow}}</param>
|
|
255
|
+
<param name="modules">{{module_infos}}</param>
|
|
256
|
+
<output name="flow_mapping" />
|
|
257
|
+
</task>
|
|
258
|
+
</loop>
|
|
259
|
+
|
|
260
|
+
<!-- Checkpoint: Flows identified -->
|
|
261
|
+
<checkpoint name="flows_identified" verify="end_to_end_flows.length >= 0" />
|
|
262
|
+
|
|
263
|
+
<!-- Step 7: Generate system-overview.md -->
|
|
264
|
+
<!-- Phase A: Skeleton Construction -->
|
|
265
|
+
<task name="count_modules" action="run-script">
|
|
266
|
+
<param name="script">count-items.js</param>
|
|
267
|
+
<param name="items">{{module_infos}}</param>
|
|
268
|
+
<output name="module_count" />
|
|
269
|
+
</task>
|
|
270
|
+
|
|
271
|
+
<task name="count_flows" action="run-script">
|
|
272
|
+
<param name="script">count-items.js</param>
|
|
273
|
+
<param name="items">{{end_to_end_flows}}</param>
|
|
274
|
+
<output name="flow_count" />
|
|
275
|
+
</task>
|
|
276
|
+
|
|
277
|
+
<task name="count_integrations" action="run-script">
|
|
278
|
+
<param name="script">count-items.js</param>
|
|
279
|
+
<param name="items">{{external_deps}}</param>
|
|
280
|
+
<output name="integration_count" />
|
|
281
|
+
</task>
|
|
282
|
+
|
|
283
|
+
<!-- Read tech stack mappings -->
|
|
284
|
+
<task name="read_tech_mappings" action="run-skill" skill="Read">
|
|
285
|
+
<param name="file_path">speccrew-workspace/docs/configs/tech-stack-mappings.json</param>
|
|
286
|
+
<output name="tech_mappings" />
|
|
287
|
+
</task>
|
|
288
|
+
|
|
289
|
+
<!-- Read Mermaid rules -->
|
|
290
|
+
<task name="read_mermaid_rules" action="run-skill" skill="Read">
|
|
291
|
+
<param name="file_path">speccrew-workspace/docs/rules/mermaid-rule.md</param>
|
|
292
|
+
<output name="mermaid_rules" />
|
|
293
|
+
</task>
|
|
294
|
+
|
|
295
|
+
<!-- Invoke speccrew-get-timestamp skill -->
|
|
296
|
+
<task name="get_timestamp" action="run-skill" skill="speccrew-get-timestamp">
|
|
297
|
+
<output name="timestamp" />
|
|
298
|
+
</task>
|
|
299
|
+
|
|
300
|
+
<!-- Gateway: Fallback for timestamp -->
|
|
301
|
+
<gateway name="check_timestamp" mode="exclusive">
|
|
302
|
+
<branch condition="timestamp == null">
|
|
303
|
+
<task name="fallback_timestamp" action="run-script">
|
|
304
|
+
<param name="script">get-system-time.js</param>
|
|
305
|
+
<output name="timestamp" />
|
|
306
|
+
</task>
|
|
307
|
+
<event action="log" level="warning">Using system fallback timestamp</event>
|
|
308
|
+
</branch>
|
|
309
|
+
</gateway>
|
|
310
|
+
|
|
311
|
+
<!-- Determine technology stack -->
|
|
312
|
+
<task name="determine_tech_stack" action="run-script">
|
|
313
|
+
<param name="script">determine-tech-stack.js</param>
|
|
314
|
+
<param name="platforms">{{extracted_platforms}}</param>
|
|
315
|
+
<param name="mappings">{{tech_mappings}}</param>
|
|
316
|
+
<output name="tech_stack" />
|
|
317
|
+
</task>
|
|
318
|
+
|
|
319
|
+
<!-- Create skeleton structure -->
|
|
320
|
+
<task name="create_skeleton" action="run-script">
|
|
321
|
+
<param name="script">create-system-skeleton.js</param>
|
|
322
|
+
<param name="template">{{template_content}}</param>
|
|
323
|
+
<param name="module_count">{{module_count}}</param>
|
|
324
|
+
<param name="flow_count">{{flow_count}}</param>
|
|
325
|
+
<param name="integration_count">{{integration_count}}</param>
|
|
326
|
+
<param name="timestamp">{{timestamp}}</param>
|
|
327
|
+
<param name="tech_stack">{{tech_stack}}</param>
|
|
328
|
+
<param name="language">{{language}}</param>
|
|
329
|
+
<output name="document_skeleton" />
|
|
330
|
+
</task>
|
|
331
|
+
|
|
332
|
+
<!-- Rule: Skeleton must be complete before filling -->
|
|
333
|
+
<rule level="mandatory">DO NOT start filling content until the complete skeleton is verified</rule>
|
|
334
|
+
|
|
335
|
+
<!-- Checkpoint: Skeleton ready -->
|
|
336
|
+
<checkpoint name="skeleton_ready" verify="document_skeleton != null AND document_skeleton.contains('[TO BE FILLED]')" />
|
|
337
|
+
|
|
338
|
+
<!-- Phase B: Content Filling -->
|
|
339
|
+
<!-- Fill Index and Overview section -->
|
|
340
|
+
<task name="fill_index_section" action="run-script">
|
|
341
|
+
<param name="script">fill-index-section.js</param>
|
|
342
|
+
<param name="skeleton">{{document_skeleton}}</param>
|
|
343
|
+
<param name="timestamp">{{timestamp}}</param>
|
|
344
|
+
<param name="tech_stack">{{tech_stack}}</param>
|
|
345
|
+
<param name="statistics">{{aggregated_stats}}</param>
|
|
346
|
+
<param name="module_index">{{module_index}}</param>
|
|
347
|
+
<output name="filled_index" />
|
|
348
|
+
</task>
|
|
349
|
+
|
|
350
|
+
<!-- Fill Section 1: System Overview -->
|
|
351
|
+
<task name="fill_system_overview" action="run-script">
|
|
352
|
+
<param name="script">fill-system-overview.js</param>
|
|
353
|
+
<param name="skeleton">{{filled_index}}</param>
|
|
354
|
+
<param name="modules">{{module_infos}}</param>
|
|
355
|
+
<param name="language">{{language}}</param>
|
|
356
|
+
<output name="filled_section1" />
|
|
357
|
+
</task>
|
|
358
|
+
|
|
359
|
+
<!-- Fill Section 2: Module Topology -->
|
|
360
|
+
<task name="fill_module_topology" action="run-script">
|
|
361
|
+
<param name="script">fill-module-topology.js</param>
|
|
362
|
+
<param name="skeleton">{{filled_section1}}</param>
|
|
363
|
+
<param name="domain_diagram">{{domain_diagram}}</param>
|
|
364
|
+
<param name="dependency_graph">{{dependency_graph}}</param>
|
|
365
|
+
<param name="mermaid_deps">{{mermaid_deps}}</param>
|
|
366
|
+
<param name="module_index">{{module_index}}</param>
|
|
367
|
+
<param name="language">{{language}}</param>
|
|
368
|
+
<output name="filled_section2" />
|
|
369
|
+
</task>
|
|
370
|
+
|
|
371
|
+
<!-- Fill Section 3: End-to-End Business Flows -->
|
|
372
|
+
<task name="fill_business_flows" action="run-script">
|
|
373
|
+
<param name="script">fill-business-flows.js</param>
|
|
374
|
+
<param name="skeleton">{{filled_section2}}</param>
|
|
375
|
+
<param name="flows">{{end_to_end_flows}}</param>
|
|
376
|
+
<param name="flow_mappings">{{flow_mappings}}</param>
|
|
377
|
+
<param name="modules">{{module_infos}}</param>
|
|
378
|
+
<param name="language">{{language}}</param>
|
|
379
|
+
<output name="filled_section3" />
|
|
380
|
+
</task>
|
|
381
|
+
|
|
382
|
+
<!-- Fill Section 4: System Boundaries and Integration -->
|
|
383
|
+
<task name="fill_system_boundaries" action="run-script">
|
|
384
|
+
<param name="script">fill-system-boundaries.js</param>
|
|
385
|
+
<param name="skeleton">{{filled_section3}}</param>
|
|
386
|
+
<param name="external_deps">{{external_deps}}</param>
|
|
387
|
+
<param name="language">{{language}}</param>
|
|
388
|
+
<output name="filled_section4" />
|
|
389
|
+
</task>
|
|
390
|
+
|
|
391
|
+
<!-- Fill Section 5: Requirement Assessment Guide -->
|
|
392
|
+
<task name="fill_assessment_guide" action="run-script">
|
|
393
|
+
<param name="script">fill-assessment-guide.js</param>
|
|
394
|
+
<param name="skeleton">{{filled_section4}}</param>
|
|
395
|
+
<param name="language">{{language}}</param>
|
|
396
|
+
<output name="filled_section5" />
|
|
397
|
+
</task>
|
|
398
|
+
|
|
399
|
+
<!-- Error Handler for document writing -->
|
|
400
|
+
<error-handler>
|
|
401
|
+
<try>
|
|
402
|
+
<!-- Step 7a: Prepare Document -->
|
|
403
|
+
<task name="write_document" action="run-skill" skill="Write">
|
|
404
|
+
<param name="file_path">{{output_path}}/system-overview.md</param>
|
|
405
|
+
<param name="content">{{filled_section5}}</param>
|
|
406
|
+
</task>
|
|
407
|
+
</try>
|
|
408
|
+
<catch error="write_error">
|
|
409
|
+
<event action="log" level="error">Failed to write system overview: {{write_error.message}}</event>
|
|
410
|
+
<output name="status" from="failed" />
|
|
411
|
+
</catch>
|
|
412
|
+
<finally>
|
|
413
|
+
<event action="log" level="info">Document write operation completed</event>
|
|
414
|
+
</finally>
|
|
415
|
+
</error-handler>
|
|
416
|
+
|
|
417
|
+
<!-- Rule: Critical constraints -->
|
|
418
|
+
<rule level="forbidden">FORBIDDEN: create_file for documents - Document MUST be created by copying template then filling with search_replace</rule>
|
|
419
|
+
<rule level="forbidden">FORBIDDEN: Full-file rewrite - Always use targeted search_replace on specific sections</rule>
|
|
420
|
+
<rule level="mandatory">MANDATORY: Template-first workflow - Step 7a MUST execute before Step 7b</rule>
|
|
421
|
+
|
|
422
|
+
<!-- Checkpoint: Document generated -->
|
|
423
|
+
<checkpoint name="document_generated" verify="output_file_exists == true" />
|
|
424
|
+
|
|
425
|
+
<!-- Step 8: Report Results -->
|
|
426
|
+
<task name="calculate_metrics" action="run-script">
|
|
427
|
+
<param name="script">calculate-metrics.js</param>
|
|
428
|
+
<param name="modules">{{module_infos}}</param>
|
|
429
|
+
<param name="platforms">{{extracted_platforms}}</param>
|
|
430
|
+
<output name="metrics" />
|
|
431
|
+
</task>
|
|
432
|
+
|
|
433
|
+
<task name="generate_report" action="run-script">
|
|
434
|
+
<param name="script">generate-system-report.js</param>
|
|
435
|
+
<param name="module_count">{{module_count}}</param>
|
|
436
|
+
<param name="entity_count">{{metrics.entity_count}}</param>
|
|
437
|
+
<param name="api_count">{{metrics.api_count}}</param>
|
|
438
|
+
<param name="dependency_count">{{all_dependencies.length}}</param>
|
|
439
|
+
<param name="flow_count">{{flow_count}}</param>
|
|
440
|
+
<output name="completion_report" />
|
|
441
|
+
</task>
|
|
442
|
+
|
|
443
|
+
<!-- Event: Log completion -->
|
|
444
|
+
<event action="log" level="info">
|
|
445
|
+
System summarization completed:
|
|
446
|
+
- Modules Processed: {{module_count}}
|
|
447
|
+
- Entities Aggregated: {{metrics.entity_count}}
|
|
448
|
+
- APIs Counted: {{metrics.api_count}}
|
|
449
|
+
- Dependencies Mapped: {{all_dependencies.length}}
|
|
450
|
+
- Business Flows Identified: {{flow_count}}
|
|
451
|
+
- Output: system-overview.md (complete)
|
|
452
|
+
- Status: success
|
|
453
|
+
</event>
|
|
454
|
+
|
|
455
|
+
<!-- Output Block: Define workflow outputs -->
|
|
456
|
+
<output name="status" from="success" />
|
|
457
|
+
<output name="output_file" from="system-overview.md" />
|
|
458
|
+
<output name="message" from="System summarization completed with {{module_count}} modules processed" />
|
|
459
|
+
</workflow>
|
|
460
|
+
|
|
461
|
+
## Constraints
|
|
462
|
+
|
|
463
|
+
### Critical Constraints
|
|
464
|
+
|
|
465
|
+
> 1. **FORBIDDEN: `create_file` for documents** — Document MUST be created by copying template (Step 7a) then filling with `search_replace` (Step 7b)
|
|
466
|
+
> 2. **FORBIDDEN: Full-file rewrite** — Always use targeted `search_replace` on specific sections
|
|
467
|
+
> 3. **MANDATORY: Template-first workflow** — Step 7a MUST execute before Step 7b
|
|
468
|
+
|
|
469
|
+
### Content Language
|
|
470
|
+
|
|
471
|
+
**IMPORTANT**: ALL generated content (system description, module summaries, flow descriptions, section headers, and narrative text) MUST be written in the language specified by the `language` parameter. Only code identifiers, file paths, and technical terms remain in their original language.
|
|
472
|
+
|
|
473
|
+
## Return Value Format
|
|
474
|
+
|
|
475
|
+
```json
|
|
476
|
+
{
|
|
477
|
+
"status": "success|failed",
|
|
478
|
+
"output_file": "system-overview.md",
|
|
479
|
+
"message": "System summarization completed with N modules processed"
|
|
480
|
+
}
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
## Task Completion Report
|
|
484
|
+
|
|
485
|
+
Upon completion, output the following structured report:
|
|
486
|
+
|
|
487
|
+
```json
|
|
488
|
+
{
|
|
489
|
+
"status": "success | partial | failed",
|
|
490
|
+
"skill": "speccrew-knowledge-system-summarize-xml",
|
|
491
|
+
"output_files": [
|
|
492
|
+
"{output_path}/system-overview.md"
|
|
493
|
+
],
|
|
494
|
+
"summary": "System overview generated from {module_count} modules across {platform_count} platforms",
|
|
495
|
+
"metrics": {
|
|
496
|
+
"platforms_covered": 0,
|
|
497
|
+
"modules_summarized": 0,
|
|
498
|
+
"system_overview_generated": true
|
|
499
|
+
},
|
|
500
|
+
"errors": [],
|
|
501
|
+
"next_steps": [
|
|
502
|
+
"Review system-overview.md for completeness",
|
|
503
|
+
"Run speccrew-pm-requirement-assess if requirement assessment is needed"
|
|
504
|
+
]
|
|
505
|
+
}
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
## Reference Guides
|
|
509
|
+
|
|
510
|
+
### Mermaid Diagram Guide
|
|
511
|
+
|
|
512
|
+
When generating Mermaid diagrams, follow these compatibility guidelines:
|
|
513
|
+
|
|
514
|
+
**Key Requirements:**
|
|
515
|
+
- Use only basic node definitions: `A[text content]`
|
|
516
|
+
- No HTML tags (e.g., `<br/>`)
|
|
517
|
+
- No nested subgraphs
|
|
518
|
+
- No `direction` keyword
|
|
519
|
+
- No `style` definitions
|
|
520
|
+
- Use standard `graph TB/LR` syntax only
|
|
521
|
+
|
|
522
|
+
**Diagram Types:**
|
|
523
|
+
|
|
524
|
+
| Diagram Type | Use Case | Example |
|
|
525
|
+
|---------|---------|------|
|
|
526
|
+
| `graph TB/LR` | System structure, module dependencies | System architecture, module dependency graph |
|
|
527
|
+
| `sequenceDiagram` | Cross-module interaction flow | User operation flow, service call chain |
|
|
528
|
+
| `flowchart TD` | Business logic, conditional branches | State transition, exception handling |
|
|
529
|
+
| `classDiagram` | Class structure, entity relationships | Data model, service interface |
|
|
530
|
+
| `erDiagram` | Database table relationships | Entity relationship diagram |
|
|
531
|
+
| `stateDiagram-v2` | State machine | Order status, approval status |
|
|
532
|
+
|
|
533
|
+
### Source Traceability Guide
|
|
534
|
+
|
|
535
|
+
Aggregate source file references from all module overview documents:
|
|
536
|
+
|
|
537
|
+
> **Note**: Use relative paths from the generated document to the source file. Do NOT use `file://` protocol.
|
|
538
|
+
|
|
539
|
+
1. **File Reference Block** (at document start):
|
|
540
|
+
```markdown
|
|
541
|
+
**Referenced Files**
|
|
542
|
+
|
|
543
|
+
- Aggregated from all module overview documents
|
|
544
|
+
- [OrderController.java](path/to/source/OrderController.java)
|
|
545
|
+
- [PaymentController.java](path/to/source/PaymentController.java)
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
2. **Diagram Source** (after each Mermaid diagram):
|
|
549
|
+
```markdown
|
|
550
|
+
**Diagram Source**
|
|
551
|
+
- Aggregated from: order-overview.md, payment-overview.md
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
3. **Section Source** (at end of document):
|
|
555
|
+
```markdown
|
|
556
|
+
**Section Source**
|
|
557
|
+
- Aggregated from all module overview documents
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
## Checklist
|
|
561
|
+
|
|
562
|
+
- [ ] All {{module_name}}-overview.md files discovered
|
|
563
|
+
- [ ] Module information extracted
|
|
564
|
+
- [ ] Source file references aggregated from module documents
|
|
565
|
+
- [ ] Module index table created
|
|
566
|
+
- [ ] Dependency graph built
|
|
567
|
+
- [ ] Business domains identified
|
|
568
|
+
- [ ] End-to-end flows mapped
|
|
569
|
+
- [ ] system-overview.md generated with all sections
|
|
570
|
+
- [ ] Source traceability information included
|
|
571
|
+
- [ ] Mermaid diagrams follow compatibility guidelines
|
|
572
|
+
- [ ] Results reported
|