@bovinphang/frontend-craft 2.5.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 (180) hide show
  1. package/.claude-plugin/marketplace.json +61 -0
  2. package/.claude-plugin/plugin.json +32 -0
  3. package/.mcp.json +44 -0
  4. package/CHANGELOG.md +229 -0
  5. package/CHANGELOG.zh-CN.md +228 -0
  6. package/CODE_OF_CONDUCT.md +34 -0
  7. package/CODE_OF_CONDUCT.zh-CN.md +34 -0
  8. package/CONTRIBUTING.md +356 -0
  9. package/CONTRIBUTING.zh-CN.md +356 -0
  10. package/LICENSE +21 -0
  11. package/README.md +467 -0
  12. package/README.openclaw.md +262 -0
  13. package/README.openclaw.zh-CN.md +262 -0
  14. package/README.zh-CN.md +467 -0
  15. package/SECURITY.md +44 -0
  16. package/SECURITY.zh-CN.md +44 -0
  17. package/agents/fec-architect.md +125 -0
  18. package/agents/fec-code-reviewer.md +152 -0
  19. package/agents/fec-debugger.md +44 -0
  20. package/agents/fec-design-token-mapper.md +75 -0
  21. package/agents/fec-doc-updater.md +30 -0
  22. package/agents/fec-e2e-runner.md +107 -0
  23. package/agents/fec-figma-implementer.md +104 -0
  24. package/agents/fec-performance-optimizer.md +293 -0
  25. package/agents/fec-refactor-cleaner.md +32 -0
  26. package/agents/fec-security-reviewer.md +116 -0
  27. package/agents/fec-test-planner.md +50 -0
  28. package/agents/fec-typescript-reviewer.md +142 -0
  29. package/agents/fec-ui-checker.md +120 -0
  30. package/commands/fec-debug.md +30 -0
  31. package/commands/fec-doc-sync.md +18 -0
  32. package/commands/fec-init.md +70 -0
  33. package/commands/fec-plan.md +94 -0
  34. package/commands/fec-refactor-clean.md +19 -0
  35. package/commands/fec-review.md +66 -0
  36. package/commands/fec-scaffold.md +205 -0
  37. package/commands/fec-tdd.md +21 -0
  38. package/dist/bin/frontend-craft.js +82 -0
  39. package/dist/hooks/fec-cleanup-claude-cache.js +4 -0
  40. package/dist/hooks/fec-format-changed-file.js +1 -0
  41. package/dist/hooks/fec-notify.js +1 -0
  42. package/dist/hooks/fec-run-tests.js +1 -0
  43. package/dist/hooks/fec-security-check.js +2 -0
  44. package/dist/hooks/fec-session-start.js +1 -0
  45. package/docs/example-prompts.md +124 -0
  46. package/docs/ja-JP/README.md +467 -0
  47. package/docs/ko-KR/README.md +467 -0
  48. package/docs/project-structure.md +119 -0
  49. package/docs/runtimes/antigravity.md +10 -0
  50. package/docs/runtimes/augment.md +10 -0
  51. package/docs/runtimes/claude.md +171 -0
  52. package/docs/runtimes/claude.zh-CN.md +169 -0
  53. package/docs/runtimes/cline.md +10 -0
  54. package/docs/runtimes/codebuddy.md +10 -0
  55. package/docs/runtimes/codex.md +10 -0
  56. package/docs/runtimes/copilot.md +10 -0
  57. package/docs/runtimes/cursor.md +10 -0
  58. package/docs/runtimes/gemini.md +10 -0
  59. package/docs/runtimes/kilo.md +10 -0
  60. package/docs/runtimes/openclaw.md +10 -0
  61. package/docs/runtimes/opencode.md +10 -0
  62. package/docs/runtimes/qoder.md +19 -0
  63. package/docs/runtimes/trae.md +10 -0
  64. package/docs/runtimes/windsurf.md +10 -0
  65. package/docs/superpowers/plans/2026-05-29-fec-debug.md +491 -0
  66. package/docs/superpowers/specs/2026-05-29-fec-debug-design.md +340 -0
  67. package/docs/zh-CN/example-prompts.md +124 -0
  68. package/docs/zh-CN/project-structure.md +119 -0
  69. package/docs/zh-TW/README.md +467 -0
  70. package/hooks/hooks.json +71 -0
  71. package/openclaw.plugin.json +26 -0
  72. package/package.json +101 -0
  73. package/skills/TEMPLATE.md +155 -0
  74. package/skills/eval_queries.json +890 -0
  75. package/skills/fec-accessibility-check/SKILL.md +39 -0
  76. package/skills/fec-accessibility-check/references/report-template.md +23 -0
  77. package/skills/fec-accessibility-check/references/screen-reader-testing.md +33 -0
  78. package/skills/fec-api-integration/SKILL.md +78 -0
  79. package/skills/fec-api-integration/references/integration-patterns.md +80 -0
  80. package/skills/fec-browser-storage/SKILL.md +34 -0
  81. package/skills/fec-browser-storage/references/storage-patterns.md +65 -0
  82. package/skills/fec-canvas-threejs/SKILL.md +66 -0
  83. package/skills/fec-canvas-threejs/references/rendering-patterns.md +67 -0
  84. package/skills/fec-canvas-threejs/references/shader-webgl-patterns.md +67 -0
  85. package/skills/fec-code-review/SKILL.md +135 -0
  86. package/skills/fec-code-review/references/report-template.md +29 -0
  87. package/skills/fec-component-testing/SKILL.md +119 -0
  88. package/skills/fec-data-fetching/SKILL.md +62 -0
  89. package/skills/fec-data-fetching/references/query-patterns.md +77 -0
  90. package/skills/fec-debug-framework/SKILL.md +162 -0
  91. package/skills/fec-dependency-upgrade/SKILL.md +34 -0
  92. package/skills/fec-dependency-upgrade/references/dependency-upgrade-workflow.md +56 -0
  93. package/skills/fec-doc-sync/SKILL.md +37 -0
  94. package/skills/fec-e2e-testing/SKILL.md +40 -0
  95. package/skills/fec-e2e-testing/references/e2e-advanced.md +176 -0
  96. package/skills/fec-e2e-testing/references/playwright-patterns.md +95 -0
  97. package/skills/fec-form-handling/SKILL.md +76 -0
  98. package/skills/fec-form-handling/references/advanced-form-patterns.md +72 -0
  99. package/skills/fec-implement-from-design/SKILL.md +122 -0
  100. package/skills/fec-implement-from-design/references/design-plan-template.md +36 -0
  101. package/skills/fec-legacy-to-modern-migration/SKILL.md +180 -0
  102. package/skills/fec-legacy-to-modern-migration/references/migration-report-template.md +41 -0
  103. package/skills/fec-legacy-web-standard/SKILL.md +35 -0
  104. package/skills/fec-legacy-web-standard/references/legacy-patterns.md +85 -0
  105. package/skills/fec-list-virtualization/SKILL.md +34 -0
  106. package/skills/fec-list-virtualization/references/virtualization-patterns.md +52 -0
  107. package/skills/fec-monorepo-project-standard/SKILL.md +142 -0
  108. package/skills/fec-motion-interaction/SKILL.md +66 -0
  109. package/skills/fec-motion-interaction/references/motion-patterns.md +112 -0
  110. package/skills/fec-nextjs-project-standard/SKILL.md +117 -0
  111. package/skills/fec-nuxt-project-standard/SKILL.md +122 -0
  112. package/skills/fec-performance-optimization/SKILL.md +72 -0
  113. package/skills/fec-pwa-implementation/SKILL.md +36 -0
  114. package/skills/fec-pwa-implementation/references/manifest-and-icons.md +53 -0
  115. package/skills/fec-pwa-implementation/references/service-worker-workbox.md +68 -0
  116. package/skills/fec-react-project-standard/SKILL.md +83 -0
  117. package/skills/fec-react-project-standard/references/react-project-details.md +642 -0
  118. package/skills/fec-refactor-clean/SKILL.md +48 -0
  119. package/skills/fec-responsive-layout/SKILL.md +34 -0
  120. package/skills/fec-responsive-layout/references/responsive-layout-patterns.md +59 -0
  121. package/skills/fec-route-protection/SKILL.md +135 -0
  122. package/skills/fec-security-review/SKILL.md +38 -0
  123. package/skills/fec-security-review/references/report-template.md +27 -0
  124. package/skills/fec-security-review/references/security-checklist.md +64 -0
  125. package/skills/fec-source-driven-development/SKILL.md +61 -0
  126. package/skills/fec-state-management/SKILL.md +140 -0
  127. package/skills/fec-state-management/references/state-patterns.md +109 -0
  128. package/skills/fec-storybook-component-doc/SKILL.md +37 -0
  129. package/skills/fec-storybook-component-doc/references/story-patterns.md +118 -0
  130. package/skills/fec-svg-animation/SKILL.md +148 -0
  131. package/skills/fec-tailwind-design-system/SKILL.md +34 -0
  132. package/skills/fec-tailwind-design-system/references/tailwind-system-patterns.md +55 -0
  133. package/skills/fec-tdd-workflow/SKILL.md +52 -0
  134. package/skills/fec-testing-strategy/SKILL.md +45 -0
  135. package/skills/fec-typescript-type-safety/SKILL.md +157 -0
  136. package/skills/fec-typescript-type-safety/references/type-safety-patterns.md +102 -0
  137. package/skills/fec-ui-design/SKILL.md +90 -0
  138. package/skills/fec-ui-design/data/product-rules.json +110 -0
  139. package/skills/fec-ui-design/data/stack-ui-rules.json +14 -0
  140. package/skills/fec-ui-design/data/style-archetypes.json +74 -0
  141. package/skills/fec-ui-design/data/ux-quality-rules.json +56 -0
  142. package/skills/fec-ui-design/references/design-intelligence.md +37 -0
  143. package/skills/fec-ui-design/references/master-page-overrides.md +30 -0
  144. package/skills/fec-ui-design/references/pre-delivery-checklist.md +33 -0
  145. package/skills/fec-ui-design/scripts/design-system.mjs +530 -0
  146. package/skills/fec-validation-fix/SKILL.md +48 -0
  147. package/skills/fec-vite-project-standard/SKILL.md +83 -0
  148. package/skills/fec-vue3-project-standard/SKILL.md +49 -0
  149. package/skills/fec-vue3-project-standard/references/vue3-project-details.md +547 -0
  150. package/skills/fec-web-workers/SKILL.md +36 -0
  151. package/skills/fec-web-workers/references/advanced-workers.md +54 -0
  152. package/skills/fec-web-workers/references/basic-worker.md +67 -0
  153. package/skills/metadata.json +1422 -0
  154. package/skills/relations.json +644 -0
  155. package/templates/claude/CLAUDE.md +106 -0
  156. package/templates/claude/settings.json +62 -0
  157. package/templates/codex/AGENTS.md +105 -0
  158. package/templates/codex/config.toml +32 -0
  159. package/templates/openclaw/AGENTS.md +101 -0
  160. package/templates/openclaw/OPENCLAW-CONFIG.md +12 -0
  161. package/templates/shared/rules/fec-agent-workflow.md +54 -0
  162. package/templates/shared/rules/fec-api-layer.md +99 -0
  163. package/templates/shared/rules/fec-ci-cd.md +128 -0
  164. package/templates/shared/rules/fec-code-comments.md +33 -0
  165. package/templates/shared/rules/fec-design-system.md +248 -0
  166. package/templates/shared/rules/fec-error-handling.md +200 -0
  167. package/templates/shared/rules/fec-git-conventions.md +73 -0
  168. package/templates/shared/rules/fec-i18n.md +112 -0
  169. package/templates/shared/rules/fec-naming-conventions.md +120 -0
  170. package/templates/shared/rules/fec-performance.md +101 -0
  171. package/templates/shared/rules/fec-react.md +82 -0
  172. package/templates/shared/rules/fec-refactoring.md +43 -0
  173. package/templates/shared/rules/fec-rendering-patterns.md +183 -0
  174. package/templates/shared/rules/fec-responsive-design.md +227 -0
  175. package/templates/shared/rules/fec-source-driven-development.md +31 -0
  176. package/templates/shared/rules/fec-state-management.md +163 -0
  177. package/templates/shared/rules/fec-testing.md +98 -0
  178. package/templates/shared/rules/fec-typescript.md +355 -0
  179. package/templates/shared/rules/fec-vue.md +64 -0
  180. package/templates/shared/rules/fec-working-modes.md +50 -0
@@ -0,0 +1,102 @@
1
+ # 类型安全模式
2
+
3
+ ## 类型边界审查清单
4
+
5
+ - DTO 应与外部载荷对应,并在 API 边界处进行转换。
6
+ - 领域模型或视图模型使用前端命名和稳定的联合类型。
7
+ - 组件 props 需命名明确,仅在该文件外复用时才导出。
8
+ - 公开函数必须有显式的参数和返回值类型。
9
+ - 外部输入必须从 `unknown` 开始,通过 schema 校验或类型守卫逐步收窄。
10
+ - 配置映射表优先使用 `as const` 和 `satisfies`,避免宽泛断言。
11
+
12
+ ## 使用 `satisfies` 的配置映射表
13
+
14
+ ```ts
15
+ type Tone = "neutral" | "success" | "warning" | "danger";
16
+
17
+ const STATUS_TONE = {
18
+ draft: "neutral",
19
+ paid: "success",
20
+ overdue: "danger",
21
+ } as const satisfies Record<string, Tone>;
22
+
23
+ type InvoiceStatus = keyof typeof STATUS_TONE;
24
+ ```
25
+
26
+ 这样既保留了字面量值,又验证了映射表符合预期的值域。
27
+
28
+ ## 映射类型用于表单错误
29
+
30
+ ```ts
31
+ type FieldErrors<TValues extends Record<string, unknown>> = {
32
+ [Key in keyof TValues]?: string;
33
+ };
34
+
35
+ interface ProfileFormValues {
36
+ email: string;
37
+ displayName: string;
38
+ }
39
+
40
+ type ProfileFormErrors = FieldErrors<ProfileFormValues>;
41
+ ```
42
+
43
+ ## 模板字面量类型用于事件命名
44
+
45
+ ```ts
46
+ interface AnalyticsPayloads {
47
+ checkoutStarted: { cartId: string };
48
+ checkoutCompleted: { orderId: string };
49
+ }
50
+
51
+ type AnalyticsEventName = keyof AnalyticsPayloads;
52
+ type AnalyticsHandlerName = `on${Capitalize<string & AnalyticsEventName>}`;
53
+ ```
54
+
55
+ 当项目中已有事件命名规范时使用此模式。不要为一次性字符串引入。
56
+
57
+ ## 更安全的泛型组件模式
58
+
59
+ ```tsx
60
+ interface Entity {
61
+ id: string;
62
+ }
63
+
64
+ interface EntityPickerProps<TEntity extends Entity> {
65
+ items: TEntity[];
66
+ selectedId: string | null;
67
+ getLabel: (item: TEntity) => string;
68
+ onSelect: (item: TEntity) => void;
69
+ }
70
+
71
+ export function EntityPicker<TEntity extends Entity>({
72
+ items,
73
+ selectedId,
74
+ getLabel,
75
+ onSelect,
76
+ }: EntityPickerProps<TEntity>) {
77
+ return (
78
+ <ul>
79
+ {items.map((item) => (
80
+ <li key={item.id}>
81
+ <button
82
+ aria-pressed={item.id === selectedId}
83
+ type="button"
84
+ onClick={() => onSelect(item)}
85
+ >
86
+ {getLabel(item)}
87
+ </button>
88
+ </li>
89
+ ))}
90
+ </ul>
91
+ );
92
+ }
93
+ ```
94
+
95
+ ## 类型审查反馈
96
+
97
+ 报告类型安全问题时,需包含:
98
+
99
+ - 过于宽泛、过于狭窄或不合理的类型边界。
100
+ - 尽管通过 TypeScript 但可能在运行时失败的行為。
101
+ - 最小替换类型或守卫方案。
102
+ - 该变更是否需要测试或类型测试。
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: fec-ui-design
3
+ description: Use when building, reviewing, or improving frontend UI that needs product-specific design direction, design-system generation, Master/Page overrides, distinctive visual identity, anti-generic interface choices, first-screen hierarchy, UI polish, chart UX, interaction states, responsive behavior, or visual QA. When an external design file is authoritative, implement from that source instead of inventing direction; Chinese triggers include UI 设计, 设计系统, 视觉风格, 不要模板化, 高级感, 界面打磨, 交互状态.
4
+ ---
5
+
6
+ # UI 设计
7
+
8
+ 适用于需要把前端界面推进到“符合产品语境、可扫描、可信赖、有辨识度,并且细节稳定”的 UI 任务。需要系统化设计建议时,加载 [design-intelligence.md](references/design-intelligence.md);需要长期沉淀设计系统时,加载 [master-page-overrides.md](references/master-page-overrides.md);上线前做 UI/UX QA 时,加载 [pre-delivery-checklist.md](references/pre-delivery-checklist.md)。
9
+
10
+ 可执行设计系统生成器位于 [design-system.mjs](scripts/design-system.mjs),其原创知识包包括 [product-rules.json](data/product-rules.json)、[style-archetypes.json](data/style-archetypes.json)、[ux-quality-rules.json](data/ux-quality-rules.json) 和 [stack-ui-rules.json](data/stack-ui-rules.json)。
11
+
12
+ ## Purpose
13
+
14
+ 为页面、组件、仪表盘和工具界面建立设计方向,并完成可落地的视觉与交互 polish。
15
+
16
+ ## Procedure
17
+
18
+ 1. 明确界面的工作
19
+ - 先说清它帮助用户完成什么任务,而不是先选颜色或布局。
20
+ - 判断这是日常高频工具、营销展示、内容阅读、可视化探索、游戏,还是配置/管理后台。
21
+ - 如果已有 Figma、Sketch、MasterGo、Pixso、墨刀、摹客或截图是事实来源,优先还原设计上下文,不自行发明方向。
22
+
23
+ 2. 定义审美主张
24
+ - 写出目标用户、使用场景、可信赖感来源和一个可被记住的视觉锚点。
25
+ - 视觉锚点可以来自信息结构、真实媒体、数据形态、行业材质、字体性格、交互节奏或空间组织,而不是空泛装饰。
26
+ - 表现力必须服务业务语境:工具型界面重效率和稳定,展示型页面重主体识别和记忆点。
27
+ - 为页面类型设定设计拨盘:信息密度、视觉张力、动效强度、内容说服力和媒体真实性;这些拨盘必须随任务变化,而不是沿用同一套模板。
28
+
29
+ 3. 生成或读取设计系统
30
+ - 若项目还没有设计系统,可运行 `node skills/fec-ui-design/scripts/design-system.mjs "<product audience tone>" --project "<name>"` 生成建议。
31
+ - 若需要跨会话复用,使用 `--persist` 生成 `design-system/<project>/MASTER.md`;页面差异用 `--page <page>` 写入 `pages/<page>.md`。
32
+ - 构建具体页面时先读页面 override,再读 Master;页面规则只覆盖差异,不复制全量设计系统。
33
+
34
+ 4. 建立首屏与视觉层级
35
+ - 工具型界面:首屏直接呈现核心工作区、列表、表格、画布或编辑器。
36
+ - 落地页:H1 使用品牌、产品、地点、人名或明确品类,价值说明放在辅助文案。
37
+ - 产品/对象页:首屏必须可见真实产品、对象、状态或可检查媒体。
38
+ - 首屏应留下一个明确记忆点,但不能遮挡核心任务、导航和状态反馈。
39
+ - 营销和产品页需要先写清受众、痛点、承诺、证据和行动入口;文案结构服务转化,但不使用夸张、空泛或不可验证的声明。
40
+
41
+ 5. 组织视觉语言
42
+ - 字体:优先沿用项目字体体系;若任务允许建立新方向,选择能表达产品性格的标题/正文字体组合,并保证可读性。
43
+ - 色彩:明确主色、功能色、中性色和强调色的角色,避免所有元素平均用力。
44
+ - 空间:根据任务选择高密度、留白、非对称、分栏、画布式或编辑器式布局,不套用固定卡片模板。
45
+ - 动效:只为页面入场、层级展开、状态确认、错误反馈和重点引导建立节奏,并尊重 `prefers-reduced-motion`。
46
+ - 媒体:优先使用真实产品、真实状态、真实图表、可检查截图或本地生成资产;不要用模糊氛围图、占位 URL 或无关插画替代主体信息。
47
+ - 图表:先判断数据任务是趋势、比较、构成、分布还是流程,再选择图表,不把所有数据都做成卡片或饼图。
48
+
49
+ 6. 对齐设计系统、组件与 token
50
+ - 先复用项目已有组件、token、图标库、路由和布局约定。
51
+ - 缺少 token 时集中补齐或明确记录,不要在多个组件里散落硬编码。
52
+ - 复杂 UI 在实现前写出复用组件、新建组件、响应式策略和状态覆盖。
53
+ - 设计系统先定义语义 token、组件 API、状态矩阵和使用边界,再落到 Tailwind、CSS Modules、组件库或 CSS 变量实现。
54
+ - Tailwind 专项 token、variant、dark mode 和 class 治理分流到 Tailwind 设计系统工作流;跨设备布局、容器查询和触摸目标分流到响应式布局工作流。
55
+ - 组件 API 应区分基础组件、业务组件和页面私有组件;避免让单个 `variant` 同时承担语义、尺寸、密度和权限含义。
56
+
57
+ 7. 打磨几何、文本和状态
58
+ - 嵌套圆角遵循“外层圆角约等于内层圆角 + 间距”的光学关系。
59
+ - 非对称图标、播放三角、箭头、星标等需要按视觉中心微调。
60
+ - 标题和短文本可使用 `text-wrap: balance` 或 `text-wrap: pretty`。
61
+ - 表格、价格、计数器、计时器使用 `font-variant-numeric: tabular-nums`。
62
+ - 小控件点击区域至少 40x40px,空间允许时优先 44x44px。
63
+ - focus ring 用于键盘定位,hover/active 用于鼠标反馈,disabled 不只靠透明度表达。
64
+
65
+ 8. 验证设计结果
66
+ - 检查 loading、empty、error、disabled、hover、focus、selected 状态。
67
+ - 在 mobile(375px)、tablet(768px)、desktop(1440px) 检查文案是否溢出或遮挡。
68
+ - 对依赖图片、图表、画布或 3D 的界面,确认资源真实渲染且承担主体信息。
69
+ - 复核是否存在默认紫色渐变、空泛 hero、卡片堆叠、单一色相或无语境字体等模板化痕迹。
70
+ - 检查首屏是否同时具备任务入口、主体识别、可信证据和下一屏内容线索;若只剩装饰,应回到信息架构重做。
71
+ - 对生产级控件补齐 hover、active、focus-visible、disabled、loading、selected、invalid 和 skeleton 状态。
72
+ - 对仪表盘、表格、编辑器和配置台检查扫描路径、密度、固定尺寸和重复使用时的疲劳感。
73
+
74
+ ## Constraints
75
+
76
+ - 不把工具型应用做成营销落地页;首屏应是可用工作区。
77
+ - 不用通用紫色渐变、装饰光斑、堆叠卡片或空泛 hero 作为默认方案。
78
+ - 不使用无语境默认字体、均匀无重点配色、重复圆角卡片和模板化双栏 hero 来替代真实设计判断。
79
+ - 不在卡片里再套大卡片;页面分区优先用全宽区域或无框布局。
80
+ - 不用可见文案解释控件本该表达的功能,常见动作优先用图标和 tooltip。
81
+ - 不为了质感添加大面积装饰、模糊光斑、无语义渐变或无关重写。
82
+ - 不为了统一风格让整个界面落入单一色相;颜色应有层次和语义区分。
83
+ - 不把生成器输出当成不可修改的设计稿;它是决策起点,必须结合项目已有组件、token、用户任务和真实数据校正。
84
+ - 不用不可检查的远程占位图、通用 stock 氛围图或 lorem 文案作为交付主体;缺素材时明确生成、制作或降级为真实结构化内容。
85
+ - 不让视觉 polish 破坏键盘路径、触摸目标、文本可读性或低端设备性能。
86
+ - 不把 Tailwind、组件库或 Storybook 文档等实现载体当成设计方向本身;它们应承接已经明确的产品语境和 token 边界。
87
+
88
+ ## Expected Output
89
+
90
+ 输出应包含明确的设计方向、首屏记忆点、视觉语言策略、组件/布局边界、状态覆盖、响应式策略和验证结果。复核时界面应符合业务语境、视觉层级支持快速扫描、交互状态完整,并避免泛化模板感。
@@ -0,0 +1,110 @@
1
+ [
2
+ {
3
+ "id": "saas",
4
+ "keywords": ["saas", "b2b", "subscription", "crm", "admin", "console"],
5
+ "pattern": "Work-first dashboard with concise onboarding and persistent primary action",
6
+ "style": "data-dense",
7
+ "colorMood": "trustworthy neutrals with a clear action accent",
8
+ "typographyMood": "professional, compact, readable",
9
+ "motion": "quiet transitions for filters, drawers, and state changes",
10
+ "chart": "stat cards plus line/bar charts for trends and comparisons",
11
+ "risks": ["marketing hero replacing the workspace", "low-density cards hiding operational detail"],
12
+ "antiPatterns": ["decorative gradients as primary structure", "unlabeled icon-only tools"]
13
+ },
14
+ {
15
+ "id": "fintech",
16
+ "keywords": ["fintech", "bank", "finance", "crypto", "wallet", "invoice", "billing"],
17
+ "pattern": "Trust-first dashboard with balances, risk states, audit trail, and clear next actions",
18
+ "style": "minimal",
19
+ "colorMood": "stable blue/green neutrals with strict danger states",
20
+ "typographyMood": "precise, numeric, high contrast",
21
+ "motion": "subtle confirmation and risk feedback only",
22
+ "chart": "time-series, comparison bars, and tabular details with export paths",
23
+ "risks": ["playful visual language reducing trust", "color-only profit/loss communication"],
24
+ "antiPatterns": ["neon cyber styling for serious finance", "ambiguous destructive actions"]
25
+ },
26
+ {
27
+ "id": "healthcare",
28
+ "keywords": ["health", "medical", "clinic", "dental", "pharmacy", "patient", "therapy"],
29
+ "pattern": "Guided task flow with calm hierarchy, strong labels, and clear recovery paths",
30
+ "style": "minimal",
31
+ "colorMood": "calm accessible tones with clear warning and error roles",
32
+ "typographyMood": "human, readable, low fatigue",
33
+ "motion": "reassuring transitions, no surprise movement",
34
+ "chart": "progress trends and summaries with plain-language explanations",
35
+ "risks": ["low contrast calming palettes", "hidden labels in critical forms"],
36
+ "antiPatterns": ["decorative medical imagery over task clarity", "tiny touch targets"]
37
+ },
38
+ {
39
+ "id": "ecommerce",
40
+ "keywords": ["shop", "store", "ecommerce", "marketplace", "cart", "checkout", "product"],
41
+ "pattern": "Product-led browsing with strong media, filters, comparison, and checkout confidence",
42
+ "style": "editorial",
43
+ "colorMood": "brand-forward accents with neutral product surfaces",
44
+ "typographyMood": "clear commerce hierarchy with readable prices",
45
+ "motion": "fast hover/tap feedback and cart confirmation",
46
+ "chart": "only for seller dashboards or comparison analytics",
47
+ "risks": ["visual effects competing with product inspection", "unclear price/availability states"],
48
+ "antiPatterns": ["cropped product media", "hidden shipping or error feedback"]
49
+ },
50
+ {
51
+ "id": "creative",
52
+ "keywords": ["portfolio", "agency", "studio", "creator", "photography", "editorial"],
53
+ "pattern": "Portfolio-led narrative with memorable first viewport and selective case-study depth",
54
+ "style": "editorial",
55
+ "colorMood": "high-contrast neutrals with one expressive accent",
56
+ "typographyMood": "distinctive display with restrained body",
57
+ "motion": "purposeful reveals tied to content rhythm",
58
+ "chart": "rare; use visual timelines or case metrics when needed",
59
+ "risks": ["style overpowering work samples", "scroll theatrics blocking access"],
60
+ "antiPatterns": ["generic split hero", "decorative mockups without real work"]
61
+ },
62
+ {
63
+ "id": "wellness",
64
+ "keywords": ["spa", "beauty", "wellness", "meditation", "fitness", "booking", "lifestyle"],
65
+ "pattern": "Emotion-led service page with service clarity, trust proof, and low-friction booking",
66
+ "style": "soft",
67
+ "colorMood": "warm natural tones with a premium accent",
68
+ "typographyMood": "calm, elegant, approachable",
69
+ "motion": "gentle, short transitions with reduced-motion fallback",
70
+ "chart": "habit streaks or progress charts only when product-led",
71
+ "risks": ["pastel contrast failures", "luxury styling hiding booking details"],
72
+ "antiPatterns": ["overly bright wellness gradients", "placeholder stock atmosphere"]
73
+ },
74
+ {
75
+ "id": "education",
76
+ "keywords": ["education", "learning", "course", "student", "school", "flashcard"],
77
+ "pattern": "Learning path with progress, next task, feedback loops, and approachable empty states",
78
+ "style": "bento",
79
+ "colorMood": "encouraging accents with quiet surfaces",
80
+ "typographyMood": "friendly, readable, structured",
81
+ "motion": "reward moments and progress feedback, never distracting from reading",
82
+ "chart": "progress, mastery, and completion summaries",
83
+ "risks": ["gamification clutter", "unclear next lesson state"],
84
+ "antiPatterns": ["dense dashboards for beginners", "reward animation blocking tasks"]
85
+ },
86
+ {
87
+ "id": "gaming",
88
+ "keywords": ["game", "gaming", "esports", "arcade", "quest", "leaderboard"],
89
+ "pattern": "Immersive status-first interface with strong feedback and readable controls",
90
+ "style": "immersive",
91
+ "colorMood": "high-energy palette balanced by readable surfaces",
92
+ "typographyMood": "expressive headings with legible UI text",
93
+ "motion": "high feedback, strict performance budget",
94
+ "chart": "leaderboards, comparisons, progression, and match history",
95
+ "risks": ["motion overload", "stylized text reducing readability"],
96
+ "antiPatterns": ["all-caps tiny labels", "animations that delay input"]
97
+ },
98
+ {
99
+ "id": "data-dashboard",
100
+ "keywords": ["dashboard", "analytics", "metrics", "kpi", "monitoring", "reporting"],
101
+ "pattern": "Scan-first analytical workspace with filters, summaries, charts, and drill-down paths",
102
+ "style": "data-dense",
103
+ "colorMood": "semantic chart palette with restrained UI chrome",
104
+ "typographyMood": "compact, tabular, legible",
105
+ "motion": "state transitions only; no decorative chart animation by default",
106
+ "chart": "match chart to question: trend, compare, composition, distribution, funnel, timeline",
107
+ "risks": ["chart decoration hiding insight", "too many equal-weight cards"],
108
+ "antiPatterns": ["pie charts for many categories", "color-only series distinction"]
109
+ }
110
+ ]
@@ -0,0 +1,14 @@
1
+ [
2
+ { "stack": "react", "keywords": ["react", "vite", "spa"], "guidance": ["Keep visual components pure and prop-driven", "Split expensive lists and charts", "Use existing component and token conventions before adding UI primitives"] },
3
+ { "stack": "next", "keywords": ["next", "nextjs", "app router"], "guidance": ["Keep route shells and loading/error states explicit", "Prefer server components for static content and data shells", "Use client components only for interaction-heavy UI"] },
4
+ { "stack": "vue", "keywords": ["vue", "vue3"], "guidance": ["Use scoped components and composables for view logic", "Keep Pinia/global state out of purely local UI state", "Preserve SFC style boundaries"] },
5
+ { "stack": "nuxt", "keywords": ["nuxt"], "guidance": ["Use layouts for persistent UI chrome", "Align useFetch/useAsyncData states with loading and error UI", "Keep route middleware separate from component display logic"] },
6
+ { "stack": "svelte", "keywords": ["svelte"], "guidance": ["Use component-local reactivity for UI state", "Keep transitions meaningful and reduced-motion aware", "Avoid global stores for local interaction state"] },
7
+ { "stack": "astro", "keywords": ["astro"], "guidance": ["Use islands only where interaction is needed", "Keep marketing content fast and mostly static", "Prioritize image optimization and content hierarchy"] },
8
+ { "stack": "angular", "keywords": ["angular"], "guidance": ["Prefer standalone components", "Keep templates declarative", "Use CDK/a11y patterns for overlays and focus"] },
9
+ { "stack": "react-native", "keywords": ["react native", "rn", "mobile"], "guidance": ["Respect safe areas and platform gestures", "Use 44/48px touch targets", "Test dynamic type and screen reader labels"] },
10
+ { "stack": "flutter", "keywords": ["flutter"], "guidance": ["Prefer composition with small widgets", "Use theme tokens instead of per-screen styles", "Respect platform text scaling and safe areas"] },
11
+ { "stack": "threejs", "keywords": ["three", "threejs", "webgl", "3d"], "guidance": ["Make the primary scene full-bleed when it is the experience", "Provide DOM controls and accessible summaries", "Verify canvas is nonblank and resources dispose cleanly"] },
12
+ { "stack": "shadcn", "keywords": ["shadcn", "tailwind"], "guidance": ["Use shadcn components as accessible primitives", "Map theme variables before custom styling", "Avoid arbitrary utility soup when a token exists"] },
13
+ { "stack": "tailwind", "keywords": ["tailwind", "html"], "guidance": ["Keep mobile-first utilities", "Extract repeated class patterns into components", "Use semantic CSS variables for theme-critical color"] }
14
+ ]
@@ -0,0 +1,74 @@
1
+ [
2
+ {
3
+ "id": "minimal",
4
+ "keywords": ["minimal", "clean", "enterprise", "trust", "calm"],
5
+ "description": "Quiet surfaces, strong hierarchy, restrained accents, fast scanning.",
6
+ "tokens": { "radius": "4-8px", "shadow": "low", "density": "medium-high" },
7
+ "bestFor": ["enterprise", "finance", "healthcare", "documentation"],
8
+ "avoid": ["empty white space without information priority", "low-contrast gray text"]
9
+ },
10
+ {
11
+ "id": "editorial",
12
+ "keywords": ["editorial", "magazine", "portfolio", "brand", "luxury"],
13
+ "description": "Expressive typography, strong media, controlled asymmetry, narrative pacing.",
14
+ "tokens": { "radius": "0-8px", "shadow": "content-dependent", "density": "medium" },
15
+ "bestFor": ["creative", "ecommerce", "portfolio", "launch pages"],
16
+ "avoid": ["decorative text that harms reading", "media that hides the actual product"]
17
+ },
18
+ {
19
+ "id": "glass",
20
+ "keywords": ["glass", "modern", "ai", "overlay", "depth"],
21
+ "description": "Layered translucent surfaces used sparingly for hierarchy and focus.",
22
+ "tokens": { "radius": "12-20px", "shadow": "soft depth", "density": "medium" },
23
+ "bestFor": ["modern SaaS", "AI tools", "visualization"],
24
+ "avoid": ["blurred low-contrast text", "using blur as pure decoration"]
25
+ },
26
+ {
27
+ "id": "brutalist",
28
+ "keywords": ["brutalist", "raw", "bold", "youth", "experimental"],
29
+ "description": "Hard edges, bold contrast, visible structure, intentionally direct composition.",
30
+ "tokens": { "radius": "0-4px", "shadow": "hard or none", "density": "variable" },
31
+ "bestFor": ["creative campaigns", "youth brands", "experimental portfolios"],
32
+ "avoid": ["serious regulated workflows", "inaccessible contrast or chaotic navigation"]
33
+ },
34
+ {
35
+ "id": "bento",
36
+ "keywords": ["bento", "cards", "modular", "features", "education"],
37
+ "description": "Modular information blocks with varied scale and clear grouping.",
38
+ "tokens": { "radius": "8px or less unless system differs", "shadow": "subtle", "density": "medium" },
39
+ "bestFor": ["feature overviews", "learning paths", "product summaries"],
40
+ "avoid": ["card-inside-card layouts", "equal-weight modules that hide priority"]
41
+ },
42
+ {
43
+ "id": "data-dense",
44
+ "keywords": ["dashboard", "analytics", "table", "monitoring", "dense"],
45
+ "description": "Operational density, table/chart alignment, semantic color, stable controls.",
46
+ "tokens": { "radius": "4-8px", "shadow": "minimal", "density": "high" },
47
+ "bestFor": ["dashboards", "admin", "monitoring", "analytics"],
48
+ "avoid": ["marketing hero screens", "large decorative cards"]
49
+ },
50
+ {
51
+ "id": "immersive",
52
+ "keywords": ["immersive", "game", "3d", "canvas", "story", "visualization"],
53
+ "description": "Full-bleed visual space with controls that remain predictable and readable.",
54
+ "tokens": { "radius": "contextual", "shadow": "scene-driven", "density": "low-medium" },
55
+ "bestFor": ["games", "3D previews", "interactive visualization"],
56
+ "avoid": ["framing the primary scene in a decorative card", "controls hidden by atmosphere"]
57
+ },
58
+ {
59
+ "id": "mobile-native",
60
+ "keywords": ["mobile", "app", "native", "touch", "safe-area"],
61
+ "description": "Touch-first layout with platform-safe spacing, clear feedback, and resilient text scaling.",
62
+ "tokens": { "radius": "platform-consistent", "shadow": "native elevation", "density": "touch-comfortable" },
63
+ "bestFor": ["mobile apps", "responsive tools", "field workflows"],
64
+ "avoid": ["hover-only behavior", "content behind safe areas"]
65
+ },
66
+ {
67
+ "id": "soft",
68
+ "keywords": ["soft", "wellness", "beauty", "calm", "organic"],
69
+ "description": "Warm surfaces, gentle contrast, tactile spacing, and calm interaction rhythm.",
70
+ "tokens": { "radius": "8-16px", "shadow": "soft", "density": "low-medium" },
71
+ "bestFor": ["wellness", "beauty", "lifestyle", "care services"],
72
+ "avoid": ["pastel contrast failures", "vague atmospheric imagery over real services"]
73
+ }
74
+ ]
@@ -0,0 +1,56 @@
1
+ [
2
+ {
3
+ "category": "accessibility",
4
+ "priority": "critical",
5
+ "checks": ["Text contrast meets WCAG AA", "Focus rings are visible", "Icon-only controls have names", "Keyboard order follows visual order"],
6
+ "avoid": ["Removing outlines globally", "Color-only error or success states"]
7
+ },
8
+ {
9
+ "category": "interaction",
10
+ "priority": "critical",
11
+ "checks": ["Primary controls respond within 100ms", "Touch targets are at least 44x44px", "Disabled states are semantic and visible"],
12
+ "avoid": ["Hover-only primary actions", "Tap targets packed without spacing"]
13
+ },
14
+ {
15
+ "category": "performance",
16
+ "priority": "high",
17
+ "checks": ["Images reserve dimensions", "Large lists are virtualized", "Animations use transform/opacity", "Heavy visual work is deferred or moved off main thread"],
18
+ "avoid": ["Animating layout properties", "Unbounded chart or table rendering"]
19
+ },
20
+ {
21
+ "category": "layout",
22
+ "priority": "high",
23
+ "checks": ["375/768/1024/1440px layouts are checked", "No horizontal overflow", "Fixed headers/footers reserve content space"],
24
+ "avoid": ["Desktop-first max-width fixes", "Nested scroll regions without reason"]
25
+ },
26
+ {
27
+ "category": "typography",
28
+ "priority": "medium",
29
+ "checks": ["Body text stays readable", "Line length is controlled", "Numbers use tabular figures where alignment matters"],
30
+ "avoid": ["Tiny low-contrast labels", "Negative tracking on body text"]
31
+ },
32
+ {
33
+ "category": "animation",
34
+ "priority": "medium",
35
+ "checks": ["Micro-interactions are 150-300ms", "Exit is faster than enter", "Reduced motion is respected"],
36
+ "avoid": ["Decorative motion without cause", "Blocking input during transitions"]
37
+ },
38
+ {
39
+ "category": "forms",
40
+ "priority": "medium",
41
+ "checks": ["Labels are persistent", "Errors appear near fields", "Submit has loading/success/error feedback", "First invalid field receives focus"],
42
+ "avoid": ["Placeholder-only labels", "Error summary without field recovery"]
43
+ },
44
+ {
45
+ "category": "navigation",
46
+ "priority": "high",
47
+ "checks": ["Current location is visible", "Back behavior preserves state", "Primary navigation remains reachable"],
48
+ "avoid": ["Mixing multiple primary nav systems", "Using modals for primary navigation"]
49
+ },
50
+ {
51
+ "category": "charts",
52
+ "priority": "medium",
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
+ "avoid": ["Pie charts for many categories", "Color-only series distinction"]
55
+ }
56
+ ]
@@ -0,0 +1,37 @@
1
+ # 设计智能参考
2
+
3
+ 本参考用于把模糊的 UI 请求转成可执行设计系统。先识别产品类别,再组合风格原型、色彩角色、字体情绪、动效节奏、图表任务和 UX 风险。
4
+
5
+ ## 决策流程
6
+
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. 输出反模式:每个设计建议必须附带“不要做什么”,避免落入通用模板。
14
+
15
+ ## 何时运行生成器
16
+
17
+ 使用以下命令生成设计系统建议:
18
+
19
+ ```bash
20
+ node skills/fec-ui-design/scripts/design-system.mjs "beauty spa booking" --project "Serenity Spa"
21
+ ```
22
+
23
+ 输出 Markdown 适合贴入计划或 PR 描述;输出 JSON 适合测试或工具消费:
24
+
25
+ ```bash
26
+ node skills/fec-ui-design/scripts/design-system.mjs "fintech analytics dashboard" --format json --stack next
27
+ ```
28
+
29
+ ## 输出必须回答
30
+
31
+ - 这个界面的主任务是什么?
32
+ - 推荐哪种页面结构或工作区结构?
33
+ - 视觉锚点是什么,为什么贴合业务?
34
+ - 主风格、字体、色彩、动效分别服务什么目标?
35
+ - 图表和数据密度如何处理?
36
+ - 哪些反模式必须避免?
37
+ - 上线前最小 QA 清单是什么?
@@ -0,0 +1,30 @@
1
+ # 全局/页面级差异覆盖
2
+
3
+ 当项目需要长期保持 UI 一致性时,用 `design-system/MASTER.md` 存放全局设计系统,用 `design-system/pages/<page>.md` 存放页面级差异。
4
+
5
+ ## 读取顺序
6
+
7
+ 1. 先检查当前页面是否有 `design-system/<project>/pages/<page>.md`。
8
+ 2. 如果存在,页面文件里的规则覆盖 Master 中相同维度。
9
+ 3. 如果不存在,完全遵循 `design-system/<project>/MASTER.md`。
10
+ 4. 页面文件只记录差异,不复制 Master 全文。
11
+
12
+ ## 生成命令
13
+
14
+ ```bash
15
+ node skills/fec-ui-design/scripts/design-system.mjs "saas analytics dashboard" --project "Acme Console" --persist --output-dir .
16
+ ```
17
+
18
+ 生成页面 overrides:
19
+
20
+ ```bash
21
+ node skills/fec-ui-design/scripts/design-system.mjs "saas analytics dashboard" --project "Acme Console" --page dashboard --persist --output-dir .
22
+ ```
23
+
24
+ ## 页面 override 应包含
25
+
26
+ - 页面任务和信息密度差异
27
+ - 布局差异:工作区、表格、图表、表单、详情页或营销首屏
28
+ - token 差异:只写需要覆盖的语义色、间距、状态或图表色
29
+ - 组件差异:只写当前页面新增或改变的组件行为
30
+ - QA 焦点:当前页面最容易出错的响应式、可访问性、性能或交互风险
@@ -0,0 +1,33 @@
1
+ # UI/UX 交付前检查
2
+
3
+ ## 严重
4
+
5
+ - 文本对比度:正文至少 4.5:1,大字号至少 3:1。
6
+ - 键盘可达:菜单、弹窗、标签页、抽屉和自定义控件都能键盘操作。
7
+ - 焦点可见:focus ring 不能被全局样式移除。
8
+ - 图标按钮:必须有可访问名称。
9
+ - 触摸目标:移动端主要交互至少 44x44px;空间允许时使用 48px。
10
+
11
+ ## 高优先级
12
+
13
+ - 首屏:工具型界面直接展示核心工作区,不用营销 hero 替代功能。
14
+ - 响应式:375px、768px、1024px、1440px 无水平溢出、遮挡或文本截断。
15
+ - 性能:图片有尺寸或 aspect-ratio;非首屏图片懒加载;列表过大时虚拟化。
16
+ - 动效:只动画 transform/opacity,尊重 `prefers-reduced-motion`。
17
+ - 状态:loading、empty、error、disabled、hover、focus、selected 都有设计。
18
+
19
+ ## 中优先级
20
+
21
+ - 字体:正文不小于 16px;数字列、金额、计时器使用 tabular nums。
22
+ - 颜色:错误、成功、警告不只靠颜色表达。
23
+ - 表单:label 常驻,错误靠近字段,提交后有 loading/success/error。
24
+ - 导航:当前路由可识别,返回行为可预测,深层页面仍能回到主路径。
25
+ - 图表:有标题、单位、图例、tooltip 或明细表替代,色彩不依赖红绿区分。
26
+
27
+ ## 反模式
28
+
29
+ - 用装饰光斑、紫色渐变、卡片堆叠掩盖信息结构不足。
30
+ - hover 导致布局位移。
31
+ - `transition: all`、`will-change: all`。
32
+ - 低对比灰字、无意义透明度、单一色相界面。
33
+ - 空状态只有“暂无数据”,没有下一步动作。