Converts UI design screenshots into Vue 3 Composition API components, supporting Vant, Element Plus, and Ant Design Vue. Handles batch conversion with page grouping, asset extraction, and routing.
How this skill is triggered — by the user, by Claude, or both
Slash command
/everything-claude-code:ui-to-vueThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
将 UI 设计截图批量转换为 Vue 3 Composition API 组件代码。
将 UI 设计截图批量转换为 Vue 3 Composition API 组件代码。
使用按模块和页面状态分组的截图输入目录:
screenshots/
|-- HomePage/
| |-- List/
| | |-- [email protected]
| | `-- cut-images/
| |-- cut-images/
| `-- [email protected]
`-- cut-images/
支持的切图目录名称包括 assets、icons、sprites、cut、images 和 cut-images。
使用 npx 运行转换器,使文档中的命令无需依赖全局二进制文件即可工作:
export DASHSCOPE_API_KEY=your_key
npx [email protected] --input ./screenshots --ui vant --output ./src
对于桌面 UI 库:
npx [email protected] --input ./designs --ui element-plus --output ./src
npx [email protected] --input ./designs --ui antd-vue --output ./src
如果包全局安装,可以直接使用 ui-to-vue 二进制文件:
npm install -g [email protected]
ui-to-vue --input ./screenshots --ui vant --output ./src
| 选项 | 描述 | 默认值 |
|---|---|---|
--input | 设计图片目录 | ./screenshots |
--ui | UI 库:vant、element-plus 或 antd-vue | vant |
--output | 输出目录 | ./src |
--config | 配置文件路径 | ./.ui-to-vue.config.json |
转换器可以从配置文件或环境变量读取 DashScope 凭据。在仓库中优先使用环境变量:
export DASHSCOPE_API_KEY=your_key
如果需要本地配置文件,将其排除在版本控制之外:
{
"apiKey": "your_dashscope_key",
"input": "./designs",
"ui": "vant",
"output": "./src"
}
.ui-to-vue.config.json
@latest。.ui-to-vue.config.json、API 密钥、生成的密钥或客户截图。views/ 或选择的输出目录下生成。components/。| 问题 | 检查 |
|---|---|
401 或认证错误 | 确认运行命令的 Shell 中设置了 DASHSCOPE_API_KEY。 |
command not found: ui-to-vue | 使用 npx [email protected] 形式或全局安装包。 |
| 切图被忽略 | 确认资产目录名称受支持且嵌套在匹配的页面或模块下。 |
| 组件忽略请求的 UI 库 | 用显式 --ui 值重新运行并检查生成的导入。 |
| 生成的布局尺寸看起来不对 | 确认截图导出宽度与目标库基线匹配。 |
ui-to-vue-converternpx claudepluginhub aaione/everything-claude-code-zhBatch-converts UI screenshots into Vue 3 Composition API components. Use when the user provides a directory of design images and wants generated page components, shared components, and router wiring using Vant, Element Plus, or Ant Design Vue.
Guides planning and implementation of Vue 3 projects with TypeScript, Composition API, defineModel bindings, Testing Library user-behavior tests, and MSW API mocking to enforce modern patterns.
Provides Vue 3 + TypeScript project conventions: component boundaries, composables, Pinia state ownership, API/error handling, routing, and style isolation. Use when designing or reviewing Vue 3 project structure.