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
@@ -72,495 +72,11 @@ Generate the following documents in `{output_path}/`:
72
72
  - If system has `*Dashboard.vue` files → `dashboard-pages.md`
73
73
  - If system has custom patterns like `*Workflow.vue` → `workflow-pages.md`
74
74
 
75
- ## Workflow
75
+ ## AgentFlow Definition
76
76
 
77
- ### Absolute Constraints
77
+ <!-- @agentflow: workflow.agentflow.xml -->
78
78
 
79
- > **These rules apply to ALL document generation steps. Violation = task failure.**
80
-
81
- 1. **FORBIDDEN: `create_file` for analysis documents** — NEVER use `create_file` to write any UI analysis document. Each document MUST be created by copying the appropriate template then filling sections with `search_replace`. `create_file` produces truncated output on large files.
82
-
83
- 2. **FORBIDDEN: Full-file rewrite** — NEVER replace the entire document content in a single operation. Always use targeted `search_replace` on specific sections.
84
-
85
- 3. **MANDATORY: Template-first workflow** — For every output document, the corresponding template MUST be copied to the target path first, then sections filled with `search_replace`. Skipping copy and writing content directly is FORBIDDEN.
86
-
87
- ### Step 0: Pre-load Required Templates (Mandatory)
88
-
89
- **This step must complete before any workflow step begins.**
90
-
91
- Read all template files to understand document structures and required content:
92
-
93
- | Template File | Output Document | Purpose |
94
- |---------------|-----------------|---------|
95
- | `templates/UI-STYLE-GUIDE-TEMPLATE.md` | `ui-style-guide.md` | Main style guide structure |
96
- | `templates/PAGE-TYPE-SUMMARY-TEMPLATE.md` | `page-types/page-type-summary.md` | Page type classification structure |
97
- | `templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md` | `page-types/[type]-pages.md` | Individual page type structure |
98
- | `templates/COMPONENT-LIBRARY-TEMPLATE.md` | `components/component-library.md` | Component inventory structure |
99
- | `templates/COMMON-COMPONENTS-TEMPLATE.md` | `components/common-components.md` | Common component usage structure |
100
- | `templates/BUSINESS-COMPONENTS-TEMPLATE.md` | `components/business-components.md` | Business component usage structure |
101
- | `templates/COMPONENT-INDIVIDUAL-TEMPLATE.md` | `components/{component-name}.md` | Individual component detail |
102
- | `templates/LAYOUT-PATTERNS-TEMPLATE.md` | `layouts/page-layouts.md` | Layout patterns structure |
103
- | `templates/NAVIGATION-PATTERNS-TEMPLATE.md` | `layouts/navigation-patterns.md` | Navigation patterns structure |
104
- | `templates/LAYOUT-INDIVIDUAL-TEMPLATE.md` | `layouts/{layout-name}-layout.md` | Individual layout detail |
105
- | `templates/STYLE-SYSTEM-TEMPLATE.md` | `styles/color-system.md` | Color system structure |
106
- | `templates/TYPOGRAPHY-TEMPLATE.md` | `styles/typography.md` | Typography structure |
107
- | `templates/SPACING-TEMPLATE.md` | `styles/spacing-system.md` | Spacing system structure |
108
-
109
- **Key principle**: Extract information from source code according to each template's section requirements.
110
-
111
- **Error Handling**: IF any template file is missing THEN report error with template path and STOP workflow.
112
-
113
- ### Step 1: Discover Source Structure
114
-
115
- **Purpose**: Gather project metadata for `ui-style-guide.md` Section 1-2 (Project Overview, Platform Summary)
116
-
117
- **Template Reference**: `UI-STYLE-GUIDE-TEMPLATE.md` - Sections: Project Overview, Platform Summary
118
-
119
- Explore the source code directory to understand:
120
- - Project structure (views/pages directory)
121
- - Component organization
122
- - Style file locations
123
- - Configuration files (package.json, vite.config, etc.)
124
-
125
- **Key directories to explore:**
126
- - `src/views/` or `src/pages/` - Page components
127
- - `src/components/` - Reusable components
128
- - `src/layout/` or `src/layouts/` - Layout components
129
- - `src/styles/` or `src/assets/styles/` - Style files
130
-
131
- **Extract for ui-style-guide.md:**
132
- - Technology Stack (framework, UI library, build tool, language versions)
133
- - Directory Structure
134
- - Platform details (resolution range, target device)
135
- - Browser support list
136
-
137
- ### Step 2: Analyze Page Types
138
-
139
- **Purpose**: Generate `page-types/page-type-summary.md` and individual `[type]-pages.md` files
140
-
141
- **Templates to Read First**:
142
- - `templates/PAGE-TYPE-SUMMARY-TEMPLATE.md` - Sections: Analysis Methodology, Page Type Statistics, Naming Conventions Summary, New Page Selection Guide, Page Type Details
143
- - `templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md` - Structure for each page type document
144
-
145
- **Output Documents**:
146
- 1. `page-types/page-type-summary.md` - Classification overview
147
- 2. `page-types/[type]-pages.md` - One per discovered page type (dynamically named)
148
-
149
- Scan page files to identify and classify page types dynamically based on actual source code.
150
-
151
- #### Dynamic Page Type Discovery
152
-
153
- **DO NOT assume predefined page types.** Instead, analyze the actual codebase to discover what page types exist:
154
-
155
- 1. **File Name Analysis**
156
- - Extract naming patterns from page files
157
- - Group files by similar naming conventions
158
- - Examples: `*List.vue`, `*Form.vue`, `*Detail.vue`, `*Chart.vue`, etc.
159
-
160
- 2. **Component Usage Analysis**
161
- - Identify dominant components in each file group
162
- - Look for patterns like:
163
- - Table-heavy files → likely list/query pages
164
- - Form-heavy files → likely create/edit pages
165
- - Chart-heavy files → likely report/dashboard pages
166
- - Split-pane layouts → likely master-detail pages
167
-
168
- 3. **Route/Navigation Analysis**
169
- - Check router configuration for page organization
170
- - Identify menu structures and page hierarchies
171
-
172
- 4. **Content Pattern Recognition**
173
- - Search for keywords in template sections:
174
- - Search/filter inputs → query functionality
175
- - Submit buttons → form functionality
176
- - Charts/graphs → report functionality
177
- - Trees + tables → tree-table functionality
178
-
179
- #### Page Type Classification Output
180
-
181
- Based on analysis, generate a classification table:
182
-
183
- ```
184
- | Page Type | Detection Pattern | File Count | Typical Files |
185
- |-----------|-------------------|------------|---------------|
186
- | [Auto-discovered Type 1] | [Recognition features] | N | [Example files] |
187
- | [Auto-discovered Type 2] | [Recognition features] | N | [Example files] |
188
- ```
189
-
190
- #### Analysis Content for Each Discovered Page Type
191
-
192
- For each identified page type, extract according to `PAGE-TYPE-INDIVIDUAL-TEMPLATE.md`:
193
-
194
- 1. **File List** - All files belonging to this type
195
- 2. **Naming Pattern** - Common naming convention
196
- 3. **Common Components** - Components used across pages of this type
197
- 4. **Layout Pattern** - DOM structure and layout approach
198
- 5. **Data Flow** - How data is fetched and managed
199
- 6. **Interaction Patterns** - Common user interactions
200
- 7. **Business Scenarios** - What business functions this page type serves
201
-
202
- **Generate**: `page-types/[type]-pages.md` for each discovered type
203
-
204
- #### Document Generation (per document)
205
-
206
- **For `page-types/page-type-summary.md`:**
207
- 1. Copy template `templates/PAGE-TYPE-SUMMARY-TEMPLATE.md` → `{output_path}/page-types/page-type-summary.md`
208
- 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
209
-
210
- **For each `page-types/[type]-pages.md`:**
211
- 1. Copy template `templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md` → `{output_path}/page-types/[type]-pages.md`
212
- 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
213
-
214
- ### Step 3: Extract Component Usage
215
-
216
- **Purpose**: Generate component documentation in `components/` directory
217
-
218
- **Templates to Read First**:
219
- - `templates/COMPONENT-LIBRARY-TEMPLATE.md` - Sections: UI Framework Components, Common Components, Business Components, Component Usage Statistics
220
- - `templates/COMMON-COMPONENTS-TEMPLATE.md` - Common component patterns and usage
221
- - `templates/BUSINESS-COMPONENTS-TEMPLATE.md` - Business component patterns
222
-
223
- **Output Documents**:
224
- 1. `components/component-library.md` - Component inventory (summary with links)
225
- 2. `components/common-components.md` - Common component usage conventions
226
- 3. `components/business-components.md` - Business component usage conventions
227
- 4. `components/{component-name}.md` - Individual component detail (one per discovered component)
228
-
229
- **Note**: `component-library.md` serves as the inventory/index:
230
- - Lists ALL discovered components with category, source, and brief description
231
- - Links to individual component documents: [wd-button](wd-button.md)
232
- - Does NOT contain detailed Props/Events (those are in individual files)
233
-
234
- Analyze component imports and usage:
235
-
236
- #### Component Categories
237
-
238
- **UI Framework Components** (Element Plus, Ant Design, Vant, etc.)
239
- - Button, Input, Select, Table, Form, Modal, etc.
240
-
241
- **Common Components** (Project-specific)
242
- - SearchForm, Pagination, DictTag, ImagePreview, etc.
243
-
244
- **Business Components** (Domain-specific)
245
- - UserSelect, DeptTree, RolePicker, etc.
246
-
247
- #### Extraction Method
248
-
249
- 1. Read component files in `src/components/`
250
- 2. Analyze imports in page files
251
- 3. Identify component props and usage patterns
252
- 4. Document component APIs
253
-
254
- **Extract for component-library.md** (per COMPONENT-LIBRARY-TEMPLATE.md):
255
- - UI Framework Components: Basic, Form, Data Display, Navigation, Feedback components
256
- - Common Components: Layout, Utility, Functional components with props
257
- - Business Components: Domain-specific components
258
- - Component usage statistics and dependencies
259
-
260
- **Extract for common-components.md**:
261
- - Component purpose and usage scenarios
262
- - Props definition and examples
263
- - Usage patterns and best practices
264
-
265
- **Extract for business-components.md**:
266
- - Business component list by domain
267
- - Props and event definitions
268
- - Business logic integration patterns
269
-
270
- #### Document Generation (per document)
271
-
272
- **For `components/component-library.md`:**
273
- 1. Copy template `templates/COMPONENT-LIBRARY-TEMPLATE.md` → `{output_path}/components/component-library.md`
274
- 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
275
-
276
- **For `components/common-components.md`:**
277
- 1. Copy template `templates/COMMON-COMPONENTS-TEMPLATE.md` → `{output_path}/components/common-components.md`
278
- 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
279
-
280
- **For `components/business-components.md`:**
281
- 1. Copy template `templates/BUSINESS-COMPONENTS-TEMPLATE.md` → `{output_path}/components/business-components.md`
282
- 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
283
-
284
- #### Generate Individual Component Documents
285
-
286
- For each component discovered during analysis:
287
-
288
- 1. **Copy Template**: Copy `templates/COMPONENT-INDIVIDUAL-TEMPLATE.md` to `{output_path}/components/{component-name}.md`
289
- - Component name: lowercase, kebab-case (e.g., `wd-button.md`, `fg-search-form.md`)
290
-
291
- 2. **Fill Template**: Use search_replace to fill each section:
292
- - Extract Props/Events/Slots from source code (TypeScript interfaces, defineProps, defineEmits)
293
- - Generate usage examples from actual usage found in pages/
294
- - Extract CSS variables/classes from component styles
295
- - Identify related components from imports
296
-
297
- 3. **Scope Control**:
298
- - For UI framework components (e.g., wd-*, el-*): Focus on project-specific usage patterns and customization, NOT full API docs (defer to official documentation)
299
- - For custom components (e.g., fg-*): Full Props/Events/Slots documentation
300
- - Skip trivial components (< 10 lines, no props/events)
301
-
302
- 4. **Naming Convention**: {component-name}.md
303
- - Use the component tag name in kebab-case
304
- - Examples: wd-button.md, fg-search-form.md, z-paging.md
305
-
306
- ### Step 4: Analyze Layout Patterns
307
-
308
- **Purpose**: Generate layout documentation in `layouts/` directory
309
-
310
- **Templates to Read First**:
311
- - `templates/LAYOUT-PATTERNS-TEMPLATE.md` - Layout pattern structure
312
- - `templates/NAVIGATION-PATTERNS-TEMPLATE.md` - Navigation pattern structure
313
-
314
- **Output Documents**:
315
- 1. `layouts/page-layouts.md` - Layout pattern summary (with links)
316
- 2. `layouts/navigation-patterns.md` - Navigation patterns
317
- 3. `layouts/{layout-name}-layout.md` - Individual layout detail (one per discovered layout)
318
-
319
- **Note**: `page-layouts.md` serves as the layout pattern summary:
320
- - Lists ALL discovered layout patterns with type and usage frequency
321
- - Links to individual layout documents: [TabBar Layout](tabbar-layout.md)
322
- - Contains high-level comparison table between layouts
323
- - Does NOT contain detailed region/component analysis (those are in individual files)
324
-
325
- Identify common layout patterns:
326
-
327
- #### Layout Types
328
-
329
- 1. **Standard List Layout**
330
- ```
331
- Search Form
332
- Toolbar (Add/Export/Delete buttons)
333
- Data Table
334
- Pagination
335
- ```
336
-
337
- 2. **Standard Form Layout**
338
- ```
339
- Form Card
340
- Form Fields (2-3 columns)
341
- Action Buttons (Submit/Cancel)
342
- ```
343
-
344
- 3. **Detail View Layout**
345
- ```
346
- Detail Card
347
- Description List
348
- Action Buttons
349
- ```
350
-
351
- 4. **Split Pane Layout**
352
- ```
353
- Left: Tree/Menu
354
- Right: Content Table/Form
355
- ```
356
-
357
- **Extract for page-layouts.md** (per LAYOUT-PATTERNS-TEMPLATE.md):
358
- - Layout type definitions and visual diagrams
359
- - DOM structure patterns
360
- - Responsive behavior rules
361
- - Usage scenarios for each layout
362
-
363
- **Extract for navigation-patterns.md** (per NAVIGATION-PATTERNS-TEMPLATE.md):
364
- - Navigation structure (sidebar, topbar, breadcrumbs)
365
- - Menu organization patterns
366
- - Route configuration conventions
367
- - Navigation state management
368
-
369
- #### Document Generation (per document)
370
-
371
- **For `layouts/page-layouts.md`:**
372
- 1. Copy template `templates/LAYOUT-PATTERNS-TEMPLATE.md` → `{output_path}/layouts/page-layouts.md`
373
- 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
374
-
375
- **For `layouts/navigation-patterns.md`:**
376
- 1. Copy template `templates/NAVIGATION-PATTERNS-TEMPLATE.md` → `{output_path}/layouts/navigation-patterns.md`
377
- 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
378
-
379
- #### Generate Individual Layout Documents
380
-
381
- For each distinct layout pattern discovered:
382
-
383
- 1. **Copy Template**: Copy `templates/LAYOUT-INDIVIDUAL-TEMPLATE.md` to `{output_path}/layouts/{layout-name}-layout.md`
384
- - Layout name: lowercase, kebab-case (e.g., `tabbar-layout.md`, `detail-layout.md`)
385
-
386
- 2. **Fill Template**: Use search_replace to fill each section:
387
- - Generate ASCII layout diagram from actual page structure
388
- - List components used in this layout
389
- - Extract page configuration from pages.json or route config
390
- - Identify pages that use this layout pattern
391
-
392
- 3. **Discovery Rules**:
393
- - Analyze page structures to identify distinct layout patterns
394
- - Group pages with similar structure into layout categories
395
- - Minimum 2 pages must share a layout pattern to warrant a document
396
- - Common layout types: tabbar, detail, form, list, dashboard, modal, fullscreen
397
-
398
- 4. **Naming Convention**: {layout-name}-layout.md
399
- - Use descriptive name in kebab-case
400
- - Examples: tabbar-layout.md, detail-layout.md, form-layout.md
401
-
402
- ### Step 5: Extract Style Conventions
403
-
404
- **Purpose**: Generate style system documentation in `styles/` directory
405
-
406
- **Templates to Read First**:
407
- - `templates/STYLE-SYSTEM-TEMPLATE.md` - Color system structure
408
- - `templates/TYPOGRAPHY-TEMPLATE.md` - Typography structure
409
- - `templates/SPACING-TEMPLATE.md` - Spacing system structure
410
-
411
- **Output Documents**:
412
- 1. `styles/color-system.md` - Color system
413
- 2. `styles/typography.md` - Typography conventions
414
- 3. `styles/spacing-system.md` - Spacing system
415
-
416
- Analyze style files to extract:
417
-
418
- #### Color System
419
- - Primary colors
420
- - Status colors (success, warning, error, info)
421
- - Text colors
422
- - Background colors
423
- - Border colors
424
-
425
- **Extract for color-system.md** (per STYLE-SYSTEM-TEMPLATE.md):
426
- - Color palette with hex values
427
- - Semantic color usage (primary, success, warning, error, info)
428
- - Color application rules (text, background, border)
429
- - CSS variables or theme configuration
430
-
431
- #### Typography
432
- - Font families
433
- - Font sizes (heading, body, small)
434
- - Font weights
435
- - Line heights
436
-
437
- **Extract for typography.md** (per TYPOGRAPHY-TEMPLATE.md):
438
- - Font family definitions
439
- - Type scale (H1-H6, body, small sizes)
440
- - Font weights and line heights
441
- - Typography usage patterns
442
-
443
- #### Spacing System
444
- - Padding/Margin scales
445
- - Grid system
446
- - Container widths
447
-
448
- **Extract for spacing-system.md** (per SPACING-TEMPLATE.md):
449
- - Spacing tokens (xs, sm, md, lg, xl values)
450
- - Grid system configuration
451
- - Container and breakpoint definitions
452
- - Spacing application guidelines
453
-
454
- #### Document Generation (per document)
455
-
456
- **For `styles/color-system.md`:**
457
- 1. Copy template `templates/STYLE-SYSTEM-TEMPLATE.md` → `{output_path}/styles/color-system.md`
458
- 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
459
-
460
- **For `styles/typography.md`:**
461
- 1. Copy template `templates/TYPOGRAPHY-TEMPLATE.md` → `{output_path}/styles/typography.md`
462
- 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
463
-
464
- **For `styles/spacing-system.md`:**
465
- 1. Copy template `templates/SPACING-TEMPLATE.md` → `{output_path}/styles/spacing-system.md`
466
- 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
467
-
468
- ### Step 6: Generate Documentation
469
-
470
- **Purpose**: Create all documentation files using extracted data and templates
471
-
472
- #### Document Generation Workflow
473
-
474
- For each document, follow this process:
475
-
476
- 1. **Copy the corresponding template** from `templates/` directory to target path
477
- 2. **Review extracted data** from Steps 1-5
478
- 3. **Fill template sections** using `search_replace` - map data to template placeholders
479
- 4. **Verify** all template placeholders are filled
480
-
481
- **Note**: NEVER use `create_file` to generate documents. Always copy template first, then use `search_replace` to fill sections.
482
-
483
- #### Document Generation (per document)
484
-
485
- **For `ui-style-guide.md`:**
486
- 1. Copy template `templates/UI-STYLE-GUIDE-TEMPLATE.md` → `{output_path}/ui-style-guide.md`
487
- 2. Fill each section using `search_replace` (FORBIDDEN: `create_file` rewrite)
488
-
489
- #### Document Generation Order and Dependencies
490
-
491
- | Order | Document | Template | Data Source | Dependencies |
492
- |-------|----------|----------|-------------|--------------|
493
- | 1 | `ui-style-guide.md` | UI-STYLE-GUIDE-TEMPLATE.md | Step 1, 3, 4, 5 | None (main entry) |
494
- | 2 | `page-types/page-type-summary.md` | PAGE-TYPE-SUMMARY-TEMPLATE.md | Step 2 | None |
495
- | 3 | `page-types/[type]-pages.md` | PAGE-TYPE-INDIVIDUAL-TEMPLATE.md | Step 2 | page-type-summary.md |
496
- | 4 | `components/component-library.md` | COMPONENT-LIBRARY-TEMPLATE.md | Step 3 | None |
497
- | 5 | `components/common-components.md` | COMMON-COMPONENTS-TEMPLATE.md | Step 3 | component-library.md |
498
- | 6 | `components/business-components.md` | BUSINESS-COMPONENTS-TEMPLATE.md | Step 3 | component-library.md |
499
- | 7 | `components/{component-name}.md` | COMPONENT-INDIVIDUAL-TEMPLATE.md | Step 3 | component-library.md |
500
- | 8 | `layouts/page-layouts.md` | LAYOUT-PATTERNS-TEMPLATE.md | Step 4 | None |
501
- | 9 | `layouts/navigation-patterns.md` | NAVIGATION-PATTERNS-TEMPLATE.md | Step 4 | page-layouts.md |
502
- | 10 | `layouts/{layout-name}-layout.md` | LAYOUT-INDIVIDUAL-TEMPLATE.md | Step 4 | page-layouts.md |
503
- | 11 | `styles/color-system.md` | STYLE-SYSTEM-TEMPLATE.md | Step 5 | None |
504
- | 12 | `styles/typography.md` | TYPOGRAPHY-TEMPLATE.md | Step 5 | color-system.md |
505
- | 13 | `styles/spacing-system.md` | SPACING-TEMPLATE.md | Step 5 | color-system.md |
506
-
507
- **Note**: `ui-style-guide.md` should reference/link to all other generated documents.
508
-
509
- #### Required Documents (All Platforms)
510
-
511
- | Document | Template | Required |
512
- |----------|----------|----------|
513
- | `ui-style-guide.md` | UI-STYLE-GUIDE-TEMPLATE.md | ✅ Yes |
514
- | `page-types/page-type-summary.md` | PAGE-TYPE-SUMMARY-TEMPLATE.md | ✅ Yes |
515
- | `page-types/[type]-pages.md` | PAGE-TYPE-INDIVIDUAL-TEMPLATE.md | ✅ Yes (one per discovered type) |
516
- | `components/component-library.md` | COMPONENT-LIBRARY-TEMPLATE.md | ✅ Yes |
517
- | `components/common-components.md` | COMMON-COMPONENTS-TEMPLATE.md | ✅ Yes |
518
- | `components/business-components.md` | BUSINESS-COMPONENTS-TEMPLATE.md | ✅ Yes |
519
- | `components/{component-name}.md` | COMPONENT-INDIVIDUAL-TEMPLATE.md | ✅ Yes (one per discovered component) |
520
- | `layouts/page-layouts.md` | LAYOUT-PATTERNS-TEMPLATE.md | ✅ Yes |
521
- | `layouts/navigation-patterns.md` | NAVIGATION-PATTERNS-TEMPLATE.md | ✅ Yes |
522
- | `layouts/{layout-name}-layout.md` | LAYOUT-INDIVIDUAL-TEMPLATE.md | ✅ Yes (one per discovered layout) |
523
- | `styles/color-system.md` | STYLE-SYSTEM-TEMPLATE.md | ✅ Yes |
524
- | `styles/typography.md` | TYPOGRAPHY-TEMPLATE.md | ✅ Yes |
525
- | `styles/spacing-system.md` | SPACING-TEMPLATE.md | ✅ Yes |
526
-
527
- ### Step 7: Verify Output Completeness
528
-
529
- **CRITICAL**: Verify all required files exist before reporting completion.
530
-
531
- **Required File Structure**:
532
- ```
533
- {output_path}/ # Caller should pass path ending with ui-style/
534
- ├── ui-style-guide.md ✅ Required
535
- ├── page-types/
536
- │ ├── page-type-summary.md ✅ Required
537
- │ └── [type-1]-pages.md ✅ Required (one per discovered type)
538
- │ └── [type-2]-pages.md ✅ Required (one per discovered type)
539
- │ └── ... ✅ Additional types...
540
- ├── components/
541
- │ ├── component-library.md ✅ Required
542
- │ ├── common-components.md ✅ Required
543
- │ ├── business-components.md ✅ Required
544
- │ └── {component-name}.md ✅ Required (one per discovered component)
545
- ├── layouts/
546
- │ ├── page-layouts.md ✅ Required
547
- │ ├── navigation-patterns.md ✅ Required
548
- │ └── {layout-name}-layout.md ✅ Required (one per discovered layout)
549
- └── styles/
550
- ├── color-system.md ✅ Required
551
- ├── typography.md ✅ Required
552
- └── spacing-system.md ✅ Required
553
- ```
554
-
555
- **Verification Rules**:
556
- 1. Count discovered page types from Step 2
557
- 2. Verify each page type has a corresponding `[type]-pages.md` file
558
- 3. Verify all 13 required documents exist (11 base + individual component/layout files)
559
- 4. Verify each component in component-library.md has a corresponding `{component-name}.md` file
560
- 5. Verify each layout in page-layouts.md has a corresponding `{layout-name}-layout.md` file
561
- 6. Verify component-library.md contains links to all individual component files
562
- 7. Verify page-layouts.md contains links to all individual layout files
563
- 8. If any file is missing, regenerate before proceeding
79
+ > **REQUIRED**: Before executing this workflow, read the XML workflow specification: `speccrew-workspace/docs/rules/agentflow-spec.md`
564
80
 
565
81
  ## Checklist
566
82