speccrew 0.6.34 → 0.6.36

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.
@@ -0,0 +1,859 @@
1
+ ---
2
+ name: speccrew-knowledge-techs-generate-conventions-xml
3
+ description: Generate technology convention documents (INDEX, tech-stack, architecture, conventions-*) for a specific platform using XML Block workflow. Extracts tech stack, architecture, and development conventions from configuration files and source code. Split from techs-generate for parallel execution with ui-style worker.
4
+ tools: Read, Write, Glob, Grep
5
+ ---
6
+
7
+ # Stage 2: Generate Platform Convention Documents (XML Block Workflow)
8
+
9
+ Generate comprehensive convention documentation for a specific platform by analyzing its configuration files and source code structure. This skill focuses on conventions documents only; UI style analysis is handled by the separate techs-generate-ui-style worker.
10
+
11
+ ## Trigger Scenarios
12
+
13
+ - "Generate convention documents for {platform}"
14
+ - "Create tech stack and architecture documentation"
15
+ - "Extract development conventions from {platform}"
16
+ - "Generate platform conventions docs"
17
+ - "Create INDEX, tech-stack, and conventions-* files"
18
+
19
+ ## User
20
+
21
+ Worker Agent (speccrew-task-worker)
22
+
23
+ ## Input Variables
24
+
25
+ | Variable | Type | Description | Example |
26
+ |----------|------|-------------|---------|
27
+ | `{{platform_id}}` | string | Platform identifier | `"web-react"`, `"backend-nestjs"` |
28
+ | `{{platform_type}}` | string | Platform type | `web`, `mobile`, `backend`, `desktop`, `api` |
29
+ | `{{framework}}` | string | Primary framework | `react`, `nestjs`, `flutter`, etc. |
30
+ | `{{source_path}}` | string | Platform source directory | `"frontend-web"` |
31
+ | `{{config_files}}` | array | List of configuration file paths | `["package.json", "tsconfig.json"]` |
32
+ | `{{convention_files}}` | array | List of convention file paths | `[".eslintrc.js", ".prettierrc"]` |
33
+ | `{{output_path}}` | string | Output directory for generated documents | `speccrew-workspace/knowledges/techs/{platform_id}/` |
34
+ | `{{language}}` | string | Target language for generated content | `"zh"`, `"en"` |
35
+ | `{{completed_dir}}` | string | (Optional) Directory for analysis coverage report output | `speccrew-workspace/iterations/...` |
36
+
37
+ ## Output Variables
38
+
39
+ | Variable | Type | Description |
40
+ |----------|------|-------------|
41
+ | `{{status}}` | string | Generation status: `"success"`, `"partial"`, or `"failed"` |
42
+ | `{{documents_generated}}` | array | List of generated document filenames |
43
+ | `{{analysis_file}}` | string | Path to the analysis coverage report |
44
+ | `{{message}}` | string | Summary message for status update |
45
+
46
+ ## Output
47
+
48
+ Generate the following documents in `{{output_path}}/`:
49
+
50
+ ```
51
+ {{output_path}}/
52
+ ├── INDEX.md # Platform technology index (Required)
53
+ ├── tech-stack.md # Technology stack details (Required)
54
+ ├── architecture.md # Architecture conventions (Required)
55
+ ├── conventions-design.md # Design conventions (Required)
56
+ ├── conventions-dev.md # Development conventions (Required)
57
+ ├── conventions-unit-test.md # Unit testing conventions (Required)
58
+ ├── conventions-system-test.md # System testing conventions (Required)
59
+ ├── conventions-build.md # Build & Deployment conventions (Required)
60
+ └── conventions-data.md # Data conventions (Optional)
61
+ ```
62
+
63
+ ### Platform Type to Document Mapping
64
+
65
+ | Platform Type | Required Documents | Optional Documents | Generate conventions-data.md? |
66
+ |---------------|-------------------|-------------------|------------------------------|
67
+ | `backend` | All 8 docs | - | **Must Generate** - Contains ORM, data modeling, caching strategy |
68
+ | `web` | All 8 docs | conventions-data.md | **Conditional** - Only when using ORM/data layer (Prisma, TypeORM, Sequelize, etc.) |
69
+ | `mobile` | All 8 docs | conventions-data.md | **Default No** - Based on actual tech stack |
70
+ | `desktop` | All 8 docs | conventions-data.md | **Default No** - Based on actual tech stack |
71
+ | `api` | All 8 docs | conventions-data.md | **Conditional** - Based on whether data layer exists |
72
+
73
+ ## Workflow
74
+
75
+ <!--
76
+ == Block Types Schema ==
77
+ input : Workflow input parameters (required=mandatory, default=default value)
78
+ output : Workflow output results (from=data source variable)
79
+ task : Execute action (action: run-skill | run-script | dispatch-to-worker)
80
+ gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
81
+ loop : Iterate over collection (over=collection, as=current item)
82
+ event : Log/confirm/signal (action: log | confirm | signal)
83
+ error-handler : Exception handling (try > catch > finally)
84
+ checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
85
+ rule : Constraint declaration (level: forbidden | mandatory | note)
86
+ -->
87
+
88
+ ```xml
89
+ <workflow name="platform-conventions-generation" version="1.0">
90
+
91
+ <!-- ==================== INPUT PARAMETERS ==================== -->
92
+ <input name="platform_id" type="string" required="true" description="Platform identifier (e.g., web-react, backend-nestjs)"/>
93
+ <input name="platform_type" type="string" required="true" description="Platform type: web, mobile, backend, desktop, api"/>
94
+ <input name="framework" type="string" required="true" description="Primary framework (react, nestjs, flutter, etc.)"/>
95
+ <input name="source_path" type="string" required="true" description="Platform source directory"/>
96
+ <input name="config_files" type="array" required="true" description="List of configuration file paths"/>
97
+ <input name="convention_files" type="array" required="true" description="List of convention file paths (eslint, prettier, etc.)"/>
98
+ <input name="output_path" type="string" required="true" description="Output directory for generated documents"/>
99
+ <input name="language" type="string" required="true" description="Target language (e.g., zh, en)"/>
100
+ <input name="completed_dir" type="string" required="false" description="Directory for analysis coverage report output"/>
101
+
102
+ <!-- ==================== GLOBAL CONSTRAINT RULES ==================== -->
103
+ <block type="rule" id="GLOBAL-R1" level="mandatory" desc="Continuous execution rules">
104
+ <field name="text">This skill MUST execute continuously without user interruption</field>
105
+ <field name="text">All steps must complete in a single session</field>
106
+ <field name="text">If context window is running low, save checkpoint and inform user - DO NOT create false done marker</field>
107
+ </block>
108
+
109
+ <block type="rule" id="GLOBAL-R-TECHSTACK" level="mandatory" desc="Technology stack constraints">
110
+ <field name="text">Extract actual values from config files: "React 18.2.0" (from package.json) - NOT "React (version varies)"</field>
111
+ <field name="text">Focus on actionable conventions: "Use PascalCase for component files: UserProfile.tsx" - NOT vague statements</field>
112
+ <field name="text">Include concrete examples wherever possible</field>
113
+ </block>
114
+
115
+ <block type="rule" id="GLOBAL-R-DONE-MARKER" level="forbidden" desc="Done marker integrity rules">
116
+ <field name="text">DO NOT create done marker file until ALL required documents have been verified to exist on disk</field>
117
+ <field name="text">Required documents: INDEX.md, tech-stack.md, architecture.md, conventions-design.md, conventions-dev.md, conventions-unit-test.md, conventions-system-test.md, conventions-build.md</field>
118
+ <field name="text">If context window is running low, save checkpoint and inform user - DO NOT create false done marker</field>
119
+ </block>
120
+
121
+ <block type="rule" id="GLOBAL-R-CONTEXT" level="mandatory" desc="Context management rules">
122
+ <field name="text">Write each document to file immediately after generation - DO NOT accumulate all documents in memory</field>
123
+ <field name="text">Use search_replace to fill template sections - NEVER use create_file to rewrite entire document</field>
124
+ <field name="text">Preserve all template section headers and structure</field>
125
+ </block>
126
+
127
+ <block type="rule" id="GLOBAL-R-SOURCE" level="mandatory" desc="Source traceability rules">
128
+ <field name="text">All source file links MUST use RELATIVE PATHS - Absolute paths and file:// protocol are STRICTLY FORBIDDEN</field>
129
+ <field name="text">Use ../../../../ as prefix to reference source files from document location</field>
130
+ <field name="text">Add File Reference Block at beginning of each document</field>
131
+ <field name="text">Add Diagram Source annotations after each Mermaid diagram</field>
132
+ <field name="text">Add Section Source annotations at end of major sections</field>
133
+ </block>
134
+
135
+ <block type="rule" id="GLOBAL-R-MERMAID" level="mandatory" desc="Mermaid diagram compatibility rules">
136
+ <field name="text">Use only basic node definitions: A[text content]</field>
137
+ <field name="text">No HTML tags (e.g., &lt;br/&gt;)</field>
138
+ <field name="text">No nested subgraphs</field>
139
+ <field name="text">No direction keyword</field>
140
+ <field name="text">No style definitions</field>
141
+ <field name="text">Use standard graph TB/LR syntax only</field>
142
+ </block>
143
+
144
+ <!-- ==================== STEP 0: READ DOCUMENT TEMPLATES ==================== -->
145
+ <task name="step0-read-templates" action="run-skill">
146
+ <description>Read all template files to understand required content structure for each document type</description>
147
+ <script>
148
+ <!-- Read INDEX Template -->
149
+ <task action="read-file" target="../speccrew-knowledge-techs-generate/templates/INDEX-TEMPLATE.md">
150
+ <output name="template_index" from="file.content"/>
151
+ </task>
152
+
153
+ <!-- Read TECH-STACK Template -->
154
+ <task action="read-file" target="../speccrew-knowledge-techs-generate/templates/TECH-STACK-TEMPLATE.md">
155
+ <output name="template_tech_stack" from="file.content"/>
156
+ </task>
157
+
158
+ <!-- Read ARCHITECTURE Template -->
159
+ <task action="read-file" target="../speccrew-knowledge-techs-generate/templates/ARCHITECTURE-TEMPLATE.md">
160
+ <output name="template_architecture" from="file.content"/>
161
+ </task>
162
+
163
+ <!-- Read CONVENTIONS-DESIGN Template -->
164
+ <task action="read-file" target="../speccrew-knowledge-techs-generate/templates/CONVENTIONS-DESIGN-TEMPLATE.md">
165
+ <output name="template_conventions_design" from="file.content"/>
166
+ </task>
167
+
168
+ <!-- Read CONVENTIONS-DEV Template -->
169
+ <task action="read-file" target="../speccrew-knowledge-techs-generate/templates/CONVENTIONS-DEV-TEMPLATE.md">
170
+ <output name="template_conventions_dev" from="file.content"/>
171
+ </task>
172
+
173
+ <!-- Read CONVENTIONS-UNIT-TEST Template -->
174
+ <task action="read-file" target="../speccrew-knowledge-techs-generate/templates/CONVENTIONS-UNIT-TEST-TEMPLATE.md">
175
+ <output name="template_conventions_unit_test" from="file.content"/>
176
+ </task>
177
+
178
+ <!-- Read CONVENTIONS-SYSTEM-TEST Template -->
179
+ <task action="read-file" target="../speccrew-knowledge-techs-generate/templates/CONVENTIONS-SYSTEM-TEST-TEMPLATE.md">
180
+ <output name="template_conventions_system_test" from="file.content"/>
181
+ </task>
182
+
183
+ <!-- Read CONVENTIONS-BUILD Template -->
184
+ <task action="read-file" target="../speccrew-knowledge-techs-generate/templates/CONVENTIONS-BUILD-TEMPLATE.md">
185
+ <output name="template_conventions_build" from="file.content"/>
186
+ </task>
187
+
188
+ <!-- Read CONVENTIONS-DATA Template (Optional) -->
189
+ <task action="read-file" target="../speccrew-knowledge-techs-generate/templates/CONVENTIONS-DATA-TEMPLATE.md">
190
+ <output name="template_conventions_data" from="file.content"/>
191
+ </task>
192
+
193
+ <!-- Read Mermaid Rules -->
194
+ <task action="read-file" target="speccrew-workspace/docs/rules/mermaid-rule.md">
195
+ <output name="mermaid_rules" from="file.content"/>
196
+ </task>
197
+
198
+ <checkpoint name="templates-loaded" verify="{{template_index}} != null AND {{template_tech_stack}} != null"/>
199
+ <event action="log" level="info" message="Step 0 Status: COMPLETED - All templates loaded"/>
200
+ </script>
201
+ </task>
202
+
203
+ <!-- ==================== STEP 1: ANALYZE PROJECT SOURCE CODE STRUCTURE ==================== -->
204
+ <task name="step1-analyze-structure" action="run-skill">
205
+ <description>Read configuration files and analyze project structure to extract technology stack and conventions</description>
206
+ <script>
207
+ <!-- Read Primary Config Files -->
208
+ <loop name="config-reading" over="{{config_files}}" as="config_file">
209
+ <task action="read-file" target="{{source_path}}/{{config_file}}">
210
+ <output name="config_{{config_file}}" from="file.content"/>
211
+ </task>
212
+ </loop>
213
+
214
+ <!-- Read Convention Files -->
215
+ <loop name="convention-reading" over="{{convention_files}}" as="convention_file">
216
+ <task action="read-file" target="{{source_path}}/{{convention_file}}">
217
+ <output name="convention_{{convention_file}}" from="file.content"/>
218
+ </task>
219
+ </loop>
220
+
221
+ <!-- Extract Technology Stack -->
222
+ <task action="extract-tech-stack">
223
+ <input name="config_files">{{config_files}}</input>
224
+ <input name="config_content">{{config_content}}</input>
225
+ <output name="framework" from="extraction.framework"/>
226
+ <output name="framework_version" from="extraction.framework_version"/>
227
+ <output name="language" from="extraction.language"/>
228
+ <output name="language_version" from="extraction.language_version"/>
229
+ <output name="build_tool" from="extraction.build_tool"/>
230
+ <output name="dependencies" from="extraction.dependencies"/>
231
+ <output name="dev_dependencies" from="extraction.dev_dependencies"/>
232
+ </task>
233
+
234
+ <!-- Extract Conventions from Config Files -->
235
+ <task action="extract-conventions">
236
+ <input name="convention_files">{{convention_files}}</input>
237
+ <input name="convention_content">{{convention_content}}</input>
238
+ <output name="eslint_rules" from="extraction.eslint"/>
239
+ <output name="prettier_config" from="extraction.prettier"/>
240
+ <output name="testing_config" from="extraction.testing"/>
241
+ <output name="naming_conventions" from="extraction.naming"/>
242
+ </task>
243
+
244
+ <!-- Analyze Directory Structure -->
245
+ <task action="analyze-structure" target="{{source_path}}">
246
+ <output name="directory_structure" from="analysis.directories"/>
247
+ <output name="file_patterns" from="analysis.patterns"/>
248
+ </task>
249
+
250
+ <!-- Detect Data Layer for conventions-data.md decision -->
251
+ <task action="detect-data-layer">
252
+ <input name="dependencies">{{dependencies}}</input>
253
+ <input name="platform_type">{{platform_type}}</input>
254
+ <output name="data_layer_detected" from="detection.found"/>
255
+ <output name="data_technology" from="detection.technology"/>
256
+ <output name="generate_data_doc" from="detection.should_generate"/>
257
+ </task>
258
+
259
+ <event action="log" level="info" message="Platform: {{platform_id}}, Type: {{platform_type}}, Framework: {{framework}}"/>
260
+ <event action="log" level="info" message="Data Layer Detected: {{data_layer_detected}}, Technology: {{data_technology}}"/>
261
+ <event action="log" level="info" message="Generate conventions-data.md: {{generate_data_doc}}"/>
262
+
263
+ <checkpoint name="structure-analyzed" verify="{{framework}} != null"/>
264
+ <event action="log" level="info" message="Step 1 Status: COMPLETED - Project structure analyzed"/>
265
+ </script>
266
+ </task>
267
+
268
+ <!-- ==================== STEP 2: DOMAIN-SPECIFIC CONVENTION EXTRACTION ==================== -->
269
+ <task name="step2-extract-domain-conventions" action="run-skill">
270
+ <description>Extract domain-specific conventions based on platform type</description>
271
+ <script>
272
+ <!-- Frontend Topics Extraction -->
273
+ <gateway name="frontend-topics" mode="guard">
274
+ <branch condition="{{platform_type}} == 'web' OR {{platform_type}} == 'mobile' OR {{platform_type}} == 'desktop'">
275
+ <task action="search-topic">
276
+ <input name="topic">i18n</input>
277
+ <input name="paths">["locales/", "i18n/", "lang/"]</input>
278
+ <output name="topic_i18n_status" from="search.status"/>
279
+ <output name="topic_i18n_files" from="search.files"/>
280
+ </task>
281
+ <task action="search-topic">
282
+ <input name="topic">authorization</input>
283
+ <input name="paths">["permission/", "router/", "store/", "utils/auth"]</input>
284
+ <output name="topic_auth_status" from="search.status"/>
285
+ <output name="topic_auth_files" from="search.files"/>
286
+ </task>
287
+ <task action="search-topic">
288
+ <input name="topic">menu_registration</input>
289
+ <input name="paths">["router/", "store/", "layout/"]</input>
290
+ <output name="topic_menu_status" from="search.status"/>
291
+ <output name="topic_menu_files" from="search.files"/>
292
+ </task>
293
+ <task action="search-topic">
294
+ <input name="topic">data_dictionary</input>
295
+ <input name="paths">["components/Dict", "utils/dict", "store/"]</input>
296
+ <output name="topic_dict_status" from="search.status"/>
297
+ <output name="topic_dict_files" from="search.files"/>
298
+ </task>
299
+ <task action="search-topic">
300
+ <input name="topic">logging</input>
301
+ <input name="paths">["utils/log", "plugins/sentry"]</input>
302
+ <output name="topic_logging_status" from="search.status"/>
303
+ <output name="topic_logging_files" from="search.files"/>
304
+ </task>
305
+ <task action="search-topic">
306
+ <input name="topic">api_request_layer</input>
307
+ <input name="paths">["utils/request", "api/", "config/", "interceptors/"]</input>
308
+ <output name="topic_api_status" from="search.status"/>
309
+ <output name="topic_api_files" from="search.files"/>
310
+ </task>
311
+ <task action="search-topic">
312
+ <input name="topic">data_validation</input>
313
+ <input name="paths">["utils/validate"]</input>
314
+ <output name="topic_validation_status" from="search.status"/>
315
+ <output name="topic_validation_files" from="search.files"/>
316
+ </task>
317
+ <task action="search-topic">
318
+ <input name="topic">file_upload</input>
319
+ <input name="paths">["components/Upload", "api/file", "utils/upload"]</input>
320
+ <output name="topic_upload_status" from="search.status"/>
321
+ <output name="topic_upload_files" from="search.files"/>
322
+ </task>
323
+ </branch>
324
+ </gateway>
325
+
326
+ <!-- Backend Topics Extraction -->
327
+ <gateway name="backend-topics" mode="guard">
328
+ <branch condition="{{platform_type}} == 'backend'">
329
+ <task action="search-topic">
330
+ <input name="topic">backend_i18n</input>
331
+ <input name="paths">["resources/i18n/", "messages*.properties"]</input>
332
+ <output name="topic_backend_i18n_status" from="search.status"/>
333
+ <output name="topic_backend_i18n_files" from="search.files"/>
334
+ </task>
335
+ <task action="search-topic">
336
+ <input name="topic">authorization_permissions</input>
337
+ <input name="paths">["security/", "controller/", "framework/"]</input>
338
+ <output name="topic_backend_auth_status" from="search.status"/>
339
+ <output name="topic_backend_auth_files" from="search.files"/>
340
+ </task>
341
+ <task action="search-topic">
342
+ <input name="topic">data_dictionary</input>
343
+ <input name="paths">["dict/", "system/"]</input>
344
+ <output name="topic_backend_dict_status" from="search.status"/>
345
+ <output name="topic_backend_dict_files" from="search.files"/>
346
+ </task>
347
+ <task action="search-topic">
348
+ <input name="topic">multi_tenancy</input>
349
+ <input name="paths">["framework/tenant/", "base/entity/"]</input>
350
+ <output name="topic_tenant_status" from="search.status"/>
351
+ <output name="topic_tenant_files" from="search.files"/>
352
+ </task>
353
+ <task action="search-topic">
354
+ <input name="topic">logging_audit</input>
355
+ <input name="paths">["logback*.xml", "log4j2*.xml", "operatelog/"]</input>
356
+ <output name="topic_backend_logging_status" from="search.status"/>
357
+ <output name="topic_backend_logging_files" from="search.files"/>
358
+ </task>
359
+ <task action="search-topic">
360
+ <input name="topic">exception_handling</input>
361
+ <input name="paths">["handler/", "exception/", "enums/ErrorCode"]</input>
362
+ <output name="topic_exception_status" from="search.status"/>
363
+ <output name="topic_exception_files" from="search.files"/>
364
+ </task>
365
+ <task action="search-topic">
366
+ <input name="topic">caching</input>
367
+ <input name="paths">["cache/", "redis/", "CacheConfig"]</input>
368
+ <output name="topic_cache_status" from="search.status"/>
369
+ <output name="topic_cache_files" from="search.files"/>
370
+ </task>
371
+ <task action="search-topic">
372
+ <input name="topic">scheduled_jobs</input>
373
+ <input name="paths">["job/", "task/", "schedule/"]</input>
374
+ <output name="topic_jobs_status" from="search.status"/>
375
+ <output name="topic_jobs_files" from="search.files"/>
376
+ </task>
377
+ <task action="search-topic">
378
+ <input name="topic">file_storage</input>
379
+ <input name="paths">["file/", "infra/file/", "FileClient"]</input>
380
+ <output name="topic_storage_status" from="search.status"/>
381
+ <output name="topic_storage_files" from="search.files"/>
382
+ </task>
383
+ </branch>
384
+ </gateway>
385
+
386
+ <checkpoint name="domain-conventions-extracted" verify="true"/>
387
+ <event action="log" level="info" message="Step 2 Status: COMPLETED - Domain-specific conventions extracted"/>
388
+ </script>
389
+ </task>
390
+
391
+ <!-- ==================== STEP 2.1: GENERATE INDEX.MD ==================== -->
392
+ <task name="step2-1-generate-index" action="run-skill">
393
+ <description>Generate INDEX.md by copying template and filling sections</description>
394
+ <script>
395
+ <task action="copy-template" source="{{template_index}}" target="{{output_path}}/INDEX.md">
396
+ <parameter name="platform_id">{{platform_id}}</parameter>
397
+ <parameter name="platform_type">{{platform_type}}</parameter>
398
+ <parameter name="framework">{{framework}}</parameter>
399
+ </task>
400
+ <task action="search_replace" target="{{output_path}}/INDEX.md">
401
+ <search>{Platform Name}</search>
402
+ <replace>{{platform_id}}</replace>
403
+ </task>
404
+ <task action="search_replace" target="{{output_path}}/INDEX.md">
405
+ <search>{Platform Type}</search>
406
+ <replace>{{platform_type}}</replace>
407
+ </task>
408
+ <checkpoint name="index-generated" verify="file.exists({{output_path}}/INDEX.md)"/>
409
+ <event action="log" level="info" message="Step 2.1 Status: COMPLETED - INDEX.md generated"/>
410
+ </script>
411
+ </task>
412
+
413
+ <!-- ==================== STEP 2.2: GENERATE TECH-STACK.MD ==================== -->
414
+ <task name="step2-2-generate-tech-stack" action="run-skill">
415
+ <description>Generate tech-stack.md with extracted technology information</description>
416
+ <script>
417
+ <task action="copy-template" source="{{template_tech_stack}}" target="{{output_path}}/tech-stack.md">
418
+ <parameter name="framework">{{framework}}</parameter>
419
+ <parameter name="framework_version">{{framework_version}}</parameter>
420
+ <parameter name="dependencies">{{dependencies}}</parameter>
421
+ </task>
422
+ <task action="fill-tech-stack-sections" target="{{output_path}}/tech-stack.md">
423
+ <input name="framework">{{framework}}</input>
424
+ <input name="framework_version">{{framework_version}}</input>
425
+ <input name="language">{{language}}</input>
426
+ <input name="build_tool">{{build_tool}}</input>
427
+ <input name="dependencies">{{dependencies}}</input>
428
+ <input name="dev_dependencies">{{dev_dependencies}}</input>
429
+ </task>
430
+ <checkpoint name="tech-stack-generated" verify="file.exists({{output_path}}/tech-stack.md)"/>
431
+ <event action="log" level="info" message="Step 2.2 Status: COMPLETED - tech-stack.md generated"/>
432
+ </script>
433
+ </task>
434
+
435
+ <!-- ==================== STEP 2.3: GENERATE ARCHITECTURE.MD ==================== -->
436
+ <task name="step2-3-generate-architecture" action="run-skill">
437
+ <description>Generate architecture.md with platform architecture patterns</description>
438
+ <script>
439
+ <task action="copy-template" source="{{template_architecture}}" target="{{output_path}}/architecture.md">
440
+ <parameter name="platform_type">{{platform_type}}</parameter>
441
+ <parameter name="directory_structure">{{directory_structure}}</parameter>
442
+ </task>
443
+ <task action="fill-architecture-sections" target="{{output_path}}/architecture.md">
444
+ <input name="platform_type">{{platform_type}}</input>
445
+ <input name="framework">{{framework}}</input>
446
+ <input name="directory_structure">{{directory_structure}}</input>
447
+ <input name="file_patterns">{{file_patterns}}</input>
448
+ </task>
449
+ <checkpoint name="architecture-generated" verify="file.exists({{output_path}}/architecture.md)"/>
450
+ <event action="log" level="info" message="Step 2.3 Status: COMPLETED - architecture.md generated"/>
451
+ </script>
452
+ </task>
453
+
454
+ <!-- ==================== STEP 2.4: GENERATE CONVENTIONS-DESIGN.MD ==================== -->
455
+ <task name="step2-4-generate-conventions-design" action="run-skill">
456
+ <description>Generate conventions-design.md with design principles and patterns</description>
457
+ <script>
458
+ <task action="copy-template" source="{{template_conventions_design}}" target="{{output_path}}/conventions-design.md">
459
+ <parameter name="platform_type">{{platform_type}}</parameter>
460
+ </task>
461
+ <task action="fill-design-sections" target="{{output_path}}/conventions-design.md">
462
+ <input name="platform_type">{{platform_type}}</input>
463
+ <input name="framework">{{framework}}</input>
464
+ <input name="naming_conventions">{{naming_conventions}}</input>
465
+ </task>
466
+ <checkpoint name="conventions-design-generated" verify="file.exists({{output_path}}/conventions-design.md)"/>
467
+ <event action="log" level="info" message="Step 2.4 Status: COMPLETED - conventions-design.md generated"/>
468
+ </script>
469
+ </task>
470
+
471
+ <!-- ==================== STEP 2.5: GENERATE CONVENTIONS-DEV.MD ==================== -->
472
+ <task name="step2-5-generate-conventions-dev" action="run-skill">
473
+ <description>Generate conventions-dev.md with development conventions</description>
474
+ <script>
475
+ <task action="copy-template" source="{{template_conventions_dev}}" target="{{output_path}}/conventions-dev.md">
476
+ <parameter name="eslint_rules">{{eslint_rules}}</parameter>
477
+ <parameter name="prettier_config">{{prettier_config}}</parameter>
478
+ </task>
479
+ <task action="fill-dev-sections" target="{{output_path}}/conventions-dev.md">
480
+ <input name="eslint_rules">{{eslint_rules}}</input>
481
+ <input name="prettier_config">{{prettier_config}}</input>
482
+ <input name="naming_conventions">{{naming_conventions}}</input>
483
+ <input name="file_patterns">{{file_patterns}}</input>
484
+ </task>
485
+ <checkpoint name="conventions-dev-generated" verify="file.exists({{output_path}}/conventions-dev.md)"/>
486
+ <event action="log" level="info" message="Step 2.5 Status: COMPLETED - conventions-dev.md generated"/>
487
+ </script>
488
+ </task>
489
+
490
+ <!-- ==================== STEP 2.6: GENERATE CONVENTIONS-UNIT-TEST.MD ==================== -->
491
+ <task name="step2-6-generate-conventions-unit-test" action="run-skill">
492
+ <description>Generate conventions-unit-test.md with unit testing requirements</description>
493
+ <script>
494
+ <task action="copy-template" source="{{template_conventions_unit_test}}" target="{{output_path}}/conventions-unit-test.md">
495
+ <parameter name="testing_config">{{testing_config}}</parameter>
496
+ </task>
497
+ <task action="fill-unit-test-sections" target="{{output_path}}/conventions-unit-test.md">
498
+ <input name="testing_config">{{testing_config}}</input>
499
+ <input name="framework">{{framework}}</input>
500
+ <input name="platform_type">{{platform_type}}</input>
501
+ </task>
502
+ <checkpoint name="conventions-unit-test-generated" verify="file.exists({{output_path}}/conventions-unit-test.md)"/>
503
+ <event action="log" level="info" message="Step 2.6 Status: COMPLETED - conventions-unit-test.md generated"/>
504
+ </script>
505
+ </task>
506
+
507
+ <!-- ==================== STEP 2.7: GENERATE CONVENTIONS-SYSTEM-TEST.MD ==================== -->
508
+ <task name="step2-7-generate-conventions-system-test" action="run-skill">
509
+ <description>Generate conventions-system-test.md with system testing requirements</description>
510
+ <script>
511
+ <task action="copy-template" source="{{template_conventions_system_test}}" target="{{output_path}}/conventions-system-test.md">
512
+ <parameter name="platform_type">{{platform_type}}</parameter>
513
+ </task>
514
+ <task action="fill-system-test-sections" target="{{output_path}}/conventions-system-test.md">
515
+ <input name="platform_type">{{platform_type}}</input>
516
+ <input name="framework">{{framework}}</input>
517
+ </task>
518
+ <checkpoint name="conventions-system-test-generated" verify="file.exists({{output_path}}/conventions-system-test.md)"/>
519
+ <event action="log" level="info" message="Step 2.7 Status: COMPLETED - conventions-system-test.md generated"/>
520
+ </script>
521
+ </task>
522
+
523
+ <!-- ==================== STEP 2.8: GENERATE CONVENTIONS-BUILD.MD ==================== -->
524
+ <task name="step2-8-generate-conventions-build" action="run-skill">
525
+ <description>Generate conventions-build.md with build and deployment conventions</description>
526
+ <script>
527
+ <task action="copy-template" source="{{template_conventions_build}}" target="{{output_path}}/conventions-build.md">
528
+ <parameter name="build_tool">{{build_tool}}</parameter>
529
+ </task>
530
+ <task action="fill-build-sections" target="{{output_path}}/conventions-build.md">
531
+ <input name="build_tool">{{build_tool}}</input>
532
+ <input name="config_files">{{config_files}}</input>
533
+ <input name="dependencies">{{dependencies}}</input>
534
+ </task>
535
+ <checkpoint name="conventions-build-generated" verify="file.exists({{output_path}}/conventions-build.md)"/>
536
+ <event action="log" level="info" message="Step 2.8 Status: COMPLETED - conventions-build.md generated"/>
537
+ </script>
538
+ </task>
539
+
540
+ <!-- ==================== STEP 2.9: GENERATE CONVENTIONS-DATA.MD (CONDITIONAL) ==================== -->
541
+ <gateway name="generate-data-doc" mode="exclusive">
542
+ <branch condition="{{generate_data_doc}} == true">
543
+ <task name="step2-9-generate-conventions-data" action="run-skill">
544
+ <description>Generate conventions-data.md with data layer conventions</description>
545
+ <script>
546
+ <task action="copy-template" source="{{template_conventions_data}}" target="{{output_path}}/conventions-data.md">
547
+ <parameter name="data_technology">{{data_technology}}</parameter>
548
+ </task>
549
+ <task action="fill-data-sections" target="{{output_path}}/conventions-data.md">
550
+ <input name="data_technology">{{data_technology}}</input>
551
+ <input name="platform_type">{{platform_type}}</input>
552
+ <input name="dependencies">{{dependencies}}</input>
553
+ </task>
554
+ <checkpoint name="conventions-data-generated" verify="file.exists({{output_path}}/conventions-data.md)"/>
555
+ <event action="log" level="info" message="Step 2.9 Status: COMPLETED - conventions-data.md generated"/>
556
+ </script>
557
+ </task>
558
+ </branch>
559
+ <branch condition="default">
560
+ <event action="log" level="info" message="Step 2.9 Status: SKIPPED - No data layer detected, conventions-data.md not generated"/>
561
+ </branch>
562
+ </gateway>
563
+
564
+ <!-- ==================== STEP 3: VERIFY ALL FILES GENERATED ==================== -->
565
+ <task name="step3-verify-files" action="run-skill">
566
+ <description>Verify all required documents exist on disk before creating done marker</description>
567
+ <script>
568
+ <task action="verify-file-exists" target="{{output_path}}/INDEX.md">
569
+ <output name="index_exists" from="verify.result"/>
570
+ </task>
571
+ <task action="verify-file-exists" target="{{output_path}}/tech-stack.md">
572
+ <output name="tech_stack_exists" from="verify.result"/>
573
+ </task>
574
+ <task action="verify-file-exists" target="{{output_path}}/architecture.md">
575
+ <output name="architecture_exists" from="verify.result"/>
576
+ </task>
577
+ <task action="verify-file-exists" target="{{output_path}}/conventions-design.md">
578
+ <output name="conventions_design_exists" from="verify.result"/>
579
+ </task>
580
+ <task action="verify-file-exists" target="{{output_path}}/conventions-dev.md">
581
+ <output name="conventions_dev_exists" from="verify.result"/>
582
+ </task>
583
+ <task action="verify-file-exists" target="{{output_path}}/conventions-unit-test.md">
584
+ <output name="conventions_unit_test_exists" from="verify.result"/>
585
+ </task>
586
+ <task action="verify-file-exists" target="{{output_path}}/conventions-system-test.md">
587
+ <output name="conventions_system_test_exists" from="verify.result"/>
588
+ </task>
589
+ <task action="verify-file-exists" target="{{output_path}}/conventions-build.md">
590
+ <output name="conventions_build_exists" from="verify.result"/>
591
+ </task>
592
+
593
+ <task action="compile-verification">
594
+ <input name="index_exists">{{index_exists}}</input>
595
+ <input name="tech_stack_exists">{{tech_stack_exists}}</input>
596
+ <input name="architecture_exists">{{architecture_exists}}</input>
597
+ <input name="conventions_design_exists">{{conventions_design_exists}}</input>
598
+ <input name="conventions_dev_exists">{{conventions_dev_exists}}</input>
599
+ <input name="conventions_unit_test_exists">{{conventions_unit_test_exists}}</input>
600
+ <input name="conventions_system_test_exists">{{conventions_system_test_exists}}</input>
601
+ <input name="conventions_build_exists">{{conventions_build_exists}}</input>
602
+ <output name="all_required_exist" from="compilation.all_exist"/>
603
+ <output name="missing_files" from="compilation.missing"/>
604
+ </task>
605
+
606
+ <gateway name="verification-result" mode="exclusive">
607
+ <branch condition="{{all_required_exist}} == true">
608
+ <event action="log" level="info" message="Step 3 Status: COMPLETED - All required documents verified to exist"/>
609
+ </branch>
610
+ <branch condition="default">
611
+ <event action="log" level="error" message="Step 3 Status: FAILED - Missing files: {{missing_files}}"/>
612
+ <output name="status" value="failed"/>
613
+ <output name="message" value="Verification failed - missing required documents"/>
614
+ </branch>
615
+ </gateway>
616
+
617
+ <checkpoint name="files-verified" verify="{{all_required_exist}} == true"/>
618
+ </script>
619
+ </task>
620
+
621
+ <!-- ==================== STEP 4: CREATE COMPLETION MARKER ==================== -->
622
+ <task name="step4-create-done-marker" action="run-skill">
623
+ <description>Create done marker file to signal completion - ONLY after all files verified</description>
624
+ <script>
625
+ <gateway name="pre-create-check" mode="guard">
626
+ <branch condition="{{all_required_exist}} == true">
627
+ <task action="create-file" target="{{output_path}}/conventions.done">
628
+ <content>{
629
+ "platform_id": "{{platform_id}}",
630
+ "worker_type": "conventions",
631
+ "status": "completed",
632
+ "documents_generated": ["INDEX.md", "tech-stack.md", "architecture.md", "conventions-design.md", "conventions-dev.md", "conventions-unit-test.md", "conventions-system-test.md", "conventions-build.md"],
633
+ "conventions_data_generated": {{generate_data_doc}},
634
+ "analysis_file": "{{platform_id}}.analysis-conventions.json",
635
+ "completed_at": "{{iso_timestamp}}"
636
+ }</content>
637
+ </task>
638
+ <event action="log" level="info" message="Step 4 Status: COMPLETED - Done marker created"/>
639
+ </branch>
640
+ </gateway>
641
+
642
+ <checkpoint name="done-marker-created" verify="file.exists({{output_path}}/conventions.done)"/>
643
+ </script>
644
+ </task>
645
+
646
+ <!-- ==================== STEP 5: GENERATE ANALYSIS COVERAGE REPORT ==================== -->
647
+ <task name="step5-generate-analysis-report" action="run-skill">
648
+ <description>Generate analysis coverage report as JSON file</description>
649
+ <script>
650
+ <task action="determine-output-dir">
651
+ <input name="completed_dir">{{completed_dir}}</input>
652
+ <input name="output_path">{{output_path}}</input>
653
+ <output name="report_output_dir" from="determination.dir"/>
654
+ </task>
655
+
656
+ <task action="create-file" target="{{report_output_dir}}/{{platform_id}}.analysis-conventions.json">
657
+ <content>{
658
+ "platform_id": "{{platform_id}}",
659
+ "platform_type": "{{platform_type}}",
660
+ "worker_type": "conventions",
661
+ "analyzed_at": "{{iso_timestamp}}",
662
+ "topics": {
663
+ "i18n": {
664
+ "status": "{{topic_i18n_status}}",
665
+ "files_analyzed": {{topic_i18n_files}},
666
+ "notes": ""
667
+ },
668
+ "authorization": {
669
+ "status": "{{topic_auth_status}}",
670
+ "files_analyzed": {{topic_auth_files}},
671
+ "notes": ""
672
+ },
673
+ "menu_registration": {
674
+ "status": "{{topic_menu_status}}",
675
+ "files_analyzed": {{topic_menu_files}},
676
+ "notes": ""
677
+ },
678
+ "data_dictionary": {
679
+ "status": "{{topic_dict_status}}",
680
+ "files_analyzed": {{topic_dict_files}},
681
+ "notes": ""
682
+ },
683
+ "logging": {
684
+ "status": "{{topic_logging_status}}",
685
+ "files_analyzed": {{topic_logging_files}},
686
+ "notes": ""
687
+ },
688
+ "api_request_layer": {
689
+ "status": "{{topic_api_status}}",
690
+ "files_analyzed": {{topic_api_files}},
691
+ "notes": ""
692
+ },
693
+ "data_validation": {
694
+ "status": "{{topic_validation_status}}",
695
+ "files_analyzed": {{topic_validation_files}},
696
+ "notes": ""
697
+ },
698
+ "file_upload": {
699
+ "status": "{{topic_upload_status}}",
700
+ "files_analyzed": {{topic_upload_files}},
701
+ "notes": ""
702
+ }
703
+ },
704
+ "config_files_analyzed": {{config_files}},
705
+ "source_dirs_scanned": ["{{source_path}}"],
706
+ "documents_generated": ["INDEX.md", "tech-stack.md", "architecture.md", "conventions-design.md", "conventions-dev.md", "conventions-unit-test.md", "conventions-system-test.md", "conventions-build.md"],
707
+ "coverage_summary": {
708
+ "topics_found": 0,
709
+ "topics_partial": 0,
710
+ "topics_not_found": 0,
711
+ "topics_total": 8,
712
+ "coverage_percent": 0
713
+ }
714
+ }</content>
715
+ </task>
716
+
717
+ <checkpoint name="analysis-report-generated" verify="file.exists({{report_output_dir}}/{{platform_id}}.analysis-conventions.json)"/>
718
+ <event action="log" level="info" message="Step 5 Status: COMPLETED - Analysis coverage report generated"/>
719
+ </script>
720
+ </task>
721
+
722
+ <!-- ==================== STEP 6: REPORT RESULTS ==================== -->
723
+ <task name="step6-report-results" action="run-skill">
724
+ <description>Report final results and task completion</description>
725
+ <script>
726
+ <event action="log" level="info" message="==============================================="/>
727
+ <event action="log" level="info" message="Platform Convention Documents Generated: {{platform_id}}"/>
728
+ <event action="log" level="info" message="- INDEX.md: ✓"/>
729
+ <event action="log" level="info" message="- tech-stack.md: ✓"/>
730
+ <event action="log" level="info" message="- architecture.md: ✓"/>
731
+ <event action="log" level="info" message="- conventions-design.md: ✓"/>
732
+ <event action="log" level="info" message="- conventions-dev.md: ✓"/>
733
+ <event action="log" level="info" message="- conventions-unit-test.md: ✓"/>
734
+ <event action="log" level="info" message="- conventions-system-test.md: ✓"/>
735
+ <event action="log" level="info" message="- conventions-build.md: ✓"/>
736
+ <event action="log" level="info" message="- conventions-data.md: {{generate_data_doc ? '✓' : 'SKIPPED'}}"/>
737
+ <event action="log" level="info" message="- {{platform_id}}.analysis-conventions.json: ✓"/>
738
+ <event action="log" level="info" message="- Output Directory: {{output_path}}"/>
739
+ <event action="log" level="info" message="==============================================="/>
740
+
741
+ <output name="status" value="success"/>
742
+ <output name="documents_generated" value="[INDEX.md, tech-stack.md, architecture.md, conventions-design.md, conventions-dev.md, conventions-unit-test.md, conventions-system-test.md, conventions-build.md]"/>
743
+ <output name="analysis_file" value="{{report_output_dir}}/{{platform_id}}.analysis-conventions.json"/>
744
+ <output name="message" value="Convention documents generated for {{platform_id}}"/>
745
+
746
+ <checkpoint name="workflow-complete" verify="true"/>
747
+ </script>
748
+ </task>
749
+
750
+ <!-- ==================== FINAL OUTPUT ==================== -->
751
+ <output name="status" from="step6-report-results.status"/>
752
+ <output name="documents_generated" from="step6-report-results.documents_generated"/>
753
+ <output name="analysis_file" from="step6-report-results.analysis_file"/>
754
+ <output name="message" from="step6-report-results.message"/>
755
+
756
+ <!-- ==================== ERROR HANDLING ==================== -->
757
+ <error-handler>
758
+ <catch type="file-not-found">
759
+ <event action="log" level="error" message="File not found: {{error.file}}"/>
760
+ <output name="status" value="failed"/>
761
+ <output name="message" value="Required file not found: {{error.file}}"/>
762
+ </catch>
763
+ <catch type="template-error">
764
+ <event action="log" level="error" message="Template processing error: {{error.message}}"/>
765
+ <output name="status" value="failed"/>
766
+ <output name="message" value="Failed to process template: {{error.message}}"/>
767
+ </catch>
768
+ <catch type="verification-failed">
769
+ <event action="log" level="error" message="Verification failed: {{error.message}}"/>
770
+ <output name="status" value="failed"/>
771
+ <output name="message" value="Document verification failed: {{error.message}}"/>
772
+ </catch>
773
+ <catch type="context-limit">
774
+ <event action="log" level="warning" message="Context window running low - checkpoint saved"/>
775
+ <output name="status" value="partial"/>
776
+ <output name="message" value="Execution paused due to context limit. Checkpoint saved, can resume."/>
777
+ </catch>
778
+ <finally>
779
+ <event action="log" level="info" message="Workflow execution completed with status: {{status}}"/>
780
+ </finally>
781
+ </error-handler>
782
+
783
+ </workflow>
784
+ ```
785
+
786
+ ## Constraints
787
+
788
+ 1. **DO NOT create temporary scripts, batch files, or workaround code files (`.py`, `.bat`, `.sh`, `.ps1`, etc.)** under any circumstances
789
+ 2. **DO NOT analyze files outside the specified `{{source_path}}`**
790
+ 3. **All content MUST be in the language specified by `{{language}}`**
791
+ 4. **Use `search_replace` for section filling, NEVER rewrite entire document**
792
+ 5. **Mermaid diagrams MUST follow the rules in `mermaid-rule.md`**
793
+ 6. **All links MUST use relative paths, NEVER `file://` protocol**
794
+ 7. **Write each document to file immediately after generation - DO NOT accumulate all documents in memory**
795
+ 8. **DO NOT create done marker file until ALL required documents have been verified to exist on disk**
796
+
797
+ ## Task Completion Report
798
+
799
+ When the task is complete, report the following:
800
+
801
+ **Status:** `success` | `partial` | `failed`
802
+
803
+ **Summary:**
804
+ - Platform: `{{platform_id}}`
805
+ - Type: `{{platform_type}}`
806
+ - Framework: `{{framework}}`
807
+ - Documents generated: 8 required + (1 optional if data layer detected)
808
+
809
+ **Files Generated:**
810
+ - `{{output_path}}/INDEX.md` - Platform technology index
811
+ - `{{output_path}}/tech-stack.md` - Technology stack details
812
+ - `{{output_path}}/architecture.md` - Architecture conventions
813
+ - `{{output_path}}/conventions-design.md` - Design conventions
814
+ - `{{output_path}}/conventions-dev.md` - Development conventions
815
+ - `{{output_path}}/conventions-unit-test.md` - Unit testing conventions
816
+ - `{{output_path}}/conventions-system-test.md` - System testing conventions
817
+ - `{{output_path}}/conventions-build.md` - Build and deployment conventions
818
+ - `{{output_path}}/conventions-data.md` - Data conventions (optional)
819
+ - `{{completed_dir}}/{{platform_id}}.analysis-conventions.json` - Analysis coverage report
820
+
821
+ ## Checklist
822
+
823
+ ### Pre-Generation
824
+ - [ ] All template files read successfully
825
+ - [ ] All configuration files read and parsed
826
+ - [ ] Technology stack extracted accurately
827
+ - [ ] Conventions analyzed from config files
828
+
829
+ ### Document Generation
830
+ - [ ] INDEX.md generated with navigation
831
+ - [ ] tech-stack.md generated with dependency tables
832
+ - [ ] architecture.md generated with platform-specific patterns
833
+ - [ ] conventions-design.md generated with design principles
834
+ - [ ] conventions-dev.md generated with naming and style rules
835
+ - [ ] conventions-unit-test.md generated with unit testing requirements
836
+ - [ ] conventions-system-test.md generated with system testing requirements
837
+ - [ ] conventions-build.md generated with build and deployment conventions
838
+ - [ ] conventions-data.md generated (only if applicable per platform type mapping)
839
+
840
+ ### Quality Checks
841
+ - [ ] All files written to output_path
842
+ - [ ] **Source traceability**: File reference block added to each document
843
+ - [ ] **Source traceability**: Diagram Source annotations added after each Mermaid diagram
844
+ - [ ] **Source traceability**: Section Source annotations added at end of major sections
845
+ - [ ] **Mermaid compatibility**: No `style`, `direction`, `<br/>`, or nested subgraphs
846
+ - [ ] **Document completeness**: All 8 required documents exist (verified in Step 3)
847
+ - [ ] **Done marker integrity**: Done marker only created after verification
848
+ - [ ] **Analysis Coverage Report**: `{{platform_id}}.analysis-conventions.json` generated
849
+
850
+ ## CONTINUOUS EXECUTION RULES
851
+
852
+ This skill MUST execute continuously without user interruption:
853
+
854
+ 1. **All steps must complete in a single session** - from template reading to done marker creation
855
+ 2. **If context window is running low**: Save checkpoint and inform user - DO NOT create false done marker
856
+ 3. **No intermediate user confirmation required** between steps
857
+ 4. **Error handling**: On error, log details and stop - do not proceed with incomplete data
858
+ 5. **Verification gate**: Step 3 verification MUST pass before Step 4 done marker creation
859
+ 6. **Memory management**: Write each document immediately after generation, do not accumulate in memory