Summary
OpenDesign 代码直出指南。当设计师(尤其各社区体验/设计团队)让 AI 工具把需求/设计意图直接做成页面或组件时使用此 skill——AI 应**直接生成符合工程规范的 Vue 3 + OpenDesign 代码**(真实 O 组件 + --o- 设计 token + scoped SCSS + BEM +…
finch-poi/opendesign-skills
OpenDesign 代码直出指南。当设计师(尤?
npx skills add finch-poi/opendesign-skills --skill opendesign-codegen
OpenDesign 代码直出指南。当设计师(尤其各社区体验/设计团队)让 AI 工具把需求/设计意图直接做成页面或组件时使用此 skill——AI 应**直接生成符合工程规范的 Vue 3 + OpenDesign 代码**(真实 O 组件 + --o- 设计 token + scoped SCSS + BEM +…
Related neighbors and high-traction skills in the same topics — useful to compare before installing.
Guidance for distinctive, intentional visual design when building new UI or reshaping an existi…
866.4K installsBrowser automation CLI for AI agents. Use when the user needs to interact with websites, includ…
810.4K installsReview UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "chec…
617.3K installsBuild, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and …
576.5K installsDebug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe …
568.9K installsOther skills from finch-poi/opendesign-skills.
npx skills add finch-poi/opendesign-skills
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
main
Files included with this skill beyond the listing page.
SKILL.md
10,291 B
SUMMARY.md
800 B
设计师用 AI 工具干活时,AI 直接产出的就是符合工程规范的 Vue 3 + OpenDesign 代码——渲染出来即设计稿,可直接进生产工程。
❌ 不要"先生成 HTML 再转成代码"。
✅ 一步到位:直接输出真实@opensig/opendesign组件 +--o-token 的 Vue SFC。
本 skill 不重复 Token 表与组件 API,按需链接:
- 全量 Token(六主题 / 响应式 / 24 栅格 / 色值反查)→ [../opendesign-tokens/SKILL.md](../opendesign-tokens/SKILL.md)
- 46 个组件的 Props/Events/Slots → [../opendesign-components/SKILL.md](../opendesign-components/SKILL.md)
- 想产 Pixso 设计稿而非代码 → [../opendesign-design/SKILL.md](../opendesign-design/SKILL.md)
本 skill 产出的代码要落进各开源社区官网(portal)仓。并非所有 portal 都用 OpenDesign——确认前不要动手:
AGENTS.md(遵循 agents.md 标准,是所有 AI 工具进仓的唯一入口)的 §1 技术栈表,看 UI 组件库 行。@opensig/opendesign → 继续用本 skill。违反任意一条即视为不合规,必须重写:
<OButton> / <OCard> / <OTable> …,禁止用原生 <button>/<select>/手写 div 替代。var(--o-) 或 var(--o-r-),禁止硬编码 hex / rgb / px 字号 / px 间距。**颜色必须用语义 token(--o-color-*),严禁直接用色板变量**(blue1/gray1 这类,如 --o-kleinblue-/--o-grey-/--o-brand-*)。<script setup lang="ts"> + TypeScript:props 用 defineProps<T>() 泛型,不用字符串数组式。style="..."(动态值等极特殊情况除外并注释);无 !important。<style lang="scss" scoped>,嵌套 ≤ 3 层。props 与主题 token 表达,不用 :deep() 重写 OpenDesign 组件内部结构。t('module.key'))。从合规 SFC 模板开始,不要白手起稿:复制 [references/starter-page.vue](references/starter-page.vue),它已示范:<script setup> 区块顺序、@opensig/opendesign 组件导入、--o-/--o-r- token、scoped SCSS、响应式、i18n 占位。
主题由消费工程在初始化时选定并通过根节点设置,组件与 token 自动适配,生成的页面代码无需关心:
<html data-o-theme="e.light"> <!-- e/a/k/m/g/u . light/dark -->
| 社区 | 主题码 | 社区 | 主题码 |
|---|---|---|---|
| openEuler | e |
Mindspore | m |
| Ascend | a |
openGauss | g |
| Kunpeng | k |
openUBMC | u |
颜色全用语义 token → 切主题 / 明暗时自动适配,无需为暗色另写样式。
--o-color-fill1/2/3,文字 --o-color-info1~info4,主色 --o-color-primary1,功能色 --o-color-success/warning/danger1,边框 --o-color-control1,链接 --o-color-link1。语义色自带 rgb 包裹,直接 var(--o-color-fill2)。--o-kleinblue-、--o-blue-、--o-grey-、--o-green-、--o-red-、--o-orange-、--o-brand-* 等都只能由语义 token 内部引用,业务代码禁止直接写。要的是「这个颜色是什么用途」(语义),不是「这是第几号蓝」(色板)。- ❌ color: var(--o-grey-14) / background: var(--o-kleinblue-6) - ✅ color: var(--o-color-info1) / background: var(--o-color-primary1)
--o-r-fontsize- + 配套 --o-r-lineheight-、--o-r-gap-*(随视口自动缩放,免写 media query)。--o-radius-、阴影 --o-shadow-1/2/3、动效 --o-duration-+--o-easing-*。#fff/rgb()、--o-color-bg1/2/3(不存在,背景用 fill*)、硬编码 22px/32px。详表 → [opendesign-tokens](../opendesign-tokens/SKILL.md)。
设计意图直接映射到 OpenDesign 组件(不自造原生替代):
| 设计意图 | 组件 | 设计意图 | 组件 |
|---|---|---|---|
| 按钮 | OButton |
表格 | OTable |
| 链接 | OLink |
分页 | OPagination |
| 卡片 | OCard |
标签页 | OTab+OTabPane |
| 标签 | OTag |
对话框 | ODialog |
| 输入/下拉 | OInput / OSelect+OOption |
图标 | OIcon |
选用速查与关键 props/slots → [references/component-cheatsheet.md](references/component-cheatsheet.md);完整 API → [opendesign-components](../opendesign-components/SKILL.md)。
--o-r-grid-N + 水槽 --o-r-grid-column-gutter),并排块列数之和 = 断点总列数。@media(或目标工程的 respond-to mixin)。保证代码可直接进生产工程,详见 [references/engineering-rules.md](references/engineering-rules.md),核心即上方「硬规则红线」。
⚠️ 社区差异:路径别名(如
~@/)、i18n 写法、排版 mixin(@include h3)、Vue API 是否自动导入(VitePress 显式 import vs Nuxt 自动导入)、SSR/SSG 安全写法等因目标仓而异。本 skill 给的是 OpenDesign 通用合规骨架;落地前先按「工作流·步骤 1」读目标仓根AGENTS.md+rules/适配。各 portal 仓如何暴露这些约定,见 portal-workflow 的portal-agents-docskill。
- 读目标仓根 AGENTS.md(AI 工具唯一入口)→ 按其规范索引 Read 相关 rules/*.md。 - 确认 UI 库是 @opensig/opendesign(见上「适用前提」),否则停。 - 摸清并据此适配:框架族(VitePress:Vue API 显式 import;Nuxt:自动导入、import.meta.client/<ClientOnly>、useSeoMeta)、路径别名(~@//@/ 等)、i18n(locales 位置与 t() 写法,zh/en 同步)、SEO/GEO 机制(TDK 由 portal-workflow geo-fix 链路负责,组件里不要重复注入)、样式 rules(token 用法、:deep 策略、SCSS 嵌套上限、是否有 respond-to mixin)、命名约定。 - 不确定处用通用写法 + 注释,绝不臆造仓内不存在的目录/机制。
- 用到颜色/间距/字号/圆角等具体 token 值 → 读 [../opendesign-tokens/SKILL.md](../opendesign-tokens/SKILL.md) + 对应主题 references/tokens-{theme}.md。 - 用到组件的 Props/Events/Slots → 读 [../opendesign-components/SKILL.md](../opendesign-components/SKILL.md) + 对应 references/{component}.md。 - 需要图标/构建/样式等 CLI 命令(gen:icon/build-style 等)→ 读 [../opendesign-scripts/SKILL.md](../opendesign-scripts/SKILL.md)。 - 需对照设计稿规范(栅格/断点/组件视觉规格)→ 读 [../opendesign-design/SKILL.md](../opendesign-design/SKILL.md)。 - 本 skill 顶部链接与 component-cheatsheet.md 只是索引,真值以同级 skill 文件为准。
references/starter-page.vue。@opensig/opendesign 组件搭结构,样式全用 var(--o-)/var(--o-r-),文案走 i18n,列表用 v-for+语义 :key。node skills/opendesign-tokens/scripts/bin.mjs scan <file> --theme <主题> --strict)。