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,473 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: speccrew-knowledge-module-summarize-xml
|
|
3
|
+
description: Summarize a module's features to complete MODULE-OVERVIEW.md using XML workflow blocks. Reads all FEATURE-DETAIL.md files of a module and generates the complete module overview with entities, dependencies, and business rules.
|
|
4
|
+
tools: Read, Write, Glob
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Module Summarize - Complete Module Overview (XML Workflow)
|
|
8
|
+
|
|
9
|
+
Read all {{feature_name}}.md files of a specific module, extract and summarize information to complete {{module_name}}-overview.md (full version with entities, dependencies, flows, and rules).
|
|
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 (entity names, descriptions, business rules, flow descriptions) must be in the target language only.**
|
|
20
|
+
|
|
21
|
+
## Trigger Scenarios
|
|
22
|
+
|
|
23
|
+
- "Summarize module {name} features"
|
|
24
|
+
- "Complete module overview for {name}"
|
|
25
|
+
- "Finalize module documentation for {name}"
|
|
26
|
+
|
|
27
|
+
## Input
|
|
28
|
+
|
|
29
|
+
| Parameter | Type | Required | Description |
|
|
30
|
+
|-----------|------|----------|-------------|
|
|
31
|
+
| `module_name` | string | Yes | Module name to summarize |
|
|
32
|
+
| `module_path` | string | Yes | Path to module directory (e.g., `speccrew-workspace/knowledges/bizs/{{platform_type}}/{{module_name}}/`) containing: {{module_name}}-overview.md (initial version), features/{{feature_name}}.md files |
|
|
33
|
+
| `language` | string | Yes | Target language for generated content (e.g., "zh", "en") |
|
|
34
|
+
|
|
35
|
+
## Output
|
|
36
|
+
|
|
37
|
+
| Output | Path | Description |
|
|
38
|
+
|--------|------|-------------|
|
|
39
|
+
| `{{module_name}}-overview.md` | `{{module_path}}/{{module_name}}-overview.md` | Complete module overview (overwritten). Example: `speccrew-workspace/knowledges/bizs/backend-ai/chat/chat-overview.md` |
|
|
40
|
+
|
|
41
|
+
## Workflow
|
|
42
|
+
|
|
43
|
+
```mermaid
|
|
44
|
+
flowchart TD
|
|
45
|
+
Start([Start]) --> Step1[Step 1: Read Prerequisites]
|
|
46
|
+
Step1 --> Step2[Step 2: Extract Entities]
|
|
47
|
+
Step2 --> Step3[Step 3: Identify Dependencies]
|
|
48
|
+
Step3 --> Step4[Step 4: Summarize Business Rules]
|
|
49
|
+
Step4 --> Step5[Step 5: Generate Complete MODULE-OVERVIEW.md]
|
|
50
|
+
Step5 --> Step6[Step 6: Report Results]
|
|
51
|
+
Step6 --> End([End])
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
<!--
|
|
55
|
+
== Block Types ==
|
|
56
|
+
input : Workflow input parameters (required=mandatory, default=default value)
|
|
57
|
+
output : Workflow output results (from=data source variable)
|
|
58
|
+
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
59
|
+
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
60
|
+
loop : Iterate over collection (over=collection, as=current item)
|
|
61
|
+
event : Log/confirm/signal (action: log | confirm | signal)
|
|
62
|
+
error-handler : Exception handling (try > catch > finally)
|
|
63
|
+
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
64
|
+
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
65
|
+
-->
|
|
66
|
+
|
|
67
|
+
<workflow>
|
|
68
|
+
<!-- Input Block: Define workflow inputs -->
|
|
69
|
+
<input name="module_name" type="string" required="true" />
|
|
70
|
+
<input name="module_path" type="string" required="true" />
|
|
71
|
+
<input name="language" type="string" required="true" />
|
|
72
|
+
|
|
73
|
+
<!-- Step 1: Read Prerequisites -->
|
|
74
|
+
<task name="read_template" action="run-skill" skill="Read">
|
|
75
|
+
<param name="file_path">../speccrew-knowledge-module-summarize/templates/MODULE-OVERVIEW-TEMPLATE.md</param>
|
|
76
|
+
<output name="template_content" />
|
|
77
|
+
</task>
|
|
78
|
+
|
|
79
|
+
<task name="read_initial_overview" action="run-skill" skill="Read">
|
|
80
|
+
<param name="file_path">{{module_path}}/{{module_name}}-overview.md</param>
|
|
81
|
+
<output name="initial_overview" />
|
|
82
|
+
</task>
|
|
83
|
+
|
|
84
|
+
<task name="discover_features" action="run-skill" skill="Glob">
|
|
85
|
+
<param name="pattern">{{module_path}}/features/*.md</param>
|
|
86
|
+
<output name="feature_files" />
|
|
87
|
+
</task>
|
|
88
|
+
|
|
89
|
+
<!-- Loop: Read all feature detail files -->
|
|
90
|
+
<loop name="read_features" over="feature_files" as="feature_file">
|
|
91
|
+
<task name="read_feature" action="run-skill" skill="Read">
|
|
92
|
+
<param name="file_path">{{feature_file}}</param>
|
|
93
|
+
<output name="feature_content" />
|
|
94
|
+
</task>
|
|
95
|
+
</loop>
|
|
96
|
+
|
|
97
|
+
<!-- Checkpoint: Verify prerequisites loaded -->
|
|
98
|
+
<checkpoint name="prerequisites_loaded" verify="template_content != null AND feature_files != null" />
|
|
99
|
+
|
|
100
|
+
<!-- Gateway: Handle edge case - no features found -->
|
|
101
|
+
<gateway name="check_features" mode="exclusive">
|
|
102
|
+
<branch condition="feature_files.length == 0">
|
|
103
|
+
<event action="log" level="warning">No feature documents found for module {{module_name}}</event>
|
|
104
|
+
<task name="generate_minimal_overview" action="run-skill" skill="Write">
|
|
105
|
+
<param name="file_path">{{module_path}}/{{module_name}}-overview.md</param>
|
|
106
|
+
<param name="content">{{minimal_skeleton}}</param>
|
|
107
|
+
</task>
|
|
108
|
+
<output name="status" from="partial" />
|
|
109
|
+
<event action="signal">workflow_complete</event>
|
|
110
|
+
</branch>
|
|
111
|
+
<branch condition="feature_files.length > 0">
|
|
112
|
+
<event action="log" level="info">Found {{feature_files.length}} feature documents</event>
|
|
113
|
+
</branch>
|
|
114
|
+
</gateway>
|
|
115
|
+
|
|
116
|
+
<!-- Step 2: Extract Entities -->
|
|
117
|
+
<task name="extract_entities" action="run-script">
|
|
118
|
+
<param name="script">extract-entities.js</param>
|
|
119
|
+
<param name="inputs">feature_contents</param>
|
|
120
|
+
<output name="extracted_entities" />
|
|
121
|
+
</task>
|
|
122
|
+
|
|
123
|
+
<!-- Loop: Process each entity for deduplication -->
|
|
124
|
+
<loop name="process_entities" over="extracted_entities" as="entity">
|
|
125
|
+
<task name="aggregate_entity" action="run-script">
|
|
126
|
+
<param name="script">aggregate-entity.js</param>
|
|
127
|
+
<param name="entity">{{entity}}</param>
|
|
128
|
+
<output name="aggregated_entity" />
|
|
129
|
+
</task>
|
|
130
|
+
</loop>
|
|
131
|
+
|
|
132
|
+
<!-- Checkpoint: Entities aggregated -->
|
|
133
|
+
<checkpoint name="entities_aggregated" verify="unique_entities.length > 0" />
|
|
134
|
+
|
|
135
|
+
<!-- Step 3: Identify Dependencies -->
|
|
136
|
+
<task name="identify_dependencies" action="run-script">
|
|
137
|
+
<param name="script">identify-dependencies.js</param>
|
|
138
|
+
<param name="inputs">feature_contents</param>
|
|
139
|
+
<output name="dependencies" />
|
|
140
|
+
</task>
|
|
141
|
+
|
|
142
|
+
<!-- Classify dependencies -->
|
|
143
|
+
<loop name="classify_deps" over="dependencies" as="dependency">
|
|
144
|
+
<gateway name="classify_direction" mode="exclusive">
|
|
145
|
+
<branch condition="dependency.direction == 'provides'">
|
|
146
|
+
<output name="provided_deps" append="{{dependency}}" />
|
|
147
|
+
</branch>
|
|
148
|
+
<branch condition="dependency.direction == 'consumes'">
|
|
149
|
+
<output name="consumed_deps" append="{{dependency}}" />
|
|
150
|
+
</branch>
|
|
151
|
+
</gateway>
|
|
152
|
+
</loop>
|
|
153
|
+
|
|
154
|
+
<!-- Checkpoint: Dependencies classified -->
|
|
155
|
+
<checkpoint name="dependencies_classified" verify="dependencies != null" />
|
|
156
|
+
|
|
157
|
+
<!-- Step 4: Summarize Business Rules -->
|
|
158
|
+
<task name="extract_rules" action="run-script">
|
|
159
|
+
<param name="script">extract-rules.js</param>
|
|
160
|
+
<param name="inputs">feature_contents</param>
|
|
161
|
+
<output name="business_rules" />
|
|
162
|
+
</task>
|
|
163
|
+
|
|
164
|
+
<!-- Loop: Associate rules with features -->
|
|
165
|
+
<loop name="associate_rules" over="business_rules" as="rule">
|
|
166
|
+
<task name="find_rule_source" action="run-script">
|
|
167
|
+
<param name="script">find-source-feature.js</param>
|
|
168
|
+
<param name="rule">{{rule}}</param>
|
|
169
|
+
<param name="features">{{feature_files}}</param>
|
|
170
|
+
<output name="rule_with_source" />
|
|
171
|
+
</task>
|
|
172
|
+
</loop>
|
|
173
|
+
|
|
174
|
+
<!-- Checkpoint: Rules collected -->
|
|
175
|
+
<checkpoint name="rules_collected" verify="business_rules.length >= 0" />
|
|
176
|
+
|
|
177
|
+
<!-- Step 5: Generate Complete MODULE-OVERVIEW.md -->
|
|
178
|
+
<!-- Phase A: Skeleton Construction -->
|
|
179
|
+
<task name="count_entities" action="run-script">
|
|
180
|
+
<param name="script">count-items.js</param>
|
|
181
|
+
<param name="items">{{unique_entities}}</param>
|
|
182
|
+
<output name="entity_count" />
|
|
183
|
+
</task>
|
|
184
|
+
|
|
185
|
+
<task name="count_dependencies" action="run-script">
|
|
186
|
+
<param name="script">count-items.js</param>
|
|
187
|
+
<param name="items">{{dependencies}}</param>
|
|
188
|
+
<output name="dependency_count" />
|
|
189
|
+
</task>
|
|
190
|
+
|
|
191
|
+
<task name="count_flows" action="run-script">
|
|
192
|
+
<param name="script">count-flows.js</param>
|
|
193
|
+
<param name="features">{{feature_contents}}</param>
|
|
194
|
+
<output name="flow_count" />
|
|
195
|
+
</task>
|
|
196
|
+
|
|
197
|
+
<task name="count_rules" action="run-script">
|
|
198
|
+
<param name="script">count-items.js</param>
|
|
199
|
+
<param name="items">{{business_rules}}</param>
|
|
200
|
+
<output name="rule_count" />
|
|
201
|
+
</task>
|
|
202
|
+
|
|
203
|
+
<!-- Create skeleton structure -->
|
|
204
|
+
<task name="create_skeleton" action="run-script">
|
|
205
|
+
<param name="script">create-overview-skeleton.js</param>
|
|
206
|
+
<param name="template">{{template_content}}</param>
|
|
207
|
+
<param name="entity_count">{{entity_count}}</param>
|
|
208
|
+
<param name="dependency_count">{{dependency_count}}</param>
|
|
209
|
+
<param name="flow_count">{{flow_count}}</param>
|
|
210
|
+
<param name="rule_count">{{rule_count}}</param>
|
|
211
|
+
<param name="language">{{language}}</param>
|
|
212
|
+
<output name="document_skeleton" />
|
|
213
|
+
</task>
|
|
214
|
+
|
|
215
|
+
<!-- Rule: Skeleton must be complete before filling -->
|
|
216
|
+
<rule level="mandatory">DO NOT start filling content until the complete skeleton is verified</rule>
|
|
217
|
+
|
|
218
|
+
<!-- Checkpoint: Skeleton verified -->
|
|
219
|
+
<checkpoint name="skeleton_verified" verify="document_skeleton != null AND document_skeleton.contains('[TO BE FILLED]')" />
|
|
220
|
+
|
|
221
|
+
<!-- Phase B: Content Filling -->
|
|
222
|
+
<!-- Read Mermaid rules -->
|
|
223
|
+
<task name="read_mermaid_rules" action="run-skill" skill="Read">
|
|
224
|
+
<param name="file_path">speccrew-workspace/docs/rules/mermaid-rule.md</param>
|
|
225
|
+
<output name="mermaid_rules" />
|
|
226
|
+
</task>
|
|
227
|
+
|
|
228
|
+
<!-- Fill Section 3: Business Entities -->
|
|
229
|
+
<loop name="fill_entities" over="unique_entities" as="entity">
|
|
230
|
+
<task name="fill_entity_row" action="run-script">
|
|
231
|
+
<param name="script">fill-entity-row.js</param>
|
|
232
|
+
<param name="entity">{{entity}}</param>
|
|
233
|
+
<param name="language">{{language}}</param>
|
|
234
|
+
<output name="entity_row" />
|
|
235
|
+
</task>
|
|
236
|
+
</loop>
|
|
237
|
+
|
|
238
|
+
<!-- Fill Section 4: Dependencies -->
|
|
239
|
+
<loop name="fill_dependencies" over="dependencies" as="dependency">
|
|
240
|
+
<task name="fill_dependency_row" action="run-script">
|
|
241
|
+
<param name="script">fill-dependency-row.js</param>
|
|
242
|
+
<param name="dependency">{{dependency}}</param>
|
|
243
|
+
<param name="language">{{language}}</param>
|
|
244
|
+
<output name="dependency_row" />
|
|
245
|
+
</task>
|
|
246
|
+
</loop>
|
|
247
|
+
|
|
248
|
+
<!-- Fill Section 5: Core Business Flows -->
|
|
249
|
+
<loop name="fill_flows" over="core_flows" as="flow">
|
|
250
|
+
<task name="fill_flow_item" action="run-script">
|
|
251
|
+
<param name="script">fill-flow-item.js</param>
|
|
252
|
+
<param name="flow">{{flow}}</param>
|
|
253
|
+
<param name="language">{{language}}</param>
|
|
254
|
+
<output name="flow_item" />
|
|
255
|
+
</task>
|
|
256
|
+
</loop>
|
|
257
|
+
|
|
258
|
+
<!-- Fill Section 6: Business Rules -->
|
|
259
|
+
<loop name="fill_rules" over="business_rules" as="rule">
|
|
260
|
+
<task name="fill_rule_row" action="run-script">
|
|
261
|
+
<param name="script">fill-rule-row.js</param>
|
|
262
|
+
<param name="rule">{{rule}}</param>
|
|
263
|
+
<param name="language">{{language}}</param>
|
|
264
|
+
<output name="rule_row" />
|
|
265
|
+
</task>
|
|
266
|
+
</loop>
|
|
267
|
+
|
|
268
|
+
<!-- Error Handler for document writing -->
|
|
269
|
+
<error-handler>
|
|
270
|
+
<try>
|
|
271
|
+
<!-- Write final document -->
|
|
272
|
+
<gateway name="check_existing_doc" mode="exclusive">
|
|
273
|
+
<branch condition="initial_overview != null">
|
|
274
|
+
<!-- Use search_replace for existing document -->
|
|
275
|
+
<loop name="replace_sections" over="sections" as="section">
|
|
276
|
+
<task name="replace_section" action="run-skill" skill="search_replace">
|
|
277
|
+
<param name="file_path">{{module_path}}/{{module_name}}-overview.md</param>
|
|
278
|
+
<param name="section">{{section}}</param>
|
|
279
|
+
</task>
|
|
280
|
+
</loop>
|
|
281
|
+
</branch>
|
|
282
|
+
<branch condition="initial_overview == null">
|
|
283
|
+
<!-- Create new document -->
|
|
284
|
+
<task name="write_overview" action="run-skill" skill="Write">
|
|
285
|
+
<param name="file_path">{{module_path}}/{{module_name}}-overview.md</param>
|
|
286
|
+
<param name="content">{{document_skeleton}}</param>
|
|
287
|
+
</task>
|
|
288
|
+
</branch>
|
|
289
|
+
</gateway>
|
|
290
|
+
</try>
|
|
291
|
+
<catch error="write_error">
|
|
292
|
+
<event action="log" level="error">Failed to write overview document: {{write_error.message}}</event>
|
|
293
|
+
<output name="status" from="failed" />
|
|
294
|
+
</catch>
|
|
295
|
+
<finally>
|
|
296
|
+
<event action="log" level="info">Document write operation completed</event>
|
|
297
|
+
</finally>
|
|
298
|
+
</error-handler>
|
|
299
|
+
|
|
300
|
+
<!-- Rule: Content language constraint -->
|
|
301
|
+
<rule level="mandatory">ALL generated content MUST be in the language specified by the language parameter</rule>
|
|
302
|
+
|
|
303
|
+
<!-- Rule: Forbidden operations -->
|
|
304
|
+
<rule level="forbidden">FORBIDDEN: create_file for overview document rewrite - use search_replace instead</rule>
|
|
305
|
+
<rule level="forbidden">FORBIDDEN: Full-file rewrite - always use targeted search_replace on specific sections</rule>
|
|
306
|
+
|
|
307
|
+
<!-- Checkpoint: Document generated -->
|
|
308
|
+
<checkpoint name="document_generated" verify="output_file_exists == true" />
|
|
309
|
+
|
|
310
|
+
<!-- Step 6: Report Results -->
|
|
311
|
+
<task name="generate_report" action="run-script">
|
|
312
|
+
<param name="script">generate-report.js</param>
|
|
313
|
+
<param name="module_name">{{module_name}}</param>
|
|
314
|
+
<param name="feature_count">{{feature_files.length}}</param>
|
|
315
|
+
<param name="entity_count">{{unique_entities.length}}</param>
|
|
316
|
+
<param name="dependency_count">{{dependencies.length}}</param>
|
|
317
|
+
<param name="rule_count">{{business_rules.length}}</param>
|
|
318
|
+
<output name="completion_report" />
|
|
319
|
+
</task>
|
|
320
|
+
|
|
321
|
+
<!-- Event: Log completion -->
|
|
322
|
+
<event action="log" level="info">
|
|
323
|
+
Module summarization completed:
|
|
324
|
+
- Module: {{module_name}}
|
|
325
|
+
- Features Processed: {{feature_files.length}}
|
|
326
|
+
- Entities Extracted: {{unique_entities.length}}
|
|
327
|
+
- Dependencies Identified: {{dependencies.length}}
|
|
328
|
+
- Business Rules Summarized: {{business_rules.length}}
|
|
329
|
+
- Output: {{module_name}}-overview.md (complete)
|
|
330
|
+
- Status: success
|
|
331
|
+
</event>
|
|
332
|
+
|
|
333
|
+
<!-- Output Block: Define workflow outputs -->
|
|
334
|
+
<output name="status" from="success" />
|
|
335
|
+
<output name="module_name" from="module_name" />
|
|
336
|
+
<output name="output_file" from="{{module_name}}-overview.md" />
|
|
337
|
+
<output name="message" from="Module summarization completed with {{feature_files.length}} features processed" />
|
|
338
|
+
</workflow>
|
|
339
|
+
|
|
340
|
+
## Constraints
|
|
341
|
+
|
|
342
|
+
### Critical Constraints
|
|
343
|
+
|
|
344
|
+
> 1. **FORBIDDEN: `create_file` for overview document** — If skeleton exists, use `search_replace`; if not, copy template first then fill with `search_replace`
|
|
345
|
+
> 2. **FORBIDDEN: Full-file rewrite** — Always use targeted `search_replace` on specific sections
|
|
346
|
+
> 3. **MANDATORY: Template-first workflow** — Template (or existing skeleton) MUST be in place before filling sections
|
|
347
|
+
|
|
348
|
+
### Content Language
|
|
349
|
+
|
|
350
|
+
**IMPORTANT**: ALL generated content (entity descriptions, business rules, 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 (class names, API endpoints) remain in their original language.
|
|
351
|
+
|
|
352
|
+
## Return Value Format
|
|
353
|
+
|
|
354
|
+
```json
|
|
355
|
+
{
|
|
356
|
+
"status": "success|failed",
|
|
357
|
+
"module_name": "module_name",
|
|
358
|
+
"output_file": "module_name-overview.md",
|
|
359
|
+
"message": "Module summarization completed with N features processed"
|
|
360
|
+
}
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
## Task Completion Report
|
|
364
|
+
|
|
365
|
+
Upon completion, output the following structured report:
|
|
366
|
+
|
|
367
|
+
```json
|
|
368
|
+
{
|
|
369
|
+
"status": "success | partial | failed",
|
|
370
|
+
"skill": "speccrew-knowledge-module-summarize-xml",
|
|
371
|
+
"output_files": [
|
|
372
|
+
"{module_path}/{module_name}-overview.md"
|
|
373
|
+
],
|
|
374
|
+
"summary": "Module overview completed with entities, dependencies, and business rules extracted from {feature_count} features",
|
|
375
|
+
"metrics": {
|
|
376
|
+
"modules_processed": 1,
|
|
377
|
+
"documents_generated": 1,
|
|
378
|
+
"features_covered": 0
|
|
379
|
+
},
|
|
380
|
+
"errors": [],
|
|
381
|
+
"next_steps": [
|
|
382
|
+
"Run speccrew-knowledge-system-summarize-xml to aggregate all modules into system overview"
|
|
383
|
+
]
|
|
384
|
+
}
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
## Reference Guides
|
|
388
|
+
|
|
389
|
+
### Mermaid Diagram Guide
|
|
390
|
+
|
|
391
|
+
When generating Mermaid diagrams, follow these compatibility guidelines:
|
|
392
|
+
|
|
393
|
+
**Key Requirements:**
|
|
394
|
+
- Use only basic node definitions: `A[text content]`
|
|
395
|
+
- No HTML tags (e.g., `<br/>`)
|
|
396
|
+
- No nested subgraphs
|
|
397
|
+
- No `direction` keyword
|
|
398
|
+
- No `style` definitions
|
|
399
|
+
- Use standard `graph TB/LR` syntax only
|
|
400
|
+
|
|
401
|
+
**Diagram Types:**
|
|
402
|
+
|
|
403
|
+
| Diagram Type | Use Case | Example |
|
|
404
|
+
|---------|---------|------|
|
|
405
|
+
| `graph TB/LR` | Module structure, dependencies | Project structure diagram, dependency graph |
|
|
406
|
+
| `sequenceDiagram` | Interaction flow, API calls | User operation flow, service call chain |
|
|
407
|
+
| `flowchart TD` | Business logic, conditional branches | State transition, exception handling |
|
|
408
|
+
| `classDiagram` | Class structure, entity relationships | Data model, service interface |
|
|
409
|
+
| `erDiagram` | Database table relationships | Entity relationship diagram |
|
|
410
|
+
| `stateDiagram-v2` | State machine | Order status, approval status |
|
|
411
|
+
|
|
412
|
+
### Source Traceability Guide
|
|
413
|
+
|
|
414
|
+
Aggregate source file references from all feature documents:
|
|
415
|
+
|
|
416
|
+
> **Note**: Use relative paths from the generated document to the source file. Do NOT use `file://` protocol.
|
|
417
|
+
|
|
418
|
+
**CRITICAL: Dynamic Relative Path Calculation**
|
|
419
|
+
|
|
420
|
+
The document generation location is `speccrew-workspace/knowledges/bizs/{platform_id}/{module_path}/{file}.md`, which has a **variable depth** from the project root. You MUST dynamically calculate the relative path depth based on the actual document location.
|
|
421
|
+
|
|
422
|
+
**Calculation Method:**
|
|
423
|
+
1. Count the number of directory separators (`/`) from the project root to the document's directory
|
|
424
|
+
2. Each directory level requires one `../` to traverse up to the project root
|
|
425
|
+
3. Example: Document at `speccrew-workspace/knowledges/bizs/backend-ai/chat/overview.md` (5 levels) → Use `../../../../../src/...`
|
|
426
|
+
|
|
427
|
+
**Common Path Depths Reference:**
|
|
428
|
+
| Document Location | Depth | Relative Path Prefix |
|
|
429
|
+
|---|---|---|
|
|
430
|
+
| `speccrew-workspace/knowledges/bizs/{platform}/{module}/` | 5+ | `../../../../../` |
|
|
431
|
+
| `speccrew-workspace/knowledges/bizs/{platform}/{module}/{sub}/` | 6+ | `../../../../../../` |
|
|
432
|
+
|
|
433
|
+
**Source reference examples by tech stack (assuming document at depth 5):**
|
|
434
|
+
|
|
435
|
+
Backend (Java): `[OrderController.java](../../../../../src/main/java/.../OrderController.java#L10-L25)`
|
|
436
|
+
Backend (Python): `[views.py](../../../../../app/order/views.py#L10-L25)`
|
|
437
|
+
Backend (Node.js): `[orderController.js](../../../../../src/modules/order/orderController.js#L10-L25)`
|
|
438
|
+
Frontend (Vue): `[OrderList.vue](../../../../../src/views/order/OrderList.vue#L10-L25)`
|
|
439
|
+
Frontend (React): `[OrderDetail.tsx](../../../../../src/pages/order/OrderDetail.tsx#L10-L25)`
|
|
440
|
+
|
|
441
|
+
1. **File Reference Block** (at document start):
|
|
442
|
+
```markdown
|
|
443
|
+
**Referenced Files**
|
|
444
|
+
|
|
445
|
+
- [OrderController.*](path/to/source/OrderController.*)
|
|
446
|
+
- [OrderService.*](path/to/source/OrderService.*)
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
2. **Diagram Source** (after each Mermaid diagram):
|
|
450
|
+
```markdown
|
|
451
|
+
**Diagram Source**
|
|
452
|
+
- [OrderController.*](path/to/source/OrderController.*#L45-L60)
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
3. **Section Source** (at end of document):
|
|
456
|
+
```markdown
|
|
457
|
+
**Section Source**
|
|
458
|
+
- [OrderController.*](path/to/source/OrderController.*#L1-L100)
|
|
459
|
+
- [OrderService.*](path/to/source/OrderService.*#L1-L80)
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
## Notes
|
|
463
|
+
|
|
464
|
+
> **Note**: This skill focuses on document aggregation only. Knowledge graph data (nodes, edges) is handled separately by the dispatch skill's `process-batch-results.js` script during Stage 2. Module-summarize does NOT read from or write to the knowledge graph.
|
|
465
|
+
|
|
466
|
+
## Checklist
|
|
467
|
+
|
|
468
|
+
- [ ] Step 1: Prerequisites read (template, initial overview, feature details)
|
|
469
|
+
- [ ] Step 2: Entities extracted and aggregated
|
|
470
|
+
- [ ] Step 3: Dependencies identified
|
|
471
|
+
- [ ] Step 4: Business rules collected
|
|
472
|
+
- [ ] Step 5: Section 3-6 completed in {{module_name}}-overview.md
|
|
473
|
+
- [ ] Step 6: Results reported
|