@ui-code-agent/capability-pack 0.1.66

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 (35) hide show
  1. package/AGENTS-static.md +354 -0
  2. package/AGENTS.md +573 -0
  3. package/SKILL.md +377 -0
  4. package/package.json +20 -0
  5. package/specs/code-style.md +227 -0
  6. package/specs/data-conversion-empty.md +144 -0
  7. package/specs/data-implementation/group.md +180 -0
  8. package/specs/data-implementation/list.md +136 -0
  9. package/specs/data-implementation/stat.md +167 -0
  10. package/specs/data-implementation/workflow.md +155 -0
  11. package/specs/data-implementation.md +519 -0
  12. package/specs/data-integration.md +507 -0
  13. package/specs/data-plan.template.json +113 -0
  14. package/specs/design-style.md +53 -0
  15. package/specs/page-patterns.md +110 -0
  16. package/specs/portal-page.md +441 -0
  17. package/specs/portal-references/catalog.md +77 -0
  18. package/specs/portal-references/full-captures/pc-portal-asset-management.png +0 -0
  19. package/specs/portal-references/full-captures/pc-portal-ecode.png +0 -0
  20. package/specs/portal-references/full-captures/pc-portal-info-security.png +0 -0
  21. package/specs/portal-references/full-captures/pc-portal-jingqiaotong.png +0 -0
  22. package/specs/portal-references/full-captures/pc-portal-jiuchuihui.png +0 -0
  23. package/specs/portal-references/full-captures/pc-portal-job.png +0 -0
  24. package/specs/portal-references/full-captures/pc-portal-knowledge.png +0 -0
  25. package/specs/portal-references/full-captures/pc-portal-marketing.png +0 -0
  26. package/specs/portal-references/full-captures/pc-portal-organization.png +0 -0
  27. package/specs/portal-references/full-captures/pc-portal-party-government.png +0 -0
  28. package/specs/portal-references/full-captures/pc-portal-project.png +0 -0
  29. package/specs/portal-references/full-captures/pc-portal-sales-report.png +0 -0
  30. package/specs/static-visual.md +66 -0
  31. package/specs/ui-interaction.md +139 -0
  32. package/specs/ui-visual.md +194 -0
  33. package/static-html/frontend-design/LICENSE.txt +177 -0
  34. package/static-html/frontend-design/SKILL.md +55 -0
  35. package/static-html/frontend-design/SOURCE.txt +3 -0
@@ -0,0 +1,139 @@
1
+ # UI 组件选型与交互规范(需求 → 组件 → 规则)
2
+
3
+ > status: **draft(已补充已确认规则,仍待前端/设计团队评审)** | 消费方式:agent 在实现步通过
4
+ > `ui-code-agent spec ui-interaction` 读取。条目格式固定为“场景 / 规范 / 禁止”,
5
+ > 可机器判定的条款会逐步下沉为 validate 规则。
6
+ >
7
+ > 组件名必须是当前 `@weapp/ui` 真实导出;组件 API、默认值和事件签名以当前源码与 demo
8
+ > 为准,禁止按本文或模型记忆猜 props。
9
+ >
10
+ > **当前范围:PC。移动端规范待后续专项取样后补充,本阶段不据 PC 页面推断 H5 规则。**
11
+
12
+ ## 实现前判定
13
+
14
+ | 场景 | 规范 | 禁止 |
15
+ | -------- | --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
16
+ | 需求拆解 | 先提取页型、对象、信息层级、数据量、操作、反馈、权限和跳转目标;缺失项写入假设或待确认 | 禁止只按“好看/简洁/高级”等形容词直接生成页面 |
17
+ | 平台判定 | 当前仅按 PC 规范实现;出现移动端/H5要求时标记为后续范围并向用户说明 | 禁止把 PC 结构或组件直接推断为移动端方案 |
18
+ | 页型判定 | 再判断门户 / 列表 / 表单 / 详情,并按 `spec page-patterns` 对号入座 | 禁止列表页做成表单堆叠或门户首页;禁止门户页退化成纯表格页 |
19
+ | 组件选型 | 先查 `@weapp/ui`,再看 demo 和 source;无标准组件时才允许原生 React 兜底并在 `plan.json` 说明 | 禁止用自造控件替代已有组件,尤其是 Browser、日期、上传、搜索、表格、弹层 |
20
+ | API 落实 | 组件名确认后继续核对 import、props、事件、空态和 loading 用法;文档、source、demo 冲突时以当前 source 为准 | 禁止只确认组件名就猜参数;禁止把页面 class 名当公开 API |
21
+ | 视觉取值 | 文字默认 E10 的颜色、字体、间距、圆角、边框、阴影优先使用 `var.css` 语义变量;按图还原或使用额外资料时按 `spec design-style --dir <工程>` | 文字默认 E10 禁止无依据硬编码品牌色/灰阶或混入大圆角、金色、深色营销风;按图还原或使用额外资料时按所选设计依据 |
22
+
23
+ ## 页面结构与信息组织
24
+
25
+ | 场景 | 规范 | 禁止 |
26
+ | ------------ | ------------------------------------------------------------------ | ------------------------------------------------------------- |
27
+ | 通用页面结构 | 页面按导航/搜索或工具区/主内容/操作区分层;同层级模块保持一致间距 | 禁止无分区堆叠;禁止为装饰感牺牲信息浏览效率 |
28
+ | 业务模块容器 | 优先清晰卡片或区块;E10 标准风使用无圆角或平台小圆角,间距取平台档位 | 禁止无业务意义 Banner;文字默认 E10 避免大面积装饰图、夸张渐变和悬浮小卡片堆叠,按图还原或使用额外资料时按设计依据 |
29
+
30
+ ## 需求语义 → 组件选择
31
+
32
+ | 需求描述或证据 | 规范组件与规则 | 禁止 |
33
+ | ---------------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- |
34
+ | 反向识别已有页面 | 遍历整棵 DOM,按 `ui-*` / `weapp-ui-*` 的组件根 class 归一;保留 `Layout` 内嵌的 `Menu` / `List` / `Spin` 等不同组件 | 禁止只取页面最外层组件;禁止把同组件的 item、尺寸、active 等子 class 重复算成组件;`ebcom-*` 只作编排证据 |
35
+ | 行列、分栏、栅格、左右结构 | portal 可用自定义 Grid/Flex;采用 `Layout.Row/Col` 时列宽和断点以 source/demo 为准 | 禁止在同一区域混用互相冲突的布局轨道 |
36
+ | 导航树、侧栏菜单、分级入口 | 使用 `Menu`;面包屑使用 `BreadCrumb`;大量同级页签可核对 `SlideTabs` | 禁止用普通列表伪装菜单;禁止无层级混排导航和业务内容 |
37
+ | 门户流程、审批、待办/已办 | 必须 inspect `WorkflowListStandalone`;公开契约匹配时默认使用,只有需求冲突或 MCP 证明不适配时才自定义 | 禁止因 Mock、Preview limited、自定义更快或轻微外观差异放弃组件 |
38
+ | 门户文档、知识、新闻中心 | 必须 inspect `DocListStandalone`;公开契约匹配时默认使用,只有需求冲突或 MCP 证明不适配时才自定义 | 禁止因 Mock、Preview limited、自定义更快或轻微外观差异放弃组件 |
39
+ | 无匹配业务组件的轻量重复信息 | 普通展示可自定义 JSX;带查询、分页、复杂行结构时调研 `ListView` | 禁止为了组件覆盖率增加无业务意义的组件 |
40
+ | 明确列结构、排序或分页 | 使用 `Table`;可编辑表格使用 `EditableTable` | 禁止用空格对齐列;禁止重复实现表格、排序和分页 |
41
+ | 轮播、焦点图、多张 Banner | 使用 `Carousel`;只有一张图时直接展示,不伪造轮播控件 | 禁止自写定时器和轮播状态 |
42
+ | 快捷应用入口 | 使用 `Icon` + 文本或 `Button`;只有需求或源码明确给出模块/自定义图标标识时才查证 `AppIcon` | 禁止用图片和裸 div 伪造可交互按钮,禁止把 `AppIcon` 当通用入口宫格 |
43
+ | 指标数字、统计卡 | 外壳可自定义;静态展示图表可用 SVG,需要 tooltip、缩放、图例联动等复杂行为时调研 `EChart` | `Digital` 是数字分身组件,禁止按名称猜成指标数字;禁止引入未批准的另一套图表库 |
44
+ | 日期、日程、步骤、时间线 | 分别核对 `DatePicker` / `Calendar` / `Steps` / `Timeline` | 禁止根据外观相似随意混用 |
45
+ | 人员、部门、流程等对象选择 | 使用 `Browser`;人员摘要用 `Avatar`,有真实人员 ID 时再核对 `HrmCard` | 禁止自造组织选择器、手写首字头像、伪造人员 ID 或用普通输入框伪装 |
46
+ | 表单、上传、长文本 | 使用 `Form` / `FormItem`、`Upload`、`Textarea`;控件按字段语义选择 | 禁止裸控件无 label、校验和错误反馈地堆叠 |
47
+ | 加载、骨架、空数据、错误 | 使用 `Spin` / `Skeleton` / `Empty`;错误原位说明并提供重试 | 禁止长白屏、静默失败或把错误伪装成空数据 |
48
+ | 返回顶部、内容滚动 | 长内容按 demo 使用 `Scroller` / `BackTop`;页面保持一个明确主滚动容器 | 禁止多层无必要滚动或自造悬浮返回按钮 |
49
+ | 需求没有对应标准组件 | portal 视觉外壳可直接使用受限 React/JSX/CSS;复杂标准业务控件缺失时再记录能力缺口 | 禁止为了组件覆盖率加入无业务意义的组件 |
50
+
51
+ ### 图表类型识别
52
+
53
+ 用户文字、截图或数据语义出现柱状图、饼状图、环形图、折线图、堆积柱图、条形图、堆积条图、
54
+ 旭日图或其他图表时先判断交互边界。截图复刻、Mock 摘要或纯静态趋势/占比展示
55
+ 可以使用自定义 SVG;需要 tooltip、缩放、图例联动、动态系列或复杂数据更新时,才通过当前
56
+ `ui-code-mcp` 核验 `EChart` 的 symbol、props、数据结构和 Demo。采用 `EChart` 后不得因为本地
57
+ Preview 无真实数据而换成另一套实现。
58
+
59
+ ## 检索与筛选
60
+
61
+ | 场景 | 规范 | 禁止 |
62
+ | -------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
63
+ | PC 多条件搜索 | 用 `SearchAdvanced`:常用条件外露,更多条件展开;条件与结果字段对应 | 禁止裸 `Input + Button` 自造高级搜索 |
64
+ | PC 单字段关键词搜索 | 用 `Input` 承载关键词;需要显式触发时配一个标准 `Button`,回车与按钮统一走同一查询入口 | 禁止把 `SearchGroup` 当普通关键词框;禁止为单字段搜索套用完整高级搜索面板 |
65
+ | PC 简单分组/折叠条件 | 用 `SearchGroup`;它用于条件分组与面板展开收起,不是通用单字段搜索框 | 禁止把 `SearchGroup` 当作普通关键词输入框 |
66
+ | PC 日期快速筛选 | 用 `DateQuickFilter`;日期区间用 `DatePicker isRange`;精确日期/时间录入用 `DatePicker` / `DateTimePicker` / `TimePicker` | 禁止手写两个输入框拼日期区间;禁止文本框手输日期 |
67
+ | 筛选状态 | 默认展示可交互态;仅在真实不可用或请求提交期间进入 disabled/loading | 禁止用 disabled 或超低对比度状态做静态占位 |
68
+ | 搜索联动 | 搜索、分页、排序、重置统一走同一查询入口;条件变化后按业务约定重置页码 | 禁止多套请求状态互相覆盖;禁止重置筛选后保留失效页码 |
69
+
70
+ ## 列表与数据展示
71
+
72
+ | 场景 | 规范 | 禁止 |
73
+ | ----------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
74
+ | PC 分页列表 | 使用 `Table`(含分页配置)或业务列表 `ListView`;列表、搜索、分页保持联动 | 禁止手写分页 UI 和重复实现表格能力 |
75
+ | 大数据量 | 使用 `Table` 已有虚拟滚动/按需加载能力,具体 API 以 source 为准 | 禁止一次渲染全量行 |
76
+ | 列宽分配 | 表头与数据行复用同一列定义;定长列和操作列固定宽度,名称/标题/描述等主字段可伸缩;总宽度填满内容区 | 禁止表头与数据行错列;禁止操作列伸缩;禁止右侧留下大块无意义空白 |
77
+ | 内容溢出 | 单行内容超宽时省略号截断并保留可查看完整内容的入口;多于一行时切双行变体或卡片列表 | 禁止文字、图标越过容器或直接贴边 |
78
+ | 宽表 | 列数超过 8 时优先横向滚动;次要列可收进详情面板 | 禁止强行压缩到不可读;禁止缩窄操作列 |
79
+ | 行结构 | 所有行/单元格有平台间距档位的内边距;时间与操作通常置于末列 | 禁止直接把裸文本当列结构导致无法对齐 |
80
+ | 状态展示 | 状态标签按成功/警告/危险/信息语义区分,文字默认 E10 使用平台色彩变量或标准 `Tag` 能力,按图还原或使用额外资料时沿用所选风格的状态色 | 禁止所有业务状态使用同一种颜色 |
81
+ | 空数据 | 使用 `Empty`,文案说明当前结果并在合适时提供下一步入口 | 禁止空白区域或仅写“暂无数据” |
82
+ | 加载中 | 区域加载使用 `Spin`;首屏结构稳定且内容加载较慢时使用 `Skeleton` | 禁止无反馈长白屏;禁止一次局部请求锁死整页 |
83
+ | 加载失败 | 在失败区域展示原因与重试入口;门户卡片独立维护 loading/empty/error,单卡失败不影响其他卡片 | 禁止静默失败;禁止一个卡片失败导致整页不可用 |
84
+ | 权限不足 | 按安全约束隐藏不可见内容,或在原区域展示明确的无权限状态;不得泄露受限数量、摘要和操作 | 禁止用 `Empty` 冒充无数据;禁止先渲染敏感信息再由前端遮挡 |
85
+
86
+ ## 操作与反馈
87
+
88
+ | 场景 | 规范 | 禁止 |
89
+ | --------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------- |
90
+ | 删除/不可逆操作 | 使用 `Dialog.confirm`;说明对象与影响,确认操作使用 danger 语义 | 禁止点击即删;禁止 `window.confirm`;禁止含糊的“是否确定”而不说明后果 |
91
+ | 轻量结果反馈 | 使用 `Dialog.message`;成功简洁确认,失败说明原因并给出可恢复动作 | 禁止静默成功/失败;禁止为轻提示自造浮层 |
92
+ | 新建/编辑入口 | 放在页面主操作区;一个页面仅一个视觉主操作 `Button type="primary"` | 禁止多个 primary 并列争抢层级 |
93
+ | 批量操作 | 使用 `BatchOperator`;仅在存在选中项时展示或启用相关动作 | 禁止自造批量选择条;禁止未选择数据就执行批量动作 |
94
+ | 提交/保存 | 校验通过后提交;提交期间显示 loading 并防重复触发;完成后恢复可操作状态 | 禁止重复提交;禁止把未接接口的按钮长期伪装成 disabled 占位 |
95
+ | 同级页签过多 | 核对 `SlideTabs` 或提供左右切换/更多入口;低频项可收进菜单 | 禁止压缩到文字重叠或溢出容器 |
96
+
97
+ ## 表单与录入
98
+
99
+ | 场景 | 规范 | 禁止 |
100
+ | -------------------- | ------------------------------------------------------------- | --------------------------------------------------- |
101
+ | 完整业务表单 | 优先 `Form`;简单表单用 `FormItem` + 标准控件;字段按业务分组 | 禁止裸控件无 label、校验与错误说明地堆叠 |
102
+ | 人员/部门/流程等选择 | 使用 `Browser` | **禁止自造人员/组织选择器或用纯输入框伪装 Browser** |
103
+ | 日期时间 | 使用 `DatePicker` 及其已导出变体,具体 type/API 以 source 为准 | 禁止文本输入模拟日期控件 |
104
+ | 文件上传 | 使用 `Upload` | 禁止裸 `input[type=file]` |
105
+ | 字段较多 | 字段超过 15 个时分组;仍过长时改为分步表单 | 禁止单屏无层级堆叠大量字段 |
106
+ | 长标签 | 中文标签超过 6 字时优先上下布局,备选是增加统一标签宽度 | 禁止单个字段临时改宽导致整组错位 |
107
+ | 校验反馈 | 字段级错误贴近字段展示;提交级失败在操作区或消息层说明原因 | 禁止只在控制台报错;禁止清空用户已输入内容 |
108
+ | 未保存离开 | 有实际修改且尚未保存时提示确认(统一组件与触发边界待团队确认) | 禁止无提示丢失已编辑内容 |
109
+
110
+ ## 人员身份展示
111
+
112
+ | 场景 | 规范 | 禁止 |
113
+ | ----------------------- | -------------------------------------------------------- | ------------------------------------------------- |
114
+ | Mock 姓名、无人员 ID | 使用 `Avatar` 的 name fallback,姓名不可触发人员卡片 | 编造 ID、手写首字圆形头像、发起必然失败的人员请求 |
115
+ | 真实人员 ID + 头像 | 使用 `Avatar` 正式人员能力,props 以当前 MCP 为准 | 用 CSS 圆形文字替代组件 |
116
+ | 真实人员 ID + PC 小卡片 | 查询并使用 `HrmCard.openHrmCard(...)` 当前公开签名 | 复制历史方法签名或从名称猜参数 |
117
+ | 明确打开完整人员页 | 查询并使用 `HrmCard.openHrmSP(...)` 当前公开签名 | 把小卡片调用冒充完整详情 |
118
+ | 移动端人员卡片 | 查询并使用 `HrmCard.openMobileHrmCard(...)` 当前公开签名 | 在 PC/移动端之间猜测复用 |
119
+
120
+ `Avatar/HrmCard` 的 props、方法和 Demo 都属于当前 `ui-code-mcp` 动态事实。编码前按能力簇查询,
121
+ 只在有合法人员 ID 时绑定 HrmCard 交互;本规范只固定选择语义,不保存版本化 API 副本。
122
+
123
+ ## 通用禁止清单
124
+
125
+ - 不要把真实可用的组件渲染成 disabled 态占位。
126
+ - 不要在同一功能区混用同一组件的多种高度、圆角或图标尺寸。
127
+ - 文字默认 E10 不要使用 token 表和当前 `var.css` 都未定义的色值;按图还原或使用额外资料时的色彩按 `spec design-style --dir <工程>`。
128
+ - 不要手动生成或猜测 `weId`;仅在脚手架或周边代码明确要求时沿用既有规范。
129
+ - 不要为了“更好看”改变 E10 标准业务页的页型、信息层级和操作顺序。
130
+ - 不要根据 PC 页面自行补写移动端布局与交互;移动端规范待后续专项分析。后续实现优先使用
131
+ `MButton` 等 M 系列标准组件,不将 PC 组件直接搬到移动端或与其混用。
132
+
133
+ ## 待团队确认
134
+
135
+ - 抽屉与弹窗的统一选用边界;
136
+ - `Skeleton` 的统一适用边界;
137
+ - PC 通知类组件与默认展示时长;
138
+ - 未保存离开确认的统一触发范围;
139
+ - `specs.xlsx` 中主色、栅格列数与当前 `var.css` / 现有 24 栅格规范的冲突处理结论。
@@ -0,0 +1,194 @@
1
+ # UI 展示规范(视觉一致性)
2
+
3
+ > status: **draft(已补充已确认规则,仍待前端/设计团队评审)** | 消费方式:`ui-code-agent spec ui-visual`。
4
+ >
5
+ > 本规范只约束页面的视觉呈现。场景、组件选型和操作反馈见 `spec ui-interaction`,
6
+ > 页型与页面载体见 `spec page-patterns`;PC 门户主体骨架和组合见 `spec portal-page`。
7
+ > 原则:一切视觉值必须来自平台 CSS 变量(weapp-ui 的 var.css / componentVar.css),
8
+ > 原生 React 兜底实现也必须贴这些变量 —— 这是"原生兜底不破坏视觉一致"的唯一保障。
9
+
10
+ ## 事实源与使用原则
11
+
12
+ 视觉事实按以下优先级判定,低优先级资料不得覆盖高优先级事实:
13
+
14
+ 1. 当前项目实际加载的主题变量;
15
+ 2. 当前 `weapp-ui/src/style/var.css`、`componentVar.css` 与组件样式源码;
16
+ 3. 当前 `weapp-ui` demo 和组件文档;
17
+
18
+ | 场景 | 规范 | 禁止 |
19
+ | ---------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
20
+ | 标准组件 | 优先使用 `@weapp/ui` 组件及其公开能力;默认不满足本次已选 E10 参考时按“组件视觉适配升级”处理 | 禁止用自定义 DOM 重做已有组件;禁止无证据、无作用域地覆盖内部样式 |
21
+ | 自定义区域 | 仅在无标准组件时使用业务容器;颜色、字体、间距、边框、圆角和阴影均取平台变量 | 禁止复制变量当前色值为硬编码;禁止在业务 CSS 中创建第二套设计系统 |
22
+ | 主题适配 | 始终引用语义变量,由主题负责实际值;提交前在项目真实主题下检查 | 禁止假定 `--primary` 永远等于某个十六进制色值 |
23
+ | 缩放与密度 | 长度优先用已有变量;无对应变量时使用 `calc(N * var(--hd))`;受最大密度限制的图标等沿用 `--max-hd` 变量 | 禁止大量裸 `px`;禁止自行修改 `--hd`、`--max-hd` 或组件变量 |
24
+
25
+ ## 色彩
26
+
27
+ ### 基础与文字色
28
+
29
+ | 用途 | 使用变量 | 展示要求 |
30
+ | ------------------------ | ----------------------------------------------- | ------------------------------------------------- |
31
+ | 主题、链接、选中、主操作 | `--primary`、`--primary-rgb`、`--link-fc` | 同一视区只突出最重要层级;链接与可操作文字保持统一 |
32
+ | 主文字 | `--main-fc` | 标题、关键数据、主要正文 |
33
+ | 常规文字 | `--regular-fc` | 普通正文、表单标签、常规说明 |
34
+ | 次要文字 | `--secondary-fc` | 时间、元信息、辅助说明;不得承担关键结论 |
35
+ | 占位与失效文字 | `--placeholder-fc`、`--invalid-fc`、`--disable` | 只用于真实占位、失效或禁用状态 |
36
+ | 反色文字 | `--white-fc`、`--black-fc` | 仅在对应深/浅背景确保对比度时使用 |
37
+
38
+ ### 状态与背景
39
+
40
+ | 用途 | 使用变量 | 展示要求 |
41
+ | -------------- | -------------------------------------------------------------------- | --------------------------------------------- |
42
+ | 成功 | `--success` | 已完成、正常、通过等正向状态 |
43
+ | 警告 | `--warning` | 待处理、有风险但仍可继续的状态 |
44
+ | 危险 | `--danger` | 错误、失败、删除及不可逆操作 |
45
+ | 信息 | `--info` | 中性提示和信息状态 |
46
+ | 页面/区域背景 | PC 优先 `--bg-base`、`--bg-gray`、`--bg-white`;H5 可用 `--m-bg-base` | 页面背景、内容面板和控件表面须形成稳定层级 |
47
+ | 悬停/按下/选中 | `--hover-bc`、`--bg-tap`、`--label-bc-active` | 只用于对应状态,不得作为大面积静态装饰 |
48
+ | 遮罩/轻提示 | `--mask-bc`、`--tip-bc` | 复用标准弹层;不要在业务层另配透明黑 |
49
+ | 高亮 | `--highlight-color`、`--highlight-bg` | 仅用于搜索命中等短时局部强调,不得替代危险语义 |
50
+
51
+ - 禁止硬编码品牌蓝、`#333/#666/#999` 等灰阶、状态色和透明蒙层。
52
+ - 禁止只用颜色传达状态;状态同时使用文字、图标或结构标识。
53
+ - 禁止使用 token 表和当前源码都未定义的颜色,包括随意渐变和金色。
54
+ - 正文、控件、边框与背景须保持可辨识对比;低对比度只允许真实禁用或占位态。
55
+
56
+ ## 字体与文本
57
+
58
+ | 条目 | 规范 | 禁止 |
59
+ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
60
+ | 字体族 | 常规内容使用 `--regular-ff`;需要强调时使用 `--medium-ff` / `--bold-ff` | 禁止自引字体;禁止用同一字体族内不存在的字重模拟 |
61
+ | 字号 | 优先使用语义变量:`--font-size-base` 正文、`--font-size-caption-sm` 辅助标题、`--font-size-subhead` 次标题、`--font-size-caption` 标题、`--font-size-heading` 页头 | 禁止硬编码字号;禁止无层级地混用多个字号 |
62
+ | 补充字号 | 语义变量不足且与组件一致时使用 `--font-size-10/12/14/15/16/17/18` | 禁止超出平台字号档位 |
63
+ | 字重 | 正文 `--font-weight-base`;强调内容 `--font-weight-bold`;谨慎使用 `--font-weight-thin` | 禁止仅靠放大或全局加粗制造层级 |
64
+ | 行高 | 先保留标准组件默认行高并在 Preview 读取 computed value;门户明确目标 `12/18`、`14/20`、`16/24` 不匹配时使用 `calc(18/20/24 * var(--hd))` 或有证据的组件适配;段落可沿用实测匹配的 `--line-height-paragraph` | 禁止仅凭变量名假定最终行高;禁止文字贴边、行间重叠或用固定高度裁切多行内容 |
65
+ | 对齐 | 中文正文左对齐;数值列按表格既有模式统一;同组标签和字段值统一基线 | 禁止同列混用不同对齐方式;禁止靠空格对齐 |
66
+ | 溢出 | 单行标题/名称可省略并提供查看完整内容的方式;正文按业务允许换行 | 禁止溢出容器;禁止重要信息无提示截断 |
67
+
68
+ 视觉层级按“页面标题 → 区块标题 → 正文/字段值 → 辅助信息”递减。同级内容使用同一
69
+ 字号、字重和颜色。
70
+
71
+ 语义 token 名称不是目标值的证明。当前运行时中的 `--line-height-sm` 可能计算为与门户
72
+ `12/18` 不同的值;不能因为名称含 `sm` 就直接采用。最终以目标元素的 computed
73
+ `font-size`、`line-height` 为准。当前版本的受管审计不承诺任务特定数值 probe;实现时仍应按
74
+ 这些目标校准,并通过 WorkBuddy 读取最终截图复核可读性和层级。
75
+
76
+ ## 尺寸、间距与密度
77
+
78
+ 平台现有间距档位:
79
+
80
+ - 水平:`--h-spacing-xs/sm/md/lg/xl` = 4/6/8/16/24 个 `--hd`;
81
+ - 垂直:`--v-spacing-xs/sm/md/lg/xl` = 4/6/8/16/24 个 `--hd`;
82
+ - 字体相关模块间距:`--spacing-sm/md/lg` = 8/16/24 个 `--hd`。
83
+
84
+ | 场景 | 规范 | 禁止 |
85
+ | ------------ | ------------------------------------------------------------------ | ---------------------------------------- |
86
+ | 同类元素内部 | 图标与文字、标签与值等紧密关系优先 4/6/8 档 | 禁止元素贴合;禁止同组内随机使用多个间距 |
87
+ | 控件与控件 | 同行或同组控件优先 8/16 档,并保持水平与垂直节奏一致 | 禁止靠 margin 微调每个控件到不同位置 |
88
+ | 区块与区块 | 页面模块、卡片和分组之间优先 16/24 档 | 禁止用巨大空白替代信息层级 |
89
+ | 页面边距 | 以既有页面范式或外层布局组件为准;自定义容器优先 16/24 档 | 禁止重复叠加页面与组件内边距造成过宽留白 |
90
+ | 组件尺寸 | 先使用公开 size 档位;确有参考差异时按受控升级处理 | 禁止全局覆盖按钮、输入框、菜单、表格行高 |
91
+ | H5 触控 | 关键操作点击容器最小热区 `calc(44 * var(--hd))`;视觉图标可小于热区 | 禁止只给细小图标本体绑定点击区域 |
92
+
93
+ `specs.xlsx` 的 PC 4/8/12/16/20/24/32 与 H5 8 基准仅用于检查。实现时先映射平台变量;
94
+ 无法映射的 12/20/32 使用 `calc(N * var(--hd))`,不得新增私有 token。
95
+
96
+ ## 栅格与布局
97
+
98
+ | 场景 | 规范 | 禁止 |
99
+ | -------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
100
+ | PC 栅格 | 当前平台采用 24 栅格,使用 `Row` / `Col` 或 `--col-1` 至 `--col-24`;所有 `Col` 放在 `Row` 内 | 禁止另造百分比栅格;禁止把表格列宽当页面栅格 |
101
+ | 页面骨架 | 导航、工具区、主内容、操作区按页型建立层级;主内容占据剩余空间 | 禁止所有模块同等强调 |
102
+ | 卡片矩阵 | 同行卡片尽量自然齐底、间距一致;卡片填满所属 Col 宽度;具体高度关系按当前截图判断 | 禁止由内容数量碰巧撑出宽高;禁止为对齐写无依据固定高度;禁止参差不齐的卡片间距 |
103
+ | 内容宽度 | 名称、标题、描述等主信息获得伸缩空间;时间、状态、操作等辅助区域稳定 | 禁止主要内容被固定装饰宽度挤压 |
104
+ | H5 布局 | 默认单列、纵向信息流;使用 M 系列组件和移动端间距,适配顶部/底部安全区 | 禁止把 PC 多栏、侧栏或宽表等比缩小到 H5 |
105
+ | 响应变化 | 根据容器宽度重排、换行或切换移动端结构 | 禁止依赖单一设计稿宽高;禁止整页横向溢出 |
106
+
107
+ 门户页当前按 24 栅格实现。`specs.xlsx` 中 PC 12 列、16 外边距、16 槽宽与当前平台事实冲突,
108
+ 在团队裁决前不得据此改写 `Row/Col` 或 `--col-*`。
109
+
110
+ PC 门户宏观布局按 `spec portal-page` 使用自定义 Grid/Flex 或 `Layout.Row/Col`。采用 Layout 时
111
+ `Row` 决定轨道、`Col` 决定宽度;Card 高度与内部空间分配由当前参考和截图判断。flex/grid item 按需使用 `min-width:0`,
112
+ 纵向滚动或剩余高度分配链按需使用 `min-height:0`,不得把外层 flex 误写成全页固定高度链。
113
+
114
+ 参考图任务在浏览器中检查 Banner、主栏、侧栏的上下/左右结构关系和 Card 自然齐底效果;
115
+ 禁止通过补 mock 条目、空白内容或无依据固定高度掩盖尺寸问题。
116
+
117
+ ## 边框、圆角、阴影与分层
118
+
119
+ | 条目 | 规范 | 禁止 |
120
+ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
121
+ | 边框 | `--border-solid`、`--border-dotted`、`--diviling-line-solid` 作为完整 border shorthand 直接使用;只有自行组合宽度/样式且有源码证据时才单独使用 `--border-color`、`--light-border-color` | 禁止给完整 shorthand 再拼颜色导致声明无效;禁止硬编码 1px 灰线;禁止同时使用重边框与重阴影 |
122
+ | 圆角 | 无圆角/小/中/大档使用 `--border-radius-none/xs/sm/md`;组件圆角优先使用其专属变量 | 禁止全页大圆角卡片化;禁止无证据全局覆盖标准控件圆角 |
123
+ | 圆形元素 | 仅头像、徽标、圆形图标按钮等语义明确的元素使用组件圆形能力或 `--border-radius-lg` | 禁止把普通矩形业务容器做成胶囊 |
124
+ | 阴影 | 仅浮层、弹层或确需抬升层级的区域使用 `--box-shadow` / `--box-shadow-storke` 或组件专属变量 | 禁止每张卡片都加重阴影;禁止阴影作为唯一分区手段 |
125
+ | 层级 | 弹层、Toast、Picker 等使用标准组件及平台 z-index 变量 | 禁止业务 CSS 写任意超大 z-index;禁止覆盖富文本/弹窗层级 |
126
+
127
+ E10 标准业务页优先用背景差、留白和分隔线组织信息,避免悬浮卡片、轻奢金色、深色营销
128
+ 背景、大面积渐变和无业务意义 Banner。
129
+
130
+ 正确示例:`border: var(--border-solid)`。错误示例:
131
+ `border: var(--border-solid) var(--light-border-color)`,因为当前 token 已包含宽度、样式和颜色,
132
+ 再次拼接会使整条声明无效。只有截图出现明确边界问题时才读取相关 computed style 定位;
133
+ 正常首版不为每条 border 建立测量回执。
134
+
135
+ ## 图标、图片与数据视觉
136
+
137
+ | 场景 | 规范 | 禁止 |
138
+ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
139
+ | 通用图标 | 优先使用平台现有 `Icon`;按 `search-icons -> get-icon -> 必要时 get-icon-svg` 取得并核验规范 name,最终由 E010 校验;尺寸使用组件 size 或 `--icon-size-*` | 禁止把搜索候选直接当最终名称;禁止猜测 `Icon-*`、调用不存在的 `render-icon`、引入第三方图标库或用 emoji 充当业务图标 |
140
+ | 图标风格 | 常规操作使用线性图标;面性图标仅用于主入口、空状态或卡片头部;同一模块保持相同尺寸和风格 | 禁止随意混用线性/面性、彩色/单色图标 |
141
+ | 图片 | 保持比例,明确 `object-fit`;加载失败提供占位或回退 | 禁止拉伸变形;禁止低清图片放大;禁止图片溢出容器 |
142
+ | 头像/缩略图 | 使用标准组件尺寸与裁切方式,同列表保持一致 | 禁止逐项使用不同尺寸或圆角 |
143
+ | 图表 | 色板首先取主题色和语义色,同指标在同页保持相同颜色;同时提供文字/数值 | 禁止仅凭颜色区分类别;禁止 3D、霓虹和装饰性动画干扰读数 |
144
+ | 数值 | 单位、精度和千分位在同一模块保持一致;关键数值突出但不超过平台字号档位 | 禁止同指标多种格式;禁止用超大数字破坏页面层级 |
145
+
146
+ 图标按业务语义合并搜索并确认规范名称;语义相同的重复和次要项目复用已经确认的中性图标,
147
+ 不为每张卡片或每个工具重复查询同一事实。
148
+
149
+ ## 动效
150
+
151
+ | 场景 | 规范 | 禁止 |
152
+ | -------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------- |
153
+ | 状态过渡 | 优先使用组件默认动效;自定义区域使用平台 `--transition-*` 变量 | 禁止硬编码时长和缓动;禁止覆盖组件动效 |
154
+ | 新增动效 | 仅用于状态变化、展开收起或层级切换,时长与缓动统一取 `--transition-du`、`--transition-tf` | 禁止循环、弹跳、炫光等装饰动画;禁止动效延迟业务操作反馈 |
155
+
156
+ ## 组件视觉适配升级
157
+
158
+ 公共组件默认配置无法达到本次 E10 参考时,按以下证据层级选择能解决问题的最低一级:
159
+
160
+ 1. 保留组件默认视觉;
161
+ 2. 使用当前 source/Demo 已确认的公开 props、size/type、className/style 能力;
162
+ 3. 用业务 wrapper 处理外层尺寸链、留白、对齐与 overflow;
163
+ 4. 使用公开 custom render/item renderer,内部仍组合已查证组件并保留默认业务行为;
164
+ 5. 仅在以上能力不足时,使用业务根下最小范围的稳定 class override。
165
+
166
+ 轻 plan 不记录 `component.adaptation` 或证据对象。scoped override 必须绑定包含
167
+ `UI_CODE_AGENT_LOCAL_PREVIEW` 的
168
+ 根选择器,只命中解决当前问题所需的最小 class 面;禁止改全局变量、写全局标签/组件选择器或
169
+ 依赖完整动态 `weId`。优先不用 `!important`。改动后重新 validate 并用最终截图确认问题已
170
+ 解决;业务组件尤其不能只因外观差异被替换成页面自研数据列表。
171
+
172
+ custom render 只有在当前公开类型和实现都提供所需参数、上下文与默认事件复用方式时才可
173
+ 采用。Demo 出现未公开的额外回调参数时,不得猜参数、照抄示例或修改业务组件;保留组件默认
174
+ 数据/行为,改用 wrapper 或有 Preview 证据的最小 scoped override,并记录契约冲突。
175
+
176
+ ## 状态展示检查
177
+
178
+ 按本次核心需求和截图中的实际可见状态检查,确保当前任务要求的内容、状态与视觉效果完整:
179
+
180
+ - 默认、hover、active/focus、selected、disabled、loading、empty、error 状态视觉完整;
181
+ - disabled 与 placeholder 只用于真实不可用/未输入状态,不能作为未实现内容的灰色占位;
182
+ - loading 不造成页面明显跳动,empty/error 保持原容器尺寸与页面结构稳定;
183
+ - 表单错误色使用 danger 语义,错误文本贴近字段且不遮挡相邻内容;
184
+ - 表格表头与数据列对齐,操作列稳定,长文本不越界;
185
+ - PC 与 H5 分别检查,不在同一页面混用普通组件和 M 系列组件。
186
+
187
+ ## 通用禁止清单
188
+
189
+ - 不修改 `weapp-ui/src/style/var.css`;共享变量应由 `weapp-base-css-vars` 按平台流程维护。
190
+ - 不猜测或手动生成 `weId`;视觉样式也不得依赖完整动态 `weId`。
191
+ - 自定义样式限定在业务根容器下;不覆盖全局变量或标签样式。标准组件后代只允许按上述
192
+ 有证据的最小 scoped override 规则处理。
193
+ - 不混用多套字号、间距、圆角、阴影、图标和按钮高度。
194
+ - 不为了“更好看”改变 E10 标准页型、信息密度和视觉层级。
@@ -0,0 +1,177 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: frontend-design
3
+ description: Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
4
+ license: Complete terms in LICENSE.txt
5
+ ---
6
+
7
+ # Frontend Design
8
+
9
+ Approach this as the design lead at a small studio known for giving every client a visual identity that could not be mistaken for anyone else's. This client has already rejected proposals that felt templated, and is paying for a distinctive point of view: make deliberate, opinionated choices about palette, typography, and layout that are specific to this brief, and take one real aesthetic risk you can justify.
10
+
11
+ ## Ground it in the subject
12
+
13
+ If the brief does not pin down what the product or subject is, pin it yourself before designing: name one concrete subject, its audience, and the page's single job, and state your choice. If there's any information in your memory about the human's preferences, context about what they're building, or designs you've made before – use that as a hint. The subject's own world, its materials, instruments, artifacts, and vernacular, is where distinctive choices come from. Build with the brief's real content and subject matter throughout.
14
+
15
+ ## Design principles
16
+
17
+ For web designs, the hero is a thesis. Open with the most characteristic thing in the subject's world, in whatever form makes sense for it: a headline, an image, an animation, a live demo, an interactive moment. Be deliberate with your choice: a big number with a small label, supporting stats, and a gradient accent is the template answer, only use if that's truly the best option.
18
+
19
+ Typography carries the personality of the page. Pair the display and body faces deliberately, not the same families you would reach for on any other project, and set a clear type scale with intentional weights, widths, and spacing. Make the type treatment itself a memorable part of the design, not a neutral delivery vehicle for the content.
20
+
21
+ Structure is information. Structural devices, numbering, eyebrows, dividers, labels, should encode something true about the content, not decorate it. Many generic designs use numbered markers (01 / 02 / 03), but that's only appropriate if the content actually is a sequence - like a real process or a typed timeline where order carries information the reader needs. Question if choices like numbered markers actually make sense before incorporating them.
22
+
23
+ Leverage motion deliberately. Think about where and if animation can serve the subject: a page-load sequence, a scroll-triggered reveal, hover micro-interactions, ambient atmosphere. An orchestrated moment usually lands harder than scattered effects; choose what the direction calls for. However, sometimes less is more, and extra animation contributes to the feeling that the design is AI-generated.
24
+
25
+ Match complexity to the vision. Maximalist directions need elaborate execution; minimal directions need precision in spacing, type, and detail. Elegance is executing the chosen vision well.
26
+
27
+ Consider written content carefully. Often a design brief may not contain real content, and it's up to you to come up with copy. Copy can make a design feel as templated as the design itself. See the below section on writing for more guidance.
28
+
29
+ ## Process: brainstorm, explore, plan, critique, build, critique again
30
+
31
+ For calibration: AI-generated design right now clusters around three looks: (1) a warm cream background (near #F4F1EA) with a high-contrast serif display and a terracotta accent; (2) a near-black background with a single bright acid-green or vermilion accent; (3) a broadsheet-style layout with hairline rules, zero border-radius, and dense newspaper-like columns. All three are legitimate for some briefs, but they are defaults rather than choices, and they appear regardless of subject. Where the brief pins down a visual direction, follow it exactly — the brief's own words always win, including when it asks for one of these looks. Where it leaves an axis free, don't spend that freedom on one of these defaults. Just like a human designer who's hired, there's often a careful balance between doing what you're good at and taking each project as a chance to experiment and learn.
32
+
33
+ Work in two passes. First, brainstorm a short design plan based on the human's design brief: create a compact token system with color, type, layout, and signature. Color: describe the palette as 4–6 named hex values. Type: the typefaces for 2+ roles (a characterful display face that's used with restraint, a complementary body face, and a utility face for captions or data if needed). Layout: a layout concept, using one-sentence prose descriptions and ASCII wireframes to ideate and compare. Signature: the single unique element this page will be remembered by that embodies the brief in an appropriate way.
34
+
35
+ Then review that plan against the brief before building: if any part of it reads like the generic default you would produce for any similar page (work through a similar prompt to see if you arrive somewhere similar) rather than a choice made for this specific brief — revise that part, say what you changed and why. Only after you've confirmed the relative uniqueness of your design plan should you start to write the code, following the revised plan exactly and deriving every color and type decision from it.
36
+
37
+ When writing the code, be careful of structuring your CSS selector specificities. It's easy to generate CSS classes that cancel each other out (especially with a type-based selector like .section and a element-based selector like .cta). This can happen often with paddings/margins between sections.
38
+
39
+ Try to do a lot of this planning and iteration in your thinking, and only show ideas to the user when you have higher confidence it'll delight them.
40
+
41
+ ## Restraint and self-critique
42
+
43
+ Spend your boldness in one place. Let the signature element be the one memorable thing, keep everything around it quiet and disciplined, and cut any decoration that does not serve the brief. Not taking a risk can be a risk itself! Build to a quality floor without announcing it: responsive down to mobile, visible keyboard focus, reduced motion respected. Critique your own work as you build, taking screenshots if your environment supports it – a picture is worth 1000 tokens. Consider Chanel's advice: before leaving the house, take a look in the mirror and remove one accessory. Human creators have memory and always try to do something new, so if you have a space to quickly jot down notes about what you've tried, it can help you in future passes.
44
+
45
+ ## More on writing in design
46
+
47
+ Words appear in a design for one reason: to make it easier to understand, and therefore easier to use. They are design material, not decoration. Bring the same intentionality to copy that you would bring to spacing and color. Before writing anything, ask what the design needs to say, and how it can best be said to help the person navigate the experience.
48
+
49
+ Write from the end user's side of the screen. Name things by what people control and recognize, never by how the system is built. A person manages notifications, not webhook config. Describe what something does in plain terms rather than selling it. Being specific is always better than being clever.
50
+
51
+ Use active voice as default. A control should say exactly what happens when it's used: "Save changes," not "Submit." An action keeps the same name through the whole flow, so the button that says "Publish" produces a toast that says "Published." The vocabulary of an interface is the signposting for someone navigating the product. Cohesion and consistency are how people learn their way around.
52
+
53
+ Treat failure and emptiness as moments for direction, not mood. Explain what went wrong and how to fix it, in the interface's voice rather than a person's. Errors don't apologize, and they are never vague about what happened. An empty screen is an invitation to act.
54
+
55
+ Keep the register conversational and tuned: plain verbs, sentence case, no filler, with tone matched to the brand and the audience. Let each element do exactly one job. A label labels, an example demonstrates, and nothing quietly does double duty.
@@ -0,0 +1,3 @@
1
+ source=anthropics/skills@frontend-design
2
+ commit=3b3fad96af16a10759d930941b4520ba0c40edae
3
+ license=Apache-2.0