webcraft-skills 0.1.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 (29) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/CHANGELOG_zh_CN.md +67 -0
  3. package/LICENSE +21 -0
  4. package/README.md +148 -0
  5. package/README_zh_CN.md +148 -0
  6. package/commands/ui-audit.md +21 -0
  7. package/commands/ui-build.md +21 -0
  8. package/commands/ui-fix.md +21 -0
  9. package/commands/ui-polish.md +21 -0
  10. package/commands/ui-preset.md +15 -0
  11. package/commands/ui-review.md +21 -0
  12. package/package.json +36 -0
  13. package/scripts/install.mjs +101 -0
  14. package/skills/webcraft-skills/SKILL.md +45 -0
  15. package/skills/webcraft-skills/agents/openai.yaml +4 -0
  16. package/skills/webcraft-skills/references/checklists/ui-audit.md +621 -0
  17. package/skills/webcraft-skills/references/checklists/ui-audit.zh.md +675 -0
  18. package/skills/webcraft-skills/references/presets/cinematic-minimal.md +48 -0
  19. package/skills/webcraft-skills/references/presets/cinematic-minimal.zh.md +53 -0
  20. package/skills/webcraft-skills/references/workflows/audit-ui.md +272 -0
  21. package/skills/webcraft-skills/references/workflows/audit-ui.zh.md +299 -0
  22. package/skills/webcraft-skills/references/workflows/build-ui.md +12 -0
  23. package/skills/webcraft-skills/references/workflows/build-ui.zh.md +385 -0
  24. package/skills/webcraft-skills/references/workflows/fix-ui.md +261 -0
  25. package/skills/webcraft-skills/references/workflows/fix-ui.zh.md +261 -0
  26. package/skills/webcraft-skills/references/workflows/polish-ui.md +12 -0
  27. package/skills/webcraft-skills/references/workflows/polish-ui.zh.md +246 -0
  28. package/skills/webcraft-skills/references/workflows/review-ui.md +12 -0
  29. package/skills/webcraft-skills/references/workflows/review-ui.zh.md +207 -0
@@ -0,0 +1,48 @@
1
+ # cinematic-minimal
2
+
3
+ A restrained cinematic minimal web UI preset for personal sites, product pages, portfolios, quiet landing pages, and lightweight SaaS pages.
4
+
5
+ ## Goals
6
+
7
+ - Calm visual hierarchy.
8
+ - Stable spacing, typography, radius, borders, and states.
9
+ - Less AI-template smell and decorative noise.
10
+ - More realistic product feel.
11
+
12
+ ## Principles
13
+
14
+ - Every visual element must serve information, action, or atmosphere.
15
+ - Make the page readable, usable, and credible before styling it.
16
+ - The hero must have one primary focal point; title, product visual, and background should not all compete.
17
+ - Components need complete states, not only a static screenshot.
18
+ - Mobile is not a scaled-down desktop layout.
19
+
20
+ ## Visual Rules
21
+
22
+ - Use warm dark, graphite, and deep muted neutral backgrounds. Avoid pure black.
23
+ - Use low-saturation amber, gold, or warm yellow accents in small areas only.
24
+ - Avoid neon, cyberpunk, rainbow gradients, glowing buttons, heavy glassmorphism, and decorative light blobs.
25
+ - Background texture, noise, or edge light must stay quiet and secondary.
26
+
27
+ ## Typography And Copy
28
+
29
+ - Headings should be clear and confident, not poster-like or slogan-heavy.
30
+ - Body copy should be specific, restrained, and credible.
31
+ - Avoid empty marketing phrases such as "redefine", "next generation", "revolutionary", and "unlock limitless potential".
32
+ - Keep font size, weight, and line-height scales limited and stable.
33
+
34
+ ## Layout And Components
35
+
36
+ - Each section should communicate one core idea.
37
+ - Keep max widths restrained; avoid empty wide screens and cramped small screens.
38
+ - Use fewer cards than common templates. Do not wrap every content block in a floating panel.
39
+ - Buttons, links, forms, menus, and modals need hover, active, focus-visible, disabled, and loading states where relevant.
40
+ - Lists and data areas need loading, empty, error, and success states where relevant.
41
+ - Radius, border, shadow, and background opacity should form a coherent system.
42
+
43
+ ## Responsive
44
+
45
+ - Check 375px, 768px, and 1280px viewports.
46
+ - Avoid horizontal scroll, edge-touching text, tiny buttons, distorted images, and sticky elements that hide content.
47
+ - Mobile navigation and modals must be truly usable.
48
+
@@ -0,0 +1,53 @@
1
+ # cinematic-minimal
2
+
3
+ 电影感极简网页规则,用于生成、重构或润色个人品牌页、产品页、作品集、轻量 SaaS 官网和安静的工具型页面。
4
+
5
+ ## 适用目标
6
+
7
+ - 更克制的视觉层级
8
+ - 更稳定的 spacing、typography、圆角、边框和状态
9
+ - 更少 AI 模板感、营销感和装饰噪音
10
+ - 更像真实产品,而不是概念海报
11
+
12
+ ## 核心原则
13
+
14
+ - 每个视觉元素都必须服务信息、操作或氛围。
15
+ - 页面先保证可读、可用、可信,再追求风格。
16
+ - 首屏只能有一个主视觉焦点,标题、产品视觉、背景不要同时抢注意力。
17
+ - 组件要有完整状态,不能只做静态截图。
18
+ - 移动端不是桌面端缩小版,必须重新检查导航、按钮、标题、图片和弹窗。
19
+
20
+ ## 视觉规则
21
+
22
+ - 背景使用暖黑、石墨灰、深棕灰等低饱和暗色,避免纯黑。
23
+ - 强调色小面积使用低饱和暖黄、琥珀、金棕,避免高饱和蓝紫、霓虹和彩虹渐变。
24
+ - 背景可以有轻微空气感、柔和暗部变化、低透明噪点或边缘光,但不能成为主视觉。
25
+ - 避免大面积炫光、科技网格、玻璃拟态、发光按钮、装饰性光球。
26
+
27
+ ## 字体与文案
28
+
29
+ - 标题清楚、有力量,但不要海报化或口号化。
30
+ - 中文标题自然断句,英文标题不要把短词逐个拆行。
31
+ - 正文具体、可信、克制,避免“重新定义”“下一代”“革命性”“释放无限潜能”等空泛营销词。
32
+ - 字号、字重、行高层级要少而稳定。
33
+
34
+ ## 布局
35
+
36
+ - section 只表达一个核心信息。
37
+ - 页面最大宽度保持克制,大屏不要空散,小屏不要拥挤。
38
+ - 卡片数量少于常规模板,不要把每个内容块都包成浮层卡片。
39
+ - hero 建议包含清晰标题、简短说明、1 到 2 个 CTA,以及一个安静的产品视觉或氛围视觉。
40
+
41
+ ## 组件与状态
42
+
43
+ - 按钮、链接、表单、菜单、弹窗必须具备 hover、active、focus-visible、disabled;涉及异步时补 loading。
44
+ - 数据、列表或用户动作必须考虑 loading、empty、error、success。
45
+ - 边框、圆角、阴影、背景透明度要形成体系,避免组件拼贴感。
46
+ - hover 不应导致布局位移,避免夸张放大、弹跳、强阴影。
47
+
48
+ ## 响应式
49
+
50
+ - 检查 375px、768px、1280px 三档视口。
51
+ - 禁止横向滚动、文字贴边、按钮过小、图片变形、sticky 遮挡内容。
52
+ - 移动端导航必须真实可用,弹窗必须可关闭且内容不溢出。
53
+
@@ -0,0 +1,272 @@
1
+ # UI Audit Workflow
2
+
3
+ Use this workflow to inspect the UI quality of a page, component, screenshot, local app, or whole site. `audit-ui` defines the execution process; the `ui-audit` rubric defines the judging criteria.
4
+
5
+ The goal is to find issues, collect evidence, and recommend fix order. Do not redesign or edit code during audit unless the user explicitly asks to audit and fix.
6
+
7
+ ## Responsibility Boundary
8
+
9
+ - This workflow defines how to run the audit: choose depth, collect context, verify viewports, capture evidence, structure findings, and decide whether to hand off to fixing.
10
+ - For what counts as an issue, severity definitions, page-type differences, and dimension-specific criteria, read `references/checklists/ui-audit.md`.
11
+ - Do not mechanically dump every rubric category into the report. Report only issues with evidence, impact, and a worthwhile fix.
12
+ - Do not read both English and Chinese references unless the task is translation, bilingual comparison, localization, or consistency checking.
13
+
14
+ ## 1. Choose Audit Mode
15
+
16
+ Choose depth from the user's request:
17
+
18
+ - `Quick Audit`: for "quick look" or "any big issues". Report only Critical and obvious Major issues.
19
+ - `Standard Audit`: default. Report Critical, Major, and a small number of valuable Minor findings.
20
+ - `Deep Audit`: for "thorough audit", "strict audit", "pre-launch", or "find details". Use the full rubric, scoring model, content stress testing, and extra viewports.
21
+
22
+ Use `Standard Audit` when the user does not specify.
23
+
24
+ ## 2. Collect Context
25
+
26
+ Before judging, confirm or infer:
27
+
28
+ - Scope: single page, component, screenshot, whole site, code directory, or localhost.
29
+ - Page type: landing page, dashboard, app screen, portfolio, docs, form, checkout, admin, etc.
30
+ - Core task: read, sign up, buy, search, filter, manage, create, contact, download, book, etc.
31
+ - Audience: general users, developers, enterprise buyers, creators, internal operators, managers, etc.
32
+ - Tech constraints: component library, Tailwind, shadcn, custom CSS, design tokens, routes, breakpoints.
33
+ - Verification level: browser-tested, static code review, screenshot review, or mixed.
34
+
35
+ If information is missing, infer from structure and content, but label it as inferred.
36
+
37
+ ## 3. Identify Existing Visual System
38
+
39
+ First identify the product's current visual system:
40
+
41
+ - Color: brand, background, text, status, and accent usage.
42
+ - Typography: type scale, weight, line-height, heading/body rhythm.
43
+ - Spacing: containers, section spacing, component padding, grid gaps.
44
+ - Radius, border, shadow: shared rules across buttons, cards, inputs, dialogs, menus.
45
+ - Component style: buttons, forms, navigation, cards, tables, dialogs, toasts.
46
+ - Product tone: marketing, tool, content, admin, personal brand, etc.
47
+
48
+ Unless the user asks for a new direction, judge recommendations within the existing visual system. Do not impose a preset as the default taste standard.
49
+
50
+ ## 4. Read Audit Rubric
51
+
52
+ At runtime, read `references/checklists/ui-audit.md`. Apply:
53
+
54
+ - Audit boundaries
55
+ - Deduplication and priority
56
+ - Device matrix
57
+ - Evidence standards
58
+ - Page-type differences
59
+ - Scoring model
60
+ - Layout / Typography / Color / Border Radius Shadow / Components / Navigation / Forms / Modals / Responsive / Motion / Accessibility / Content Stress / AI Template Smell
61
+
62
+ ## 5. Choose Inspection Method
63
+
64
+ ### Code Project
65
+
66
+ - Inspect project structure, page entry points, global styles, components, and routes first.
67
+ - Judge risks from component implementation, style rules, breakpoints, and state logic.
68
+ - If the app can run, verify key viewports and interactions in the browser.
69
+
70
+ ### Localhost / Runnable Page
71
+
72
+ - Prefer browser inspection for real layout, scrolling, click, focus, dialogs, dropdowns, inputs, and responsive behavior.
73
+ - Record actual viewport and page region.
74
+ - Do not make final claims from source alone when the page is runnable.
75
+
76
+ ### Screenshot
77
+
78
+ - Audit only visible visual, layout, hierarchy, copy, and obvious states.
79
+ - Do not assert hover, focus, keyboard paths, dialog closing, dropdown styling, loading states, or other behavior not visible in the screenshot.
80
+ - Put interaction questions under `Open Questions`.
81
+
82
+ ### Single Component
83
+
84
+ - Focus on size, states, long content, variants, accessible names, and relationship to surrounding components.
85
+ - Do not audit a single component using whole-page landing-page standards.
86
+
87
+ ### Whole Site
88
+
89
+ - Sample core paths; do not enumerate every page.
90
+ - Cover at least homepage, primary conversion page, core product/function page, and state-heavy pages such as forms, auth, or settings.
91
+ - Report systemic issues and Top Findings instead of piling up page-by-page minor problems.
92
+
93
+ ## 6. Inspect Project Structure
94
+
95
+ For code audits, locate:
96
+
97
+ - Page entries: `app/`, `pages/`, `src/routes/`, `src/pages/`, `index.html`, etc.
98
+ - Global styles: `globals.css`, `app.css`, `tailwind.config.*`, design tokens.
99
+ - Components: button, card, input, modal, nav, table, list, toast.
100
+ - Routes and page types: home, pricing, dashboard, settings, docs, auth, checkout.
101
+ - UI system: shadcn, Radix, MUI, custom components, Tailwind utilities.
102
+
103
+ Do not give broad visual advice before understanding the project structure.
104
+
105
+ ## 7. Run Viewport Checks
106
+
107
+ If the project can run, prefer browser verification. Check at least:
108
+
109
+ - 375px mobile
110
+ - 768px tablet
111
+ - 1280px desktop
112
+
113
+ For Deep Audit, add:
114
+
115
+ - 360px
116
+ - 390px or 430px
117
+ - 834px
118
+ - 1440px
119
+ - 1920px
120
+
121
+ If the page cannot run, infer from CSS, layout code, breakpoints, and component structure. State which viewports and interactions were not verified.
122
+
123
+ ## 8. Capture Evidence
124
+
125
+ Capture evidence according to inspection method:
126
+
127
+ - Browser evidence: viewport width, page region, interaction state, scroll position, visible symptom.
128
+ - Code evidence: file path, component name, CSS class, breakpoint, state branch, style token.
129
+ - Screenshot evidence: visible region, element relationship, clipping, overlap, hierarchy.
130
+ - Inferred evidence: risks based on code or screenshot must be labeled as untested or needs verification.
131
+
132
+ Evidence should support judgment; do not list irrelevant implementation details.
133
+
134
+ ## 9. Audit Order
135
+
136
+ Check in this order:
137
+
138
+ 1. Critical usability: overflow, overlap, unclickable controls, unreadable content, broken nav/dialog/form.
139
+ 2. Responsive: mobile, tablet, large desktop, fixed/sticky elements, images, tables.
140
+ 3. Information hierarchy: first-screen priority, page type, core task clarity.
141
+ 4. Components and states: hover, active, focus-visible, disabled, loading, empty, error, success.
142
+ 5. Visual system: spacing, typography, color, radius, border, shadow.
143
+ 6. Content stress: long text, mixed languages, varied counts, varied image ratios.
144
+ 7. AI template smell: vague slogans, excessive badges, bento grids, gradient glows, fake data.
145
+ 8. Minor polish: alignment, rhythm, motion, copy details.
146
+
147
+ ## 10. Control Finding Count
148
+
149
+ - `Quick Audit`: up to 5 findings, only Critical and obvious Major.
150
+ - `Standard Audit`: usually 8 to 12 findings, prioritized as Top Findings.
151
+ - `Deep Audit`: may include more, but start with Top Findings before category detail.
152
+ - If Critical/Major findings already explain the main risk, do not keep digging for low-value Minor items.
153
+ - Do not pad the report to look complete.
154
+
155
+ ## 11. Report Format
156
+
157
+ Use this structure:
158
+
159
+ ```markdown
160
+ ## Context
161
+
162
+ - Scope:
163
+ - Audit mode:
164
+ - Page type:
165
+ - Core task:
166
+ - Viewports checked:
167
+ - Verification level:
168
+ - Constraints:
169
+
170
+ ## Top Findings
171
+
172
+ - The 3 to 5 highest-risk issues, sorted by impact.
173
+
174
+ ## Critical
175
+
176
+ ### 1. Finding title
177
+ Location:
178
+ Evidence:
179
+ Impact:
180
+ Fix:
181
+
182
+ ## Major
183
+
184
+ ...
185
+
186
+ ## Minor
187
+
188
+ ...
189
+
190
+ ## Open Questions
191
+
192
+ - Questions that need user confirmation or runtime verification.
193
+
194
+ ## Pass Notes
195
+
196
+ - 1 to 3 high-value notes about areas with no obvious issue.
197
+
198
+ ## Fix Order
199
+
200
+ 1.
201
+ 2.
202
+ 3.
203
+
204
+ ## Score
205
+
206
+ - Usability:
207
+ - Clarity:
208
+ - Consistency:
209
+ - Responsiveness:
210
+ - Interaction States:
211
+ - Visual Maturity:
212
+ - AI Template Smell:
213
+ - Overall:
214
+ ```
215
+
216
+ Rules:
217
+
218
+ - `Quick Audit` may omit Score and Minor.
219
+ - `Standard Audit` may omit Score unless requested.
220
+ - `Deep Audit` should usually include Score.
221
+ - Every finding needs concrete evidence.
222
+ - Critical and Major findings must be locatable and fixable.
223
+ - Omit categories with no findings.
224
+ - `Open Questions` is only for questions, not advice.
225
+ - `Pass Notes` should be short and high-value.
226
+
227
+ ## 12. Deduplicate And Group
228
+
229
+ - Report one root cause once.
230
+ - Keep blocking usability issues as separate Critical findings.
231
+ - Group systemic visual issues, such as mixed radius/border/shadow systems, into one Major finding.
232
+ - Do not force coverage of every rubric category.
233
+ - If a question needs product judgment, put it under `Open Questions`.
234
+
235
+ ## 13. Handoff To Fix
236
+
237
+ If the user asks to continue fixing, enter the `fix-ui` workflow.
238
+
239
+ Before fixing, confirm or infer:
240
+
241
+ - Whether the user asked for direct code changes.
242
+ - Whether only Critical/Major issues should be fixed.
243
+ - Whether visual tokens may be adjusted.
244
+ - Whether existing visual style and content must be preserved.
245
+
246
+ Fix order:
247
+
248
+ 1. Critical: unusable, unreadable, unclickable, unclosable issues.
249
+ 2. Major: responsive behavior, hierarchy, component states, visual tokens.
250
+ 3. Content Stress: long copy, real data, varied counts and media ratios.
251
+ 4. AI Template Smell: remove template noise and add real information structure.
252
+ 5. Minor: alignment, motion, copy, visual polish.
253
+
254
+ Do not make broad code changes during audit unless the user explicitly asks to audit and fix.
255
+
256
+ ## 14. Stop Conditions
257
+
258
+ - If you find a blocking Critical issue, stop digging for Minor polish and report risk plus fix order.
259
+ - In Standard Audit, stop when Top Findings cover the meaningful risks.
260
+ - In Deep Audit, prioritize systemic issues over scattered details.
261
+ - If evidence is insufficient, stop inferring and mark it as `Open Questions` or needs verification.
262
+
263
+ ## 15. Prohibited
264
+
265
+ - Do not fabricate browser verification.
266
+ - Do not report issues without location, evidence, and fix direction.
267
+ - Do not package personal taste as a defect.
268
+ - Do not recommend unrelated technical refactors.
269
+ - Do not turn every page into the same style.
270
+ - Do not force a preset when the user did not choose one.
271
+ - Do not remove necessary business information for the sake of visual consistency.
272
+ - Do not state unverified issues as fact.
@@ -0,0 +1,299 @@
1
+ # UI Audit Workflow
2
+
3
+ 用于严格、系统地排查网页、页面、组件、截图或整站 UI 质量。`audit-ui` 负责执行流程,`ui-audit` rubric 负责判断标准。
4
+
5
+ 审查的目标是发现问题、给出证据和修复顺序,不是直接重写设计。只有当用户明确要求修复时,才进入修复流程。
6
+
7
+ ## 职责边界
8
+
9
+ - 本 workflow 只定义如何执行 audit:选择模式、收集上下文、验证视口、采集证据、组织报告、决定是否转入修复。
10
+ - 具体什么算问题、如何分级、各页面类型和 UI 维度的判断标准,读取 `references/checklists/ui-audit.zh.md`。
11
+ - 不要把 rubric 逐条复制进报告;只输出有证据、有影响、有修复价值的问题。
12
+ - 不要同时读取英文和中文 reference,除非任务是翻译、双语对齐或一致性检查。
13
+
14
+ ## 1. 选择审查模式
15
+
16
+ 根据用户请求选择审查深度:
17
+
18
+ - `Quick Audit`:用户说“快速看看”“有没有大问题”。只报告 Critical 和明显 Major。
19
+ - `Standard Audit`:默认模式。报告 Critical、Major 和少量有价值 Minor。
20
+ - `Deep Audit`:用户说“全面排查”“严格 audit”“准备上线”“找细节问题”。使用完整 Rubric、评分模型、Content Stress Test 和更多视口。
21
+
22
+ 如果用户没有指定,使用 `Standard Audit`。
23
+
24
+ ## 2. 收集上下文
25
+
26
+ 正式审查前,先确认或推断:
27
+
28
+ - Scope:单页、组件、截图、整站、代码目录或 localhost。
29
+ - Page type:landing page、dashboard、app screen、portfolio、docs、form、checkout、admin 等。
30
+ - Core task:阅读、注册、购买、搜索、筛选、管理、创作、联系、下载、预约等。
31
+ - Audience:普通用户、开发者、企业客户、创作者、内部运营、管理者等。
32
+ - Tech constraints:已有组件库、Tailwind、shadcn、自定义 CSS、设计 token、路由和断点。
33
+ - Verification level:已运行浏览器、代码静态审查、截图审查,或混合审查。
34
+
35
+ 缺少信息时可以根据项目结构和页面内容推断,但要标明“推断”。
36
+
37
+ 如果用户使用中文提问,报告默认使用中文;必要的字段名和模式名可以保留英文,方便和命令、文档、自动化输出保持一致。
38
+
39
+ ## 3. 识别现有视觉体系
40
+
41
+ 审查必须先识别当前网站或产品已有的视觉体系,包括:
42
+
43
+ - 颜色:品牌色、背景色、文字色、状态色、强调色使用方式。
44
+ - 字体:字号层级、字重、行高、标题和正文节奏。
45
+ - spacing:页面容器、section 间距、组件内边距、grid gap。
46
+ - 圆角、边框、阴影:按钮、卡片、输入框、弹窗和菜单的共同规律。
47
+ - 组件风格:按钮、表单、导航、卡片、表格、弹窗、toast 的既有样式。
48
+ - 页面语气:营销型、工具型、内容型、后台型、个人品牌型等。
49
+
50
+ 除非用户明确要求重设风格,否则所有审查建议都必须在现有视觉体系内判断。不要把某个 preset 当作默认审美标准。Preset 只有在用户明确指定,或当前项目没有明确视觉方向时,才作为参考。
51
+
52
+ ## 4. 读取审查标准
53
+
54
+ 运行时读取 `references/checklists/ui-audit.zh.md`。重点应用其中:
55
+
56
+ - 审查边界
57
+ - 去重与优先级
58
+ - 设备检查矩阵
59
+ - 证据标准
60
+ - 页面类型差异
61
+ - 评分模型
62
+ - Layout / Typography / Color / Border Radius Shadow / Components / Navigation / Forms / Modals / Responsive / Motion / Accessibility / Content Stress / AI Template Smell
63
+
64
+ 不要逐条机械输出所有分类。只报告有证据、有影响、有修复价值的问题。
65
+
66
+ ## 5. 根据输入类型选择审查方式
67
+
68
+ ### 代码项目
69
+
70
+ - 先读项目结构、页面入口、全局样式、组件和路由。
71
+ - 基于组件实现、样式规则、断点和状态逻辑判断风险。
72
+ - 如果能运行,再用浏览器验证关键视口和交互。
73
+
74
+ ### localhost / 可运行页面
75
+
76
+ - 优先用浏览器检查真实布局、滚动、点击、focus、弹窗和响应式。
77
+ - 记录实际视口和页面区域。
78
+ - 不要只看源码就下最终结论。
79
+
80
+ ### 截图
81
+
82
+ - 只能审查可见的视觉、布局、层级、文案和明显状态。
83
+ - 不要断言 hover、focus、键盘路径、弹窗关闭、loading 等无法从截图验证的行为。
84
+ - 需要交互判断时,列入 `Open Questions`。
85
+
86
+ ### 单组件
87
+
88
+ - 重点检查尺寸、状态、长内容、组合变体、可访问名称和与周边组件的关系。
89
+ - 不要按整页 landing page 标准审查一个组件。
90
+
91
+ ### 整站
92
+
93
+ - 先抽样核心路径,不要逐页穷举。
94
+ - 至少覆盖首页、核心转化页、核心功能页、表单/登录/设置等状态密集页面。
95
+ - 输出系统性问题和 Top Findings,而不是把每一页的小问题堆在一起。
96
+
97
+ ## 6. 检查项目结构
98
+
99
+ 如果审查的是代码项目,先找到:
100
+
101
+ - 页面入口:`app/`、`pages/`、`src/routes/`、`src/pages/`、`index.html` 等。
102
+ - 全局样式:`globals.css`、`app.css`、`tailwind.config.*`、design tokens。
103
+ - 组件:button、card、input、select、combobox、dropdown、checkbox、radio、modal、nav、table、list、toast。
104
+ - 路由和页面类型:home、pricing、dashboard、settings、docs、auth、checkout。
105
+ - 已有 UI 系统:shadcn、Radix、MUI、自定义组件、Tailwind utility 体系。
106
+
107
+ 不要在不了解项目结构时直接给大范围设计建议。
108
+
109
+ ### 自定义控件一致性检查
110
+
111
+ 代码审查时必须主动检查项目是否已有自定义基础控件,并反查页面是否仍混用原生控件:
112
+
113
+ - 先找已有组件:`Select`、`Combobox`、`Dropdown`、`MultiSelect`、`Checkbox`、`RadioGroup`、`Input`、`Textarea`、`Button` 等。
114
+ - 再找原生用法:`<select>`、`<option>`、`<input type="checkbox">`、`<input type="radio">`、未封装的 `<input>` / `<textarea>`,以及只靠浏览器默认样式的控件。
115
+ - 如果项目已有对应自定义控件,但某个页面仍使用突兀原生控件,必须作为 `Components And States` 或 `Forms` finding 评估,不要只放进 `Content Stress` 或 `Pass Notes`。
116
+ - 如果项目没有对应自定义控件,但原生控件明显不符合当前网站风格,也要报告;修复方向是建立或封装与现有视觉体系一致的基础控件,而不是只调整单个页面。
117
+ - 如果原生控件只是视觉略不协调且不影响操作,通常是 `Minor`;如果出现在筛选、批量操作、编辑表单等核心后台流程,并明显破坏视觉系统或操作信心,通常是 `Major`。
118
+
119
+ ## 7. 运行与视口检查
120
+
121
+ 如果项目可运行,优先用浏览器验证真实布局和交互,并可用截图记录证据。默认至少检查:
122
+
123
+ - 375px mobile
124
+ - 768px tablet
125
+ - 1280px desktop
126
+
127
+ Deep Audit 增加:
128
+
129
+ - 360px
130
+ - 390px 或 430px
131
+ - 834px
132
+ - 1440px
133
+ - 1920px
134
+
135
+ 如果无法运行页面:
136
+
137
+ - 基于 CSS、布局代码、断点和组件结构做静态推断。
138
+ - 明确写出未验证的视口和交互。
139
+ - 不要虚构“已看到”的浏览器结果。
140
+
141
+ ## 8. 证据采集
142
+
143
+ 根据审查方式记录证据:
144
+
145
+ - 浏览器证据:视口宽度、页面区域、交互状态、滚动位置、可见现象。
146
+ - 代码证据:文件路径、组件名、CSS 类、断点、状态分支、样式 token。
147
+ - 截图证据:截图区域、可见元素、层级关系、裁切或遮挡现象。
148
+ - 推断证据:基于代码或截图推断的风险,必须标明“未实测”或“需要验证”。
149
+
150
+ 证据要服务判断,不要为了显得详细而罗列无关实现。
151
+
152
+ ## 9. 审查顺序
153
+
154
+ 按这个顺序检查,避免一开始陷入审美细节:
155
+
156
+ 1. Critical usability:overflow、遮挡、不可点击、不可读、导航/弹窗/表单不可用。
157
+ 2. Responsive:移动端、平板、大屏、fixed/sticky、图片和表格溢出。
158
+ 3. Information hierarchy:首屏主次、页面类型是否清楚、核心任务是否明确。
159
+ 4. Components and states:hover、active、focus-visible、disabled、loading、empty、error、success。
160
+ 5. Form/control consistency:输入、选择、下拉、多选、菜单、批量操作是否沿用项目已有组件体系。
161
+ 6. Visual system:spacing、typography、color、radius、border、shadow。
162
+ 7. Content stress:长文案、中英文混排、不同数据数量、不同图片比例。
163
+ 8. AI template smell:空泛口号、过度 badge、bento grid、渐变光斑、虚假数据。
164
+ 9. Minor polish:对齐、节奏、动效、文案细节。
165
+
166
+ ## 10. Findings 数量控制
167
+
168
+ - `Quick Audit`:最多 5 条,只报告 Critical 和明显 Major。
169
+ - `Standard Audit`:建议 8 到 12 条,优先 Top Findings。
170
+ - `Deep Audit`:可以更多,但先输出 Top Findings,再按分类展开。
171
+ - 如果 Critical/Major 已经足够说明主要风险,不继续挖低价值 Minor。
172
+ - 不要为了让报告看起来完整而凑数量。
173
+
174
+ ## 11. 输出报告
175
+
176
+ 使用这个结构:
177
+
178
+ ```markdown
179
+ ## Context
180
+
181
+ - Scope:
182
+ - Audit mode:
183
+ - Page type:
184
+ - Core task:
185
+ - Viewports checked:
186
+ - Verification level:
187
+ - Constraints:
188
+
189
+ ## Top Findings
190
+
191
+ - 最重要的 3 到 5 个问题,按风险排序。
192
+
193
+ ## Critical
194
+
195
+ ### 1. 问题标题
196
+ Location:
197
+ Evidence:
198
+ Impact:
199
+ Fix:
200
+
201
+ ## Major
202
+
203
+ ...
204
+
205
+ ## Minor
206
+
207
+ ...
208
+
209
+ ## Open Questions
210
+
211
+ - 需要用户确认或需要运行页面才能判断的问题。
212
+
213
+ ## Pass Notes
214
+
215
+ - 简短说明没有发现明显问题的关键方面。
216
+
217
+ ## Fix Order
218
+
219
+ 1.
220
+ 2.
221
+ 3.
222
+
223
+ ## Score
224
+
225
+ - Usability:
226
+ - Clarity:
227
+ - Consistency:
228
+ - Responsiveness:
229
+ - Interaction States:
230
+ - Visual Maturity:
231
+ - AI Template Smell:
232
+ - Overall:
233
+ ```
234
+
235
+ 规则:
236
+
237
+ - `Quick Audit` 可以省略 Score 和 Minor。
238
+ - `Standard Audit` 可省略 Score,除非用户要求。
239
+ - `Deep Audit` 建议保留 Score。
240
+ - `Top Findings` 用于让用户先看到最重要风险;如果问题很少,可以省略。
241
+ - 每个 finding 必须有具体证据。
242
+ - Critical 和 Major 必须可定位、可修复。
243
+ - 没有发现的问题分类不要输出。
244
+ - `Open Questions` 只放需要确认的问题,不放建议。
245
+ - `Pass Notes` 不要逐项列通过,只保留 1 到 3 条高价值说明。
246
+
247
+ ## 12. 去重与分组
248
+
249
+ - 同一根因只报告一次。
250
+ - 阻断使用的问题单独列为 Critical,不要合并进系统性问题。
251
+ - 系统性视觉问题可以合并,例如 radius、border、shadow 混乱可以作为一个 Major。
252
+ - 不要为了覆盖所有分类而凑问题。
253
+ - 如果问题需要产品决策,放到 `Open Questions`,不要假装是确定缺陷。
254
+
255
+ ## 13. 修复衔接
256
+
257
+ 如果用户要求继续修复,进入 `fix-ui` workflow。
258
+
259
+ 修复前先确认:
260
+
261
+ - 用户是否要求直接改代码。
262
+ - 是否只修 Critical/Major。
263
+ - 是否允许调整视觉 token。
264
+ - 是否需要保持现有视觉风格和内容不变。
265
+
266
+ 修复顺序:
267
+
268
+ 1. Critical:先修不可用、不可读、不可点击、不可关闭。
269
+ 2. Major:再修响应式、信息层级、组件状态、视觉 token。
270
+ 3. Content Stress:再修长文案、真实数据和变体内容。
271
+ 4. AI Template Smell:删除模板噪音,补真实信息结构。
272
+ 5. Minor:最后做对齐、动效、文案和视觉 polish。
273
+
274
+ 不要在 audit 阶段直接大改代码,除非用户明确要求“审查并修复”。
275
+
276
+ 修复后必须复检对应问题:
277
+
278
+ - 修 overflow 的,复检对应视口。
279
+ - 修状态的,复检 hover、focus-visible、disabled、loading、error。
280
+ - 修弹窗的,复检关闭、滚动和 focus。
281
+ - 修视觉 token 的,复检同类组件是否一致。
282
+
283
+ ## 14. 停止条件
284
+
285
+ - 已经找到会阻断使用的 Critical 时,先停止深挖 Minor,优先输出风险和修复顺序。
286
+ - Standard Audit 中,如果 Top Findings 已覆盖主要风险,不继续列低价值 polish。
287
+ - Deep Audit 中,可以继续展开,但要把系统性问题优先于零散细节。
288
+ - 如果证据不足,不继续推断;把问题放入 `Open Questions` 或标注需要验证。
289
+
290
+ ## 15. 禁止事项
291
+
292
+ - 不要虚构浏览器验证结果。
293
+ - 不要输出没有位置、没有证据、没有修复建议的问题。
294
+ - 不要把纯审美偏好包装成缺陷。
295
+ - 不要建议无关技术重构。
296
+ - 不要把所有页面都改成同一种风格。
297
+ - 不要在用户未指定 preset 时强行套用 preset 风格。
298
+ - 不要因为统一视觉而删除必要业务信息。
299
+ - 不要把没有验证的问题写成确定事实。
@@ -0,0 +1,12 @@
1
+ # UI Build Workflow
2
+
3
+ Use this workflow to create a new page or site.
4
+
5
+ 1. Identify the page type, subject, audience, core content, tech stack, and constraints.
6
+ 2. If the user does not specify a style, choose the closest preset based on product context; do not force cinematic-minimal.
7
+ 3. Plan the information structure before visual styling.
8
+ 4. Generate a complete runnable page or implementation, including responsive behavior and relevant hover, active, focus-visible, disabled, loading, empty, error, and success states.
9
+ 5. Run the UI Audit Checklist against the result and fix obvious issues.
10
+
11
+ Output the implementation result, key design decisions, and verification performed. Do not stop at abstract design advice.
12
+