
migrate-v1-to-v2
将用户项目从 Wot UI v1 迁移到 v2。用户要求升级 wot-design-uni 到 @wot-ui/ui、替换旧组件/旧 API、迁移表单校验体系、迁移图标名称,或修复因 v2 不兼容变更导致的编译错误、空图标和运行时报错时调用。
- Installs
- 489
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/wot-ui/open-wot --skill migrate-v1-to-v2- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads migrate-v1-to-v2 automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
从 v1 迁移到 v2 技能
本技能用于辅助用户将项目从 Wot UI v1 (wot-design-uni) 迁移到 Wot UI v2 (@wot-ui/ui)。
职责边界
- 扫描 v1 用法、替换包名/路径、迁移组件 API、迁移表单校验体系与内置图标名称、修复不兼容变更。
- 不负责新建业务页面或重构业务逻辑,仅做最小必要的兼容性替换。
- 不负责安装依赖,由用户自行在终端执行。
首次交互确认
在开始任何操作前,先向用户确认以下三点(如果上下文已可推断则跳过对应问题):
- 安装方式:npm 还是 uni_modules?(影响导入路径和 easycom 配置)
- 目标:
- A. 全量迁移(项目尚未升级)→ 按阶段一~七执行
- B. 升级后修错误(已升级但遇到编译/运行时报错)→ 先读
errors.md定位问题
- 目标平台:H5 / 微信小程序 / 支付宝小程序?(影响样式隔离和 easycom 验证方式)
快速通道
根据用户描述的问题,直接加载对应子文件:
| 关键词 | 子文件 |
|---|---|
| 错误信息 / 编译报错 / 找不到模块 / is not defined / 升级后异常 | errors.md |
| 表单 / Form / schema / zodAdapter / FormRules / 校验 / 必填星号 | form.md |
| 包名 / easycom / Volar / vite 插件 / 国际化 / 路径替换 / uni_modules | infra.md |
| Sass / 主题 / Design Token / CSS 变量 / 样式覆盖 / 深色模式 / ConfigProvider | styles.md |
| Dialog / MessageBox / Empty / StatusTip / Cascader / ColPicker / Keyboard / NumberKeyboard / Button / Tag / Radio / Checkbox / Search / Grid / Fab / Badge / Slider / Tabs / Steps / Swiper / Tooltip / Popover / Collapse / Cell / Input / Textarea / PickerView / ImgCropper / CountTo / Segmented | components.md |
| Icon / 图标 / wd-icon / icon / iconClass / activeIcon / inactiveIcon / prefixIcon / suffixIcon / 空图标 | components.md 的“图标迁移”与 icons.json |
核心变更速查表
| 类型 | v1 | v2 |
|---|---|---|
| npm 包名 | wot-design-uni | @wot-ui/ui |
| uni_modules 目录 | wot-design-uni | wot-ui |
| 弹框组件 | wd-message-box | wd-dialog |
| 弹框 Hook | useMessage | useDialog |
| 缺省提示 | wd-status-tip | wd-empty |
| 多列选择器 | wd-col-picker | wd-cascader |
| 数字键盘 | wd-number-keyboard | wd-keyboard |
| 表单校验 | rules / FormRules | schema / FormSchema |
| 按钮变体 | plain / type="text" / type="icon" | variant / 图标按钮 |
| 按钮危险色 | type="error" | type="danger" |
| 标签变体 | plain | variant="plain" |
| 单选/复选形态 | shape / inline / cell | type / direction / 手动组合 wd-cell |
| 搜索框浅色样式 | light | variant="light" |
| GridItem 点击 | @itemclick | @click |
| 工具函数路径 | components/common/util | common/util |
| 内置图标名称 | v1 图标集合 | 按 icons.json 中的人工审核结果迁移 |
迁移流程
推荐顺序:依赖升级 → 路径替换 → Form 页面 → 高影响组件 → 中低影响组件 → 图标与低影响属性 → 样式与主题 → 回归测试。
每完成一个阶段后与用户确认再进入下一阶段。
阶段一:扫描与诊断
-
确定用户的安装方式(
npm还是uni_modules)。 -
确认项目配置:
pages.jsoneasycom、tsconfig.json类型声明、Vite 插件自动导入。 -
搜索 v1 旧用法:
rg "wot-design-uni|wd-message-box|useMessage|wd-status-tip|wd-col-picker|wd-number-keyboard|wd-icon|icon-class|iconClass|active-icon|activeIcon|inactive-icon|inactiveIcon|prefix-icon|prefixIcon|suffix-icon|suffixIcon|@itemclick|shape=|inline|\scell\b|\slight\b|type=\"error\"|type=\"icon\"|type=\"text\"|\splain\b|classPrefix|components/common/util|hide-label|hide-min-max|autoLineWidth|disabled-color|setRoate|useContentSlot|useMoreSlot|\bshow=" -
如果项目有表单,额外搜索:
rg "wd-form|FormRules|:rules=|rules=|errorType|resetOnChange" -
向用户汇报发现的清单,按影响程度排序:
- 高影响:Form(结构+校验体系)、Dialog(原 MessageBox)、ColPicker、NumberKeyboard
- 中影响:Button、Tag、Radio/Checkbox、Search、Grid、Fab、内置图标名称
- 低影响:camelCase 属性名、Badge/Slider/Tabs/Steps/Swiper 等属性微调
阶段二:依赖与路径替换
详见 infra.md(包名、easycom、Volar、Vite 插件、国际化)和 styles.md(Sass 升级)。读完后回到阶段三继续。
阶段三:高影响组件迁移
详见 components.md(MessageBox→Dialog、StatusTip→Empty、ColPicker→Cascader、NumberKeyboard→Keyboard)。
Form 表单体系详见 form.md。读完后回到阶段四继续。
阶段四:中影响组件迁移
详见 components.md(Button、Tag、Radio/Checkbox、Search、Grid、Fab)。读完后回到阶段五继续。
阶段五:低影响属性与图标迁移
详见 components.md(Badge、Slider、Tabs、Steps、Swiper、Tooltip、Popover、Collapse、DatetimePickerView、ImgCropper、CountTo、Segmented、PickerView、图标迁移、camelCase 属性名)。迁移图标时必须读取 icons.json,只替换确认映射;“无对应”和动态绑定项保留给人工决策。读完后回到阶段六继续。
阶段六:样式与主题迁移
详见 styles.md(主题文件引入、全局变量覆盖、ConfigProvider、样式覆盖优先级、深色模式)。读完后进入阶段七回归验证。
阶段七:回归验证
- H5 和目标小程序端是否能正常编译
-
easycom是否能正确解析所有wd-*组件 -
Toast、Dialog、Notify等函数式调用是否已在页面中声明实例 - 表单提交、单字段校验、重置、隐藏字段和异步校验是否正常
- 选择器类表单项的回显文本和提交值是否正确
-
Button的type、variant、round和高度是否符合预期 -
Tag的variant是否已从plain迁移 -
Radio/Checkbox的shape、inline、cell是否已迁移 -
Search的light是否已迁移为variant="light" -
GridItem点击事件是否已从itemclick迁移到click -
Cell、Input、Textarea的表单相关属性是否已迁移到wd-form-item -
PickerView、ImgCropper、CountTo等实例方法是否仍可正常调用 -
Badge、Slider、Tabs、Steps、Swiper等旧属性是否已迁移 -
Dialog点击遮罩关闭、Prompt 返回值和按钮配置是否符合预期 - 深色模式、主题变量、品牌色覆盖是否生效
- 弹层在小程序端是否存在样式隔离问题
- 自定义覆盖样式是否仍然生效
- 所有静态内置图标名是否按
icons.json处理,且没有对业务字符串做全局替换 - “无对应”、动态绑定和
iconClass/activeIcon/inactiveIcon/prefixIcon/suffixIcon是否已经单独列出并人工确认 - 图标的业务语义和视觉结果是否正确,名称大小写是否保持准确
- 图标按钮高度变化是否影响页面布局
FAQ
What does the migrate-v1-to-v2 skill do?
将用户项目从 Wot UI v1 迁移到 v2。用户要求升级 wot-design-uni 到 @wot-ui/ui、替换旧组件/旧 API、迁移表单校验体系、迁移图标名称,或修复因 v2 不兼容变更导致的编译错误、空图标和运行时报错时调用。
How do I install migrate-v1-to-v2?
Run npx skills add https://github.com/wot-ui/open-wot --skill migrate-v1-to-v2 in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/migrate-v1-to-v2/ (personal) or .claude/skills/migrate-v1-to-v2/ (project).
Which AI agents can use migrate-v1-to-v2?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is migrate-v1-to-v2 safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains migrate-v1-to-v2?
It is published by wot-ui in wot-ui/open-wot. It has 489 recorded installs.
More from wot-ui/open-wot
wot-ui-v2
wot-ui/open-wot
回答、生成、重构、排查 wot-ui v2 相关代码时使用。关键词:wot-ui、uni-app、Vue3、wd-、ConfigProvider、useToast、useDialog、Form、Popup、theme、llms-full。适用于组件选型、API 查询、示例页面生成、主题定制、常见坑排查。
create-wot-ui-theme
wot-ui/open-wot
为 wot-ui 生成单文件主题 SCSS,并在用户明确要求接入时追加 App.vue 的 @use。当用户要做品牌主题、语义变量落地、单文件主题接入时使用。
wot-ui-cli
wot-ui/open-wot
使用、调试或维护 @wot-ui/cli 与 open-wot 仓库。适用于 wot CLI 命令、Agent/MCP 接入、doctor/usage/lint、组件知识查询、客户端 adapter、离线数据提取、构建测试、发布包检查和仓库开发;如果任务是直接编写 wd- 组件页面或解释组件 API,应改用 wot-ui-v2 skill。
wot-ui-unocss-preset-guide
wot-ui/open-wot
指导安装、配置并使用 @wot-ui/unocss-preset。Invoke when 用户询问该预设的接入、配置、使用示例或常见问题排查。
starter-cleaner
wot-ui/open-wot
Open the skill to read its SKILL.md instructions.
openspec-propose
wot-ui/open-wot
Open the skill to read its SKILL.md instructions.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
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.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.