跳到主内容
智客 ZICQ

技能库 智客分类:设计创意 stitch::react-components

Stitch: 反应组件

将 Stitch 设计转换为模块化 Vite 和 React 组件,或同步/更新现有的 React 组件,以配合最新的 Stitch 设计,使用系统级联网和基于 AST 的验证.

50675 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

将 Stitch 设计转换为模块化 Vite 和 React 组件,或同步/更新现有的 React 组件,以配合最新的 Stitch 设计,使用系统级联网和基于 AST 的验证.

何时用

官方 description 未单独写出 Use when。按规范,代理会在用户任务与这段 description 的关键词匹配时激活本技能。

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Stitch to React Components、Phase 1: Retrieval and networking、Anti-patterns for Phase 1、Phase 2: Style extraction、Anti-patterns for Phase 2、Phase 3: Architectural rules。 其中含规范建议的小节:分步指令。

文件分析

文件分析:除 SKILL.md 外,正文引用了 scripts/fetch-stitch.sh,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Converts Stitch designs into modular Vite and React components, or syncs/updates existing React components to align with the latest Stitch designs, using system-level networking and AST-based validation.

Stitch to React ComponentsPhase 1: Retrieval and networkingAnti-patterns for Phase 1Phase 2: Style extractionAnti-patterns for Phase 2Phase 3: Architectural rulesAnti-patterns for Phase 3Phase 4: Execution stepsAnti-patterns for Phase 4Troubleshooting

来源分类:skills.sh agent-skill skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
stitch::react-components
description
Converts Stitch designs into modular Vite and React components, or syncs/updates existing React components to align with the latest Stitch designs, using system-level networking and AST-based validation.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 1
  • scripts/fetch-stitch.sh

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「stitch::react-components」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-22230a0d058d7ced-Stitch-%E5%8F%8D%E5%BA%94%E7%BB%84%E4%BB%B6.html
请存为 .cursor/skills/stitch-react-components/SKILL.md 或 .claude/skills/stitch-react-components/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/google-labs-code/stitch-skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/google-labs-code/stitch-skills' --list

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: stitch::react-components description: >- Converts Stitch designs into modular Vite and React components, or syncs/updates existing React components to align with the latest Stitch designs, using system-level networking and AST-based validation. allowed-tools: - "stitch*:*" - "Bash" - "Read" - "Write" - "web_fetch" --- # Stitch to React Components You are a frontend engineer focused on transforming designs into clean React code or syncing/updating existing React components to align with the latest Stitch designs. You follow a modular approach and use automated tools to ensure code quality. > **CRITICAL: Every step in this skill is MANDATORY. Do NOT skip any step or take shortcuts. Each section contains a GATE that must be satisfied before proceeding.** ## Phase 1: Retrieval and networking > **GATE: Phase 1 is complete ONLY when all screens have been downloaded via `scripts/fetch-stitch.sh` AND visually audited. Reading local files directly without going through this phase is PROHIBITED.** 1. **Namespace discovery**: Run `list_tools` to find the Stitch MCP prefix. Use this prefix (e.g., `stitch:`) for all subsequent calls. 2. **Metadata fetch**: Call `[prefix]:get_screen` for **EVERY screen** in the project to retrieve the design JSON with download URLs. Do NOT skip any screen. 3. **Check for existing designs**: Before downloading, check if `.stitch/designs/{page}.html` and `.stitch/designs/{page}.png` already exist: - **If files exist**: Ask the user whether to refresh the designs from the Stitch project using the MCP, or reuse the existing local files. **You MUST ask — do not assume.** Only re-download if the user confirms. - **If files do not exist**: Proceed to step 4. 4. **High-reliability download**: Internal AI fetch tools can fail on Google Cloud Storage domains. You MUST use the provided script. - **HTML**: `bash scripts/fetch-stitch.sh "[htmlCode.downloadUrl]" ".stitch/designs/{page}.html"` - **Screenshot**: Append `=w{width}` to the screenshot URL first, where `{width}` is the `width` value from the screen metadata (Google CDN serves low-res thumbnails by default). Then run: `bash scripts/fetch-stitch.sh "[screenshot.downloadUrl]=w{width}" ".stitch/designs/{page}.png"` - This script handles the necessary redirects and security handshakes. 5. **Visual audit**: Review the downloaded screenshot (`.stitch/designs/{page}.png`) to confirm design intent and layout details. **You MUST view each screenshot** — do not proceed based on assumptions about the design. 6. **Project metadata tracking**: Retrieve project configuration using `[prefix]:get_project` and save it to `.stitch/metadata.json` (inside the app folder, and mirrored in the workspace root). Ensure it has: - `projectId`, `title`, `deviceType` - A `Last Sync Time` field matching the current sync ISO execution time - A `screens` map detailing each screen's ID, label, sourceScreen reference, dimensions, and canvasPosition. ### Anti-patterns for Phase 1 - ❌ Reading `.stitch/designs/*.html` directly without calling MCP `get_screen` first. - ❌ Skipping the `fetch-stitch.sh` download script. - ❌ Not asking the user when existing files are found. - ❌ Skipping the visual audit of `.png` screenshots. - ❌ Failing to generate or update `.stitch/metadata.json` and its `Last Sync Time` field upon syncing. ## Phase 2: Style extraction > **GATE: Phase 2 is complete ONLY when `resources/style-guide.json` has been updated with tokens extracted from the current project's HTML ``. Tokens from a previous project are NOT acceptable.** 1. **Extract `tailwind.config`**: Open each downloaded HTML file and locate the `tailwind.config` object in the `` `

相关技能

设计创意

自动化工作流程Automation Workflows

设计和实施自动化工作流程,以节省时间和规模化操作作为独家. 用于识别重复任务实现自动化,构建跨工具的工作流程,设置触发器和行动,或优化现有自动化. 包括自动化机会识别,工作流程设计,工具选择(Zapier,Make,n8n),测试,和维护. 触发"自动","自动","工作流程自动…

设计创意

Ui Ux Pro 马克思Ui Ux Pro Max

UI/UX设计智能及建筑抛光接口实施指导. 当用户要求UI设计,UX流量,信息架构,视觉风格方向,设计系统/托盘,组件规格,副本/显微镜,可访问性,或生成/critique/refine前端UI(HTML/CSS/JS,React,Next.js,Vue,Svelte,Tailw…

设计创意

前端设计Frontend Design

创建美丽现代UI的专家前端设计指南. 在构建起落架页面,仪表板,或任何用户界面时使用.

设计创意

N8n 工作流自动化N8n Workflow Automation

设计和输出 n8n 工作流程 JSON 有强力触发器, idempotency, 错误处理, 记录, 重试, 以及 人入"一站"审查队列. 当您需要可审计的自动化时使用.