speccrew 0.6.33 → 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.
- package/.speccrew/agents/speccrew-system-designer.md +101 -94
- package/.speccrew/agents/speccrew-team-leader-xml.md +17 -3
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch-xml/SKILL.md +3 -2
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +6 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch-xml/SKILL.md +863 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions-xml/SKILL.md +859 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-quality-xml/SKILL.md +687 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style-xml/SKILL.md +597 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-xml/SKILL.md +297 -0
- package/.speccrew/skills/speccrew-knowledge-techs-index-xml/SKILL.md +277 -0
- package/.speccrew/skills/speccrew-knowledge-techs-init-xml/SKILL.md +309 -0
- package/package.json +1 -1
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: speccrew-knowledge-techs-generate-ui-style-xml
|
|
3
|
+
description: Generate UI style analysis documents for a specific frontend platform using XML workflow blocks. Analyzes page types, components, layouts, and styling conventions from source code. Only applicable to frontend platforms (web, mobile, desktop).
|
|
4
|
+
tools: Read, Write, Glob, Grep, Skill
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Stage 2: Generate Platform UI Style Documents (XML Workflow)
|
|
8
|
+
|
|
9
|
+
Generate comprehensive UI style documentation for a specific frontend platform by analyzing its source code structure, components, and styling patterns using XML workflow blocks.
|
|
10
|
+
|
|
11
|
+
## Language Adaptation
|
|
12
|
+
|
|
13
|
+
**CRITICAL**: All generated documents must match the user's language. Detect the language from the user's input and generate content accordingly.
|
|
14
|
+
|
|
15
|
+
- User writes in 中文 → Generate Chinese documents, use `language: "zh"`
|
|
16
|
+
- User writes in English → Generate English documents, use `language: "en"`
|
|
17
|
+
- Other languages → Use the specified language code
|
|
18
|
+
|
|
19
|
+
## Prerequisite
|
|
20
|
+
|
|
21
|
+
This skill ONLY applies to frontend platforms. The dispatcher MUST check platform_type before invoking:
|
|
22
|
+
|
|
23
|
+
- `web` → Execute this skill
|
|
24
|
+
- `mobile` → Execute this skill
|
|
25
|
+
- `desktop` → Execute this skill
|
|
26
|
+
- `backend` → DO NOT invoke this skill
|
|
27
|
+
- `api` → DO NOT invoke this skill
|
|
28
|
+
|
|
29
|
+
## Trigger Scenarios
|
|
30
|
+
|
|
31
|
+
- "Generate UI style documents for {platform}"
|
|
32
|
+
- "Analyze UI components and layouts"
|
|
33
|
+
- "Extract design system from {platform}"
|
|
34
|
+
|
|
35
|
+
## User
|
|
36
|
+
|
|
37
|
+
Worker Agent (speccrew-task-worker)
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## XML Workflow Definition
|
|
42
|
+
|
|
43
|
+
<workflow id="techs-ui-style-generate" status="pending" version="1.0" desc="Generate UI style documents for frontend platform">
|
|
44
|
+
<!--
|
|
45
|
+
== Block Types ==
|
|
46
|
+
input : Workflow input parameters (required=mandatory, default=default value)
|
|
47
|
+
output : Workflow output results (from=data source variable)
|
|
48
|
+
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
49
|
+
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
50
|
+
loop : Iterate over collection (over=collection, as=current item)
|
|
51
|
+
event : Log/confirm/signal (action: log | confirm | signal)
|
|
52
|
+
error-handler : Exception handling (try > catch > finally)
|
|
53
|
+
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
54
|
+
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
55
|
+
== Field ==
|
|
56
|
+
field : Parameter/variable/output (name=param name, var=bind variable, value=value)
|
|
57
|
+
-->
|
|
58
|
+
|
|
59
|
+
<!-- ============================================================
|
|
60
|
+
Input Parameters Definition
|
|
61
|
+
============================================================ -->
|
|
62
|
+
<block type="input" id="I1" desc="UI style generation input parameters">
|
|
63
|
+
<field name="platform_id" required="true" type="string" desc="Platform identifier (e.g., web-react, mobile-uniapp)"/>
|
|
64
|
+
<field name="platform_type" required="true" type="string" desc="Platform type (web, mobile, desktop)"/>
|
|
65
|
+
<field name="framework" required="true" type="string" desc="Primary framework (react, vue, angular, uniapp, flutter, etc.)"/>
|
|
66
|
+
<field name="source_path" required="true" type="string" desc="Platform source directory"/>
|
|
67
|
+
<field name="output_path" required="true" type="string" desc="Output directory (e.g., speccrew-workspace/knowledges/techs/{platform_id}/)"/>
|
|
68
|
+
<field name="language" required="true" type="string" desc="Target language (zh, en)"/>
|
|
69
|
+
<field name="completed_dir" required="false" type="string" desc="Directory for completion marker and analysis report"/>
|
|
70
|
+
</block>
|
|
71
|
+
|
|
72
|
+
<!-- ============================================================
|
|
73
|
+
Global Continuous Execution Rules
|
|
74
|
+
============================================================ -->
|
|
75
|
+
<block type="rule" id="GLOBAL-R1" level="forbidden" desc="Continuous execution constraints — NEVER violate">
|
|
76
|
+
<field name="text">DO NOT ask user "Should I continue?" or "How would you like to proceed?" between steps</field>
|
|
77
|
+
<field name="text">DO NOT offer options like "Full execution / Sample execution / Pause" — always execute ALL steps to completion</field>
|
|
78
|
+
<field name="text">DO NOT suggest "Let me split this into batches" or "Let's do this in parts" — process ALL items sequentially</field>
|
|
79
|
+
<field name="text">DO NOT pause to list what you plan to do next — just do it</field>
|
|
80
|
+
<field name="text">DO NOT ask for confirmation before generating output files</field>
|
|
81
|
+
<field name="text">ONLY pause at explicit <event action="confirm"> blocks defined in the workflow</field>
|
|
82
|
+
</block>
|
|
83
|
+
|
|
84
|
+
<!-- ============================================================
|
|
85
|
+
Global Technology Stack Constraints
|
|
86
|
+
============================================================ -->
|
|
87
|
+
<block type="rule" id="GLOBAL-R-TECHSTACK" level="forbidden" desc="Technology stack constraints — NEVER violate">
|
|
88
|
+
<field name="text">FORBIDDEN: Python, Ruby, Perl, compiled binaries, or any runtime requiring separate installation</field>
|
|
89
|
+
<field name="text">PERMITTED scripting: PowerShell (Windows) and Bash (Linux/Mac) ONLY</field>
|
|
90
|
+
<field name="text">PERMITTED Node.js: ONLY for existing project scripts</field>
|
|
91
|
+
<field name="text">For JSON validation use: node -e "JSON.parse(require('fs').readFileSync('file.json','utf8'))"</field>
|
|
92
|
+
<field name="text">DO NOT create temporary .py, .rb, .pl, .bat files — use inline commands via run_in_terminal</field>
|
|
93
|
+
</block>
|
|
94
|
+
|
|
95
|
+
<!-- ============================================================
|
|
96
|
+
Pre-completion Validation Rule
|
|
97
|
+
============================================================ -->
|
|
98
|
+
<block type="rule" id="PRE-COMPLETION-R1" level="mandatory" desc="Completion marker validation — MUST verify before writing done marker">
|
|
99
|
+
<field name="text">MUST verify ALL required output files exist before writing .done-ui-style.json marker</field>
|
|
100
|
+
<field name="text">Required files: ui-style-guide.md, page-types/page-type-summary.md, components/component-library.md, layouts/page-layouts.md, styles/color-system.md</field>
|
|
101
|
+
<field name="text">If ANY required file is missing, generate it BEFORE writing completion marker</field>
|
|
102
|
+
<field name="text">NEVER write completion marker with missing required files</field>
|
|
103
|
+
</block>
|
|
104
|
+
|
|
105
|
+
<!-- ============================================================
|
|
106
|
+
Gateway: Platform Type Validation
|
|
107
|
+
============================================================ -->
|
|
108
|
+
<block type="gateway" id="G0" mode="exclusive" desc="Check platform type eligibility">
|
|
109
|
+
<branch test="${platform_type} NOT IN ['web', 'mobile', 'desktop']" name="Skip non-frontend platform">
|
|
110
|
+
<block type="event" id="E0-Skip" action="log" level="warn" desc="Log skip reason">
|
|
111
|
+
Skipping UI style generation: {platform_type} is not a frontend platform
|
|
112
|
+
</block>
|
|
113
|
+
<block type="output" id="O-Skip" desc="Skip result">
|
|
114
|
+
<field name="status" value="skipped"/>
|
|
115
|
+
<field name="reason" value="Not a frontend platform"/>
|
|
116
|
+
</block>
|
|
117
|
+
</branch>
|
|
118
|
+
<branch test="${platform_type} IN ['web', 'mobile', 'desktop']" name="Process frontend platform">
|
|
119
|
+
|
|
120
|
+
<!-- ============================================================
|
|
121
|
+
Step 0: Read UI Style Templates
|
|
122
|
+
============================================================ -->
|
|
123
|
+
<block type="task" id="S0-B1" action="run-skill" status="pending" desc="Read UI style template files">
|
|
124
|
+
<description>Read all UI style template files to understand the required content structure</description>
|
|
125
|
+
<template-files>
|
|
126
|
+
<file>../speccrew-knowledge-techs-generate-ui-style/templates/COMPONENT-LIBRARY-TEMPLATE.md</file>
|
|
127
|
+
<file>../speccrew-knowledge-techs-generate-ui-style/templates/PAGE-LAYOUTS-TEMPLATE.md</file>
|
|
128
|
+
<file>../speccrew-knowledge-techs-generate-ui-style/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md</file>
|
|
129
|
+
<file>../speccrew-knowledge-techs-generate-ui-style/templates/COLOR-SYSTEM-TEMPLATE.md</file>
|
|
130
|
+
</template-files>
|
|
131
|
+
<purpose>Understand template structure for fallback path copy+fill workflow</purpose>
|
|
132
|
+
<output var="templates_loaded"/>
|
|
133
|
+
</block>
|
|
134
|
+
|
|
135
|
+
<block type="checkpoint" id="CP0" name="templates_read" desc="Templates read successfully">
|
|
136
|
+
<field name="verify" value="${templates_loaded} == true"/>
|
|
137
|
+
</block>
|
|
138
|
+
|
|
139
|
+
<!-- ============================================================
|
|
140
|
+
Step 1: UI Style Analysis
|
|
141
|
+
============================================================ -->
|
|
142
|
+
<block type="rule" id="S1-R1" level="mandatory" desc="Directory ownership rules">
|
|
143
|
+
<field name="text">ui-style/ is fully managed by techs pipeline (this skill)</field>
|
|
144
|
+
<field name="text">ui-style-patterns/ is managed by bizs pipeline — NOT created by this skill</field>
|
|
145
|
+
</block>
|
|
146
|
+
|
|
147
|
+
<!-- Gateway: Choose Analysis Path -->
|
|
148
|
+
<block type="gateway" id="G1" mode="exclusive" desc="Determine analysis path">
|
|
149
|
+
<branch test="${ui_analyzer_available} == true" name="Primary Path - UI Analyzer Available">
|
|
150
|
+
|
|
151
|
+
<!-- Step 1.1: Invoke UI Analyzer Skill -->
|
|
152
|
+
<block type="task" id="S1-B1a" action="run-skill" status="pending" desc="Invoke UI analyzer skill">
|
|
153
|
+
<description>CRITICAL: Use Skill tool to invoke speccrew-knowledge-techs-ui-analyze</description>
|
|
154
|
+
<skill>speccrew-knowledge-techs-ui-analyze</skill>
|
|
155
|
+
<parameters>
|
|
156
|
+
source_path={source_path}
|
|
157
|
+
platform_id={platform_id}
|
|
158
|
+
platform_type={platform_type}
|
|
159
|
+
framework={framework}
|
|
160
|
+
output_path={output_path}/ui-style/
|
|
161
|
+
language={language}
|
|
162
|
+
</parameters>
|
|
163
|
+
<output var="ui_analyze_result"/>
|
|
164
|
+
</block>
|
|
165
|
+
|
|
166
|
+
<!-- Verify Primary Path Output -->
|
|
167
|
+
<block type="task" id="S1-B1b" action="run-script" status="pending" desc="Verify UI analyzer output files">
|
|
168
|
+
<description>Wait for completion and verify output files exist</description>
|
|
169
|
+
<required-files>
|
|
170
|
+
<file>{output_path}/ui-style/ui-style-guide.md</file>
|
|
171
|
+
<file>{output_path}/ui-style/page-types/page-type-summary.md</file>
|
|
172
|
+
<file>{output_path}/ui-style/components/component-library.md</file>
|
|
173
|
+
<file>{output_path}/ui-style/layouts/page-layouts.md</file>
|
|
174
|
+
<file>{output_path}/ui-style/styles/color-system.md</file>
|
|
175
|
+
</required-files>
|
|
176
|
+
<output var="primary_output_verified"/>
|
|
177
|
+
</block>
|
|
178
|
+
|
|
179
|
+
<block type="gateway" id="G1a" mode="guard" test="${primary_output_verified} == true" fail-action="fallback" desc="Check primary path success">
|
|
180
|
+
<field name="fallback_target" value="secondary_path"/>
|
|
181
|
+
<field name="message">Primary path failed, falling back to secondary path</field>
|
|
182
|
+
</block>
|
|
183
|
+
|
|
184
|
+
<block type="event" id="E1a" action="log" level="info" desc="Record analysis level">
|
|
185
|
+
Primary path succeeded. ui_analysis_level = "full"
|
|
186
|
+
</block>
|
|
187
|
+
|
|
188
|
+
<field name="ui_analysis_level" value="full"/>
|
|
189
|
+
|
|
190
|
+
</branch>
|
|
191
|
+
<branch test="${ui_analyzer_available} == false OR ${primary_output_verified} == false" name="Secondary Path - Template Fill">
|
|
192
|
+
|
|
193
|
+
<!-- Step 1.2: Secondary Path - Create Directory Structure -->
|
|
194
|
+
<block type="task" id="S1-B2a" action="run-script" status="pending" desc="Create ui-style directory structure">
|
|
195
|
+
<description>Create all required directories for UI style output</description>
|
|
196
|
+
<create-directories>
|
|
197
|
+
<path>{output_path}/ui-style/</path>
|
|
198
|
+
<path>{output_path}/ui-style/page-types/</path>
|
|
199
|
+
<path>{output_path}/ui-style/components/</path>
|
|
200
|
+
<path>{output_path}/ui-style/layouts/</path>
|
|
201
|
+
<path>{output_path}/ui-style/styles/</path>
|
|
202
|
+
</create-directories>
|
|
203
|
+
</block>
|
|
204
|
+
|
|
205
|
+
<!-- Step 1.2.1: Generate ui-style-guide.md -->
|
|
206
|
+
<block type="task" id="S1-B2b" action="run-skill" status="pending" desc="Generate minimal ui-style-guide.md">
|
|
207
|
+
<description>Manually scan source code and generate ui-style-guide.md</description>
|
|
208
|
+
<scan-directories>
|
|
209
|
+
<dir>{source_path}/src/styles/</dir>
|
|
210
|
+
<dir>{source_path}/src/theme/</dir>
|
|
211
|
+
<dir>{source_path}/src/components/</dir>
|
|
212
|
+
<dir>{source_path}/src/pages/</dir>
|
|
213
|
+
<dir>{source_path}/src/views/</dir>
|
|
214
|
+
</scan-directories>
|
|
215
|
+
<extract>
|
|
216
|
+
<item>Design system: identify UI framework from dependencies</item>
|
|
217
|
+
<item>Color system: scan CSS variables, theme files</item>
|
|
218
|
+
<item>Typography: scan font-family declarations</item>
|
|
219
|
+
<item>Component library: list component directories</item>
|
|
220
|
+
<item>Page types: list page directories/files</item>
|
|
221
|
+
</extract>
|
|
222
|
+
<output-file>{output_path}/ui-style/ui-style-guide.md</output-file>
|
|
223
|
+
<note>If automated analysis unavailable, use reference-only format</note>
|
|
224
|
+
</block>
|
|
225
|
+
|
|
226
|
+
<!-- Step 1.2.2: Copy and Fill Templates -->
|
|
227
|
+
<block type="task" id="S1-B2c" action="run-skill" status="pending" desc="Copy template and fill component-library.md">
|
|
228
|
+
<description>Copy COMPONENT-LIBRARY-TEMPLATE.md and fill with search_replace</description>
|
|
229
|
+
<template-source>../speccrew-knowledge-techs-generate-ui-style/templates/COMPONENT-LIBRARY-TEMPLATE.md</template-source>
|
|
230
|
+
<output-file>{output_path}/ui-style/components/component-library.md</output-file>
|
|
231
|
+
<constraints>
|
|
232
|
+
<rule level="forbidden">Using create_file to write entire document</rule>
|
|
233
|
+
<rule level="mandatory">Use search_replace to fill each section</rule>
|
|
234
|
+
<rule level="mandatory">Include props tables for top 5 components</rule>
|
|
235
|
+
</constraints>
|
|
236
|
+
<fill-sections>COMPONENT_CATEGORIES, API_REFERENCE, COMPOSITION_PATTERNS, AGENT_GUIDE</fill-sections>
|
|
237
|
+
</block>
|
|
238
|
+
|
|
239
|
+
<block type="task" id="S1-B2d" action="run-skill" status="pending" desc="Copy template and fill page-layouts.md">
|
|
240
|
+
<description>Copy PAGE-LAYOUTS-TEMPLATE.md and fill with search_replace</description>
|
|
241
|
+
<template-source>../speccrew-knowledge-techs-generate-ui-style/templates/PAGE-LAYOUTS-TEMPLATE.md</template-source>
|
|
242
|
+
<output-file>{output_path}/ui-style/layouts/page-layouts.md</output-file>
|
|
243
|
+
<fill-sections>LAYOUT_TYPES, LAYOUT_DETAILS, NAVIGATION</fill-sections>
|
|
244
|
+
</block>
|
|
245
|
+
|
|
246
|
+
<block type="task" id="S1-B2e" action="run-skill" status="pending" desc="Copy template and fill page-type-summary.md">
|
|
247
|
+
<description>Copy PAGE-TYPE-SUMMARY-TEMPLATE.md and fill with search_replace</description>
|
|
248
|
+
<template-source>../speccrew-knowledge-techs-generate-ui-style/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md</template-source>
|
|
249
|
+
<output-file>{output_path}/ui-style/page-types/page-type-summary.md</output-file>
|
|
250
|
+
<fill-sections>PAGE_TYPES, PAGE_TYPE_DETAILS, ROUTING</fill-sections>
|
|
251
|
+
</block>
|
|
252
|
+
|
|
253
|
+
<block type="task" id="S1-B2f" action="run-skill" status="pending" desc="Copy template and fill color-system.md">
|
|
254
|
+
<description>Copy COLOR-SYSTEM-TEMPLATE.md and fill with search_replace</description>
|
|
255
|
+
<template-source>../speccrew-knowledge-techs-generate-ui-style/templates/COLOR-SYSTEM-TEMPLATE.md</template-source>
|
|
256
|
+
<output-file>{output_path}/ui-style/styles/color-system.md</output-file>
|
|
257
|
+
<fill-sections>THEME_COLORS, FUNCTIONAL_COLORS, SEMANTIC_TOKENS, TYPOGRAPHY, SPACING</fill-sections>
|
|
258
|
+
</block>
|
|
259
|
+
|
|
260
|
+
<!-- Self-Verification -->
|
|
261
|
+
<block type="task" id="S1-B2g" action="run-script" status="pending" desc="Verify all mandatory files exist">
|
|
262
|
+
<description>Self-verification checklist - MUST complete before proceeding</description>
|
|
263
|
+
<checklist>
|
|
264
|
+
<item verify="exists">{output_path}/ui-style/ui-style-guide.md</item>
|
|
265
|
+
<item verify="exists">{output_path}/ui-style/page-types/page-type-summary.md</item>
|
|
266
|
+
<item verify="exists">{output_path}/ui-style/components/component-library.md</item>
|
|
267
|
+
<item verify="exists">{output_path}/ui-style/layouts/page-layouts.md</item>
|
|
268
|
+
<item verify="exists">{output_path}/ui-style/styles/color-system.md</item>
|
|
269
|
+
</checklist>
|
|
270
|
+
<on-fail>Generate missing file before proceeding</on-fail>
|
|
271
|
+
<output var="secondary_verification"/>
|
|
272
|
+
</block>
|
|
273
|
+
|
|
274
|
+
<block type="event" id="E1b" action="log" level="info" desc="Record analysis level">
|
|
275
|
+
Secondary path completed. ui_analysis_level = "minimal"
|
|
276
|
+
</block>
|
|
277
|
+
|
|
278
|
+
<field name="ui_analysis_level" value="minimal"/>
|
|
279
|
+
|
|
280
|
+
</branch>
|
|
281
|
+
<branch test="${source_structure_non_standard} == true" name="Tertiary Path - Reference Only">
|
|
282
|
+
|
|
283
|
+
<!-- Step 1.3: Tertiary Path - Reference Only -->
|
|
284
|
+
<block type="task" id="S1-B3a" action="run-skill" status="pending" desc="Generate reference-only ui-style-guide.md">
|
|
285
|
+
<description>Create ui-style-guide.md with references only when analysis is not possible</description>
|
|
286
|
+
<output-file>{output_path}/ui-style/ui-style-guide.md</output-file>
|
|
287
|
+
<content>
|
|
288
|
+
# UI Style Guide - {platform_id}
|
|
289
|
+
|
|
290
|
+
> Note: Automated and manual UI analysis were not possible for this platform.
|
|
291
|
+
> Manual inspection of source code is required.
|
|
292
|
+
|
|
293
|
+
## References
|
|
294
|
+
- Source components: {source_path}/src/components/ (if exists)
|
|
295
|
+
- Source pages: {source_path}/src/pages/ (if exists)
|
|
296
|
+
- Style files: {source_path}/src/styles/ (if exists)
|
|
297
|
+
- Package dependencies: {source_path}/package.json
|
|
298
|
+
</content>
|
|
299
|
+
</block>
|
|
300
|
+
|
|
301
|
+
<block type="event" id="E1c" action="log" level="info" desc="Record analysis level">
|
|
302
|
+
Tertiary path completed. ui_analysis_level = "reference_only"
|
|
303
|
+
</block>
|
|
304
|
+
|
|
305
|
+
<field name="ui_analysis_level" value="reference_only"/>
|
|
306
|
+
|
|
307
|
+
</branch>
|
|
308
|
+
</block>
|
|
309
|
+
|
|
310
|
+
<block type="checkpoint" id="CP1" name="ui_style_analysis_complete" desc="UI style analysis complete">
|
|
311
|
+
<field name="verify" value="${ui_analysis_level} IN ['full', 'minimal', 'reference_only']"/>
|
|
312
|
+
</block>
|
|
313
|
+
|
|
314
|
+
<!-- ============================================================
|
|
315
|
+
Step 2: Write Output Files
|
|
316
|
+
============================================================ -->
|
|
317
|
+
<block type="task" id="S2-B1" action="run-script" status="pending" desc="Ensure output directories exist">
|
|
318
|
+
<description>Create output directory structure if not exists</description>
|
|
319
|
+
<create-directories>
|
|
320
|
+
<path>{output_path}/ui-style/</path>
|
|
321
|
+
<path>{output_path}/ui-style/page-types/</path>
|
|
322
|
+
<path>{output_path}/ui-style/components/</path>
|
|
323
|
+
<path>{output_path}/ui-style/layouts/</path>
|
|
324
|
+
<path>{output_path}/ui-style/styles/</path>
|
|
325
|
+
</create-directories>
|
|
326
|
+
</block>
|
|
327
|
+
|
|
328
|
+
<block type="event" id="E2" action="log" level="info" desc="Output files written">
|
|
329
|
+
All UI style documents written to {output_path}/ui-style/
|
|
330
|
+
</block>
|
|
331
|
+
|
|
332
|
+
<block type="checkpoint" id="CP2" name="output_files_written" desc="Output files written">
|
|
333
|
+
<field name="verify" value="file_exists({output_path}/ui-style/ui-style-guide.md)"/>
|
|
334
|
+
</block>
|
|
335
|
+
|
|
336
|
+
<!-- ============================================================
|
|
337
|
+
Step 3: Generate Analysis Report
|
|
338
|
+
============================================================ -->
|
|
339
|
+
<block type="task" id="S3-B1" action="run-script" status="pending" desc="Generate analysis report JSON">
|
|
340
|
+
<description>Generate analysis report with topic coverage details</description>
|
|
341
|
+
<output-file>{completed_dir}/{platform_id}.analysis-ui-style.json</output-file>
|
|
342
|
+
<format>
|
|
343
|
+
{
|
|
344
|
+
"platform_id": "{platform_id}",
|
|
345
|
+
"platform_type": "{platform_type}",
|
|
346
|
+
"worker_type": "ui-style",
|
|
347
|
+
"analyzed_at": "{ISO 8601 timestamp}",
|
|
348
|
+
"ui_analysis_level": "{ui_analysis_level}",
|
|
349
|
+
"topics": {
|
|
350
|
+
"page_types": { "status": "found|not_found|partial", "count": N, "files_analyzed": [...] },
|
|
351
|
+
"components": { "status": "found|not_found|partial", "count": N, "files_analyzed": [...] },
|
|
352
|
+
"layouts": { "status": "found|not_found|partial", "count": N, "files_analyzed": [...] },
|
|
353
|
+
"styles": { "status": "found|not_found|partial", "files_analyzed": [...] }
|
|
354
|
+
},
|
|
355
|
+
"documents_generated": [...],
|
|
356
|
+
"source_dirs_scanned": [...],
|
|
357
|
+
"coverage_summary": { "total_topics": 4, "found": N, "not_found": N, "partial": N, "coverage_percent": N }
|
|
358
|
+
}
|
|
359
|
+
</format>
|
|
360
|
+
<output var="analysis_report"/>
|
|
361
|
+
</block>
|
|
362
|
+
|
|
363
|
+
<block type="checkpoint" id="CP3" name="analysis_report_generated" desc="Analysis report generated">
|
|
364
|
+
<field name="verify" value="file_exists({completed_dir}/{platform_id}.analysis-ui-style.json)"/>
|
|
365
|
+
</block>
|
|
366
|
+
|
|
367
|
+
<!-- ============================================================
|
|
368
|
+
Step 4: Report Results
|
|
369
|
+
============================================================ -->
|
|
370
|
+
<block type="task" id="S4-B1" action="run-script" status="pending" desc="Generate completion marker">
|
|
371
|
+
<description>Create completion marker file after verifying all required files</description>
|
|
372
|
+
<validation>
|
|
373
|
+
<rule level="mandatory">Verify all required files exist before writing marker</rule>
|
|
374
|
+
<required-files>
|
|
375
|
+
<file>{output_path}/ui-style/ui-style-guide.md</file>
|
|
376
|
+
<file>{output_path}/ui-style/page-types/page-type-summary.md</file>
|
|
377
|
+
<file>{output_path}/ui-style/components/component-library.md</file>
|
|
378
|
+
<file>{output_path}/ui-style/layouts/page-layouts.md</file>
|
|
379
|
+
<file>{output_path}/ui-style/styles/color-system.md</file>
|
|
380
|
+
</required-files>
|
|
381
|
+
</validation>
|
|
382
|
+
<output-file>{completed_dir}/{platform_id}.done-ui-style.json</output-file>
|
|
383
|
+
<format>
|
|
384
|
+
{
|
|
385
|
+
"platform_id": "{platform_id}",
|
|
386
|
+
"worker_type": "ui-style",
|
|
387
|
+
"status": "completed",
|
|
388
|
+
"ui_analysis_level": "{ui_analysis_level}",
|
|
389
|
+
"documents_generated": [...],
|
|
390
|
+
"analysis_file": "{platform_id}.analysis-ui-style.json",
|
|
391
|
+
"completed_at": "{ISO timestamp}"
|
|
392
|
+
}
|
|
393
|
+
</format>
|
|
394
|
+
<output var="completion_marker"/>
|
|
395
|
+
</block>
|
|
396
|
+
|
|
397
|
+
<block type="event" id="E4" action="log" level="info" desc="Report completion">
|
|
398
|
+
Platform UI Style Documents Generated: {platform_id}
|
|
399
|
+
- ui-style-guide.md: ✓ (analysis level: {ui_analysis_level})
|
|
400
|
+
- page-types/page-type-summary.md: ✓
|
|
401
|
+
- components/component-library.md: ✓
|
|
402
|
+
- layouts/page-layouts.md: ✓
|
|
403
|
+
- styles/color-system.md: ✓
|
|
404
|
+
- Output Directory: {output_path}/ui-style/
|
|
405
|
+
- Analysis Report: {completed_dir}/{platform_id}.analysis-ui-style.json
|
|
406
|
+
- Completion Marker: {completed_dir}/{platform_id}.done-ui-style.json
|
|
407
|
+
</block>
|
|
408
|
+
|
|
409
|
+
<!-- ============================================================
|
|
410
|
+
Output Results
|
|
411
|
+
============================================================ -->
|
|
412
|
+
<block type="output" id="O1" desc="UI style generation results">
|
|
413
|
+
<field name="platform_id" from="${platform_id}" type="string"/>
|
|
414
|
+
<field name="status" value="completed"/>
|
|
415
|
+
<field name="ui_analysis_level" from="${ui_analysis_level}" type="string"/>
|
|
416
|
+
<field name="output_directory" from="${output_path}/ui-style/" type="string"/>
|
|
417
|
+
<field name="documents_generated" type="array">
|
|
418
|
+
<item>ui-style-guide.md</item>
|
|
419
|
+
<item>page-types/page-type-summary.md</item>
|
|
420
|
+
<item>components/component-library.md</item>
|
|
421
|
+
<item>layouts/page-layouts.md</item>
|
|
422
|
+
<item>styles/color-system.md</item>
|
|
423
|
+
</field>
|
|
424
|
+
<field name="analysis_report" from="${completed_dir}/{platform_id}.analysis-ui-style.json" type="string"/>
|
|
425
|
+
<field name="completion_marker" from="${completed_dir}/{platform_id}.done-ui-style.json" type="string"/>
|
|
426
|
+
</block>
|
|
427
|
+
|
|
428
|
+
</branch>
|
|
429
|
+
</block>
|
|
430
|
+
|
|
431
|
+
<!-- ============================================================
|
|
432
|
+
Error Handling
|
|
433
|
+
============================================================ -->
|
|
434
|
+
<block type="error-handler" id="EH1" desc="Global error handling">
|
|
435
|
+
<try>
|
|
436
|
+
<!-- Main workflow defined in branches above -->
|
|
437
|
+
</try>
|
|
438
|
+
<catch on="skill_invocation_failed">
|
|
439
|
+
<block type="event" id="EH1-E1" action="log" level="warn" desc="Skill invocation failed">
|
|
440
|
+
UI analyzer skill invocation failed, falling back to secondary path
|
|
441
|
+
</block>
|
|
442
|
+
</catch>
|
|
443
|
+
<catch on="output_write_failed">
|
|
444
|
+
<block type="event" id="EH1-E2" action="log" level="error" desc="Output write failed">
|
|
445
|
+
Failed to write output files: {error.message}
|
|
446
|
+
</block>
|
|
447
|
+
</catch>
|
|
448
|
+
</block>
|
|
449
|
+
|
|
450
|
+
</workflow>
|
|
451
|
+
|
|
452
|
+
---
|
|
453
|
+
|
|
454
|
+
## Output Directory Structure
|
|
455
|
+
|
|
456
|
+
```
|
|
457
|
+
{output_path}/
|
|
458
|
+
└── ui-style/
|
|
459
|
+
├── ui-style-guide.md # Main UI style guide (Required)
|
|
460
|
+
├── page-types/
|
|
461
|
+
│ ├── page-type-summary.md # Page type overview (Required)
|
|
462
|
+
│ └── [type]-pages.md # Per-type detail (Dynamic)
|
|
463
|
+
├── components/
|
|
464
|
+
│ ├── component-library.md # Component catalog (Required)
|
|
465
|
+
│ ├── common-components.md # Common components (Required)
|
|
466
|
+
│ ├── business-components.md # Business components (Required)
|
|
467
|
+
│ └── {component-name}.md # Per-component detail (Dynamic)
|
|
468
|
+
├── layouts/
|
|
469
|
+
│ ├── page-layouts.md # Layout patterns (Required)
|
|
470
|
+
│ ├── navigation-patterns.md # Navigation patterns (Required)
|
|
471
|
+
│ └── {layout-name}-layout.md # Per-layout detail (Dynamic)
|
|
472
|
+
└── styles/
|
|
473
|
+
├── color-system.md # Color system (Required)
|
|
474
|
+
├── typography.md # Typography (Required)
|
|
475
|
+
└── spacing-system.md # Spacing system (Required)
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
## Directory Ownership
|
|
479
|
+
|
|
480
|
+
- `ui-style/` — Fully managed by this skill (techs pipeline)
|
|
481
|
+
- Contains: ui-style-guide.md, styles/, page-types/, components/, layouts/
|
|
482
|
+
- Source: Framework-level design system analysis from source code
|
|
483
|
+
- `ui-style-patterns/` — Managed by bizs pipeline (Stage 3.5: bizs-ui-style-extract)
|
|
484
|
+
- Contains: Business pattern aggregation from feature documents
|
|
485
|
+
- NOT created or written by this skill
|
|
486
|
+
- May not exist if bizs pipeline has not been executed
|
|
487
|
+
|
|
488
|
+
---
|
|
489
|
+
|
|
490
|
+
## Quality Requirements
|
|
491
|
+
|
|
492
|
+
- ui-style-guide.md MUST have substantial content (not just template placeholders)
|
|
493
|
+
- At least 5 mandatory files MUST exist (see Self-Verification Checklist)
|
|
494
|
+
- Analysis report MUST honestly reflect coverage level
|
|
495
|
+
- All paths in documents MUST be relative (never absolute or file:// protocol)
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
499
|
+
## Error Handling
|
|
500
|
+
|
|
501
|
+
| Error Type | Action |
|
|
502
|
+
|------------|--------|
|
|
503
|
+
| Platform type is backend/api | Skip execution, return skipped status |
|
|
504
|
+
| UI analyzer skill invocation fails | Execute Secondary Path (template fill) |
|
|
505
|
+
| Source code structure is non-standard | Execute Tertiary Path (reference only) |
|
|
506
|
+
| Template not found | Use default structure, log warning |
|
|
507
|
+
| Any path MUST output the done file and analysis file | Never report "completed" with missing mandatory files |
|
|
508
|
+
|
|
509
|
+
---
|
|
510
|
+
|
|
511
|
+
## Task Completion Report
|
|
512
|
+
|
|
513
|
+
Upon completion, return the following structured report:
|
|
514
|
+
|
|
515
|
+
```json
|
|
516
|
+
{
|
|
517
|
+
"status": "success | partial | failed",
|
|
518
|
+
"skill": "speccrew-knowledge-techs-generate-ui-style-xml",
|
|
519
|
+
"output_files": [
|
|
520
|
+
"{output_path}/ui-style/ui-style-guide.md",
|
|
521
|
+
"{output_path}/ui-style/page-types/page-type-summary.md",
|
|
522
|
+
"{output_path}/ui-style/components/component-library.md",
|
|
523
|
+
"{output_path}/ui-style/layouts/page-layouts.md",
|
|
524
|
+
"{output_path}/ui-style/styles/color-system.md",
|
|
525
|
+
"{completed_dir}/{platform_id}.analysis-ui-style.json",
|
|
526
|
+
"{completed_dir}/{platform_id}.done-ui-style.json"
|
|
527
|
+
],
|
|
528
|
+
"summary": "UI style documents generated for {platform_id} at {ui_analysis_level} analysis level",
|
|
529
|
+
"metrics": {
|
|
530
|
+
"components_documented": 0,
|
|
531
|
+
"style_patterns_captured": 0,
|
|
532
|
+
"design_tokens_extracted": 0
|
|
533
|
+
},
|
|
534
|
+
"errors": [],
|
|
535
|
+
"next_steps": [
|
|
536
|
+
"Review ui-style-guide.md for design system completeness",
|
|
537
|
+
"Coordinate with bizs-ui-style-extract for business pattern integration"
|
|
538
|
+
]
|
|
539
|
+
}
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
---
|
|
543
|
+
|
|
544
|
+
## Checklist
|
|
545
|
+
|
|
546
|
+
### Pre-Generation
|
|
547
|
+
- [ ] Platform type verified (web/mobile/desktop only)
|
|
548
|
+
- [ ] Template files read and understood
|
|
549
|
+
- [ ] Source directory structure scanned
|
|
550
|
+
|
|
551
|
+
### UI Style Analysis
|
|
552
|
+
- [ ] `speccrew-knowledge-techs-ui-analyze` skill invoked (Primary Path)
|
|
553
|
+
- [ ] If Primary Path failed → Secondary Path executed
|
|
554
|
+
- [ ] If Secondary Path failed → Tertiary Path executed
|
|
555
|
+
- [ ] All mandatory files created per Self-Verification Checklist
|
|
556
|
+
|
|
557
|
+
### Output Verification
|
|
558
|
+
- [ ] ui-style/ui-style-guide.md exists and has content
|
|
559
|
+
- [ ] ui-style/page-types/page-type-summary.md exists and has content
|
|
560
|
+
- [ ] ui-style/components/component-library.md exists and has content
|
|
561
|
+
- [ ] ui-style/layouts/page-layouts.md exists and has content
|
|
562
|
+
- [ ] ui-style/styles/color-system.md exists and has content
|
|
563
|
+
|
|
564
|
+
### Reporting
|
|
565
|
+
- [ ] Analysis report generated: `{platform_id}.analysis-ui-style.json`
|
|
566
|
+
- [ ] Completion marker generated: `{platform_id}.done-ui-style.json`
|
|
567
|
+
- [ ] Console output reported with correct status
|
|
568
|
+
|
|
569
|
+
---
|
|
570
|
+
|
|
571
|
+
## CONTINUOUS EXECUTION RULES
|
|
572
|
+
|
|
573
|
+
This skill MUST execute all steps continuously without unnecessary interruptions.
|
|
574
|
+
|
|
575
|
+
### FORBIDDEN Interruptions
|
|
576
|
+
|
|
577
|
+
1. DO NOT ask user "Should I continue?" after completing a step
|
|
578
|
+
2. DO NOT suggest "Let me split this into batches" or "Let's do this in parts"
|
|
579
|
+
3. DO NOT pause to list what you plan to do next — just do it
|
|
580
|
+
4. DO NOT ask for confirmation before generating output files
|
|
581
|
+
5. DO NOT warn about "large number of files" — proceed with generation
|
|
582
|
+
6. DO NOT offer "Should I proceed with the remaining items?"
|
|
583
|
+
7. DO NOT present options like "Full execution / Sample execution / Pause"
|
|
584
|
+
|
|
585
|
+
### When to Pause (ONLY these cases)
|
|
586
|
+
|
|
587
|
+
1. Explicit `<event action="confirm">` blocks in the workflow
|
|
588
|
+
2. Ambiguous requirements that genuinely need clarification
|
|
589
|
+
3. Unrecoverable errors that prevent further progress
|
|
590
|
+
4. Security-sensitive operations (e.g., deleting existing files)
|
|
591
|
+
|
|
592
|
+
### Execution Behavior
|
|
593
|
+
|
|
594
|
+
- When multiple templates need filling, process ALL of them sequentially without asking
|
|
595
|
+
- Use checkpoint files to track progress, enabling resumption if interrupted
|
|
596
|
+
- If context window is approaching limit, save progress and inform user how to resume
|
|
597
|
+
- NEVER voluntarily stop mid-process to ask if user wants to continue
|