stitch::code-to-design
它能做什么
这项技能把正在运行或已构建的网页应用转换为 Stitch 设计,包括其 HTML 和设计系统。适合希望把现有前端代码导入 Stitch 的团队。
适用场景
- ✓当你想把现有的 React、Vue 或 Angular 应用保存或上传到 Stitch 的时候。
- ✓当你想把应用的外观移入 Stitch 项目进行重新设计时。
- ✓当某个网页应用需要变成 Stitch 设计以便继续迭代的时候。
技能链接
https://github.com/google-labs-code/stitch-skills/blob/main/plugins/stitch-design/skills/code-to-design/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把我正在运行的 React 应用移入我的 Stitch 项目,以便我在那里重新设计页面。”
每周 5 个新技能,1 分钟读完。
工作原理
它从应用中提取一个独立的 HTML 页面,根据代码生成设计系统文件,然后把两者都上传到你的 Stitch 项目。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Code to Design
Transform your existing frontend code (React + Vite, Next.js, Angular, Vue, etc.) into a Stitch Design so you can iterate and improve it using Stitch.
This skill orchestrates three other skills in sequence:
extract-static-html: Extract a single self-contained HTML file from your build output or running dev server (e.g., Vite dev server or Angular CLIng serve).extract-design-md: Analyze the source code (including Angularangular.json, external.htmltemplates, theme files, and components) to create a design system (DESIGN.md).upload-to-stitch: Upload that HTML file and the design system to your Stitch project.
Workflow
Follow these steps to convert your existing code.
Prerequisites
- A running local dev server (e.g.
npm run dev,ng serve) OR a built web application directory containingindex.htmland assets. - Target Stitch
projectId(uselist_projectsif unknown).
Steps
1. Extract Self-Contained HTML
Delegate to the extract-static-html skill to generate a standalone HTML file.
Read skills/extract-static-html/SKILL.md for detailed instructions and script usage.
Expected output: A single file like /path/to/extracted/standalone.html.
2. Verify HTML (Optional — User-Driven)
After extraction, inform the user of the output file path so they can manually verify in a browser if desired. Do not block on verification — proceed directly to Step 3.
If the user reports issues after reviewing, fix them before continuing.
3. Extract Design System (File)
Delegate to the extract-design-md skill to analyze the project's source files
(components, stylesheets, theme configs) and produce a design system. Read
skills/extract-design-md/SKILL.md for the
full analysis workflow.
Write .stitch/DESIGN.md following the extract-design-md skill's output
structure.
4. Upload DESIGN.md and Create Design System in Stitch
Delegate to the manage-design-system skill to upload the DESIGN.md and
create the design system in Stitch. Read
skills/manage-design-system/SKILL.md for
the full workflow (upload script usage, create_design_system_from_design_md
call, and required schemas). Pass
--generated-by 'stitch::code-to-design' when uploading.
5. Upload HTML to Stitch
Use the same upload-to-stitch skill's script to upload the extracted HTML file.
Read skills/upload-to-stitch/SKILL.md for detailed instructions and script usage.
You will need:
- The path to the standalone HTML file generated in Step 1.
- Your Stitch API Key (same key used in Step 4).
- The target
projectId. - The
--generated-byargument set to'stitch::extract-static-html'. - The
--titleargument set to the route path of the page (e.g.,'/dashboard','/settings/profile','/inbox') so that the screen name/title in Stitch clearly identifies its route in the application.
常见问题
需要让应用处于运行状态吗?
需要。你需要运行本地开发服务器,或者提供包含 index 文件的构建文件夹。
它会替我检查 HTML 吗?
这项技能把检查的工作留给你,你可以打开输出文件自行核对。
项目 ID 是做什么用的?
它告诉 Stitch 应该把上传的设计放入哪个项目。
详情
作者的原始描述
Convert frontend code (Vite, React, Angular, Vue, etc.) to a Stitch Design by chaining static HTML extraction, design system extraction, and file upload. **ALWAYS** use this skill when the user's intent is to move existing web apps or React/Angular/Vue components into Stitch (e.g., requests to "save", "migrate", or "upload"). You must use this skill even for simple "save" operations, as it is the only way to ensure the design system is extracted and assets are properly linked.
热度
- GitHub 星标
- 8.7k
- 排名
- #12341
- 许可证
- Apache-2.0
- 更新时间
- 2026/8/17
评论
- …
同一仓库的更多技能
stitch::react-components
8.7k帮你的智能体把 Stitch 设计转换为 React 和 Vite 组件,或更新现有组件以匹配最新设计,并进行检查。
stitch::react-native
8.7k帮你的智能体把 Stitch 网页设计转换为手机应用用的 React Native 组件,或更新现有的移动端界面以匹配较新的设计。
react-vite-dashboard
8.7k帮你的智能体根据 Stitch 设计构建数据密集型的 React 和 Vite 仪表盘,使用 TanStack Query,并从 DESIGN.md 文件中读取设计令牌。
shadcn-ui
8.7k帮你的智能体查找、安装并自定义 shadcn/ui 组件,这是一组使用 Radix 或 Base UI 以及 Tailwind CSS 构建、可直接复制到项目中的界面组件。