@bovinphang/frontend-craft 2.6.0 → 2.7.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 (110) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +38 -1
  4. package/CHANGELOG.zh-CN.md +37 -1
  5. package/README.md +10 -6
  6. package/README.openclaw.md +3 -1
  7. package/README.openclaw.zh-CN.md +3 -1
  8. package/README.zh-CN.md +10 -6
  9. package/agents/fec-typescript-reviewer.md +1 -1
  10. package/docs/example-prompts.md +81 -69
  11. package/docs/ja-JP/README.md +56 -52
  12. package/docs/ko-KR/README.md +45 -41
  13. package/docs/project-structure.md +8 -4
  14. package/docs/superpowers/plans/2026-05-29-fec-debug.md +491 -0
  15. package/docs/superpowers/specs/2026-05-29-fec-debug-design.md +340 -0
  16. package/docs/zh-CN/example-prompts.md +81 -69
  17. package/docs/zh-CN/project-structure.md +8 -4
  18. package/docs/zh-TW/README.md +33 -29
  19. package/openclaw.plugin.json +1 -1
  20. package/package.json +3 -3
  21. package/skills/eval_queries.json +154 -56
  22. package/skills/fec-backend-requirements-handoff/SKILL.md +45 -0
  23. package/skills/fec-code-review/SKILL.md +1 -1
  24. package/skills/fec-drawio-studio/SKILL.md +69 -0
  25. package/skills/fec-drawio-studio/data/THIRD_PARTY_NOTICES.md +10 -0
  26. package/skills/fec-drawio-studio/data/brand-icons.json +878 -0
  27. package/skills/fec-drawio-studio/data/shape-index.json.gz +0 -0
  28. package/skills/fec-drawio-studio/references/data-residency.md +27 -0
  29. package/skills/fec-drawio-studio/references/diagram-patterns.md +41 -0
  30. package/skills/fec-drawio-studio/references/layout-and-export.md +57 -0
  31. package/skills/fec-drawio-studio/references/troubleshooting.md +29 -0
  32. package/skills/fec-drawio-studio/references/xml-and-mermaid.md +54 -0
  33. package/skills/fec-drawio-studio/scripts/brand-symbols.mjs +99 -0
  34. package/skills/fec-drawio-studio/scripts/diagram-lint.mjs +143 -0
  35. package/skills/fec-drawio-studio/scripts/diagram-url.mjs +102 -0
  36. package/skills/fec-drawio-studio/scripts/layout-graph.mjs +107 -0
  37. package/skills/fec-drawio-studio/scripts/png-embed-fix.mjs +26 -0
  38. package/skills/fec-drawio-studio/scripts/scan-go-packages.mjs +36 -0
  39. package/skills/fec-drawio-studio/scripts/scan-js-modules.mjs +52 -0
  40. package/skills/fec-drawio-studio/scripts/scan-python-classes.mjs +30 -0
  41. package/skills/fec-drawio-studio/scripts/scan-python-modules.mjs +55 -0
  42. package/skills/fec-drawio-studio/scripts/scan-rust-modules.mjs +35 -0
  43. package/skills/fec-drawio-studio/scripts/scan-ts-modules.mjs +7 -0
  44. package/skills/fec-drawio-studio/scripts/shape-query.mjs +81 -0
  45. package/skills/fec-drawio-studio/scripts/studio-core.mjs +139 -0
  46. package/skills/fec-drawio-studio/styles/built-in/corporate.json +49 -0
  47. package/skills/fec-drawio-studio/styles/built-in/default.json +49 -0
  48. package/skills/fec-drawio-studio/styles/built-in/handdrawn.json +49 -0
  49. package/skills/fec-drawio-studio/styles/schema.json +112 -0
  50. package/skills/fec-e2e-testing/SKILL.md +3 -1
  51. package/skills/fec-e2e-testing/references/e2e-ci-reporting.md +62 -0
  52. package/skills/fec-e2e-testing/references/e2e-special-scenarios.md +52 -0
  53. package/skills/fec-e2e-testing/references/e2e-visual-regression.md +60 -0
  54. package/skills/fec-image-generation/SKILL.md +56 -0
  55. package/skills/fec-image-generation/references/artifact-routing.md +80 -0
  56. package/skills/fec-image-generation/references/diagram-workflows.md +43 -0
  57. package/skills/fec-image-generation/references/png-qa-autofix.md +30 -0
  58. package/skills/fec-image-generation/scripts/png-qa.mjs +431 -0
  59. package/skills/fec-implement-from-design/SKILL.md +7 -0
  60. package/skills/fec-legacy-to-modern-migration/SKILL.md +24 -168
  61. package/skills/fec-legacy-to-modern-migration/references/migration-execution-checklist.md +110 -0
  62. package/skills/fec-legacy-to-modern-migration/references/migration-strategy-and-mapping.md +48 -0
  63. package/skills/fec-motion-interaction/SKILL.md +7 -0
  64. package/skills/fec-nextjs-project-standard/SKILL.md +7 -1
  65. package/skills/fec-performance-optimization/SKILL.md +5 -1
  66. package/skills/fec-performance-optimization/references/framework-performance-patterns.md +38 -0
  67. package/skills/fec-performance-optimization/references/report-template.md +6 -0
  68. package/skills/fec-react-project-standard/SKILL.md +11 -3
  69. package/skills/fec-react-project-standard/references/react-performance-patterns.md +35 -0
  70. package/skills/fec-react-project-standard/references/react-project-structure.md +197 -0
  71. package/skills/fec-react-project-standard/references/react-quality-patterns.md +131 -0
  72. package/skills/fec-react-project-standard/references/react-runtime-patterns.md +293 -0
  73. package/skills/fec-responsive-layout/references/responsive-layout-patterns.md +11 -0
  74. package/skills/fec-source-driven-development/SKILL.md +26 -0
  75. package/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +5 -1
  76. package/skills/fec-typescript-project-standard/SKILL.md +54 -0
  77. package/skills/{fec-typescript-type-safety → fec-typescript-project-standard}/references/type-safety-patterns.md +1 -1
  78. package/skills/{fec-typescript-type-safety/SKILL.md → fec-typescript-project-standard/references/type-safety.md} +1 -10
  79. package/skills/fec-ui-design/SKILL.md +26 -8
  80. package/skills/fec-ui-design/data/style-archetypes.json +40 -0
  81. package/skills/fec-ui-design/data/ux-quality-rules.json +35 -0
  82. package/skills/fec-ui-design/references/design-intelligence.md +66 -6
  83. package/skills/fec-ui-design/references/pre-delivery-checklist.md +6 -0
  84. package/skills/fec-ui-design/scripts/design-system.mjs +119 -1
  85. package/skills/fec-vue3-project-standard/SKILL.md +11 -2
  86. package/skills/fec-vue3-project-standard/references/vue3-composables-routing.md +163 -0
  87. package/skills/fec-vue3-project-standard/references/vue3-performance-patterns.md +13 -0
  88. package/skills/fec-vue3-project-standard/references/vue3-project-structure.md +177 -0
  89. package/skills/fec-vue3-project-standard/references/vue3-state-api-quality.md +216 -0
  90. package/skills/fec-web-video-presentation/SKILL.md +61 -0
  91. package/skills/fec-web-video-presentation/data/starter-themes.json +59 -0
  92. package/skills/fec-web-video-presentation/references/chapter-craft.md +37 -0
  93. package/skills/fec-web-video-presentation/references/content-plan.md +38 -0
  94. package/skills/fec-web-video-presentation/references/recording-and-audio.md +33 -0
  95. package/skills/fec-web-video-presentation/references/theme-system.md +36 -0
  96. package/skills/fec-web-video-presentation/scripts/create-video-presentation.mjs +430 -0
  97. package/skills/metadata.json +340 -164
  98. package/skills/relations.json +116 -25
  99. package/templates/shared/rules/fec-ci-cd.md +20 -108
  100. package/templates/shared/rules/fec-design-system.md +47 -223
  101. package/templates/shared/rules/fec-error-handling.md +35 -179
  102. package/templates/shared/rules/fec-i18n.md +43 -91
  103. package/templates/shared/rules/fec-refactoring.md +4 -0
  104. package/templates/shared/rules/fec-rendering-patterns.md +28 -171
  105. package/templates/shared/rules/fec-responsive-design.md +34 -211
  106. package/templates/shared/rules/fec-state-management.md +41 -144
  107. package/templates/shared/rules/fec-typescript.md +47 -290
  108. package/skills/fec-e2e-testing/references/e2e-advanced.md +0 -176
  109. package/skills/fec-react-project-standard/references/react-project-details.md +0 -642
  110. package/skills/fec-vue3-project-standard/references/vue3-project-details.md +0 -547
@@ -20,33 +20,44 @@ description: Use when building, reviewing, or improving frontend UI that needs p
20
20
  - 判断这是日常高频工具、营销展示、内容阅读、可视化探索、游戏,还是配置/管理后台。
21
21
  - 如果已有 Figma、Sketch、MasterGo、Pixso、墨刀、摹客或截图是事实来源,优先还原设计上下文,不自行发明方向。
22
22
 
23
- 2. 定义审美主张
23
+ 2. 读取设计语境
24
+ - 在决定布局、色彩、字体或动效前,先写出一行设计读取:页面类型、目标受众、主要任务、品牌约束和可信赖感来源。
25
+ - 判断当前界面是视觉型网站、作品/品牌展示、产品营销、工具工作区、数据密集界面、移动原生流程,还是设计稿还原任务。
26
+ - 如果 brief 有明显分歧,例如“极简但强烈实验性”,只问一个会改变方向的问题;否则基于上下文做出明确选择。
27
+ - 受监管、公共服务、医疗、金融、儿童或强可访问性场景优先稳定、清晰和可恢复,不为审美冒险牺牲可用性。
28
+
29
+ 3. 定义审美主张
24
30
  - 写出目标用户、使用场景、可信赖感来源和一个可被记住的视觉锚点。
25
31
  - 视觉锚点可以来自信息结构、真实媒体、数据形态、行业材质、字体性格、交互节奏或空间组织,而不是空泛装饰。
26
32
  - 表现力必须服务业务语境:工具型界面重效率和稳定,展示型页面重主体识别和记忆点。
27
- - 为页面类型设定设计拨盘:信息密度、视觉张力、动效强度、内容说服力和媒体真实性;这些拨盘必须随任务变化,而不是沿用同一套模板。
33
+ - 为页面类型设定设计拨盘:视觉张力、动效强度、信息密度、媒体真实性和内容说服力;这些拨盘必须随任务变化,而不是沿用同一套模板。
34
+ - 工具型和数据型界面默认提高信息密度、降低装饰动效;营销、作品集和品牌页可以提高视觉张力,但仍要保证首屏任务、主体和 CTA 可见。
35
+ - 设计拨盘用于约束实现选择:高视觉张力不等于混乱排版,高动效强度不等于滚动劫持,高媒体真实性不等于堆 stock 氛围图。
28
36
 
29
- 3. 生成或读取设计系统
37
+ 4. 生成或读取设计系统
30
38
  - 若项目还没有设计系统,可运行 `node skills/fec-ui-design/scripts/design-system.mjs "<product audience tone>" --project "<name>"` 生成建议。
31
39
  - 若需要跨会话复用,使用 `--persist` 生成 `design-system/<project>/MASTER.md`;页面差异用 `--page <page>` 写入 `pages/<page>.md`。
32
40
  - 构建具体页面时先读页面 override,再读 Master;页面规则只覆盖差异,不复制全量设计系统。
33
41
 
34
- 4. 建立首屏与视觉层级
42
+ 5. 建立首屏与视觉层级
35
43
  - 工具型界面:首屏直接呈现核心工作区、列表、表格、画布或编辑器。
36
44
  - 落地页:H1 使用品牌、产品、地点、人名或明确品类,价值说明放在辅助文案。
37
45
  - 产品/对象页:首屏必须可见真实产品、对象、状态或可检查媒体。
38
46
  - 首屏应留下一个明确记忆点,但不能遮挡核心任务、导航和状态反馈。
39
47
  - 营销和产品页需要先写清受众、痛点、承诺、证据和行动入口;文案结构服务转化,但不使用夸张、空泛或不可验证的声明。
48
+ - 视觉型页面的首屏不能只是文字、渐变和装饰物;需要真实产品、人物、空间、品牌应用、数据状态或可检查的生成资产承担主体信息。
49
+ - 导航在桌面端应保持单行且高度克制;CTA 文案保持短而清楚,桌面端不应换成多行按钮。
40
50
 
41
- 5. 组织视觉语言
51
+ 6. 组织视觉语言
42
52
  - 字体:优先沿用项目字体体系;若任务允许建立新方向,选择能表达产品性格的标题/正文字体组合,并保证可读性。
43
53
  - 色彩:明确主色、功能色、中性色和强调色的角色,避免所有元素平均用力。
44
54
  - 空间:根据任务选择高密度、留白、非对称、分栏、画布式或编辑器式布局,不套用固定卡片模板。
45
55
  - 动效:只为页面入场、层级展开、状态确认、错误反馈和重点引导建立节奏,并尊重 `prefers-reduced-motion`。
46
56
  - 媒体:优先使用真实产品、真实状态、真实图表、可检查截图或本地生成资产;不要用模糊氛围图、占位 URL 或无关插画替代主体信息。
47
57
  - 图表:先判断数据任务是趋势、比较、构成、分布还是流程,再选择图表,不把所有数据都做成卡片或饼图。
58
+ - 视觉参考:没有权威设计稿且页面视觉质量是核心目标时,可先生成或收集分区级参考图,再从图中提取布局、层级、色彩和媒体策略;不要把整站压成一个不可读长图。
48
59
 
49
- 6. 对齐设计系统、组件与 token
60
+ 7. 对齐设计系统、组件与 token
50
61
  - 先复用项目已有组件、token、图标库、路由和布局约定。
51
62
  - 缺少 token 时集中补齐或明确记录,不要在多个组件里散落硬编码。
52
63
  - 复杂 UI 在实现前写出复用组件、新建组件、响应式策略和状态覆盖。
@@ -54,15 +65,18 @@ description: Use when building, reviewing, or improving frontend UI that needs p
54
65
  - Tailwind 专项 token、variant、dark mode 和 class 治理分流到 Tailwind 设计系统工作流;跨设备布局、容器查询和触摸目标分流到响应式布局工作流。
55
66
  - 组件 API 应区分基础组件、业务组件和页面私有组件;避免让单个 `variant` 同时承担语义、尺寸、密度和权限含义。
56
67
 
57
- 7. 打磨几何、文本和状态
68
+ 8. 打磨几何、文本和状态
58
69
  - 嵌套圆角遵循“外层圆角约等于内层圆角 + 间距”的光学关系。
59
70
  - 非对称图标、播放三角、箭头、星标等需要按视觉中心微调。
60
71
  - 标题和短文本可使用 `text-wrap: balance` 或 `text-wrap: pretty`。
61
72
  - 表格、价格、计数器、计时器使用 `font-variant-numeric: tabular-nums`。
62
73
  - 小控件点击区域至少 40x40px,空间允许时优先 44x44px。
63
74
  - focus ring 用于键盘定位,hover/active 用于鼠标反馈,disabled 不只靠透明度表达。
75
+ - 不在连续多个区块重复同一种三卡片、左右交错或大标题加右侧说明段落;每个区块的布局服务该区块的具体信息任务。
76
+ - Bento 和 feature grid 的格子数量必须由真实内容决定,不用空格子补构图;多格网格至少有明确主次、媒体或状态差异。
77
+ - 小型 uppercase eyebrow 要克制使用,不能成为每个区块的节奏拐杖。
64
78
 
65
- 8. 验证设计结果
79
+ 9. 验证设计结果
66
80
  - 检查 loading、empty、error、disabled、hover、focus、selected 状态。
67
81
  - 在 mobile(375px)、tablet(768px)、desktop(1440px) 检查文案是否溢出或遮挡。
68
82
  - 对依赖图片、图表、画布或 3D 的界面,确认资源真实渲染且承担主体信息。
@@ -70,11 +84,14 @@ description: Use when building, reviewing, or improving frontend UI that needs p
70
84
  - 检查首屏是否同时具备任务入口、主体识别、可信证据和下一屏内容线索;若只剩装饰,应回到信息架构重做。
71
85
  - 对生产级控件补齐 hover、active、focus-visible、disabled、loading、selected、invalid 和 skeleton 状态。
72
86
  - 对仪表盘、表格、编辑器和配置台检查扫描路径、密度、固定尺寸和重复使用时的疲劳感。
87
+ - 对营销页、作品集和品牌页检查首屏是否适配常见小笔记本高度,导航是否单行,CTA 是否对比合格且不换行。
88
+ - 复核是否存在连续三段以上相同 section 结构、重复 zigzag、重复三卡片、卡片套卡片、假截图或没有主体信息的视觉资产。
73
89
 
74
90
  ## Constraints
75
91
 
76
92
  - 不把工具型应用做成营销落地页;首屏应是可用工作区。
77
93
  - 不用通用紫色渐变、装饰光斑、堆叠卡片或空泛 hero 作为默认方案。
94
+ - 不用三等分 feature cards、连续 zigzag、重复 eyebrow、假产品截图或不可检查媒体作为默认页面节奏。
78
95
  - 不使用无语境默认字体、均匀无重点配色、重复圆角卡片和模板化双栏 hero 来替代真实设计判断。
79
96
  - 不在卡片里再套大卡片;页面分区优先用全宽区域或无框布局。
80
97
  - 不用可见文案解释控件本该表达的功能,常见动作优先用图标和 tooltip。
@@ -84,6 +101,7 @@ description: Use when building, reviewing, or improving frontend UI that needs p
84
101
  - 不用不可检查的远程占位图、通用 stock 氛围图或 lorem 文案作为交付主体;缺素材时明确生成、制作或降级为真实结构化内容。
85
102
  - 不让视觉 polish 破坏键盘路径、触摸目标、文本可读性或低端设备性能。
86
103
  - 不把 Tailwind、组件库或 Storybook 文档等实现载体当成设计方向本身;它们应承接已经明确的产品语境和 token 边界。
104
+ - 不因参考系统偏好而强制某个框架、图标库、动效库或 CSS 工具;始终优先遵循当前项目依赖和设计系统。
87
105
 
88
106
  ## Expected Output
89
107
 
@@ -70,5 +70,45 @@
70
70
  "tokens": { "radius": "8-16px", "shadow": "soft", "density": "low-medium" },
71
71
  "bestFor": ["wellness", "beauty", "lifestyle", "care services"],
72
72
  "avoid": ["pastel contrast failures", "vague atmospheric imagery over real services"]
73
+ },
74
+ {
75
+ "id": "editorial-premium",
76
+ "keywords": ["premium", "luxury", "fashion", "magazine", "launch", "campaign"],
77
+ "description": "Image-led composition, restrained copy, high-contrast typography, and deliberate negative space.",
78
+ "tokens": { "radius": "0-8px", "shadow": "minimal", "density": "low-medium" },
79
+ "bestFor": ["brand launches", "premium ecommerce", "editorial landing pages", "portfolio features"],
80
+ "avoid": ["beige luxury defaults without brand evidence", "serif decoration that weakens readability", "hero copy that pushes the CTA below the first viewport"]
81
+ },
82
+ {
83
+ "id": "industrial-brutalist",
84
+ "keywords": ["industrial", "brutalist", "mechanical", "terminal", "tactical", "blueprint"],
85
+ "description": "Visible grids, hard edges, strong type scale contrast, and utilitarian metadata used with clear purpose.",
86
+ "tokens": { "radius": "0-2px", "shadow": "none", "density": "medium-high" },
87
+ "bestFor": ["technical portfolios", "developer tools", "editorial experiments", "telemetry interfaces"],
88
+ "avoid": ["regulated consumer flows", "tiny all-caps body copy", "decorative terminal chrome without real information"]
89
+ },
90
+ {
91
+ "id": "minimal-utilitarian",
92
+ "keywords": ["utilitarian", "document", "linear", "notion", "workspace", "minimalist"],
93
+ "description": "Quiet document-like surfaces, precise structure, low ornament, and typography doing most of the hierarchy work.",
94
+ "tokens": { "radius": "4-8px", "shadow": "none-low", "density": "medium" },
95
+ "bestFor": ["SaaS settings", "docs", "team workspaces", "productivity tools"],
96
+ "avoid": ["empty white expanses with no task priority", "low-contrast gray on gray", "identical flat cards for every section"]
97
+ },
98
+ {
99
+ "id": "image-led-landing",
100
+ "keywords": ["landing", "website", "hero", "visual", "image-led", "marketing"],
101
+ "description": "A clear conversion path carried by real or generated media, varied section structure, and inspectable visual assets.",
102
+ "tokens": { "radius": "contextual", "shadow": "media-dependent", "density": "low-medium" },
103
+ "bestFor": ["marketing sites", "product pages", "event pages", "agency sites"],
104
+ "avoid": ["text plus gradient-only hero", "fake screenshots", "repeating left-text/right-image sections", "CTA labels that wrap on desktop"]
105
+ },
106
+ {
107
+ "id": "brand-system-board",
108
+ "keywords": ["brand", "brandkit", "identity", "logo", "guidelines", "visual system"],
109
+ "description": "Presentation-grid identity boards that show logo logic, palette, typography, applications, and visual world coherently.",
110
+ "tokens": { "radius": "system-defined", "shadow": "presentation-dependent", "density": "medium" },
111
+ "bestFor": ["brand exploration", "identity systems", "design direction handoff", "visual language proposals"],
112
+ "avoid": ["random moodboards", "generic logos", "panels that do not explain the brand idea"]
73
113
  }
74
114
  ]
@@ -52,5 +52,40 @@
52
52
  "priority": "medium",
53
53
  "checks": ["Chart type matches data question", "Units and legends are visible", "Data has text/table fallback", "Color is supplemented by shape or labels"],
54
54
  "avoid": ["Pie charts for many categories", "Color-only series distinction"]
55
+ },
56
+ {
57
+ "category": "first-viewport",
58
+ "label": "First viewport",
59
+ "priority": "high",
60
+ "checks": ["Hero or workspace fits common laptop heights", "Primary CTA or task entry is visible without scrolling", "Desktop navigation stays on one line", "The next section leaves a readable cue when the page is promotional"],
61
+ "avoid": ["Oversized top padding", "Hero copy pushing actions below the fold", "Two-line desktop nav"]
62
+ },
63
+ {
64
+ "category": "cta-quality",
65
+ "label": "CTA quality",
66
+ "priority": "high",
67
+ "checks": ["CTA text contrast meets WCAG AA", "Primary CTA label stays on one line at desktop", "Each CTA intent uses one consistent label", "Ghost buttons remain visible over media backgrounds"],
68
+ "avoid": ["White text on light buttons", "Multiple contact labels for the same action", "Transparent buttons over busy imagery"]
69
+ },
70
+ {
71
+ "category": "section-variety",
72
+ "label": "Section variety",
73
+ "priority": "medium",
74
+ "checks": ["Adjacent sections use distinct layout jobs", "Bento cell count matches real content", "Feature grids have clear visual priority", "Small uppercase eyebrow labels are used sparingly"],
75
+ "avoid": ["Three equal cards as the default rhythm", "Three or more zigzag sections in a row", "Empty bento cells for decoration"]
76
+ },
77
+ {
78
+ "category": "media-authenticity",
79
+ "label": "Media authenticity",
80
+ "priority": "high",
81
+ "checks": ["Visual pages use real or generated assets with a clear role", "Product pages show inspectable product or state", "Screenshots represent real UI or are labeled as concepts", "Images reserve aspect ratio and have meaningful alt text when informative"],
82
+ "avoid": ["Text-only promotional pages", "Fake dashboard rectangles", "Blurred stock atmosphere as the main subject"]
83
+ },
84
+ {
85
+ "category": "state-completeness",
86
+ "label": "State completeness",
87
+ "priority": "critical",
88
+ "checks": ["Loading shape matches final layout", "Empty states include a useful next action", "Errors are recoverable and close to the source", "Selected, invalid, disabled, hover, focus, and reduced-motion states are covered"],
89
+ "avoid": ["Generic spinners everywhere", "Empty states that only say no data", "Disabled controls communicated only by opacity"]
55
90
  }
56
91
  ]
@@ -5,12 +5,71 @@
5
5
  ## 决策流程
6
6
 
7
7
  1. 提取关键词:产品类型、用户、场景、主要任务、内容密度、品牌语气、技术栈。
8
- 2. 匹配产品规则:从 `data/product-rules.json` 选择最接近的类别,记录推荐结构、风险和反模式。
9
- 3. 选择风格原型:从 `data/style-archetypes.json` 选择 1 个主风格和最多 1 个辅助风格,避免风格拼贴。
10
- 4. 建立 token 方向:定义主色、强调色、背景、前景、边框、危险色和 focus ring 的语义角色。
11
- 5. 选择字体情绪:不要只选“好看的字体”,要说明标题和正文各自承担的语气与可读性。
12
- 6. 判断数据表达:趋势用折线/面积,比较用柱状,构成少量类别可用环图,流程用漏斗/步骤,明细必须保留表格替代。
13
- 7. 输出反模式:每个设计建议必须附带“不要做什么”,避免落入通用模板。
8
+ 2. 写出设计读取:页面类型、受众、主任务、品牌约束和可信赖感来源。
9
+ 3. 匹配产品规则:从 `data/product-rules.json` 选择最接近的类别,记录推荐结构、风险和反模式。
10
+ 4. 选择风格原型:从 `data/style-archetypes.json` 选择 1 个主风格和最多 1 个辅助风格,避免风格拼贴。
11
+ 5. 设定设计拨盘:视觉张力、动效强度、信息密度、媒体真实性、内容说服力都用 1-10 表达,并随页面类型变化。
12
+ 6. 建立 token 方向:定义主色、强调色、背景、前景、边框、危险色和 focus ring 的语义角色。
13
+ 7. 选择字体情绪:不要只选“好看的字体”,要说明标题和正文各自承担的语气与可读性。
14
+ 8. 判断数据表达:趋势用折线/面积,比较用柱状,构成少量类别可用环图,流程用漏斗/步骤,明细必须保留表格替代。
15
+ 9. 输出反模式和质量门禁:每个设计建议必须附带“不要做什么”,并根据页面类型补充首屏、CTA、媒体真实性、section 变化和状态完整度检查。
16
+
17
+ ## 方向 Advisor
18
+
19
+ 当用户只说“好看一点”“给几个方向”“我也不知道什么风格”且没有权威设计稿时,不要连续追问泛泛口味问题。先给 3 个差异明显的方向,让用户能判断取舍。
20
+
21
+ 每个方向必须包含:
22
+
23
+ - 适用场景:为什么适合当前产品、受众和任务。
24
+ - 视觉锚点:信息结构、真实媒体、数据形态、材质、字体性格、空间组织或交互节奏。
25
+ - 关键 token:主色、强调色、背景、字体情绪、圆角/边框/阴影倾向。
26
+ - 避免项:这个方向最容易滑向的模板化错误。
27
+
28
+ 三个方向应来自不同设计逻辑,例如:
29
+
30
+ - 信息架构型:高密度、理性、数据优先,适合 B2B、运营、金融、工程工具。
31
+ - 编辑叙事型:版式、留白、强文字层级,适合品牌故事、内容产品、作品集。
32
+ - 产品实证型:真实截图、对象、状态、流程证据优先,适合 SaaS、硬件、开发者工具。
33
+ - 表现实验型:强动效、空间感、生成视觉,适合发布页、活动页、艺术/创意项目。
34
+ - 温暖人本型:低攻击性色彩、可亲近插画或真实人物,适合教育、健康、生活方式。
35
+
36
+ 用户选择方向后,再把它落成设计系统和页面结构;不要把 3 个方向拼贴成一个混杂系统。
37
+
38
+ ## 真实资产优先
39
+
40
+ 品牌或产品相关 UI 的识别度来自真实资产,而不是颜色猜测。优先级:
41
+
42
+ 1. Logo、产品图、真实 UI 截图、实体照片、品牌应用图。
43
+ 2. 项目内已有 icon、组件、数据状态、图表和截图。
44
+ 3. 为当前任务生成的专用资产。
45
+ 4. 明确标记的结构化 placeholder。
46
+
47
+ 不要用 CSS 轮廓、通用插画、假截图或远程占位图替代用户需要识别的主体。缺少关键资产时,先标记资产缺口并给替代路线;若 logo 或主体产品是首屏识别核心,应暂停确认或改为不依赖品牌识别的结构方案。
48
+
49
+ ## v0 校准
50
+
51
+ 视觉风险高、方向不明确或页面影响面较大时,先交付一个可看的 v0,而不是一次性做完整页面。
52
+
53
+ v0 应包含:
54
+
55
+ - 核心布局、首屏层级、主要 token 和一个关键模块。
56
+ - 明确 placeholder 和资产缺口。
57
+ - 1-2 个可替换方向点,例如密度、色彩温度或媒体策略。
58
+ - 不包含完整状态矩阵、所有内容细节或生产级动效。
59
+
60
+ v0 通过后再补齐组件、状态、响应式和交互动效。
61
+
62
+ ## 设计 Critique
63
+
64
+ 当用户要求“评审 UI”“好不好看”“再高级一点”或交付前需要自检时,按 5 个维度输出具体问题,而不是只给主观形容:
65
+
66
+ - 方向一致性:视觉选择是否服务设计读取和产品任务。
67
+ - 层级与扫描:首屏、标题、CTA、数据、状态是否有清楚主次。
68
+ - 工艺质量:间距、对齐、色彩数量、文字换行、圆角/边框/阴影是否稳定。
69
+ - 功能完整度:loading、empty、error、disabled、hover、focus、selected 是否覆盖。
70
+ - 原创性与识别度:是否摆脱通用渐变、三卡片、假截图、无主体 hero。
71
+
72
+ 输出应按严重程度给出可执行修复,不评价设计者本人。
14
73
 
15
74
  ## 何时运行生成器
16
75
 
@@ -29,6 +88,7 @@ node skills/fec-ui-design/scripts/design-system.mjs "fintech analytics dashboard
29
88
  ## 输出必须回答
30
89
 
31
90
  - 这个界面的主任务是什么?
91
+ - 设计读取和五个设计拨盘分别是什么?
32
92
  - 推荐哪种页面结构或工作区结构?
33
93
  - 视觉锚点是什么,为什么贴合业务?
34
94
  - 主风格、字体、色彩、动效分别服务什么目标?
@@ -11,6 +11,9 @@
11
11
  ## 高优先级
12
12
 
13
13
  - 首屏:工具型界面直接展示核心工作区,不用营销 hero 替代功能。
14
+ - 首屏:营销、作品集和品牌页在常见小笔记本高度内显示主体、CTA 和下一屏线索。
15
+ - CTA:按钮文案在桌面端不换行,对比度合格,同一意图使用一致标签。
16
+ - 导航:桌面端保持单行,移动端折叠后仍能到达主要路径。
14
17
  - 响应式:375px、768px、1024px、1440px 无水平溢出、遮挡或文本截断。
15
18
  - 性能:图片有尺寸或 aspect-ratio;非首屏图片懒加载;列表过大时虚拟化。
16
19
  - 动效:只动画 transform/opacity,尊重 `prefers-reduced-motion`。
@@ -27,6 +30,9 @@
27
30
  ## 反模式
28
31
 
29
32
  - 用装饰光斑、紫色渐变、卡片堆叠掩盖信息结构不足。
33
+ - 连续三段以上复用三卡片、左右交错、split header 或同一种 reveal 动效。
34
+ - 视觉型页面只有文字和渐变,没有真实产品、真实状态、品牌应用或可检查媒体。
35
+ - Bento 用空格子补构图,或 feature grid 每个格子同权重、同背景、同节奏。
30
36
  - hover 导致布局位移。
31
37
  - `transition: all`、`will-change: all`。
32
38
  - 低对比灰字、无意义透明度、单一色相界面。
@@ -67,6 +67,14 @@ import { fileURLToPath } from "node:url";
67
67
  * project: string;
68
68
  * page: string;
69
69
  * query: string;
70
+ * designRead: string;
71
+ * designDials: {
72
+ * visualTension: number;
73
+ * motionIntensity: number;
74
+ * informationDensity: number;
75
+ * mediaAuthenticity: number;
76
+ * contentPersuasion: number;
77
+ * };
70
78
  * product: { id: string; label: string; pattern: string; risks: string[] };
71
79
  * style: { id: string; label: string; usage: string | undefined; risks: string[] };
72
80
  * tokens: { color: string; typography: string; space: string; components: string[] };
@@ -230,6 +238,7 @@ function buildRecommendation(args) {
230
238
  const tokens = tokenize([query, args.project, args.page, args.stack].filter(Boolean).join(" "));
231
239
  const product = chooseProduct(tokens);
232
240
  const style = chooseStyle(tokens, product);
241
+ const designDials = deriveDesignDials(tokens, product, style);
233
242
  const checklist = chooseChecklist(tokens, product);
234
243
  const stackGuidance = chooseStack(args.stack, tokens);
235
244
  const pattern = product.pattern ?? product.patterns?.[0] ?? "Task-first interface with explicit states and durable visual hierarchy";
@@ -238,6 +247,8 @@ function buildRecommendation(args) {
238
247
  project: args.project || titleCase(query),
239
248
  page: args.page || "",
240
249
  query,
250
+ designRead: renderDesignRead(product, style, designDials),
251
+ designDials,
241
252
  product: {
242
253
  id: product.id,
243
254
  label: product.label ?? labelFromId(product.id),
@@ -312,11 +323,17 @@ function chooseStyle(tokens, product) {
312
323
  * @returns {ChecklistGroup[]}
313
324
  */
314
325
  function chooseChecklist(tokens, product) {
315
- const priority = new Set(["accessibility", "interaction", "layout", "typography", "animation"]);
326
+ const priority = new Set(["accessibility", "interaction", "layout", "typography", "animation", "state-completeness"]);
316
327
  if (product.id === "data-dashboard" || tokens.has("dashboard") || tokens.has("chart")) priority.add("charts");
317
328
  if (tokens.has("form") || tokens.has("booking") || tokens.has("checkout")) priority.add("forms");
318
329
  if (tokens.has("mobile") || tokens.has("app")) priority.add("navigation");
319
330
  if (tokens.has("performance") || tokens.has("canvas") || tokens.has("three")) priority.add("performance");
331
+ if (isPromotional(tokens, product)) {
332
+ priority.add("first-viewport");
333
+ priority.add("cta-quality");
334
+ priority.add("section-variety");
335
+ priority.add("media-authenticity");
336
+ }
320
337
 
321
338
  return uxQualityRules
322
339
  .filter((rule) => {
@@ -333,6 +350,96 @@ function chooseChecklist(tokens, product) {
333
350
  });
334
351
  }
335
352
 
353
+ /**
354
+ * @param {Set<string>} tokens
355
+ * @param {ProductRule} product
356
+ * @param {StyleArchetype} style
357
+ * @returns {Recommendation["designDials"]}
358
+ */
359
+ function deriveDesignDials(tokens, product, style) {
360
+ /** @type {Recommendation["designDials"]} */
361
+ const dials = {
362
+ visualTension: 5,
363
+ motionIntensity: 3,
364
+ informationDensity: 5,
365
+ mediaAuthenticity: 5,
366
+ contentPersuasion: 5,
367
+ };
368
+
369
+ if (["data-dashboard", "saas", "fintech", "healthcare"].includes(product.id)) {
370
+ dials.visualTension = 3;
371
+ dials.motionIntensity = product.id === "saas" ? 3 : 2;
372
+ dials.informationDensity = product.id === "data-dashboard" ? 8 : 6;
373
+ dials.mediaAuthenticity = 4;
374
+ dials.contentPersuasion = 4;
375
+ }
376
+
377
+ if (["ecommerce", "creative", "wellness"].includes(product.id) || isPromotional(tokens, product)) {
378
+ dials.visualTension = product.id === "creative" ? 8 : 7;
379
+ dials.motionIntensity = product.id === "creative" ? 6 : 5;
380
+ dials.informationDensity = 4;
381
+ dials.mediaAuthenticity = 8;
382
+ dials.contentPersuasion = 8;
383
+ }
384
+
385
+ if (product.id === "gaming" || style.id === "immersive") {
386
+ dials.visualTension = 8;
387
+ dials.motionIntensity = 7;
388
+ dials.informationDensity = 6;
389
+ dials.mediaAuthenticity = 7;
390
+ dials.contentPersuasion = 5;
391
+ }
392
+
393
+ if (["minimal", "minimal-utilitarian"].includes(style.id)) {
394
+ dials.visualTension = Math.min(dials.visualTension, 4);
395
+ dials.motionIntensity = Math.min(dials.motionIntensity, 3);
396
+ }
397
+
398
+ if (["editorial-premium", "image-led-landing", "brand-system-board"].includes(style.id)) {
399
+ dials.visualTension = Math.max(dials.visualTension, 7);
400
+ dials.mediaAuthenticity = Math.max(dials.mediaAuthenticity, 8);
401
+ dials.contentPersuasion = Math.max(dials.contentPersuasion, 7);
402
+ }
403
+
404
+ if (tokens.has("regulated") || tokens.has("public") || tokens.has("government") || tokens.has("accessibility")) {
405
+ dials.visualTension = Math.min(dials.visualTension, 3);
406
+ dials.motionIntensity = Math.min(dials.motionIntensity, 2);
407
+ dials.informationDensity = Math.max(dials.informationDensity, 5);
408
+ }
409
+
410
+ return dials;
411
+ }
412
+
413
+ /**
414
+ * @param {ProductRule} product
415
+ * @param {StyleArchetype} style
416
+ * @param {Recommendation["designDials"]} dials
417
+ * @returns {string}
418
+ */
419
+ function renderDesignRead(product, style, dials) {
420
+ return [
421
+ `Reading this as ${product.label ?? labelFromId(product.id)} work`,
422
+ `with a ${style.label ?? labelFromId(style.id)} visual direction`,
423
+ `and dial targets ${dials.visualTension}/${dials.motionIntensity}/${dials.informationDensity}/${dials.mediaAuthenticity}/${dials.contentPersuasion}`,
424
+ ].join(", ");
425
+ }
426
+
427
+ /**
428
+ * @param {Set<string>} tokens
429
+ * @param {ProductRule} product
430
+ * @returns {boolean}
431
+ */
432
+ function isPromotional(tokens, product) {
433
+ return product.id === "creative"
434
+ || product.id === "ecommerce"
435
+ || tokens.has("landing")
436
+ || tokens.has("marketing")
437
+ || tokens.has("portfolio")
438
+ || tokens.has("brand")
439
+ || tokens.has("website")
440
+ || tokens.has("hero");
441
+ }
442
+
336
443
  /**
337
444
  * @param {string} stack
338
445
  * @param {Set<string>} tokens
@@ -364,10 +471,19 @@ function renderMarkdown(model) {
364
471
  const lines = [
365
472
  `# Design System Recommendation: ${model.project}`,
366
473
  "",
474
+ `- Design read: ${model.designRead}`,
367
475
  `- Product category: ${model.product.label} (${model.product.id})`,
368
476
  `- Recommended pattern: ${model.product.pattern}`,
369
477
  `- Style archetype: ${model.style.label} (${model.style.id})`,
370
478
  "",
479
+ "## Design Dials",
480
+ "",
481
+ `- Visual tension: ${model.designDials.visualTension}/10`,
482
+ `- Motion intensity: ${model.designDials.motionIntensity}/10`,
483
+ `- Information density: ${model.designDials.informationDensity}/10`,
484
+ `- Media authenticity: ${model.designDials.mediaAuthenticity}/10`,
485
+ `- Content persuasion: ${model.designDials.contentPersuasion}/10`,
486
+ "",
371
487
  "## Token Direction",
372
488
  "",
373
489
  `- Color: ${model.tokens.color}`,
@@ -416,10 +532,12 @@ function renderPageOverride(model) {
416
532
  "## Page Intent",
417
533
  "",
418
534
  `Use the Master direction, then adapt layout and component density for ${pageName}. Keep overrides narrow and delete any rule that merely repeats the Master.`,
535
+ `Design read: ${model.designRead}.`,
419
536
  "",
420
537
  "## Override Strategy",
421
538
  "",
422
539
  `- Primary pattern: ${model.product.pattern}`,
540
+ `- Dials: visual ${model.designDials.visualTension}/10, motion ${model.designDials.motionIntensity}/10, density ${model.designDials.informationDensity}/10, media ${model.designDials.mediaAuthenticity}/10, persuasion ${model.designDials.contentPersuasion}/10`,
423
541
  `- Visual emphasis: ${model.style.usage}`,
424
542
  `- Chart behavior: ${model.chart}`,
425
543
  "",
@@ -19,11 +19,17 @@ description: Use when designing or reviewing Vue 3 + TypeScript project structur
19
19
  4. 输出时补齐状态归属、API 层、错误处理、样式隔离和专项 skill 分流。
20
20
  5. 页面和模块要有可恢复错误 UI;全局 `errorHandler`、`onErrorCaptured`、请求错误映射和路由错误页分工明确。
21
21
  6. Tailwind token/variant 或响应式布局需求应分流到对应专项 skill,避免把样式系统规则塞进 Vue 组件规范。
22
- 5. 状态归属复杂时先做状态清单;DTO、公共 props 或泛型 composable 复杂时先收敛 TypeScript 类型契约。
22
+ 7. 状态归属复杂时先做状态清单;DTO、公共 props、泛型 composable 或 `tsconfig` 边界复杂时,先使用 TypeScript 项目规范流程收敛跨框架类型契约。
23
+ 8. 设计可复用 composable 时明确输入是否支持 plain value、ref、computed 或 getter;测试 Vue 组件时覆盖 Pinia、Router、Teleport、Suspense 和 async setup 的常见边界。
23
24
 
24
25
  ## 详细参考
25
26
 
26
- 需要具体 Vue 3 项目结构、组件模式、Composables、slots、Provide/Inject、路由、Pinia、API 层、错误处理、指令、样式、TypeScript、测试、性能或审查清单时,加载 [references/vue3-project-details.md](references/vue3-project-details.md)。
27
+ 按需要加载更细的参考文件:
28
+
29
+ - 项目目录、组件分层、组件规范、注释和 TypeScript:加载 [references/vue3-project-structure.md](references/vue3-project-structure.md)。
30
+ - Composables、slots、Provide/Inject 和路由组织:加载 [references/vue3-composables-routing.md](references/vue3-composables-routing.md)。
31
+ - Pinia、API 层、错误处理、指令、样式、测试、反模式和输出检查清单:加载 [references/vue3-state-api-quality.md](references/vue3-state-api-quality.md)。
32
+ - Vue 项目规范层面的轻量性能约定:加载 [references/vue3-performance-patterns.md](references/vue3-performance-patterns.md)。
27
33
 
28
34
  ## Constraints
29
35
 
@@ -36,6 +42,8 @@ description: Use when designing or reviewing Vue 3 + TypeScript project structur
36
42
  - 避免在 `v-for` 中使用 `v-if`(提取为 computed 过滤)
37
43
  - 禁止直接从 feature 内部深层路径导入,绕过 `index.ts`
38
44
  - 不用全局错误处理吞掉组件内可恢复的 API、表单或权限错误。
45
+ - 不把函数型参数误当 getter 自动调用;composable 参数若可能是回调,应避免使用 getter 型输入约定。
46
+ - 不依赖快照作为 Vue 组件唯一断言;异步组件、Teleport 和 Pinia 场景要有用户可见行为断言。
39
47
 
40
48
  ## Expected Output
41
49
 
@@ -47,3 +55,4 @@ description: Use when designing or reviewing Vue 3 + TypeScript project structur
47
55
  - API 调用有类型约束和统一错误处理
48
56
  - 样式使用 scoped 隔离,关键行为有测试覆盖
49
57
  - 文件结构与项目约定一致(pages / features / components 分离)
58
+ - 可复用 composable 的输入响应性、Pinia/Router 边界和异步组件测试策略已说明