ck:stitch
AI design generation with Google Stitch. Generate UI designs from text prompts, export Tailwind/HTML/DESIGN.md, orchestrate design-to-code pipeline. Use for rapid prototyping, UI generation, design exploration.
- License 许可
- MIT
- 最近更新
- 2026-05-13
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- ck:stitch
- license
- MIT
- metadata
- { "author": "claudekit", "version": "1.0.0" }
- description
- AI design generation with Google Stitch. Generate UI designs from text prompts, export Tailwind/HTML/DESIGN.md, orchestrate design-to-code pipeline. Use for rapid prototyping, UI generation, design exploration.
- allowed-tools
- [ "Bash", "Read", "Write", "Edit" ]
- argument-hint
- [design prompt or action]
02 资源文件 9
- 参考文档data/mcp-config-snippet.json192 B
- 参考文档references/design-to-code-pipeline.md3.4 KB
- 参考文档references/quota-management.md2.1 KB
- 参考文档references/stitch-mcp-setup.md2.1 KB
- 参考文档references/stitch-sdk-api.md3.8 KB
- 脚本scripts/package.json387 B
- 脚本scripts/stitch-export.ts6.0 KB
- 脚本scripts/stitch-generate.ts6.3 KB
- 脚本scripts/stitch-quota.ts3.3 KB
03 SKILL.md 正文
Google Stitch — AI Design Generation
Generate high-fidelity UI designs from text prompts via Google Stitch. Export Tailwind/HTML, orchestrate design-to-code pipelines with existing UI skills.
Free tier: 400 credits/day + 15 redesign credits/day. Resets at midnight UTC.
Setup
1. API Key
Get an API key at https://stitch.withgoogle.com → Settings → API Keys.
Add STITCH_API_KEY=sk_... to ~/.claude/.env (or ~/.claude/skills/.env).
Running install.sh auto-adds the placeholder if missing — just fill in the value.
2. Install SDK
cd ~/.claude/skills/stitch/scripts && npm install
Or run ~/.claude/skills/install.sh which handles this automatically.
3. Optional
# In ~/.claude/.env
STITCH_PROJECT_ID="my-project" # Default project (auto-creates "claudekit-default" if unset)
STITCH_QUOTA_LIMIT="200" # Override daily limit
4. MCP Server (optional)
Add to ~/.claude/.mcp.json for native design context in Claude Code:
{
"mcpServers": {
"stitch": {
"command": "npx",
"args": ["@_davideast/stitch-mcp", "proxy"],
"env": { "STITCH_API_KEY": "${STITCH_API_KEY}" }
}
}
}
See references/stitch-mcp-setup.md for alternative options (gcloud, auto-installer).
Quick Start
# Check quota
npx tsx scripts/stitch-quota.ts check
# Generate design
npx tsx scripts/stitch-generate.ts "A checkout page with payment form and cart summary"
# Export as HTML + DESIGN.md
npx tsx scripts/stitch-export.ts <screen-id> --format all --output ./stitch-exports/
Actions
generate
Generate UI design from text prompt.
npx tsx scripts/stitch-generate.ts "<prompt>" [--project <id>] [--device MOBILE|DESKTOP|TABLET] [--variants <count>]
Returns: screen ID, preview image URL. With --variants: additional design alternatives.
export
Export generated design as HTML/Tailwind, screenshot, or DESIGN.md.
npx tsx scripts/stitch-export.ts <screen-id> [--format html|image|all] [--output <dir>]
Outputs:
design.html— Semantic HTML with Tailwind CSS classesdesign.png— Screenshot of the designDESIGN.md— Agent-readable design spec (colors, typography, spacing, components)
quota
Check and manage daily quota.
npx tsx scripts/stitch-quota.ts check # Show remaining credits
npx tsx scripts/stitch-quota.ts increment # Bump after generation
npx tsx scripts/stitch-quota.ts reset # Force reset (auto-resets daily)
edit
Refine an existing design.
const editedScreen = await screen.edit("Make the header darker and add a search bar");
Orchestration Pipeline
Design-to-Code Flow
- Check quota — Run
stitch-quota.ts check. If exhausted, suggestck:ui-ux-pro-maxfallback. - Generate — Run
stitch-generate.tswith user's design prompt - Review — Show generated design image to user for feedback
- Variants (optional) — Generate alternatives if user wants exploration
- Export — Run
stitch-export.ts --format allto get HTML + DESIGN.md - Implement — Hand off exported artifacts to implementation skill:
ck:frontend-design— React/Vue/Svelte components from Tailwind exportck:ui-ux-pro-max— Full page layouts with style guide integrationck:ui-styling— Design token extraction from DESIGN.md
- Track quota — Run
stitch-quota.ts increment
Handoff Protocol
- Export creates
DESIGN.mdin project root or plan directory - Implementation skills detect
DESIGN.mdand use it as design spec - DESIGN.md takes precedence over text descriptions when present
- If no DESIGN.md exists, skills fall back to normal text-based design flow
See references/design-to-code-pipeline.md for detailed patterns and examples.
Quota Management
- 400 credits/day + 15 redesign/day, resets at midnight UTC
- Local tracking via
~/.claudekit/.stitch-quota.json - Warns when remaining credits < 20%
- Fallback: When exhausted, use
ck:ui-ux-pro-maxfor text-based design generation
See references/quota-management.md for strategies.
Limitations
- No React export — HTML/Tailwind only; Claude converts to React/Vue components
- Non-responsive layouts — Must add breakpoints manually during implementation
- No animations — Static designs only; add micro-interactions in code
- Single-user — No multiplayer/collaboration features
- Hard daily quota — No paid tier to increase limits
- Generic output risk — Combine with style guides for differentiation
References
| Topic | File |
|---|---|
| SDK API | references/stitch-sdk-api.md |
| MCP Setup | references/stitch-mcp-setup.md |
| Pipeline Patterns | references/design-to-code-pipeline.md |
| Quota Strategy | references/quota-management.md |
04 同仓库更多 Skills
ck:web-testing
Web testing with Playwright, Vitest, k6. E2E/unit/integration/load/security/visual/a11y testing. Use for test automation, flakiness, Core Web Vitals, mobile gestures, cross-browser.
ck:web-frameworks
Build with Next.js (App Router, RSC, SSR, ISR), Turborepo monorepos. Use for React apps, server rendering, build optimization, caching strategies, shared dependencies.
ck:ui-styling
Style UIs with shadcn/ui components (Radix UI + Tailwind CSS). Use for accessible components, themes, dark mode, responsive layouts, design systems, color customization.
ck:threejs
Build 3D web apps with Three.js (WebGL/WebGPU). 556 searchable examples, 60 API classes, 20 use cases. Actions: create 3D scene, load model, add animation, implement physics, build VR/XR. Topics: GLTF loader, PBR materials, particle effects, shadows, post-processing, compute shaders, TSL. Integrations: WebGPU, physics engines, spatial audio.
ck:stitch
AI design generation with Google Stitch. Generate UI designs from text prompts, export Tailwind/HTML/DESIGN.md, orchestrate design-to-code pipeline. Use for rapid prototyping, UI generation, design exploration.
ck:skill-creator
Create or update Claude skills with eval-driven iteration. Use for new skills, skill scripts, references, benchmark optimization, description optimization, eval testing, extending Claude's capabilities.