Stitch to uni-app + uview-plus Components
Constraint: Only use this skill when the user explicitly mentions Stitch and wants conversion to uni-app + Vue 3 + uview-plus with up-* components.
You are a frontend engineer turning Stitch screens into clean, modular uview-plus pages and shared components. Use Stitch MCP (or stitch-mcp-get-screen) to retrieve metadata and HTML, then rebuild the screen with up-* components, rpx, and the current uview-plus theme/runtime model.
What makes this skill different
This is not a rename of stitch-uviewpro-components.
It is a stronger uview-plus-specific skill that:
- defaults to
up-* instead of u-*
- aligns with current
uview-plus docs, setup, and theme guidance
- covers
up-status-bar, up-safe-bottom, up-popup, up-upload, up-subsection, up-tabbar, up-empty, up-gap, and up-line
- prefers CSS variables like
--up-* and runtime theme config over hardcoded colors
- requires stronger page-shell, safe-area, and bottom-CTA handling than the generic uView Pro skill
Prerequisites
- Stitch MCP Server: https://stitch.withgoogle.com/docs/mcp/guide/
uni-app / HBuilderX or Vue CLI project using Vue 3
uview-plus installed and wired for Vue 3
- Stitch project and screen IDs, resolved in one of two ways:
- Parse a Stitch design URL:
projectId from the /projects/{id} path and screenId from the node-id query
- Browse with stitch-mcp-list-projects and stitch-mcp-list-screens
Official Documentation
Retrieval and Networking
- Discover Stitch MCP prefix: inspect tools to find the Stitch namespace.
- Resolve projectId and screenId:
- If the user supplied a Stitch URL, parse both IDs directly
- Otherwise use stitch-mcp-list-projects and stitch-mcp-list-screens
- Fetch screen metadata: call get_screen to obtain design JSON,
htmlCode.downloadUrl, screenshot.downloadUrl, dimensions, and device type.
- Download HTML reliably:
bash scripts/fetch-stitch.sh "<htmlCode.downloadUrl>" "temp/source.html"
- Use the screenshot as the visual source of truth when the exported HTML is structurally noisy.
Architectural Rules
- Use
up-* only when a uview-plus component exists. Do not generate u-* tags in this skill.
- Prefer modular output: page shell, shared components, and extracted mock/static data instead of one large page file.
- Prefer framework-native rebuilds over literal HTML translation. Reconstruct the page with
up-* semantics.
- Prefer theme-aware styles: use
var(--up-xxx) and setConfig({ color }) guidance instead of hardcoded colors when a theme token exists.
- Prefer runtime-safe page shells:
up-navbar for normal headers
up-status-bar for custom branded headers
up-safe-bottom for fixed bottom CTAs
- Read these before drafting code:
- references/component-index.md
- references/contract.md
- references/stitch-html-patterns.md
- references/tailwind-to-uview-plus.md
Execution Steps
- Environment
- ensure
uview-plus is installed
- ensure Vue 3 project wiring is valid
- ensure
App.vue, main.js, and uni.scss follow current uview-plus guidance
- Data layer
- extract repeated text, options, tabs, and upload/demo lists into data modules or page state
- Page drafting
- start from resources/page-template.vue
- keep the page shell theme-aware and safe-area-aware
- Component selection
- use
up-tabs or up-subsection for switching UI
- use
up-picker / up-popup instead of raw select
- use
up-upload instead of raw upload boxes
- use
up-tabbar for bottom nav
- use
up-empty for empty states
- Quality check
- verify against resources/architecture-checklist.md
- make sure the final output is clearly stronger and more framework-native than a raw HTML rewrite
Official API alignment and common Stitch corrections
When converting Stitch HTML, verify against references/contract.md and the official uview-plus docs. Common corrections:
| Design element |
Wrong from Stitch / generic UI |
Correct for uview-plus |
| Top tabs |
custom <view> pills or button row |
<up-tabs :list="..." :current="current" @change="..."> or v-model:current |
| Segmented filters |
custom capsule buttons |
<up-subsection :list="..." :current="..." @change="..."> |
| Picker/select |
native <select> or raw popup list |
<up-picker v-model:show="show" :columns="columns" @confirm="..."> |
| Popup/sheet |
fixed custom overlay + absolute panel |
<up-popup v-model:show="show" mode="bottom"> |
| Upload |
dashed custom upload box + hidden file input |
<up-upload :fileList="..." @afterRead="..."> |
| Bottom navigation |
fixed footer buttons manually styled as nav |
<up-tabbar :value="value" @change="..."> |
| Empty state |
plain text "No data" |
<up-empty text="No data"> |
| Divider / spacing |
manual border and margin blocks |
<up-line>, <up-divider>, <up-gap> |
| Safe area |
fixed bottom CTA without inset handling |
<up-safe-bottom> wrapper |
| Custom header |
hardcoded spacer height |
<up-status-bar> when not using up-navbar |
| Theme |
hex colors everywhere |
var(--up-*), theme tokens, and runtime color config |
Engineering guidance specific to uview-plus
uview-plus current docs favor up-* naming in examples. This skill should output that convention by default.
- For
.vue / .uvue pages, prefer CSS variables such as var(--up-primary) and var(--up-bg-color).
- For runtime theme customization, use
setConfig({ color }) guidance when the page needs explicit theme sync.
- Keep
@import 'uview-plus/theme.scss'; semantics in mind when describing project wiring.
- If the project uses the Root bridge, global calls like
uni.$u.toast() can replace manually placing up-toast in every page.
Testing trigger
Testing is command-triggered by the user, not by directly calling MCP for no reason.
Keywords
English: Stitch, uview-plus, up-button, up-tabs, up-tabbar, up-popup, up-upload, uni-app, Vue 3.
中文关键词: Stitch、uview-plus、up 组件、uni-app、Vue3、页面转换。
References
- examples/usage.md
- references/official.md
- references/contract.md
- references/component-index.md
- references/stitch-html-patterns.md
- references/tailwind-to-uview-plus.md
- resources/architecture-checklist.md
- resources/page-template.vue
- api/component-api.md
- scripts/fetch-stitch.sh
- Stitch API / MCP
能力边界
✅ 适用场景
- 当你需要使用此技能对应的技术栈时
- 当项目需要遵循最佳实践时
- 当需要快速上手或深入理解核心概念时
⚠️ 需要注意
- 复杂业务逻辑需要结合具体场景调整
- 性能优化需要根据实际数据量评估
❌ 不适用场景
常见陷阱 (Gotchas)
- 版本兼容性:注意框架版本与依赖库的兼容性,不同版本 API 可能有差异
- 配置文件格式:配置文件格式错误是最常见的问题,建议使用编辑器的语法检查
- 环境变量:确保所有必要的环境变量已正确设置,敏感信息不要硬编码
- 依赖冲突:多版本共存时注意依赖冲突,使用 lock 文件锁定版本
- 性能陷阱:大数据量场景下注意性能优化,避免 N+1 查询等常见问题
使用流程
Step 1: 环境准备
确保开发环境已安装必要的依赖和工具。
Step 2: 配置初始化
根据项目需求进行基础配置。
Step 3: 核心功能使用
按照示例代码实现核心功能。
Step 4: 测试验证
运行测试确保功能正常。
Step 5: 部署上线
完成开发后进行部署和监控。
1---2name: stitch-uview-plus-components3description: Convert Stitch designs into uni-app + Vue 3 + uview-plus pages and components. Use when the user mentions Stitch, uview-plus, up- components, or uni-app Vue 3 conversion targeting uview-plus. Retrieves screen HTML via Stitch MCP get_screen, rewrites Tailwind structure into up-* components, and enforces stronger setup, theme, safe-area, tabbar, popup, upload, and dark-mode rules than the generic uView Pro conversion skill.4---56# Stitch to uni-app + uview-plus Components78**Constraint**: Only use this skill when the user explicitly mentions **Stitch** and wants conversion to **uni-app + Vue 3 + uview-plus** with **`up-*`** components.910You are a frontend engineer turning Stitch screens into clean, modular `uview-plus` pages and shared components. Use Stitch MCP (or **stitch-mcp-get-screen**) to retrieve metadata and HTML, then rebuild the screen with `up-*` components, `rpx`, and the current `uview-plus` theme/runtime model.1112## What makes this skill different1314This is not a rename of `stitch-uviewpro-components`.1516It is a stronger `uview-plus`-specific skill that:17- defaults to **`up-*`** instead of `u-*`18- aligns with current `uview-plus` docs, setup, and theme guidance19- covers **`up-status-bar`**, **`up-safe-bottom`**, **`up-popup`**, **`up-upload`**, **`up-subsection`**, **`up-tabbar`**, **`up-empty`**, **`up-gap`**, and **`up-line`**20- prefers CSS variables like **`--up-*`** and runtime theme config over hardcoded colors21- requires stronger page-shell, safe-area, and bottom-CTA handling than the generic uView Pro skill2223## Prerequisites2425- Stitch MCP Server: https://stitch.withgoogle.com/docs/mcp/guide/26- `uni-app` / HBuilderX or Vue CLI project using **Vue 3**27- `uview-plus` installed and wired for Vue 328- Stitch project and screen IDs, resolved in one of two ways:29 1. Parse a **Stitch design URL**: `projectId` from the `/projects/{id}` path and `screenId` from the `node-id` query30 2. Browse with **stitch-mcp-list-projects** and **stitch-mcp-list-screens**3132## Official Documentation3334- **uview-plus docs**: https://uview-plus.jiangruyi.com/35- **Quick start**: https://uview-plus.jiangruyi.com/components/quickstart.html36- **Install / setup**: https://uview-plus.jiangruyi.com/components/setting.html37- **Setup rationale**: https://uview-plus.jiangruyi.com/components/settingDesc.html38- **Theme**: https://uview-plus.jiangruyi.com/guide/theme.html39- **Dark mode**: https://uview-plus.jiangruyi.com/guide/darkMode.html40- **Root bridge**: https://uview-plus.jiangruyi.com/guide/root.html41- Full links and key component docs: [references/official.md](references/official.md)4243## Retrieval and Networking44451. **Discover Stitch MCP prefix**: inspect tools to find the Stitch namespace.462. **Resolve projectId and screenId**:47 - If the user supplied a Stitch URL, parse both IDs directly48 - Otherwise use **stitch-mcp-list-projects** and **stitch-mcp-list-screens**493. **Fetch screen metadata**: call **get_screen** to obtain design JSON, `htmlCode.downloadUrl`, `screenshot.downloadUrl`, dimensions, and device type.504. **Download HTML reliably**:51 ```bash52 bash scripts/fetch-stitch.sh "<htmlCode.downloadUrl>" "temp/source.html"53 ```545. **Use the screenshot as the visual source of truth** when the exported HTML is structurally noisy.5556## Architectural Rules5758- **Use `up-*` only** when a `uview-plus` component exists. Do not generate `u-*` tags in this skill.59- **Prefer modular output**: page shell, shared components, and extracted mock/static data instead of one large page file.60- **Prefer framework-native rebuilds** over literal HTML translation. Reconstruct the page with `up-*` semantics.61- **Prefer theme-aware styles**: use `var(--up-xxx)` and `setConfig({ color })` guidance instead of hardcoded colors when a theme token exists.62- **Prefer runtime-safe page shells**:63 - `up-navbar` for normal headers64 - `up-status-bar` for custom branded headers65 - `up-safe-bottom` for fixed bottom CTAs66- **Read these before drafting code**:67 - [references/component-index.md](references/component-index.md)68 - [references/contract.md](references/contract.md)69 - [references/stitch-html-patterns.md](references/stitch-html-patterns.md)70 - [references/tailwind-to-uview-plus.md](references/tailwind-to-uview-plus.md)7172## Execution Steps73741. **Environment**75 - ensure `uview-plus` is installed76 - ensure Vue 3 project wiring is valid77 - ensure `App.vue`, `main.js`, and `uni.scss` follow current `uview-plus` guidance782. **Data layer**79 - extract repeated text, options, tabs, and upload/demo lists into data modules or page state803. **Page drafting**81 - start from [resources/page-template.vue](resources/page-template.vue)82 - keep the page shell theme-aware and safe-area-aware834. **Component selection**84 - use `up-tabs` or `up-subsection` for switching UI85 - use `up-picker` / `up-popup` instead of raw `select`86 - use `up-upload` instead of raw upload boxes87 - use `up-tabbar` for bottom nav88 - use `up-empty` for empty states895. **Quality check**90 - verify against [resources/architecture-checklist.md](resources/architecture-checklist.md)91 - make sure the final output is clearly stronger and more framework-native than a raw HTML rewrite9293## Official API alignment and common Stitch corrections9495When converting Stitch HTML, verify against [references/contract.md](references/contract.md) and the official `uview-plus` docs. Common corrections:9697| Design element | Wrong from Stitch / generic UI | Correct for uview-plus |98|---|---|---|99| Top tabs | custom `<view>` pills or button row | **`<up-tabs :list="..." :current="current" @change="...">`** or `v-model:current` |100| Segmented filters | custom capsule buttons | **`<up-subsection :list="..." :current="..." @change="...">`** |101| Picker/select | native `<select>` or raw popup list | **`<up-picker v-model:show="show" :columns="columns" @confirm="...">`** |102| Popup/sheet | fixed custom overlay + absolute panel | **`<up-popup v-model:show="show" mode="bottom">`** |103| Upload | dashed custom upload box + hidden file input | **`<up-upload :fileList="..." @afterRead="...">`** |104| Bottom navigation | fixed footer buttons manually styled as nav | **`<up-tabbar :value="value" @change="...">`** |105| Empty state | plain text "No data" | **`<up-empty text="No data">`** |106| Divider / spacing | manual border and margin blocks | **`<up-line>`**, **`<up-divider>`**, **`<up-gap>`** |107| Safe area | fixed bottom CTA without inset handling | **`<up-safe-bottom>`** wrapper |108| Custom header | hardcoded spacer height | **`<up-status-bar>`** when not using `up-navbar` |109| Theme | hex colors everywhere | `var(--up-*)`, theme tokens, and runtime color config |110111## Engineering guidance specific to uview-plus112113- `uview-plus` current docs favor **`up-*`** naming in examples. This skill should output that convention by default.114- For `.vue` / `.uvue` pages, prefer CSS variables such as `var(--up-primary)` and `var(--up-bg-color)`.115- For runtime theme customization, use `setConfig({ color })` guidance when the page needs explicit theme sync.116- Keep `@import 'uview-plus/theme.scss';` semantics in mind when describing project wiring.117- If the project uses the **Root bridge**, global calls like `uni.$u.toast()` can replace manually placing `up-toast` in every page.118119## Testing trigger120121Testing is command-triggered by the user, not by directly calling MCP for no reason.122123- **Example test command**:124 ```text125 Use the Stitch skill to convert https://stitch.withgoogle.com/projects/3492931393329678076?node-id=375b1aadc9cb45209bee8ad4f69af450 into a uview-plus page126 ```127- **Expected result**:128 - parse `projectId` and `screenId`129 - call Stitch MCP `get_screen`130 - fetch the HTML131 - output a `uni-app + Vue 3 + uview-plus` page using `up-*` components, safe-area-aware structure, and current theme guidance132133## Keywords134135**English:** Stitch, uview-plus, up-button, up-tabs, up-tabbar, up-popup, up-upload, uni-app, Vue 3. 136**中文关键词:** Stitch、uview-plus、up 组件、uni-app、Vue3、页面转换。137138## References139140- [examples/usage.md](examples/usage.md)141- [references/official.md](references/official.md)142- [references/contract.md](references/contract.md)143- [references/component-index.md](references/component-index.md)144- [references/stitch-html-patterns.md](references/stitch-html-patterns.md)145- [references/tailwind-to-uview-plus.md](references/tailwind-to-uview-plus.md)146- [resources/architecture-checklist.md](resources/architecture-checklist.md)147- [resources/page-template.vue](resources/page-template.vue)148- [api/component-api.md](api/component-api.md)149- [scripts/fetch-stitch.sh](scripts/fetch-stitch.sh)150- [Stitch API / MCP](https://stitch.withgoogle.com/docs/mcp/guide/)151152## 能力边界153154### ✅ 适用场景155- 当你需要使用此技能对应的技术栈时156- 当项目需要遵循最佳实践时157- 当需要快速上手或深入理解核心概念时158159### ⚠️ 需要注意160- 复杂业务逻辑需要结合具体场景调整161- 性能优化需要根据实际数据量评估162163### ❌ 不适用场景164- 不相关的技术栈或框架165- 需要完全自定义的特殊场景166167## 常见陷阱 (Gotchas)1681691. **版本兼容性**:注意框架版本与依赖库的兼容性,不同版本 API 可能有差异1702. **配置文件格式**:配置文件格式错误是最常见的问题,建议使用编辑器的语法检查1713. **环境变量**:确保所有必要的环境变量已正确设置,敏感信息不要硬编码1724. **依赖冲突**:多版本共存时注意依赖冲突,使用 lock 文件锁定版本1735. **性能陷阱**:大数据量场景下注意性能优化,避免 N+1 查询等常见问题174175## 使用流程176177### Step 1: 环境准备178确保开发环境已安装必要的依赖和工具。179180### Step 2: 配置初始化181根据项目需求进行基础配置。182183### Step 3: 核心功能使用184按照示例代码实现核心功能。185186### Step 4: 测试验证187运行测试确保功能正常。188189### Step 5: 部署上线190完成开发后进行部署和监控。