speccrew 0.1.0

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 (153) hide show
  1. package/.speccrew/agents/speccrew-feature-designer.md +142 -0
  2. package/.speccrew/agents/speccrew-product-manager.md +61 -0
  3. package/.speccrew/agents/speccrew-system-designer.md +200 -0
  4. package/.speccrew/agents/speccrew-system-developer.md +238 -0
  5. package/.speccrew/agents/speccrew-task-worker.md +80 -0
  6. package/.speccrew/agents/speccrew-team-leader.md +92 -0
  7. package/.speccrew/agents/speccrew-test-manager.md +313 -0
  8. package/.speccrew/skills/speccrew-create-agents/SKILL.md +98 -0
  9. package/.speccrew/skills/speccrew-create-agents/templates/agents/designer-agent.md +54 -0
  10. package/.speccrew/skills/speccrew-create-agents/templates/agents/dev-agent.md +79 -0
  11. package/.speccrew/skills/speccrew-create-agents/templates/agents/test-agent.md +80 -0
  12. package/.speccrew/skills/speccrew-dev-backend/SKILL.md +205 -0
  13. package/.speccrew/skills/speccrew-dev-backend/templates/TASK-RECORD-TEMPLATE.md +118 -0
  14. package/.speccrew/skills/speccrew-dev-desktop/SKILL.md +258 -0
  15. package/.speccrew/skills/speccrew-dev-desktop/templates/TASK-RECORD-TEMPLATE.md +161 -0
  16. package/.speccrew/skills/speccrew-dev-frontend/SKILL.md +202 -0
  17. package/.speccrew/skills/speccrew-dev-frontend/templates/TASK-RECORD-TEMPLATE.md +115 -0
  18. package/.speccrew/skills/speccrew-dev-mobile/SKILL.md +200 -0
  19. package/.speccrew/skills/speccrew-dev-mobile/templates/TASK-RECORD-TEMPLATE.md +125 -0
  20. package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +73 -0
  21. package/.speccrew/skills/speccrew-fd-api-contract/templates/API-CONTRACT-TEMPLATE.md +96 -0
  22. package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +395 -0
  23. package/.speccrew/skills/speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md +387 -0
  24. package/.speccrew/skills/speccrew-get-timestamp/SKILL.md +80 -0
  25. package/.speccrew/skills/speccrew-get-timestamp/scripts/get-timestamp.js +35 -0
  26. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +1116 -0
  27. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-FASTAPI.md +462 -0
  28. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-JAVA.md +480 -0
  29. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-NET.md +464 -0
  30. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE.md +480 -0
  31. package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/MODULE-OVERVIEW-TEMPLATE.md +367 -0
  32. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +667 -0
  33. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/STATUS-FORMATS.md +74 -0
  34. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/batch-orchestrator.js +176 -0
  35. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-next-batch.js +150 -0
  36. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-pending-features.js +106 -0
  37. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/mark-stale.js +249 -0
  38. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/process-batch-results.js +848 -0
  39. package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/update-feature-status.js +226 -0
  40. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +264 -0
  41. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/examples/features.json +34 -0
  42. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js +867 -0
  43. package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/test-inventory.js +26 -0
  44. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/SKILL.md +165 -0
  45. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/apply-module-mapping.js +208 -0
  46. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/extract-module-summary.js +180 -0
  47. package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/reindex-modules.js +358 -0
  48. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +1055 -0
  49. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-DESKTOP.md +303 -0
  50. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-ELECTRON.md +327 -0
  51. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MINIAPP.md +292 -0
  52. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MOBILE.md +281 -0
  53. package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI.md +324 -0
  54. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/SKILL.md +270 -0
  55. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/COMPONENT-PATTERN-TEMPLATE.md +33 -0
  56. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/LAYOUT-PATTERN-TEMPLATE.md +33 -0
  57. package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/PAGE-TYPE-TEMPLATE.md +33 -0
  58. package/.speccrew/skills/speccrew-knowledge-graph-query/SKILL.md +229 -0
  59. package/.speccrew/skills/speccrew-knowledge-graph-query/scripts/graph-query.js +549 -0
  60. package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +181 -0
  61. package/.speccrew/skills/speccrew-knowledge-graph-write/scripts/graph-write.js +651 -0
  62. package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +305 -0
  63. package/.speccrew/skills/speccrew-knowledge-module-summarize/templates/MODULE-OVERVIEW-TEMPLATE.md +400 -0
  64. package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +351 -0
  65. package/.speccrew/skills/speccrew-knowledge-system-summarize/templates/SYSTEM-OVERVIEW-TEMPLATE.md +294 -0
  66. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +683 -0
  67. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/STATUS-FORMATS.md +550 -0
  68. package/.speccrew/skills/speccrew-knowledge-techs-dispatch/templates/techs-manifest-EXAMPLE.json +35 -0
  69. package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +1087 -0
  70. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/ARCHITECTURE-TEMPLATE.md +240 -0
  71. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COLOR-SYSTEM-TEMPLATE.md +68 -0
  72. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COMPONENT-LIBRARY-TEMPLATE.md +86 -0
  73. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-BUILD-TEMPLATE.md +466 -0
  74. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DATA-TEMPLATE.md +432 -0
  75. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DESIGN-TEMPLATE.md +1209 -0
  76. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DEV-TEMPLATE.md +1433 -0
  77. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-SYSTEM-TEST-TEMPLATE.md +1052 -0
  78. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-UNIT-TEST-TEMPLATE.md +946 -0
  79. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/INDEX-TEMPLATE.md +29 -0
  80. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-LAYOUTS-TEMPLATE.md +69 -0
  81. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +74 -0
  82. package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/TECH-STACK-TEMPLATE.md +232 -0
  83. package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +628 -0
  84. package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +392 -0
  85. package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +489 -0
  86. package/.speccrew/skills/speccrew-knowledge-techs-index/templates/INDEX-TEMPLATE.md +243 -0
  87. package/.speccrew/skills/speccrew-knowledge-techs-init/SKILL.md +269 -0
  88. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +562 -0
  89. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/BUSINESS-COMPONENTS-TEMPLATE.md +171 -0
  90. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMMON-COMPONENTS-TEMPLATE.md +177 -0
  91. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-INDIVIDUAL-TEMPLATE.md +80 -0
  92. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-LIBRARY-TEMPLATE.md +118 -0
  93. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-INDIVIDUAL-TEMPLATE.md +97 -0
  94. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-PATTERNS-TEMPLATE.md +208 -0
  95. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/NAVIGATION-PATTERNS-TEMPLATE.md +157 -0
  96. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md +123 -0
  97. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +58 -0
  98. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/SPACING-TEMPLATE.md +119 -0
  99. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/STYLE-SYSTEM-TEMPLATE.md +117 -0
  100. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/TYPOGRAPHY-TEMPLATE.md +107 -0
  101. package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/UI-STYLE-GUIDE-TEMPLATE.md +171 -0
  102. package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +434 -0
  103. package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/BIZS-MODELING-TEMPLATE.md +332 -0
  104. package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/PRD-TEMPLATE.md +200 -0
  105. package/.speccrew/skills/speccrew-pm-requirement-assess/SKILL.md +195 -0
  106. package/.speccrew/skills/speccrew-project-diagnosis/SKILL.md +208 -0
  107. package/.speccrew/skills/speccrew-project-diagnosis/templates/DIAGNOSIS-REPORT-TEMPLATE.md +202 -0
  108. package/.speccrew/skills/speccrew-sd-backend/SKILL.md +188 -0
  109. package/.speccrew/skills/speccrew-sd-backend/templates/INDEX-TEMPLATE.md +85 -0
  110. package/.speccrew/skills/speccrew-sd-backend/templates/SD-BACKEND-TEMPLATE.md +269 -0
  111. package/.speccrew/skills/speccrew-sd-desktop/SKILL.md +192 -0
  112. package/.speccrew/skills/speccrew-sd-desktop/templates/INDEX-TEMPLATE.md +271 -0
  113. package/.speccrew/skills/speccrew-sd-desktop/templates/SD-DESKTOP-TEMPLATE.md +673 -0
  114. package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +176 -0
  115. package/.speccrew/skills/speccrew-sd-frontend/templates/INDEX-TEMPLATE.md +184 -0
  116. package/.speccrew/skills/speccrew-sd-frontend/templates/SD-FRONTEND-TEMPLATE.md +382 -0
  117. package/.speccrew/skills/speccrew-sd-mobile/SKILL.md +189 -0
  118. package/.speccrew/skills/speccrew-sd-mobile/templates/INDEX-TEMPLATE.md +219 -0
  119. package/.speccrew/skills/speccrew-sd-mobile/templates/SD-MOBILE-TEMPLATE.md +534 -0
  120. package/.speccrew/skills/speccrew-test-case-design/SKILL.md +284 -0
  121. package/.speccrew/skills/speccrew-test-case-design/templates/TEST-CASE-DESIGN-TEMPLATE.md +263 -0
  122. package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +313 -0
  123. package/.speccrew/skills/speccrew-test-code-gen/templates/TEST-CODE-PLAN-TEMPLATE.md +180 -0
  124. package/.speccrew/skills/speccrew-test-execute/SKILL.md +283 -0
  125. package/.speccrew/skills/speccrew-test-execute/templates/BUG-REPORT-TEMPLATE.md +50 -0
  126. package/.speccrew/skills/speccrew-test-execute/templates/TEST-REPORT-TEMPLATE.md +57 -0
  127. package/.speccrew/skills/speccrew-workflow-diagnose/SKILL.md +155 -0
  128. package/LICENSE +21 -0
  129. package/README.ar.md +318 -0
  130. package/README.en.md +318 -0
  131. package/README.es.md +318 -0
  132. package/README.md +340 -0
  133. package/bin/cli.js +62 -0
  134. package/lib/commands/doctor.js +138 -0
  135. package/lib/commands/init.js +231 -0
  136. package/lib/commands/list.js +114 -0
  137. package/lib/commands/uninstall.js +117 -0
  138. package/lib/commands/update.js +351 -0
  139. package/lib/ide-adapters.js +73 -0
  140. package/lib/utils.js +104 -0
  141. package/package.json +28 -0
  142. package/workspace-template/docs/configs/document-templates.json +667 -0
  143. package/workspace-template/docs/configs/platform-mapping.json +194 -0
  144. package/workspace-template/docs/configs/tech-stack-mappings.json +313 -0
  145. package/workspace-template/docs/configs/validation-rules.json +87 -0
  146. package/workspace-template/docs/rules/mermaid-rule.md +114 -0
  147. package/workspace-template/docs/solutions/Agent/346/212/200/350/203/275/345/256/232/344/271/211+/351/234/200/346/261/202/346/226/207/346/241/243+UML/344/275/277/347/224/250/346/250/241/346/235/277/357/274/210ISA-95/345/205/255/346/256/265/345/274/217/350/236/215/345/220/210/347/211/210/357/274/211.md +586 -0
  148. package/workspace-template/docs/solutions/agent-knowledge-map.md +238 -0
  149. package/workspace-template/docs/solutions/bizs-knowledge-pipeline.md +678 -0
  150. package/workspace-template/docs/solutions/harness.md +410 -0
  151. package/workspace-template/docs/solutions/knowledge-incremental-sync-spec.md +943 -0
  152. package/workspace-template/docs/solutions/techs-knowledge-pipeline.md +803 -0
  153. package/workspace-template/docs/solutions/workspace-structure.md +318 -0
@@ -0,0 +1,562 @@
1
+ ---
2
+ name: speccrew-knowledge-techs-ui-analyze
3
+ description: Analyze existing frontend UI codebase to extract and summarize page styles, layout patterns, component usage, and design conventions. Generates comprehensive UI style guides for each platform (PC, Mobile, etc.) including page type classifications, component libraries, layout patterns, and styling conventions. Used to ensure new pages maintain consistency with existing system design.
4
+ tools: Read, Write, Glob, Grep
5
+ ---
6
+
7
+ # UI Style Analyzer
8
+
9
+ Analyze existing frontend UI codebase to extract and summarize page styles, layout patterns, and component usage for each platform.
10
+
11
+ ## Language Adaptation
12
+
13
+ **CRITICAL**: Generate all content in the language specified by the `language` parameter.
14
+
15
+ - `language: "zh"` → Generate all content in 中文
16
+ - `language: "en"` → Generate all content in English
17
+
18
+ ## Trigger Scenarios
19
+
20
+ - "Analyze UI styles from existing codebase"
21
+ - "Extract page layout patterns from {platform}"
22
+ - "Summarize component usage in {project}"
23
+ - "Generate UI style guide from source code"
24
+ - "梳理现有系统页面风格"
25
+ - "分析项目UI组件使用规范"
26
+
27
+ ## User
28
+
29
+ Worker Agent (speccrew-task-worker)
30
+
31
+ ## Input
32
+
33
+ - `source_path`: Path to UI source code directory (e.g., `yudao-ui/yudao-ui-admin-vue3/`)
34
+ - `platform_id`: Platform identifier (e.g., "admin-pc", "admin-mobile")
35
+ - `platform_type`: Platform type (`web`, `mobile`, `desktop`)
36
+ - `framework`: Frontend framework (vue3, react, uniapp, etc.)
37
+ - `output_path`: Output directory for generated style guide
38
+ - `language`: Target language (e.g., "zh", "en") - **REQUIRED**
39
+
40
+ ## Output
41
+
42
+ Generate the following documents in `{output_path}/`:
43
+
44
+ **Note**: The `output_path` parameter should already include the `ui-style/` suffix when passed from the caller (e.g., `speccrew-knowledge-techs-generate`).
45
+
46
+ ```
47
+ {output_path}/ # e.g., .../techs/mobile-uniapp/ui-style/
48
+ ├── ui-style-guide.md # Main UI style guide (Required)
49
+ ├── page-types/ # Page type analysis
50
+ │ ├── page-type-summary.md # Page type overview (dynamically generated type list)
51
+ │ ├── [type-1]-pages.md # Specific page type analysis (dynamically named)
52
+ │ ├── [type-2]-pages.md # Specific page type analysis
53
+ │ └── ... # Other discovered page types
54
+ ├── components/ # Component analysis
55
+ │ ├── component-library.md # Component inventory (summary)
56
+ │ ├── common-components.md # Common component usage conventions
57
+ │ ├── business-components.md # Business component usage conventions
58
+ │ └── {component-name}.md # Individual component detail (one per discovered component)
59
+ ├── layouts/ # Layout patterns
60
+ │ ├── page-layouts.md # Layout patterns summary
61
+ │ ├── navigation-patterns.md # Navigation patterns
62
+ │ └── {layout-name}-layout.md # Individual layout detail (one per discovered layout)
63
+ └── styles/ # Styling conventions
64
+ ├── color-system.md # Color system
65
+ ├── typography.md # Typography conventions
66
+ └── spacing-system.md # Spacing system
67
+ ```
68
+
69
+ **Note**: Page type documents are dynamically named based on discovered types, e.g.
70
+ - If system has `*List.vue` files → `list-pages.md`
71
+ - If system has `*Form.vue` files → `form-pages.md`
72
+ - If system has `*Dashboard.vue` files → `dashboard-pages.md`
73
+ - If system has custom patterns like `*Workflow.vue` → `workflow-pages.md`
74
+
75
+ ## Workflow
76
+
77
+ ### Step 0: Read All Templates
78
+
79
+ Before analysis, read all template files to understand document structures and required content:
80
+
81
+ | Template File | Output Document | Purpose |
82
+ |---------------|-----------------|---------|
83
+ | `templates/UI-STYLE-GUIDE-TEMPLATE.md` | `ui-style-guide.md` | Main style guide structure |
84
+ | `templates/PAGE-TYPE-SUMMARY-TEMPLATE.md` | `page-types/page-type-summary.md` | Page type classification structure |
85
+ | `templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md` | `page-types/[type]-pages.md` | Individual page type structure |
86
+ | `templates/COMPONENT-LIBRARY-TEMPLATE.md` | `components/component-library.md` | Component inventory structure |
87
+ | `templates/COMMON-COMPONENTS-TEMPLATE.md` | `components/common-components.md` | Common component usage structure |
88
+ | `templates/BUSINESS-COMPONENTS-TEMPLATE.md` | `components/business-components.md` | Business component usage structure |
89
+ | `templates/COMPONENT-INDIVIDUAL-TEMPLATE.md` | `components/{component-name}.md` | Individual component detail |
90
+ | `templates/LAYOUT-PATTERNS-TEMPLATE.md` | `layouts/page-layouts.md` | Layout patterns structure |
91
+ | `templates/NAVIGATION-PATTERNS-TEMPLATE.md` | `layouts/navigation-patterns.md` | Navigation patterns structure |
92
+ | `templates/LAYOUT-INDIVIDUAL-TEMPLATE.md` | `layouts/{layout-name}-layout.md` | Individual layout detail |
93
+ | `templates/STYLE-SYSTEM-TEMPLATE.md` | `styles/color-system.md` | Color system structure |
94
+ | `templates/TYPOGRAPHY-TEMPLATE.md` | `styles/typography.md` | Typography structure |
95
+ | `templates/SPACING-TEMPLATE.md` | `styles/spacing-system.md` | Spacing system structure |
96
+
97
+ **Key principle**: Extract information from source code according to each template's section requirements.
98
+
99
+ ### Step 1: Discover Source Structure
100
+
101
+ **Purpose**: Gather project metadata for `ui-style-guide.md` Section 1-2 (Project Overview, Platform Summary)
102
+
103
+ **Template Reference**: `UI-STYLE-GUIDE-TEMPLATE.md` - Sections: Project Overview, Platform Summary
104
+
105
+ Explore the source code directory to understand:
106
+ - Project structure (views/pages directory)
107
+ - Component organization
108
+ - Style file locations
109
+ - Configuration files (package.json, vite.config, etc.)
110
+
111
+ **Key directories to explore:**
112
+ - `src/views/` or `src/pages/` - Page components
113
+ - `src/components/` - Reusable components
114
+ - `src/layout/` or `src/layouts/` - Layout components
115
+ - `src/styles/` or `src/assets/styles/` - Style files
116
+
117
+ **Extract for ui-style-guide.md:**
118
+ - Technology Stack (framework, UI library, build tool, language versions)
119
+ - Directory Structure
120
+ - Platform details (resolution range, target device)
121
+ - Browser support list
122
+
123
+ ### Step 2: Analyze Page Types
124
+
125
+ **Purpose**: Generate `page-types/page-type-summary.md` and individual `[type]-pages.md` files
126
+
127
+ **Templates to Read First**:
128
+ - `templates/PAGE-TYPE-SUMMARY-TEMPLATE.md` - Sections: Analysis Methodology, Page Type Statistics, Naming Conventions Summary, New Page Selection Guide, Page Type Details
129
+ - `templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md` - Structure for each page type document
130
+
131
+ **Output Documents**:
132
+ 1. `page-types/page-type-summary.md` - Classification overview
133
+ 2. `page-types/[type]-pages.md` - One per discovered page type (dynamically named)
134
+
135
+ Scan page files to identify and classify page types dynamically based on actual source code.
136
+
137
+ #### Dynamic Page Type Discovery
138
+
139
+ **DO NOT assume predefined page types.** Instead, analyze the actual codebase to discover what page types exist:
140
+
141
+ 1. **File Name Analysis**
142
+ - Extract naming patterns from page files
143
+ - Group files by similar naming conventions
144
+ - Examples: `*List.vue`, `*Form.vue`, `*Detail.vue`, `*Chart.vue`, etc.
145
+
146
+ 2. **Component Usage Analysis**
147
+ - Identify dominant components in each file group
148
+ - Look for patterns like:
149
+ - Table-heavy files → likely list/query pages
150
+ - Form-heavy files → likely create/edit pages
151
+ - Chart-heavy files → likely report/dashboard pages
152
+ - Split-pane layouts → likely master-detail pages
153
+
154
+ 3. **Route/Navigation Analysis**
155
+ - Check router configuration for page organization
156
+ - Identify menu structures and page hierarchies
157
+
158
+ 4. **Content Pattern Recognition**
159
+ - Search for keywords in template sections:
160
+ - Search/filter inputs → query functionality
161
+ - Submit buttons → form functionality
162
+ - Charts/graphs → report functionality
163
+ - Trees + tables → tree-table functionality
164
+
165
+ #### Page Type Classification Output
166
+
167
+ Based on analysis, generate a classification table:
168
+
169
+ ```
170
+ | Page Type | Detection Pattern | File Count | Typical Files |
171
+ |-----------|-------------------|------------|---------------|
172
+ | [Auto-discovered Type 1] | [Recognition features] | N | [Example files] |
173
+ | [Auto-discovered Type 2] | [Recognition features] | N | [Example files] |
174
+ ```
175
+
176
+ #### Analysis Content for Each Discovered Page Type
177
+
178
+ For each identified page type, extract according to `PAGE-TYPE-INDIVIDUAL-TEMPLATE.md`:
179
+
180
+ 1. **File List** - All files belonging to this type
181
+ 2. **Naming Pattern** - Common naming convention
182
+ 3. **Common Components** - Components used across pages of this type
183
+ 4. **Layout Pattern** - DOM structure and layout approach
184
+ 5. **Data Flow** - How data is fetched and managed
185
+ 6. **Interaction Patterns** - Common user interactions
186
+ 7. **Business Scenarios** - What business functions this page type serves
187
+
188
+ **Generate**: `page-types/[type]-pages.md` for each discovered type
189
+
190
+ ### Step 3: Extract Component Usage
191
+
192
+ **Purpose**: Generate component documentation in `components/` directory
193
+
194
+ **Templates to Read First**:
195
+ - `templates/COMPONENT-LIBRARY-TEMPLATE.md` - Sections: UI Framework Components, Common Components, Business Components, Component Usage Statistics
196
+ - `templates/COMMON-COMPONENTS-TEMPLATE.md` - Common component patterns and usage
197
+ - `templates/BUSINESS-COMPONENTS-TEMPLATE.md` - Business component patterns
198
+
199
+ **Output Documents**:
200
+ 1. `components/component-library.md` - Component inventory (summary with links)
201
+ 2. `components/common-components.md` - Common component usage conventions
202
+ 3. `components/business-components.md` - Business component usage conventions
203
+ 4. `components/{component-name}.md` - Individual component detail (one per discovered component)
204
+
205
+ **Note**: `component-library.md` serves as the inventory/index:
206
+ - Lists ALL discovered components with category, source, and brief description
207
+ - Links to individual component documents: [wd-button](wd-button.md)
208
+ - Does NOT contain detailed Props/Events (those are in individual files)
209
+
210
+ Analyze component imports and usage:
211
+
212
+ #### Component Categories
213
+
214
+ **UI Framework Components** (Element Plus, Ant Design, Vant, etc.)
215
+ - Button, Input, Select, Table, Form, Modal, etc.
216
+
217
+ **Common Components** (Project-specific)
218
+ - SearchForm, Pagination, DictTag, ImagePreview, etc.
219
+
220
+ **Business Components** (Domain-specific)
221
+ - UserSelect, DeptTree, RolePicker, etc.
222
+
223
+ #### Extraction Method
224
+
225
+ 1. Read component files in `src/components/`
226
+ 2. Analyze imports in page files
227
+ 3. Identify component props and usage patterns
228
+ 4. Document component APIs
229
+
230
+ **Extract for component-library.md** (per COMPONENT-LIBRARY-TEMPLATE.md):
231
+ - UI Framework Components: Basic, Form, Data Display, Navigation, Feedback components
232
+ - Common Components: Layout, Utility, Functional components with props
233
+ - Business Components: Domain-specific components
234
+ - Component usage statistics and dependencies
235
+
236
+ **Extract for common-components.md**:
237
+ - Component purpose and usage scenarios
238
+ - Props definition and examples
239
+ - Usage patterns and best practices
240
+
241
+ **Extract for business-components.md**:
242
+ - Business component list by domain
243
+ - Props and event definitions
244
+ - Business logic integration patterns
245
+
246
+ #### Generate Individual Component Documents
247
+
248
+ For each component discovered during analysis:
249
+
250
+ 1. **Copy Template**: Copy `templates/COMPONENT-INDIVIDUAL-TEMPLATE.md` to `{output_path}/components/{component-name}.md`
251
+ - Component name: lowercase, kebab-case (e.g., `wd-button.md`, `fg-search-form.md`)
252
+
253
+ 2. **Fill Template**: Use search_replace to fill each section:
254
+ - Extract Props/Events/Slots from source code (TypeScript interfaces, defineProps, defineEmits)
255
+ - Generate usage examples from actual usage found in pages/
256
+ - Extract CSS variables/classes from component styles
257
+ - Identify related components from imports
258
+
259
+ 3. **Scope Control**:
260
+ - For UI framework components (e.g., wd-*, el-*): Focus on project-specific usage patterns and customization, NOT full API docs (defer to official documentation)
261
+ - For custom components (e.g., fg-*): Full Props/Events/Slots documentation
262
+ - Skip trivial components (< 10 lines, no props/events)
263
+
264
+ 4. **Naming Convention**: {component-name}.md
265
+ - Use the component tag name in kebab-case
266
+ - Examples: wd-button.md, fg-search-form.md, z-paging.md
267
+
268
+ ### Step 4: Analyze Layout Patterns
269
+
270
+ **Purpose**: Generate layout documentation in `layouts/` directory
271
+
272
+ **Templates to Read First**:
273
+ - `templates/LAYOUT-PATTERNS-TEMPLATE.md` - Layout pattern structure
274
+ - `templates/NAVIGATION-PATTERNS-TEMPLATE.md` - Navigation pattern structure
275
+
276
+ **Output Documents**:
277
+ 1. `layouts/page-layouts.md` - Layout pattern summary (with links)
278
+ 2. `layouts/navigation-patterns.md` - Navigation patterns
279
+ 3. `layouts/{layout-name}-layout.md` - Individual layout detail (one per discovered layout)
280
+
281
+ **Note**: `page-layouts.md` serves as the layout pattern summary:
282
+ - Lists ALL discovered layout patterns with type and usage frequency
283
+ - Links to individual layout documents: [TabBar Layout](tabbar-layout.md)
284
+ - Contains high-level comparison table between layouts
285
+ - Does NOT contain detailed region/component analysis (those are in individual files)
286
+
287
+ Identify common layout patterns:
288
+
289
+ #### Layout Types
290
+
291
+ 1. **Standard List Layout**
292
+ ```
293
+ Search Form
294
+ Toolbar (Add/Export/Delete buttons)
295
+ Data Table
296
+ Pagination
297
+ ```
298
+
299
+ 2. **Standard Form Layout**
300
+ ```
301
+ Form Card
302
+ Form Fields (2-3 columns)
303
+ Action Buttons (Submit/Cancel)
304
+ ```
305
+
306
+ 3. **Detail View Layout**
307
+ ```
308
+ Detail Card
309
+ Description List
310
+ Action Buttons
311
+ ```
312
+
313
+ 4. **Split Pane Layout**
314
+ ```
315
+ Left: Tree/Menu
316
+ Right: Content Table/Form
317
+ ```
318
+
319
+ **Extract for page-layouts.md** (per LAYOUT-PATTERNS-TEMPLATE.md):
320
+ - Layout type definitions and visual diagrams
321
+ - DOM structure patterns
322
+ - Responsive behavior rules
323
+ - Usage scenarios for each layout
324
+
325
+ **Extract for navigation-patterns.md** (per NAVIGATION-PATTERNS-TEMPLATE.md):
326
+ - Navigation structure (sidebar, topbar, breadcrumbs)
327
+ - Menu organization patterns
328
+ - Route configuration conventions
329
+ - Navigation state management
330
+
331
+ #### Generate Individual Layout Documents
332
+
333
+ For each distinct layout pattern discovered:
334
+
335
+ 1. **Copy Template**: Copy `templates/LAYOUT-INDIVIDUAL-TEMPLATE.md` to `{output_path}/layouts/{layout-name}-layout.md`
336
+ - Layout name: lowercase, kebab-case (e.g., `tabbar-layout.md`, `detail-layout.md`)
337
+
338
+ 2. **Fill Template**: Use search_replace to fill each section:
339
+ - Generate ASCII layout diagram from actual page structure
340
+ - List components used in this layout
341
+ - Extract page configuration from pages.json or route config
342
+ - Identify pages that use this layout pattern
343
+
344
+ 3. **Discovery Rules**:
345
+ - Analyze page structures to identify distinct layout patterns
346
+ - Group pages with similar structure into layout categories
347
+ - Minimum 2 pages must share a layout pattern to warrant a document
348
+ - Common layout types: tabbar, detail, form, list, dashboard, modal, fullscreen
349
+
350
+ 4. **Naming Convention**: {layout-name}-layout.md
351
+ - Use descriptive name in kebab-case
352
+ - Examples: tabbar-layout.md, detail-layout.md, form-layout.md
353
+
354
+ ### Step 5: Extract Style Conventions
355
+
356
+ **Purpose**: Generate style system documentation in `styles/` directory
357
+
358
+ **Templates to Read First**:
359
+ - `templates/STYLE-SYSTEM-TEMPLATE.md` - Color system structure
360
+ - `templates/TYPOGRAPHY-TEMPLATE.md` - Typography structure
361
+ - `templates/SPACING-TEMPLATE.md` - Spacing system structure
362
+
363
+ **Output Documents**:
364
+ 1. `styles/color-system.md` - Color system
365
+ 2. `styles/typography.md` - Typography conventions
366
+ 3. `styles/spacing-system.md` - Spacing system
367
+
368
+ Analyze style files to extract:
369
+
370
+ #### Color System
371
+ - Primary colors
372
+ - Status colors (success, warning, error, info)
373
+ - Text colors
374
+ - Background colors
375
+ - Border colors
376
+
377
+ **Extract for color-system.md** (per STYLE-SYSTEM-TEMPLATE.md):
378
+ - Color palette with hex values
379
+ - Semantic color usage (primary, success, warning, error, info)
380
+ - Color application rules (text, background, border)
381
+ - CSS variables or theme configuration
382
+
383
+ #### Typography
384
+ - Font families
385
+ - Font sizes (heading, body, small)
386
+ - Font weights
387
+ - Line heights
388
+
389
+ **Extract for typography.md** (per TYPOGRAPHY-TEMPLATE.md):
390
+ - Font family definitions
391
+ - Type scale (H1-H6, body, small sizes)
392
+ - Font weights and line heights
393
+ - Typography usage patterns
394
+
395
+ #### Spacing System
396
+ - Padding/Margin scales
397
+ - Grid system
398
+ - Container widths
399
+
400
+ **Extract for spacing-system.md** (per SPACING-TEMPLATE.md):
401
+ - Spacing tokens (xs, sm, md, lg, xl values)
402
+ - Grid system configuration
403
+ - Container and breakpoint definitions
404
+ - Spacing application guidelines
405
+
406
+ ### Step 6: Generate Documentation
407
+
408
+ **Purpose**: Create all documentation files using extracted data and templates
409
+
410
+ #### Document Generation Workflow
411
+
412
+ For each document, follow this process:
413
+
414
+ 1. **Read the corresponding template** from `templates/` directory
415
+ 2. **Review extracted data** from Steps 1-5
416
+ 3. **Map data to template sections** - ensure all template placeholders are filled
417
+ 4. **Generate document** with actual values
418
+ 5. **Write output** to `{output_path}/`
419
+
420
+ #### Document Generation Order and Dependencies
421
+
422
+ | Order | Document | Template | Data Source | Dependencies |
423
+ |-------|----------|----------|-------------|--------------|
424
+ | 1 | `ui-style-guide.md` | UI-STYLE-GUIDE-TEMPLATE.md | Step 1, 3, 4, 5 | None (main entry) |
425
+ | 2 | `page-types/page-type-summary.md` | PAGE-TYPE-SUMMARY-TEMPLATE.md | Step 2 | None |
426
+ | 3 | `page-types/[type]-pages.md` | PAGE-TYPE-INDIVIDUAL-TEMPLATE.md | Step 2 | page-type-summary.md |
427
+ | 4 | `components/component-library.md` | COMPONENT-LIBRARY-TEMPLATE.md | Step 3 | None |
428
+ | 5 | `components/common-components.md` | COMMON-COMPONENTS-TEMPLATE.md | Step 3 | component-library.md |
429
+ | 6 | `components/business-components.md` | BUSINESS-COMPONENTS-TEMPLATE.md | Step 3 | component-library.md |
430
+ | 7 | `components/{component-name}.md` | COMPONENT-INDIVIDUAL-TEMPLATE.md | Step 3 | component-library.md |
431
+ | 8 | `layouts/page-layouts.md` | LAYOUT-PATTERNS-TEMPLATE.md | Step 4 | None |
432
+ | 9 | `layouts/navigation-patterns.md` | NAVIGATION-PATTERNS-TEMPLATE.md | Step 4 | page-layouts.md |
433
+ | 10 | `layouts/{layout-name}-layout.md` | LAYOUT-INDIVIDUAL-TEMPLATE.md | Step 4 | page-layouts.md |
434
+ | 11 | `styles/color-system.md` | STYLE-SYSTEM-TEMPLATE.md | Step 5 | None |
435
+ | 12 | `styles/typography.md` | TYPOGRAPHY-TEMPLATE.md | Step 5 | color-system.md |
436
+ | 13 | `styles/spacing-system.md` | SPACING-TEMPLATE.md | Step 5 | color-system.md |
437
+
438
+ **Note**: `ui-style-guide.md` should reference/link to all other generated documents.
439
+
440
+ #### Required Documents (All Platforms)
441
+
442
+ | Document | Template | Required |
443
+ |----------|----------|----------|
444
+ | `ui-style-guide.md` | UI-STYLE-GUIDE-TEMPLATE.md | ✅ Yes |
445
+ | `page-types/page-type-summary.md` | PAGE-TYPE-SUMMARY-TEMPLATE.md | ✅ Yes |
446
+ | `page-types/[type]-pages.md` | PAGE-TYPE-INDIVIDUAL-TEMPLATE.md | ✅ Yes (one per discovered type) |
447
+ | `components/component-library.md` | COMPONENT-LIBRARY-TEMPLATE.md | ✅ Yes |
448
+ | `components/common-components.md` | COMMON-COMPONENTS-TEMPLATE.md | ✅ Yes |
449
+ | `components/business-components.md` | BUSINESS-COMPONENTS-TEMPLATE.md | ✅ Yes |
450
+ | `components/{component-name}.md` | COMPONENT-INDIVIDUAL-TEMPLATE.md | ✅ Yes (one per discovered component) |
451
+ | `layouts/page-layouts.md` | LAYOUT-PATTERNS-TEMPLATE.md | ✅ Yes |
452
+ | `layouts/navigation-patterns.md` | NAVIGATION-PATTERNS-TEMPLATE.md | ✅ Yes |
453
+ | `layouts/{layout-name}-layout.md` | LAYOUT-INDIVIDUAL-TEMPLATE.md | ✅ Yes (one per discovered layout) |
454
+ | `styles/color-system.md` | STYLE-SYSTEM-TEMPLATE.md | ✅ Yes |
455
+ | `styles/typography.md` | TYPOGRAPHY-TEMPLATE.md | ✅ Yes |
456
+ | `styles/spacing-system.md` | SPACING-TEMPLATE.md | ✅ Yes |
457
+
458
+ ### Step 7: Verify Output Completeness
459
+
460
+ **CRITICAL**: Verify all required files exist before reporting completion.
461
+
462
+ **Required File Structure**:
463
+ ```
464
+ {output_path}/ # Caller should pass path ending with ui-style/
465
+ ├── ui-style-guide.md ✅ Required
466
+ ├── page-types/
467
+ │ ├── page-type-summary.md ✅ Required
468
+ │ └── [type-1]-pages.md ✅ Required (one per discovered type)
469
+ │ └── [type-2]-pages.md ✅ Required (one per discovered type)
470
+ │ └── ... ✅ Additional types...
471
+ ├── components/
472
+ │ ├── component-library.md ✅ Required
473
+ │ ├── common-components.md ✅ Required
474
+ │ ├── business-components.md ✅ Required
475
+ │ └── {component-name}.md ✅ Required (one per discovered component)
476
+ ├── layouts/
477
+ │ ├── page-layouts.md ✅ Required
478
+ │ ├── navigation-patterns.md ✅ Required
479
+ │ └── {layout-name}-layout.md ✅ Required (one per discovered layout)
480
+ └── styles/
481
+ ├── color-system.md ✅ Required
482
+ ├── typography.md ✅ Required
483
+ └── spacing-system.md ✅ Required
484
+ ```
485
+
486
+ **Verification Rules**:
487
+ 1. Count discovered page types from Step 2
488
+ 2. Verify each page type has a corresponding `[type]-pages.md` file
489
+ 3. Verify all 13 required documents exist (11 base + individual component/layout files)
490
+ 4. Verify each component in component-library.md has a corresponding `{component-name}.md` file
491
+ 5. Verify each layout in page-layouts.md has a corresponding `{layout-name}-layout.md` file
492
+ 6. Verify component-library.md contains links to all individual component files
493
+ 7. Verify page-layouts.md contains links to all individual layout files
494
+ 8. If any file is missing, regenerate before proceeding
495
+
496
+ ## Checklist
497
+
498
+ ### Pre-Analysis (Step 0)
499
+ - [ ] All 13 templates read and understood
500
+ - [ ] Template section requirements mapped to extraction tasks
501
+ - [ ] Source path exists and accessible
502
+ - [ ] Framework identified (Vue3, React, etc.)
503
+ - [ ] Platform type determined
504
+
505
+ ### Analysis Phase
506
+ **Step 1: Source Structure**
507
+ - [ ] Project structure explored
508
+ - [ ] Technology stack extracted for ui-style-guide.md
509
+ - [ ] Directory structure documented
510
+
511
+ **Step 2: Page Types**
512
+ - [ ] PAGE-TYPE-SUMMARY-TEMPLATE.md read
513
+ - [ ] PAGE-TYPE-INDIVIDUAL-TEMPLATE.md read
514
+ - [ ] Page files discovered and categorized
515
+ - [ ] page-type-summary.md generated
516
+ - [ ] Individual [type]-pages.md generated (one per discovered type)
517
+
518
+ **Step 3: Component Usage**
519
+ - [ ] COMPONENT-LIBRARY-TEMPLATE.md read
520
+ - [ ] COMMON-COMPONENTS-TEMPLATE.md read
521
+ - [ ] BUSINESS-COMPONENTS-TEMPLATE.md read
522
+ - [ ] COMPONENT-INDIVIDUAL-TEMPLATE.md read
523
+ - [ ] Components extracted and classified
524
+ - [ ] component-library.md generated
525
+ - [ ] common-components.md generated
526
+ - [ ] business-components.md generated
527
+ - [ ] Individual {component-name}.md files generated (one per discovered component)
528
+
529
+ **Step 4: Layout Patterns**
530
+ - [ ] LAYOUT-PATTERNS-TEMPLATE.md read
531
+ - [ ] NAVIGATION-PATTERNS-TEMPLATE.md read
532
+ - [ ] LAYOUT-INDIVIDUAL-TEMPLATE.md read
533
+ - [ ] Layout patterns identified
534
+ - [ ] page-layouts.md generated
535
+ - [ ] navigation-patterns.md generated
536
+ - [ ] Individual {layout-name}-layout.md files generated (one per discovered layout)
537
+
538
+ **Step 5: Style Conventions**
539
+ - [ ] STYLE-SYSTEM-TEMPLATE.md read
540
+ - [ ] TYPOGRAPHY-TEMPLATE.md read
541
+ - [ ] SPACING-TEMPLATE.md read
542
+ - [ ] Style conventions extracted
543
+ - [ ] color-system.md generated
544
+ - [ ] typography.md generated
545
+ - [ ] spacing-system.md generated
546
+
547
+ ### Documentation Phase (Step 6)
548
+ - [ ] UI-STYLE-GUIDE-TEMPLATE.md read
549
+ - [ ] ui-style-guide.md generated with links to all other documents
550
+ - [ ] All 13 required documents exist (11 base + individual component/layout files)
551
+ - [ ] Each component in component-library.md links to its individual file
552
+ - [ ] Each layout in page-layouts.md links to its individual file
553
+ - [ ] Document cross-references are valid
554
+
555
+ ### Quality Checks
556
+ - [ ] All content in specified language
557
+ - [ ] File paths are correct and accessible
558
+ - [ ] Code examples are syntactically correct
559
+ - [ ] ASCII diagrams are clear and accurate
560
+ - [ ] Individual component files follow template structure (Props table, Usage examples, etc.)
561
+ - [ ] Individual layout files follow template structure (Regions table, Navigation, etc.)
562
+ - [ ] Results reported with file counts