Communitygithub.com

aubarcito48/portfolio

将前端代码(Vite、React、Angular、Vue等)转换为Stitch设计,通过链式调用静态HTML提取、设计系统提取和文件上传实现。**始终**在用户意图将现有Web应用或React/Angular/Vue组件迁移到Stitch时使用此技能(例如请求“保存”、“迁移”或“上传”)。即使对于简单的“保存”操作,也必须使用此技能,因为这是确保提取设计系统并正确链接资产的唯一方法。

portfolio 是什么?

该技能是一个编排工具,旨在将现有前端代码库转换为Stitch设计。它通过依次调用三个专门的技能来实现:`extract-static-html`用于从构建输出或运行中的开发服务器生成独立的HTML文件,`extract-design-md`用于分析源代码(包括Angular配置文件、外部HTML模板、主题文件和组件)以创建设计系统(DESIGN.md),以及`upload-to-stitch`用于将HTML文件和设计系统上传到Stitch项目。此技能对迁移现有Web应用至关重要,因为它能确保正确提取设计令牌和资产,并促进在Stitch中进行迭代。它支持各种框架,包括React、Angular、Vue和Next.js,并适用于本地开发服务器或已构建的应用程序目录。通过自动化从代码到设计的转换,它简化了工作流程,使用户能够将应用程序的设计系统无缝导入Stitch平台。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/aubarcito48/portfolio/tree/HEAD/.agents/skills/stitch-code-to-design

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

代码转设计

将您现有的前端代码(React + Vite、Next.js、Angular、Vue 等)转换为 Stitch 设计,以便您可以使用 Stitch 进行迭代和改进。

此技能按顺序编排其他三个技能:

  1. extract-static-html:从构建输出或运行中的开发服务器(例如 Vite 开发服务器或 Angular CLI ng serve)中提取单个自包含的 HTML 文件。
  2. extract-design-md:分析源代码(包括 Angular angular.json、外部 .html 模板、主题文件和组件)以创建设计系统(DESIGN.md)。
  3. upload-to-stitch:将该 HTML 文件和设计系统上传到您的 Stitch 项目。

工作流程

按照以下步骤转换您现有的代码。

先决条件

  • 一个运行中的本地开发服务器(例如 npm run dev、ng serve)或一个包含 index.html 和资源的已构建 Web 应用程序目录。
  • 目标 Stitch projectId(如果未知,请使用 list_projects)。

步骤

1. 提取自包含 HTML

委托给 extract-static-html 技能以生成独立的 HTML 文件。 阅读 skills/extract-static-html/SKILL.md 获取详细说明和脚本用法。

预期输出:一个类似 /path/to/extracted/standalone.html 的文件。

2. 验证 HTML(可选——由用户驱动)

提取后,告知用户输出文件路径,以便他们可以在浏览器中手动验证(如果需要)。不要阻塞验证——直接继续步骤 3。

如果用户审查后报告问题,请在继续之前修复它们。

3. 提取设计系统(文件)

委托给 extract-design-md 技能以分析项目的源文件(组件、样式表、主题配置)并生成本设计系统。阅读 skills/extract-design-md/SKILL.md 了解完整的分析工作流程。

按照 extract-design-md 技能的输出结构编写 .stitch/DESIGN.md。

4. 上传 DESIGN.md 并在 Stitch 中创建设计系统

委托给 manage-design-system 技能以上传 DESIGN.md 并在 Stitch 中创建设计系统。阅读 skills/manage-design-system/SKILL.md 了解完整的工作流程(上传脚本用法、create_design_system_from_design_md 调用和所需的模式)。上传时传递 --generated-by 'stitch::code-to-design'。

5. 将 HTML 上传到 Stitch

使用相同的 upload-to-stitch 技能的脚本上传提取的 HTML 文件。阅读 skills/upload-to-stitch/SKILL.md 获取详细说明和脚本用法。

您需要:

  • 步骤 1 中生成的独立 HTML 文件的路径。
  • 您的 Stitch API 密钥(与步骤 4 中使用的密钥相同)。
  • 目标 projectId。
  • --generated-by 参数设置为 'stitch::extract-static-html'。
  • --title 参数设置为页面的路由路径(例如 '/dashboard'、'/settings/profile'、'/inbox'),以便 Stitch 中的屏幕名称/标题清晰标识其在应用程序中的路由。

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

aubarcito48/portfolio

Transforms vague UI ideas into polished, Stitch-optimized prompts. Enhances specificity, adds UI/UX keywords, injects design system context, and structures output for better generation results.

aubarcito48/portfolio

>- Extract a comprehensive design system (DESIGN.md) directly from frontend source code — React, Vue, Svelte, Angular, plain HTML/CSS, or any web framework. Analyzes component files, stylesheets, Tailwind configs, theme definitions, and design tokens to produce a rich, Stitch-compatible design system document. Use this skill whenever the user wants to reverse-engineer a design system from an existing codebase, audit the visual language of a project, extract design tokens from source files, or understand the styling patterns in a frontend repo — even if they just say "what does this app look like?" or "pull out the design from this code.

aubarcito48/portfolio

>- Extract self-contained static HTML from a built web application or React components by inlining CSS and images. Use this skill whenever you need to capture a specific UI state, share a static version of a page, or prepare assets for Stitch upload, even if the user just asks to 'save the HTML' or 'mock the view'.

aubarcito48/portfolio

>- Generate new screens from text prompts or images, edit existing screens with prompts and design system tokens, and generate design variants using Stitch MCP. Includes prompt enhancement pipeline, design mappings, professional UI/UX terminology, design tokens and theme system capabilities.

相关技能