跳到正文
Skillpedia
界面(UI/UX)8.7k · #12341

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/google-labs-code/stitch-skills/blob/main/plugins/stitch-design/skills/code-to-design/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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:

  1. 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 CLI ng serve).
  2. extract-design-md: Analyze the source code (including Angular angular.json, external .html templates, theme files, and components) to create a design system (DESIGN.md).
  3. 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 containing index.html and assets.
  • Target Stitch projectId (use list_projects if 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-by argument set to 'stitch::extract-static-html'.
  • The --title argument 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.

repo: google-labs-code/stitch-skills

热度

GitHub 星标
8.7k
排名
#12341
许可证
Apache-2.0
更新时间
2026/8/17

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能