speccrew 0.6.69 → 0.7.1

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.
Files changed (137) hide show
  1. package/.speccrew/agents/speccrew-task-worker.md +1 -1
  2. package/.speccrew/agents/speccrew-team-leader.md +336 -189
  3. package/.speccrew/skills/speccrew-agentflow-manager/SKILL.md +161 -0
  4. package/.speccrew/skills/speccrew-agentflow-manager/workflow.agentflow.xml +347 -0
  5. package/.speccrew/skills/speccrew-deploy-build/SKILL.md +3 -56
  6. package/.speccrew/skills/speccrew-deploy-build/workflow.agentflow.xml +125 -0
  7. package/.speccrew/skills/speccrew-deploy-migrate/SKILL.md +3 -64
  8. package/.speccrew/skills/speccrew-deploy-migrate/workflow.agentflow.xml +135 -0
  9. package/.speccrew/skills/speccrew-deploy-smoke-test/SKILL.md +4 -156
  10. package/.speccrew/skills/speccrew-deploy-smoke-test/workflow.agentflow.xml +178 -0
  11. package/.speccrew/skills/speccrew-deploy-startup/SKILL.md +3 -135
  12. package/.speccrew/skills/speccrew-deploy-startup/workflow.agentflow.xml +223 -0
  13. package/.speccrew/skills/speccrew-dev-backend/SKILL.md +10 -2
  14. package/.speccrew/skills/speccrew-dev-backend/workflow.agentflow.xml +254 -0
  15. package/.speccrew/skills/speccrew-dev-desktop-electron/SKILL.md +10 -2
  16. package/.speccrew/skills/speccrew-dev-desktop-electron/workflow.agentflow.xml +259 -0
  17. package/.speccrew/skills/speccrew-dev-desktop-tauri/SKILL.md +10 -2
  18. package/.speccrew/skills/speccrew-dev-desktop-tauri/workflow.agentflow.xml +245 -0
  19. package/.speccrew/skills/speccrew-dev-frontend/SKILL.md +10 -2
  20. package/.speccrew/skills/speccrew-dev-frontend/workflow.agentflow.xml +262 -0
  21. package/.speccrew/skills/speccrew-dev-mobile/SKILL.md +10 -2
  22. package/.speccrew/skills/speccrew-dev-mobile/workflow.agentflow.xml +244 -0
  23. package/.speccrew/skills/speccrew-dev-review-backend/SKILL.md +10 -2
  24. package/.speccrew/skills/speccrew-dev-review-backend/workflow.agentflow.xml +251 -0
  25. package/.speccrew/skills/speccrew-dev-review-desktop/SKILL.md +10 -2
  26. package/.speccrew/skills/speccrew-dev-review-desktop/workflow.agentflow.xml +214 -0
  27. package/.speccrew/skills/speccrew-dev-review-frontend/SKILL.md +10 -2
  28. package/.speccrew/skills/speccrew-dev-review-frontend/workflow.agentflow.xml +213 -0
  29. package/.speccrew/skills/speccrew-dev-review-mobile/SKILL.md +10 -2
  30. package/.speccrew/skills/speccrew-dev-review-mobile/workflow.agentflow.xml +214 -0
  31. package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +7 -1
  32. package/.speccrew/skills/speccrew-fd-api-contract/workflow.agentflow.xml +222 -0
  33. package/.speccrew/skills/speccrew-fd-feature-analyze/SKILL.md +7 -1
  34. package/.speccrew/skills/speccrew-fd-feature-analyze/workflow.agentflow.xml +223 -0
  35. package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +7 -1
  36. package/.speccrew/skills/speccrew-fd-feature-design/workflow.agentflow.xml +322 -0
  37. package/.speccrew/skills/speccrew-get-timestamp/SKILL.md +3 -39
  38. package/.speccrew/skills/speccrew-get-timestamp/workflow.agentflow.xml +43 -0
  39. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +57 -508
  40. package/.speccrew/skills/{speccrew-knowledge-bizs-api-analyze-xml/SKILL.md → speccrew-knowledge-bizs-api-analyze/workflow.agentflow.xml} +1 -154
  41. package/.speccrew/skills/speccrew-knowledge-bizs-api-graph/SKILL.md +73 -283
  42. package/.speccrew/skills/{speccrew-knowledge-bizs-api-graph-xml/SKILL.md → speccrew-knowledge-bizs-api-graph/workflow.agentflow.xml} +0 -298
  43. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +931 -801
  44. package/.speccrew/skills/{speccrew-knowledge-bizs-dispatch-xml/SKILL.md → speccrew-knowledge-bizs-dispatch/workflow.agentflow.xml} +42 -272
  45. package/.speccrew/skills/speccrew-knowledge-bizs-identify-entries/SKILL.md +263 -71
  46. package/.speccrew/skills/{speccrew-knowledge-bizs-identify-entries-xml/SKILL.md → speccrew-knowledge-bizs-identify-entries/workflow.agentflow.xml} +8 -184
  47. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +200 -181
  48. package/.speccrew/skills/{speccrew-knowledge-bizs-init-features-xml/SKILL.md → speccrew-knowledge-bizs-init-features/workflow.agentflow.xml} +7 -134
  49. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/SKILL.md +5 -89
  50. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/workflow.agentflow.xml +129 -0
  51. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +454 -326
  52. package/.speccrew/skills/{speccrew-knowledge-bizs-ui-analyze-xml/SKILL.md → speccrew-knowledge-bizs-ui-analyze/workflow.agentflow.xml} +8 -128
  53. package/.speccrew/skills/speccrew-knowledge-bizs-ui-graph/SKILL.md +302 -247
  54. package/.speccrew/skills/{speccrew-knowledge-bizs-ui-graph-xml/SKILL.md → speccrew-knowledge-bizs-ui-graph/workflow.agentflow.xml} +7 -199
  55. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/SKILL.md +267 -156
  56. package/.speccrew/skills/{speccrew-knowledge-bizs-ui-style-extract-xml/SKILL.md → speccrew-knowledge-bizs-ui-style-extract/workflow.agentflow.xml} +7 -151
  57. package/.speccrew/skills/speccrew-knowledge-graph-query/SKILL.md +3 -122
  58. package/.speccrew/skills/speccrew-knowledge-graph-query/workflow.agentflow.xml +106 -0
  59. package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +3 -80
  60. package/.speccrew/skills/speccrew-knowledge-graph-write/workflow.agentflow.xml +152 -0
  61. package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +371 -265
  62. package/.speccrew/skills/{speccrew-knowledge-module-summarize-xml/SKILL.md → speccrew-knowledge-module-summarize/workflow.agentflow.xml} +7 -197
  63. package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +45 -333
  64. package/.speccrew/skills/{speccrew-knowledge-system-summarize-xml/SKILL.md → speccrew-knowledge-system-summarize/workflow.agentflow.xml} +0 -177
  65. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +174 -727
  66. package/.speccrew/skills/{speccrew-knowledge-techs-dispatch-xml/SKILL.md → speccrew-knowledge-techs-dispatch/workflow.agentflow.xml} +10 -351
  67. package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +20 -150
  68. package/.speccrew/skills/{speccrew-knowledge-techs-generate-xml/SKILL.md → speccrew-knowledge-techs-generate/workflow.agentflow.xml} +0 -169
  69. package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +75 -587
  70. package/.speccrew/skills/{speccrew-knowledge-techs-generate-conventions-xml/SKILL.md → speccrew-knowledge-techs-generate-conventions/workflow.agentflow.xml} +0 -153
  71. package/.speccrew/skills/speccrew-knowledge-techs-generate-quality/SKILL.md +463 -297
  72. package/.speccrew/skills/{speccrew-knowledge-techs-generate-quality-xml/SKILL.md → speccrew-knowledge-techs-generate-quality/workflow.agentflow.xml} +0 -164
  73. package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +57 -292
  74. package/.speccrew/skills/{speccrew-knowledge-techs-generate-ui-style-xml/SKILL.md → speccrew-knowledge-techs-generate-ui-style/workflow.agentflow.xml} +2 -193
  75. package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +49 -335
  76. package/.speccrew/skills/{speccrew-knowledge-techs-index-xml/SKILL.md → speccrew-knowledge-techs-index/workflow.agentflow.xml} +0 -167
  77. package/.speccrew/skills/speccrew-knowledge-techs-init/SKILL.md +28 -109
  78. package/.speccrew/skills/{speccrew-knowledge-techs-init-xml/SKILL.md → speccrew-knowledge-techs-init/workflow.agentflow.xml} +0 -189
  79. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +3 -487
  80. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/workflow.agentflow.xml +278 -0
  81. package/.speccrew/skills/speccrew-pm-knowledge-detector/SKILL.md +3 -71
  82. package/.speccrew/skills/speccrew-pm-knowledge-detector/workflow.agentflow.xml +108 -0
  83. package/.speccrew/skills/speccrew-pm-module-initializer/SKILL.md +3 -107
  84. package/.speccrew/skills/speccrew-pm-module-initializer/workflow.agentflow.xml +139 -0
  85. package/.speccrew/skills/speccrew-pm-module-matcher/SKILL.md +3 -115
  86. package/.speccrew/skills/speccrew-pm-module-matcher/workflow.agentflow.xml +146 -0
  87. package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +3 -343
  88. package/.speccrew/skills/speccrew-pm-requirement-analysis/workflow.agentflow.xml +174 -0
  89. package/.speccrew/skills/speccrew-pm-requirement-assess/SKILL.md +3 -91
  90. package/.speccrew/skills/speccrew-pm-requirement-assess/workflow.agentflow.xml +173 -0
  91. package/.speccrew/skills/speccrew-pm-requirement-clarify/SKILL.md +3 -224
  92. package/.speccrew/skills/speccrew-pm-requirement-clarify/workflow.agentflow.xml +159 -0
  93. package/.speccrew/skills/speccrew-pm-requirement-model/SKILL.md +3 -275
  94. package/.speccrew/skills/speccrew-pm-requirement-model/workflow.agentflow.xml +210 -0
  95. package/.speccrew/skills/speccrew-pm-requirement-simple/SKILL.md +3 -76
  96. package/.speccrew/skills/speccrew-pm-requirement-simple/workflow.agentflow.xml +120 -0
  97. package/.speccrew/skills/speccrew-pm-sub-prd-generate/SKILL.md +7 -1
  98. package/.speccrew/skills/speccrew-pm-sub-prd-generate/workflow.agentflow.xml +218 -0
  99. package/.speccrew/skills/speccrew-sd-backend/SKILL.md +7 -1
  100. package/.speccrew/skills/speccrew-sd-backend/workflow.agentflow.xml +264 -0
  101. package/.speccrew/skills/speccrew-sd-desktop/SKILL.md +7 -1
  102. package/.speccrew/skills/speccrew-sd-desktop/workflow.agentflow.xml +288 -0
  103. package/.speccrew/skills/speccrew-sd-framework-evaluate/SKILL.md +7 -1
  104. package/.speccrew/skills/speccrew-sd-framework-evaluate/workflow.agentflow.xml +235 -0
  105. package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +7 -1
  106. package/.speccrew/skills/speccrew-sd-frontend/workflow.agentflow.xml +299 -0
  107. package/.speccrew/skills/speccrew-sd-mobile/SKILL.md +7 -1
  108. package/.speccrew/skills/speccrew-sd-mobile/workflow.agentflow.xml +301 -0
  109. package/.speccrew/skills/speccrew-test-case-design/SKILL.md +165 -284
  110. package/.speccrew/skills/speccrew-test-case-design/workflow.agentflow.xml +210 -0
  111. package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +204 -324
  112. package/.speccrew/skills/speccrew-test-code-gen/workflow.agentflow.xml +265 -0
  113. package/.speccrew/skills/speccrew-test-reporter/SKILL.md +205 -184
  114. package/.speccrew/skills/speccrew-test-reporter/workflow.agentflow.xml +284 -0
  115. package/.speccrew/skills/speccrew-test-runner/SKILL.md +242 -241
  116. package/.speccrew/skills/speccrew-test-runner/workflow.agentflow.xml +314 -0
  117. package/bin/cli.js +8 -1
  118. package/lib/commands/init.js +11 -3
  119. package/lib/commands/update.js +11 -3
  120. package/lib/commands/validate.js +565 -0
  121. package/lib/utils.js +43 -0
  122. package/package.json +1 -1
  123. package/workspace-template/docs/rules/{xml-workflow-spec.md → agentflow-spec.md} +5 -5
  124. package/workspace-template/scripts/validate-agentflow.js +637 -0
  125. package/.speccrew/agents/speccrew-team-leader-xml.md +0 -480
  126. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/STATUS-FORMATS.md +0 -99
  127. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/batch-orchestrator.js +0 -176
  128. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-next-batch.js +0 -150
  129. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-pending-features.js +0 -106
  130. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/mark-stale.js +0 -249
  131. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/merge-features.js +0 -300
  132. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/process-batch-results.js +0 -915
  133. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/update-feature-status.js +0 -226
  134. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/examples/features.json +0 -34
  135. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js +0 -1087
  136. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/test-inventory.js +0 -26
  137. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/STATUS-FORMATS.md +0 -550
@@ -0,0 +1,278 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <workflow id="knowledge-techs-ui-analyze" status="pending" version="1.0" desc="Analyze UI codebase to extract styles, patterns, and conventions">
3
+
4
+ <!-- ============================================================
5
+ Input Parameters Definition
6
+ ============================================================ -->
7
+ <block type="input" id="I1" desc="Workflow input parameters">
8
+ <field name="source_path" required="true" type="string" desc="Path to UI source code directory"/>
9
+ <field name="platform_id" required="true" type="string" desc="Platform identifier (e.g., admin-pc, admin-mobile)"/>
10
+ <field name="platform_type" required="true" type="string" desc="Platform type (web, mobile, desktop)"/>
11
+ <field name="framework" required="true" type="string" desc="Frontend framework (vue3, react, uniapp, etc.)"/>
12
+ <field name="output_path" required="true" type="string" desc="Output directory for generated style guide"/>
13
+ <field name="language" required="true" type="string" desc="Target language (e.g., zh, en)"/>
14
+ <field name="skill_path" required="true" type="string" desc="Path to this skill directory"/>
15
+ </block>
16
+
17
+ <!-- ============================================================
18
+ Global Constraints
19
+ ============================================================ -->
20
+ <block type="rule" id="R1" level="forbidden" desc="Document generation constraints">
21
+ <field name="text">FORBIDDEN: create_file for analysis documents — NEVER use create_file to write any UI analysis document</field>
22
+ <field name="text">FORBIDDEN: Full-file rewrite — NEVER replace the entire document content in a single operation</field>
23
+ <field name="text">Each document MUST be created by copying the appropriate template then filling sections with search_replace</field>
24
+ </block>
25
+
26
+ <block type="rule" id="R2" level="mandatory" desc="Template-first workflow">
27
+ <field name="text">MANDATORY: Template-first workflow — For every output document, copy the corresponding template to target path first, then fill sections with search_replace</field>
28
+ <field name="text">Skipping copy and writing content directly is FORBIDDEN</field>
29
+ </block>
30
+
31
+ <!-- ============================================================
32
+ Step 0: Pre-load Required Templates
33
+ ============================================================ -->
34
+ <block type="task" id="B0" action="read-file" desc="Read all template files to understand document structures">
35
+ <field name="templates">
36
+ - templates/UI-STYLE-GUIDE-TEMPLATE.md → ui-style-guide.md
37
+ - templates/PAGE-TYPE-SUMMARY-TEMPLATE.md → page-types/page-type-summary.md
38
+ - templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md → page-types/[type]-pages.md
39
+ - templates/COMPONENT-LIBRARY-TEMPLATE.md → components/component-library.md
40
+ - templates/COMMON-COMPONENTS-TEMPLATE.md → components/common-components.md
41
+ - templates/BUSINESS-COMPONENTS-TEMPLATE.md → components/business-components.md
42
+ - templates/COMPONENT-INDIVIDUAL-TEMPLATE.md → components/{component-name}.md
43
+ - templates/LAYOUT-PATTERNS-TEMPLATE.md → layouts/page-layouts.md
44
+ - templates/NAVIGATION-PATTERNS-TEMPLATE.md → layouts/navigation-patterns.md
45
+ - templates/LAYOUT-INDIVIDUAL-TEMPLATE.md → layouts/{layout-name}-layout.md
46
+ - templates/STYLE-SYSTEM-TEMPLATE.md → styles/color-system.md
47
+ - templates/TYPOGRAPHY-TEMPLATE.md → styles/typography.md
48
+ - templates/SPACING-TEMPLATE.md → styles/spacing-system.md
49
+ </field>
50
+ <field name="on_fail">STOP and report error with template path</field>
51
+ <field name="output" var="templates_loaded"/>
52
+ </block>
53
+
54
+ <!-- ============================================================
55
+ Main Processing Sequence
56
+ ============================================================ -->
57
+ <sequence id="S1" name="UI Style Analysis" status="pending" desc="Discover, analyze, and document UI patterns">
58
+
59
+ <!-- Step 1: Discover Source Structure -->
60
+ <block type="task" id="B1" action="analyze" desc="Explore project structure">
61
+ <field name="key_directories">
62
+ - src/views/ or src/pages/ - Page components
63
+ - src/components/ - Reusable components
64
+ - src/layout/ or src/layouts/ - Layout components
65
+ - src/styles/ or src/assets/styles/ - Style files
66
+ </field>
67
+ <field name="extract_for">ui-style-guide.md Sections: Project Overview, Platform Summary</field>
68
+ <field name="output" var="project_structure"/>
69
+ </block>
70
+
71
+ <!-- Step 2: Analyze Page Types -->
72
+ <block type="task" id="B2" action="analyze" desc="Dynamic page type discovery">
73
+ <field name="rules">
74
+ File Name Analysis:
75
+ - Extract naming patterns from page files
76
+ - Group files by similar naming conventions
77
+ - Examples: *List.vue, *Form.vue, *Detail.vue, *Chart.vue
78
+
79
+ Component Usage Analysis:
80
+ - Identify dominant components in each file group
81
+ - Table-heavy files → likely list/query pages
82
+ - Form-heavy files → likely create/edit pages
83
+ - Chart-heavy files → likely report/dashboard pages
84
+
85
+ Route/Navigation Analysis:
86
+ - Check router configuration for page organization
87
+ - Identify menu structures and page hierarchies
88
+ </field>
89
+ <field name="output" var="page_types"/>
90
+ </block>
91
+
92
+ <block type="task" id="B3" action="generate" desc="Generate page-types/page-type-summary.md">
93
+ <field name="template">templates/PAGE-TYPE-SUMMARY-TEMPLATE.md</field>
94
+ <field name="output">${output_path}/page-types/page-type-summary.md</field>
95
+ <field name="method">copy template, then use search_replace to fill sections</field>
96
+ </block>
97
+
98
+ <block type="loop" id="L1" over="${page_types}" as="page_type" desc="Generate individual page type documents">
99
+ <block type="task" action="generate" desc="Generate page-types/${page_type.name}-pages.md">
100
+ <field name="template">templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md</field>
101
+ <field name="output">${output_path}/page-types/${page_type.name}-pages.md</field>
102
+ <field name="method">copy template, then use search_replace to fill sections</field>
103
+ </block>
104
+ </block>
105
+
106
+ <!-- Step 3: Extract Component Usage -->
107
+ <block type="task" id="B4" action="analyze" desc="Analyze component imports and usage">
108
+ <field name="categories">
109
+ UI Framework Components (Element Plus, Ant Design, Vant):
110
+ - Button, Input, Select, Table, Form, Modal, etc.
111
+
112
+ Common Components (Project-specific):
113
+ - SearchForm, Pagination, DictTag, ImagePreview, etc.
114
+
115
+ Business Components (Domain-specific):
116
+ - UserSelect, DeptTree, RolePicker, etc.
117
+ </field>
118
+ <field name="output" var="components"/>
119
+ </block>
120
+
121
+ <block type="task" id="B5" action="generate" desc="Generate components/component-library.md">
122
+ <field name="template">templates/COMPONENT-LIBRARY-TEMPLATE.md</field>
123
+ <field name="output">${output_path}/components/component-library.md</field>
124
+ <field name="method">copy template, then use search_replace to fill sections</field>
125
+ </block>
126
+
127
+ <block type="task" id="B6" action="generate" desc="Generate components/common-components.md">
128
+ <field name="template">templates/COMMON-COMPONENTS-TEMPLATE.md</field>
129
+ <field name="output">${output_path}/components/common-components.md</field>
130
+ <field name="method">copy template, then use search_replace to fill sections</field>
131
+ </block>
132
+
133
+ <block type="task" id="B7" action="generate" desc="Generate components/business-components.md">
134
+ <field name="template">templates/BUSINESS-COMPONENTS-TEMPLATE.md</field>
135
+ <field name="output">${output_path}/components/business-components.md</field>
136
+ <field name="method">copy template, then use search_replace to fill sections</field>
137
+ </block>
138
+
139
+ <block type="loop" id="L2" over="${components.individual}" as="component" desc="Generate individual component documents">
140
+ <block type="task" action="generate" desc="Generate components/${component.name}.md">
141
+ <field name="template">templates/COMPONENT-INDIVIDUAL-TEMPLATE.md</field>
142
+ <field name="output">${output_path}/components/${component.name}.md</field>
143
+ <field name="method">copy template, then use search_replace to fill sections</field>
144
+ <field name="rules">
145
+ - For UI framework components: Focus on project-specific usage patterns
146
+ - For custom components: Full Props/Events/Slots documentation
147
+ - Skip trivial components (&lt; 10 lines, no props/events)
148
+ </field>
149
+ </block>
150
+ </block>
151
+
152
+ <!-- Step 4: Analyze Layout Patterns -->
153
+ <block type="task" id="B8" action="analyze" desc="Identify common layout patterns">
154
+ <field name="layout_types">
155
+ Standard List Layout:
156
+ - Search Form
157
+ - Toolbar (Add/Export/Delete buttons)
158
+ - Data Table
159
+ - Pagination
160
+
161
+ Standard Form Layout:
162
+ - Form Card
163
+ - Form Fields (2-3 columns)
164
+ - Action Buttons (Submit/Cancel)
165
+
166
+ Detail View Layout:
167
+ - Detail Card
168
+ - Description List
169
+ - Action Buttons
170
+
171
+ Split Pane Layout:
172
+ - Left: Tree/Menu
173
+ - Right: Content Table/Form
174
+ </field>
175
+ <field name="output" var="layouts"/>
176
+ </block>
177
+
178
+ <block type="task" id="B9" action="generate" desc="Generate layouts/page-layouts.md">
179
+ <field name="template">templates/LAYOUT-PATTERNS-TEMPLATE.md</field>
180
+ <field name="output">${output_path}/layouts/page-layouts.md</field>
181
+ <field name="method">copy template, then use search_replace to fill sections</field>
182
+ </block>
183
+
184
+ <block type="task" id="B10" action="generate" desc="Generate layouts/navigation-patterns.md">
185
+ <field name="template">templates/NAVIGATION-PATTERNS-TEMPLATE.md</field>
186
+ <field name="output">${output_path}/layouts/navigation-patterns.md</field>
187
+ <field name="method">copy template, then use search_replace to fill sections</field>
188
+ </block>
189
+
190
+ <block type="loop" id="L3" over="${layouts.individual}" as="layout" desc="Generate individual layout documents">
191
+ <block type="task" action="generate" desc="Generate layouts/${layout.name}-layout.md">
192
+ <field name="template">templates/LAYOUT-INDIVIDUAL-TEMPLATE.md</field>
193
+ <field name="output">${output_path}/layouts/${layout.name}-layout.md</field>
194
+ <field name="method">copy template, then use search_replace to fill sections</field>
195
+ <field name="rules">
196
+ - Minimum 2 pages must share a layout pattern to warrant a document
197
+ - Generate ASCII layout diagram from actual page structure
198
+ </field>
199
+ </block>
200
+ </block>
201
+
202
+ <!-- Step 5: Extract Style Conventions -->
203
+ <block type="task" id="B11" action="analyze" desc="Analyze style files for color, typography, spacing">
204
+ <field name="extract">
205
+ Color System:
206
+ - Primary colors, Status colors, Text colors, Background colors, Border colors
207
+
208
+ Typography:
209
+ - Font families, Font sizes, Font weights, Line heights
210
+
211
+ Spacing System:
212
+ - Padding/Margin scales, Grid system, Container widths
213
+ </field>
214
+ <field name="output" var="styles"/>
215
+ </block>
216
+
217
+ <block type="task" id="B12" action="generate" desc="Generate styles/color-system.md">
218
+ <field name="template">templates/STYLE-SYSTEM-TEMPLATE.md</field>
219
+ <field name="output">${output_path}/styles/color-system.md</field>
220
+ <field name="method">copy template, then use search_replace to fill sections</field>
221
+ </block>
222
+
223
+ <block type="task" id="B13" action="generate" desc="Generate styles/typography.md">
224
+ <field name="template">templates/TYPOGRAPHY-TEMPLATE.md</field>
225
+ <field name="output">${output_path}/styles/typography.md</field>
226
+ <field name="method">copy template, then use search_replace to fill sections</field>
227
+ </block>
228
+
229
+ <block type="task" id="B14" action="generate" desc="Generate styles/spacing-system.md">
230
+ <field name="template">templates/SPACING-TEMPLATE.md</field>
231
+ <field name="output">${output_path}/styles/spacing-system.md</field>
232
+ <field name="method">copy template, then use search_replace to fill sections</field>
233
+ </block>
234
+
235
+ <!-- Step 6: Generate Main Documentation -->
236
+ <block type="task" id="B15" action="generate" desc="Generate ui-style-guide.md">
237
+ <field name="template">templates/UI-STYLE-GUIDE-TEMPLATE.md</field>
238
+ <field name="output">${output_path}/ui-style-guide.md</field>
239
+ <field name="method">copy template, then use search_replace to fill sections</field>
240
+ <field name="note">ui-style-guide.md should reference/link to all other generated documents</field>
241
+ </block>
242
+
243
+ <!-- Step 7: Verify Output Completeness -->
244
+ <block type="task" id="B16" action="validate" desc="Verify all required files exist">
245
+ <field name="required_files">
246
+ - ui-style-guide.md
247
+ - page-types/page-type-summary.md
248
+ - page-types/[type]-pages.md (one per discovered type)
249
+ - components/component-library.md
250
+ - components/common-components.md
251
+ - components/business-components.md
252
+ - components/{component-name}.md (one per discovered component)
253
+ - layouts/page-layouts.md
254
+ - layouts/navigation-patterns.md
255
+ - layouts/{layout-name}-layout.md (one per discovered layout)
256
+ - styles/color-system.md
257
+ - styles/typography.md
258
+ - styles/spacing-system.md
259
+ </field>
260
+ <field name="output" var="verification_result"/>
261
+ </block>
262
+
263
+ </sequence>
264
+
265
+ <!-- ============================================================
266
+ Output Results
267
+ ============================================================ -->
268
+ <block type="output" id="O1" desc="Workflow output results">
269
+ <field name="status" from="${verification_result.status}" type="string" desc="Analysis status"/>
270
+ <field name="platform_id" from="${platform_id}" type="string" desc="Platform identifier"/>
271
+ <field name="output_path" from="${output_path}" type="string" desc="Output directory"/>
272
+ <field name="page_types_count" from="${page_types.length}" type="number" desc="Number of page types discovered"/>
273
+ <field name="components_count" from="${components.individual.length}" type="number" desc="Number of components documented"/>
274
+ <field name="layouts_count" from="${layouts.individual.length}" type="number" desc="Number of layouts documented"/>
275
+ <field name="documents_generated" from="${verification_result.documents_count}" type="number" desc="Total documents generated"/>
276
+ </block>
277
+
278
+ </workflow>
@@ -58,79 +58,11 @@ Detect business knowledge base availability and completeness status. Scans the s
58
58
  | `lite` | has_features = true AND has_system_overview = false |
59
59
  | `none` | has_features = false AND has_system_overview = false |
60
60
 
61
- ## Workflow
62
-
63
- ```mermaid
64
- flowchart TD
65
- Start([Start]) --> Step1[Step 1: Check system-overview.md]
66
- Step1 --> Step2[Step 2: Scan for features files]
67
- Step2 --> Step3[Step 3: Scan for entry-dirs files]
68
- Step3 --> Step4[Step 4: Count modules and platforms]
69
- Step4 --> Step5[Step 5: Determine status and return JSON]
70
- Step5 --> End([End])
71
- ```
72
-
73
- ### Step 1: Check system-overview.md
74
-
75
- Check if the system overview file exists:
76
-
77
- 1. Path: `{workspace_path}/knowledges/bizs/system-overview.md`
78
- 2. Attempt to read the file
79
- 3. Set `has_system_overview` = true if exists, false otherwise
80
- 4. Set `system_overview_path` = path if exists, null otherwise
81
-
82
- **Output**: "Step 1 Status: ✅ COMPLETED - system-overview.md {exists|not found}"
83
-
84
- ### Step 2: Scan for features files
85
-
86
- Scan the sync-state directory for feature inventory files:
87
-
88
- 1. Use provided path: `{sync_state_bizs_dir}/`
89
- 2. Glob pattern: `features-*.json`
90
- 3. Collect all matching files into `features_files` array
91
- 4. Set `has_features` = true if any files found
92
-
93
- **Output**: "Step 2 Status: ✅ COMPLETED - Found {count} features files"
94
-
95
- ### Step 3: Scan for entry-dirs files
96
-
97
- Scan for entry directory configuration files:
98
-
99
- 1. Use provided path: `{sync_state_bizs_dir}/`
100
- 2. Glob pattern: `entry-dirs-*.json`
101
- 3. Collect all matching files into `entry_dirs_files` array
102
- 4. Set `has_entry_dirs` = true if any files found
103
-
104
- **Output**: "Step 3 Status: ✅ COMPLETED - Found {count} entry-dirs files"
105
-
106
- ### Step 4: Count modules and platforms
107
-
108
- For each features file found:
109
-
110
- 1. Read the JSON content
111
- 2. Extract `platformId` and add to `available_platforms` array
112
- 3. Sum up `modules` array length for `module_count`
113
- 4. Extract `features` array length for feature count per platform
114
-
115
- **Output**: "Step 4 Status: ✅ COMPLETED - {platform_count} platforms, {module_count} modules"
116
-
117
- ### Step 5: Determine status and return JSON
118
-
119
- Calculate the overall status:
120
-
121
- ```
122
- IF has_system_overview AND has_features THEN
123
- status = "full"
124
- ELSE IF has_features THEN
125
- status = "lite"
126
- ELSE
127
- status = "none"
128
- END IF
129
- ```
61
+ ## AgentFlow Definition
130
62
 
131
- Return the complete JSON output.
63
+ <!-- @agentflow: workflow.agentflow.xml -->
132
64
 
133
- **Output**: "Step 5 Status: COMPLETED - Knowledge status: {status}"
65
+ > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md`
134
66
 
135
67
  ## Constraints
136
68
 
@@ -0,0 +1,108 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <workflow id="knowledge-detector-main" status="pending" version="1.0" desc="Detect business knowledge base availability and completeness status">
3
+
4
+ <!-- ============================================================
5
+ Input Parameters Definition
6
+ ============================================================ -->
7
+ <block type="input" id="I1" desc="Workflow input parameters">
8
+ <field name="workspace_path" required="true" type="string" desc="Absolute path to speccrew workspace"/>
9
+ <field name="sync_state_bizs_dir" required="true" type="string" desc="Absolute path to sync-state/knowledge-bizs directory"/>
10
+ <field name="configs_dir" required="true" type="string" desc="Absolute path to docs/configs directory"/>
11
+ <field name="language" required="true" type="string" desc="Language code for output content"/>
12
+ </block>
13
+
14
+ <!-- ============================================================
15
+ Global Constraints
16
+ ============================================================ -->
17
+ <block type="rule" id="R1" level="mandatory" desc="Path constraints">
18
+ <field name="text">Use the provided absolute paths directly. DO NOT construct or derive paths yourself.</field>
19
+ <field name="text">All paths must use forward slashes / as path separators (even on Windows)</field>
20
+ </block>
21
+
22
+ <block type="rule" id="R2" level="forbidden" desc="Execution constraints">
23
+ <field name="text">This skill is READ-ONLY - do not modify any files</field>
24
+ <field name="text">Use Glob for scanning, avoid deep file reads</field>
25
+ </block>
26
+
27
+ <!-- ============================================================
28
+ Main Processing Sequence
29
+ ============================================================ -->
30
+ <sequence id="S1" name="Knowledge Base Detection" status="pending" desc="Scan and detect knowledge base status">
31
+
32
+ <!-- Step 1: Check system-overview.md -->
33
+ <block type="task" id="B1" action="read-file" desc="Check if system-overview.md exists">
34
+ <field name="path" value="${workspace_path}/knowledges/bizs/system-overview.md"/>
35
+ <field name="output" var="system_overview_content"/>
36
+ <field name="on_error">continue</field>
37
+ </block>
38
+
39
+ <!-- Step 2: Scan for features files -->
40
+ <block type="task" id="B2" action="run-script" desc="Scan for features-*.json files">
41
+ <field name="command">Get-ChildItem -Path "${sync_state_bizs_dir}" -Filter "features-*.json" -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName</field>
42
+ <field name="output" var="features_files_list"/>
43
+ </block>
44
+
45
+ <!-- Step 3: Scan for entry-dirs files -->
46
+ <block type="task" id="B3" action="run-script" desc="Scan for entry-dirs-*.json files">
47
+ <field name="command">Get-ChildItem -Path "${sync_state_bizs_dir}" -Filter "entry-dirs-*.json" -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName</field>
48
+ <field name="output" var="entry_dirs_files_list"/>
49
+ </block>
50
+
51
+ <!-- Step 4: Analyze features files and count modules/platforms -->
52
+ <block type="loop" id="L1" over="${features_files_list}" as="features_file" desc="Process each features file">
53
+ <block type="task" id="B4" action="read-file" desc="Read features file content">
54
+ <field name="path" value="${features_file}"/>
55
+ <field name="output" var="features_data"/>
56
+ </block>
57
+ <block type="task" id="B5" action="analyze" desc="Extract platform and module info">
58
+ <field name="input" value="${features_data}"/>
59
+ <field name="extract">
60
+ - platformId
61
+ - platformType
62
+ - modules array length
63
+ - features array length
64
+ </field>
65
+ <field name="output" var="platform_info"/>
66
+ </block>
67
+ </block>
68
+
69
+ <!-- Step 5: Determine status and compile results -->
70
+ <block type="task" id="B6" action="analyze" desc="Determine knowledge base status">
71
+ <field name="input">
72
+ system_overview_exists: ${system_overview_content} != null
73
+ features_files: ${features_files_list}
74
+ entry_dirs_files: ${entry_dirs_files_list}
75
+ platform_data: ${platform_info}
76
+ </field>
77
+ <field name="logic">
78
+ IF has_system_overview AND has_features THEN status = "full"
79
+ ELSE IF has_features THEN status = "lite"
80
+ ELSE status = "none"
81
+ </field>
82
+ <field name="output" var="detection_result"/>
83
+ </block>
84
+
85
+ <!-- Checkpoint: Verify detection complete -->
86
+ <block type="checkpoint" id="CP1" name="detection-complete" desc="Verify detection completed">
87
+ <field name="verify" value="${detection_result.status} != null"/>
88
+ </block>
89
+
90
+ </sequence>
91
+
92
+ <!-- ============================================================
93
+ Output Results
94
+ ============================================================ -->
95
+ <block type="output" id="O1" desc="Workflow output results">
96
+ <field name="status" from="${detection_result.status}" type="string" desc="Knowledge base status: full, lite, or none"/>
97
+ <field name="has_system_overview" from="${detection_result.has_system_overview}" type="boolean" desc="Whether system-overview.md exists"/>
98
+ <field name="has_features" from="${detection_result.has_features}" type="boolean" desc="Whether features files exist"/>
99
+ <field name="has_entry_dirs" from="${detection_result.has_entry_dirs}" type="boolean" desc="Whether entry-dirs files exist"/>
100
+ <field name="available_platforms" from="${detection_result.available_platforms}" type="array" desc="List of available platform IDs"/>
101
+ <field name="module_count" from="${detection_result.module_count}" type="number" desc="Total module count"/>
102
+ <field name="features_files" from="${detection_result.features_files}" type="array" desc="List of features file paths"/>
103
+ <field name="entry_dirs_files" from="${detection_result.entry_dirs_files}" type="array" desc="List of entry-dirs file paths"/>
104
+ <field name="system_overview_path" from="${detection_result.system_overview_path}" type="string" desc="Path to system overview file"/>
105
+ <field name="message" value="Knowledge base status detected successfully" type="string" desc="Status message"/>
106
+ </block>
107
+
108
+ </workflow>
@@ -97,115 +97,11 @@ Example: `"ki-web-vue-system-index"`
97
97
 
98
98
  > **Note**: This ID is consistent with task IDs in DISPATCH-PROGRESS.json and is used for progress tracking.
99
99
 
100
- ## Workflow
101
-
102
- ```mermaid
103
- flowchart TD
104
- Start([Start]) --> Step1[Step 1: Read and filter features]
105
- Step1 --> Step2[Step 2: Select analyzer by platform_type]
106
- Step2 --> Step3[Step 3: Build task list]
107
- Step3 --> Step4[Step 4: Build summarize params]
108
- Step4 --> Step5[Step 5: Output task plan JSON]
109
- Step5 --> End([End])
110
- ```
111
-
112
- ### Step 1: Read and Filter Features
113
-
114
- **Step 1 Status: 🔄 IN PROGRESS**
115
-
116
- 1. **Read features file**: Parse the `features_file` JSON
117
- 2. **Filter by module**: Select features where `module == module_name` AND `analyzed == false`
118
- 3. **Record counts**:
119
- - Total features for this module
120
- - Pending features (analyzed = false)
121
-
122
- **Output**: "Step 1 Status: ✅ COMPLETED - Found {total} total features, {pending} pending for analysis"
123
-
124
- ### Step 2: Select Analyzer by Platform Type
125
-
126
- **Step 2 Status: 🔄 IN PROGRESS**
127
-
128
- Based on `platform_type`, select the appropriate analyzer Skill:
129
-
130
- | platform_type | skill_name | Description |
131
- |---------------|------------|-------------|
132
- | web, mobile, desktop | `speccrew-knowledge-bizs-ui-analyze` | UI Feature Analysis |
133
- | backend | `speccrew-knowledge-bizs-api-analyze` | API Controller Analysis |
134
-
135
- **Output**: "Step 2 Status: ✅ COMPLETED - Selected analyzer: {skill_name}"
136
-
137
- ### Step 3: Build Task List
100
+ ## AgentFlow Definition
138
101
 
139
- **Step 3 Status: 🔄 IN PROGRESS**
140
-
141
- For each pending feature from Step 1, build a task object with analyzer parameters.
142
-
143
- > 🛑 **IMPORTANT**: This Skill does NOT execute analyze. It ONLY generates the task list. PM Agent will dispatch Workers based on this task plan.
144
-
145
- #### Task object structure for each pending feature:
146
-
147
- ```json
148
- {
149
- "id": "ki-{platform_id}-{feature.module}-{feature.fileName}",
150
- "fileName": "{feature.fileName}",
151
- "sourcePath": "{feature.sourcePath}",
152
- "documentPath": "{output_path}/bizs/{platform_id}/{feature.module}/features",
153
- "module": "{feature.module}",
154
- "platform_type": "{platform_type}",
155
- "platform_subtype": "{platform_subtype}",
156
- "tech_stack": "{tech_stack}",
157
- "language": "{language}",
158
- "status": "pending"
159
- }
160
- ```
161
-
162
- For backend features (api-analyze), also include:
163
- ```json
164
- {
165
- "completed_dir": "{completed_dir}",
166
- "sourceFile": "{sourceFile}"
167
- }
168
- ```
169
-
170
- **Note**: The `id` field format is `ki-{platform_id}-{module}-{fileName}` where `ki` stands for "knowledge initialization". This ID is consistent with task IDs in DISPATCH-PROGRESS.json for progress tracking.
171
-
172
- **Output**: "Step 3 Status: ✅ COMPLETED - Built {count} task entries"
173
-
174
- ### Step 4: Build Summarize Parameters
175
-
176
- **Step 4 Status: 🔄 IN PROGRESS**
177
-
178
- Build the summarize_params object for module-summarize skill. This will be used by PM Agent after all analyze tasks complete.
179
-
180
- ```json
181
- {
182
- "skill": "speccrew-knowledge-module-summarize",
183
- "module_name": "{module_name}",
184
- "module_path": "{output_path}/bizs/{platform_id}/{module_name}",
185
- "language": "{language}"
186
- }
187
- ```
188
-
189
- **Output**: "Step 4 Status: ✅ COMPLETED - Summarize params ready"
190
-
191
- ### Step 5: Output Task Plan JSON
192
-
193
- **Step 5 Status: 🔄 IN PROGRESS**
194
-
195
- Compile and output the final task plan:
196
-
197
- ```json
198
- {
199
- "module_name": "...",
200
- "platform_id": "...",
201
- "analyzer_skill": "...",
202
- "tasks": [...],
203
- "total_pending": <count>,
204
- "summarize_params": {...}
205
- }
206
- ```
102
+ <!-- @agentflow: workflow.agentflow.xml -->
207
103
 
208
- **Output**: "Step 5 Status: COMPLETED - Task plan generated with {count} pending features"
104
+ > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md`
209
105
 
210
106
  ## Constraints
211
107