stitch-kit 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +139 -0
- package/CHANGELOG.md +86 -0
- package/README.md +167 -0
- package/agents/stitch-kit.md +93 -0
- package/bin/stitch-kit.mjs +430 -0
- package/docs/architecture.md +118 -0
- package/docs/color-prompt-guide.md +119 -0
- package/docs/mcp-naming-convention.md +64 -0
- package/docs/mcp-schemas/README.md +130 -0
- package/docs/mcp-schemas/apply_design_system.json +36 -0
- package/docs/mcp-schemas/create_design_system.json +78 -0
- package/docs/mcp-schemas/create_project.json +290 -0
- package/docs/mcp-schemas/delete_project.json +20 -0
- package/docs/mcp-schemas/edit_screens.json +46 -0
- package/docs/mcp-schemas/generate_screen_from_text.json +242 -0
- package/docs/mcp-schemas/generate_variants.json +77 -0
- package/docs/mcp-schemas/get_project.json +137 -0
- package/docs/mcp-schemas/get_screen.json +92 -0
- package/docs/mcp-schemas/list_design_systems.json +32 -0
- package/docs/mcp-schemas/list_projects.json +136 -0
- package/docs/mcp-schemas/list_screens.json +56 -0
- package/docs/mcp-schemas/update_design_system.json +32 -0
- package/docs/mcp-schemas/upload_screens_from_images.json +52 -0
- package/docs/prd-to-stitch-workflow.md +137 -0
- package/docs/skills-index.md +108 -0
- package/docs/tailwind-reference.md +207 -0
- package/package.json +41 -0
- package/skills/stitch-a11y/SKILL.md +428 -0
- package/skills/stitch-a11y/resources/audit-checklist.md +102 -0
- package/skills/stitch-animate/SKILL.md +371 -0
- package/skills/stitch-animate/resources/animation-patterns.md +248 -0
- package/skills/stitch-design-md/SKILL.md +215 -0
- package/skills/stitch-design-md/examples/DESIGN.md +54 -0
- package/skills/stitch-design-md/examples/usage.md +67 -0
- package/skills/stitch-design-md/scripts/fetch-stitch.sh +35 -0
- package/skills/stitch-design-system/SKILL.md +314 -0
- package/skills/stitch-design-system/resources/tokens-template.css +237 -0
- package/skills/stitch-html-components/SKILL.md +344 -0
- package/skills/stitch-html-components/resources/architecture-checklist.md +74 -0
- package/skills/stitch-html-components/scripts/fetch-stitch.sh +45 -0
- package/skills/stitch-loop/SKILL.md +183 -0
- package/skills/stitch-loop/examples/SITE.md +39 -0
- package/skills/stitch-loop/examples/next-prompt.md +24 -0
- package/skills/stitch-loop/examples/usage.md +77 -0
- package/skills/stitch-mcp-apply-design-system/SKILL.md +82 -0
- package/skills/stitch-mcp-create-design-system/SKILL.md +117 -0
- package/skills/stitch-mcp-create-project/SKILL.md +77 -0
- package/skills/stitch-mcp-delete-project/SKILL.md +62 -0
- package/skills/stitch-mcp-edit-screens/SKILL.md +121 -0
- package/skills/stitch-mcp-generate-screen-from-text/SKILL.md +102 -0
- package/skills/stitch-mcp-generate-screen-from-text/examples/desktop.md +53 -0
- package/skills/stitch-mcp-generate-screen-from-text/examples/mobile.md +71 -0
- package/skills/stitch-mcp-generate-variants/SKILL.md +124 -0
- package/skills/stitch-mcp-get-project/SKILL.md +67 -0
- package/skills/stitch-mcp-get-screen/SKILL.md +117 -0
- package/skills/stitch-mcp-get-screen/scripts/fetch-stitch.sh +35 -0
- package/skills/stitch-mcp-list-design-systems/SKILL.md +84 -0
- package/skills/stitch-mcp-list-projects/SKILL.md +77 -0
- package/skills/stitch-mcp-list-screens/SKILL.md +69 -0
- package/skills/stitch-mcp-update-design-system/SKILL.md +82 -0
- package/skills/stitch-mcp-upload-screens-from-images/SKILL.md +95 -0
- package/skills/stitch-mcp-upload-screens-from-images/scripts/encode-image.sh +43 -0
- package/skills/stitch-nextjs-components/SKILL.md +181 -0
- package/skills/stitch-nextjs-components/resources/architecture-checklist.md +65 -0
- package/skills/stitch-nextjs-components/resources/component-template.tsx +101 -0
- package/skills/stitch-nextjs-components/scripts/fetch-stitch.sh +45 -0
- package/skills/stitch-orchestrator/SKILL.md +337 -0
- package/skills/stitch-orchestrator/examples/workflow.md +173 -0
- package/skills/stitch-react-components/SKILL.md +236 -0
- package/skills/stitch-react-components/references/tailwind-to-react.md +117 -0
- package/skills/stitch-react-components/resources/architecture-checklist.md +34 -0
- package/skills/stitch-react-components/resources/component-template.tsx +35 -0
- package/skills/stitch-react-components/scripts/fetch-stitch.sh +35 -0
- package/skills/stitch-react-native-components/SKILL.md +333 -0
- package/skills/stitch-react-native-components/resources/architecture-checklist.md +74 -0
- package/skills/stitch-react-native-components/resources/component-template.tsx +104 -0
- package/skills/stitch-react-native-components/scripts/fetch-stitch.sh +45 -0
- package/skills/stitch-remotion/SKILL.md +280 -0
- package/skills/stitch-setup/SKILL.md +183 -0
- package/skills/stitch-shadcn-ui/SKILL.md +255 -0
- package/skills/stitch-skill-creator/SKILL.md +257 -0
- package/skills/stitch-skill-creator/references/output-patterns.md +71 -0
- package/skills/stitch-skill-creator/scripts/init_stitch_skill.py +229 -0
- package/skills/stitch-svelte-components/SKILL.md +282 -0
- package/skills/stitch-svelte-components/resources/architecture-checklist.md +62 -0
- package/skills/stitch-svelte-components/resources/component-template.svelte +193 -0
- package/skills/stitch-svelte-components/scripts/fetch-stitch.sh +36 -0
- package/skills/stitch-swiftui-components/SKILL.md +424 -0
- package/skills/stitch-swiftui-components/resources/architecture-checklist.md +83 -0
- package/skills/stitch-swiftui-components/resources/component-template.swift +131 -0
- package/skills/stitch-swiftui-components/resources/layout-mapping.md +155 -0
- package/skills/stitch-swiftui-components/scripts/fetch-stitch.sh +45 -0
- package/skills/stitch-ued-guide/SKILL.md +124 -0
- package/skills/stitch-ui-design-spec-generator/SKILL.md +115 -0
- package/skills/stitch-ui-design-spec-generator/examples/usage.md +79 -0
- package/skills/stitch-ui-design-variants/SKILL.md +127 -0
- package/skills/stitch-ui-prompt-architect/SKILL.md +196 -0
- package/skills/stitch-ui-prompt-architect/references/KEYWORDS.md +170 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
Guidance for Claude Code, Cursor, Copilot, Codex CLI, and other AI agents working with this plugin.
|
|
4
|
+
|
|
5
|
+
## What this repo is
|
|
6
|
+
|
|
7
|
+
A collection of Claude Code **skills** — 34 packaged instructions and scripts that extend AI agents with Stitch-specific capabilities: text-to-UI generation, design iteration (edit, variants, design systems), design token extraction, and multi-framework conversion. Think of it as a Stitch co-pilot that wraps all 14 MCP tools and knows the footguns so you don't have to learn them the hard way.
|
|
8
|
+
|
|
9
|
+
## Skill structure
|
|
10
|
+
|
|
11
|
+
Each skill directory follows the Agent Skills standard:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
skills/{skill-name}/
|
|
15
|
+
├── SKILL.md ← Required: activation instructions and workflow
|
|
16
|
+
├── examples/ ← Required: worked examples (gold-standard reference)
|
|
17
|
+
├── resources/ ← Optional: templates, checklists, mapping tables
|
|
18
|
+
├── scripts/ ← Optional: bash scripts (fetch-stitch.sh, encode-image.sh, etc.)
|
|
19
|
+
└── references/ ← Optional: style guides, contracts
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- **SKILL.md**: YAML frontmatter (`name`, `description`, `allowed-tools`) + markdown instructions
|
|
23
|
+
- **examples/**: Load for few-shot context when needed
|
|
24
|
+
- **resources/**, **scripts/**: Progressive disclosure — reference only when relevant
|
|
25
|
+
|
|
26
|
+
## Quick install (both platforms)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx stitch-kit
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Auto-detects Claude Code and/or Codex CLI and installs to the right places. Also tells you if Stitch MCP needs configuring.
|
|
33
|
+
|
|
34
|
+
To update later: `npx stitch-kit update` (npx always fetches the latest version).
|
|
35
|
+
To check what's installed: `npx stitch-kit status`.
|
|
36
|
+
|
|
37
|
+
## Installing (Claude Code)
|
|
38
|
+
|
|
39
|
+
Stitch MCP first:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
claude mcp add stitch -- npx -y @google/stitch-mcp
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Then the plugin:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
/plugin marketplace add https://github.com/gabelul/stitch-kit.git
|
|
49
|
+
/plugin install stitch-kit@stitch-kit
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Installing (Codex CLI)
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx stitch-kit
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Or clone and run the installer manually:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
git clone https://github.com/gabelul/stitch-kit.git
|
|
62
|
+
cd stitch-kit && bash install-codex.sh
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Then wire up Stitch MCP in `~/.codex/config.toml`:
|
|
66
|
+
|
|
67
|
+
```toml
|
|
68
|
+
[mcp_servers.stitch]
|
|
69
|
+
command = "npx"
|
|
70
|
+
args = ["-y", "@google/stitch-mcp"]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Use `$stitch-kit` to invoke the agent or `$stitch-orchestrator` to run a skill directly.
|
|
74
|
+
|
|
75
|
+
## Agent definition
|
|
76
|
+
|
|
77
|
+
`agents/stitch-kit.md` defines the stitch-kit specialist agent. Works in both Claude Code and Codex. It knows the full skill set (including edit-screens, generate-variants, design systems), handles Stitch URL parsing, and routes to the right skill automatically.
|
|
78
|
+
|
|
79
|
+
## Recommended entry point
|
|
80
|
+
|
|
81
|
+
For Stitch-based UI generation, load **`stitch-orchestrator`** or invoke the **`stitch-kit` agent** — both coordinate the full workflow end-to-end. Start here unless you have a specific reason to go manual.
|
|
82
|
+
|
|
83
|
+
## Architecture (4 layers)
|
|
84
|
+
|
|
85
|
+
| Layer | Count | Purpose |
|
|
86
|
+
|-------|-------|---------|
|
|
87
|
+
| **Brain** (`stitch-ui-*`) | 4 | Design intelligence — specs, prompts, variants, UED guide |
|
|
88
|
+
| **Hands** (`stitch-mcp-*`) | 14 | MCP wrappers — one per Stitch API tool, handles ID format rules |
|
|
89
|
+
| **Conversion** | 7+ | Stitch HTML → framework components (Next.js, Svelte, React, HTML, RN, SwiftUI, shadcn) |
|
|
90
|
+
| **Quality** | 3 | Design tokens, accessibility audit, animations |
|
|
91
|
+
|
|
92
|
+
## MCP prerequisite
|
|
93
|
+
|
|
94
|
+
Skills marked `allowed-tools: ["stitch*:*"]` require the **Stitch MCP Server** configured in your client. Without it, the generation steps won't work.
|
|
95
|
+
|
|
96
|
+
Setup guide: https://stitch.withgoogle.com/docs/mcp/guide/
|
|
97
|
+
|
|
98
|
+
All 14 tools wrapped: `create_project`, `get_project`, `delete_project`, `list_projects`, `generate_screen_from_text`, `upload_screens_from_images`, `edit_screens`, `generate_variants`, `list_screens`, `get_screen`, `create_design_system`, `update_design_system`, `list_design_systems`, `apply_design_system`
|
|
99
|
+
|
|
100
|
+
Without MCP: the orchestrator falls back to prompt-only mode (generates ready-to-copy Stitch prompts instead of running the full workflow — still useful, just slower).
|
|
101
|
+
|
|
102
|
+
## Key skills reference
|
|
103
|
+
|
|
104
|
+
| Skill | When to invoke |
|
|
105
|
+
|-------|----------------|
|
|
106
|
+
| `stitch-orchestrator` | "Use Stitch to design X" — handles everything |
|
|
107
|
+
| `stitch-ui-design-spec-generator` | User request → structured JSON design spec |
|
|
108
|
+
| `stitch-ui-prompt-architect` | Design spec → structured Stitch prompt |
|
|
109
|
+
| `stitch-mcp-edit-screens` | Edit existing screens with text prompts (iteration) |
|
|
110
|
+
| `stitch-mcp-generate-variants` | Generate design alternatives with creativity controls |
|
|
111
|
+
| `stitch-mcp-upload-screens-from-images` | Import screenshots for redesign workflows |
|
|
112
|
+
| `stitch-mcp-create-design-system` | Create reusable Stitch Design Systems |
|
|
113
|
+
| `stitch-mcp-apply-design-system` | Apply design systems to screens |
|
|
114
|
+
| `stitch-mcp-get-screen` | Retrieve screen HTML + screenshot by ID |
|
|
115
|
+
| `stitch-design-system` | Extract design tokens → CSS + Tailwind files |
|
|
116
|
+
| `stitch-nextjs-components` | Convert to Next.js 15 App Router |
|
|
117
|
+
| `stitch-svelte-components` | Convert to Svelte 5 / SvelteKit |
|
|
118
|
+
| `stitch-html-components` | Convert to HTML5 + CSS (WebView / Capacitor) |
|
|
119
|
+
| `stitch-react-native-components` | Convert to React Native / Expo |
|
|
120
|
+
| `stitch-swiftui-components` | Convert to SwiftUI (iOS) |
|
|
121
|
+
| `stitch-loop` | Iterative multi-page site building |
|
|
122
|
+
| `stitch-shadcn-ui` | Add shadcn/ui components to React output |
|
|
123
|
+
| `stitch-animate` | Add animations to generated components |
|
|
124
|
+
| `stitch-a11y` | WCAG 2.1 AA accessibility audit and fixes |
|
|
125
|
+
| `stitch-setup` | Install Stitch MCP + this plugin |
|
|
126
|
+
|
|
127
|
+
## Full docs reference
|
|
128
|
+
|
|
129
|
+
See [`docs/`](docs/) for:
|
|
130
|
+
- `skills-index.md` — complete skills table with descriptions and layers
|
|
131
|
+
- `mcp-schemas/` — JSON Schema for all 14 Stitch MCP tools
|
|
132
|
+
- `color-prompt-guide.md` — 8 ready-to-use color palette prompts for Stitch
|
|
133
|
+
- `tailwind-reference.md` — Tailwind utility class reference for conversions
|
|
134
|
+
- `mcp-naming-convention.md` — MCP tool name → skill name mapping
|
|
135
|
+
- `prd-to-stitch-workflow.md` — PRD-driven design workflow guide
|
|
136
|
+
|
|
137
|
+
## Context efficiency
|
|
138
|
+
|
|
139
|
+
Skills load on demand — only the relevant `SKILL.md` gets loaded per request. Resources and examples are loaded progressively when the skill needs them. Keep `SKILL.md` focused (under 500 lines) and use `references/` for detail.
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.0.0 (2026-02-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add 8 MCP wrappers, orchestrator iteration loop, native variants, design systems ([a77405a](https://github.com/gabelul/stitch-kit/commit/a77405a6248c22327a355124150a663c4364319f))
|
|
9
|
+
* add prompt quality standard, project reuse, generation timing ([b525398](https://github.com/gabelul/stitch-kit/commit/b525398a07d422c8df6bb1192b76458daa420b9a))
|
|
10
|
+
* initial release — stitch-kit v1.3.0 ([6ec1494](https://github.com/gabelul/stitch-kit/commit/6ec1494b578f8ea344fdbb11ebd9cebd96021a7f))
|
|
11
|
+
* register agents directory in plugin manifest and marketplace ([181a7cf](https://github.com/gabelul/stitch-kit/commit/181a7cfe33d036ac581a934e0a0f9700465b7a9e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* add tools and color fields to agent frontmatter to match Claude Code agent format ([40edcf5](https://github.com/gabelul/stitch-kit/commit/40edcf55a859ba332e0572aa3f14132e6f4d6a9f))
|
|
17
|
+
* remove agents field from marketplace plugins array (invalid schema) ([1ad69b7](https://github.com/gabelul/stitch-kit/commit/1ad69b7137be55d999989e34b15add7aeac043ad))
|
|
18
|
+
* remove unverified agents field from plugin.json ([b0b1e7b](https://github.com/gabelul/stitch-kit/commit/b0b1e7b65ccf62a5c27be73347af2f1e126ee6a8))
|
|
19
|
+
* rename plugin group to stitch-kit for agent auto-discovery ([e1cd72f](https://github.com/gabelul/stitch-kit/commit/e1cd72f79b2fe19bbd810eb4525ba14a29d4ed7b))
|
|
20
|
+
* strip agent frontmatter to minimal format for plugin discovery ([69ec523](https://github.com/gabelul/stitch-kit/commit/69ec5235e9b50bfe37625afd99472bdbafb3843d))
|
|
21
|
+
|
|
22
|
+
## [1.5.0] - 2026-02-25
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
- 8 new MCP wrapper skills covering all remaining Stitch API tools (14 total):
|
|
26
|
+
- `stitch-mcp-edit-screens` — iterate on designs with text prompts (the iteration tool)
|
|
27
|
+
- `stitch-mcp-generate-variants` — native variant generation with creativity/aspect controls
|
|
28
|
+
- `stitch-mcp-upload-screens-from-images` — import screenshots for redesign workflows
|
|
29
|
+
- `stitch-mcp-delete-project` — project cleanup with mandatory confirmation gate
|
|
30
|
+
- `stitch-mcp-create-design-system` — create reusable Stitch Design Systems from tokens
|
|
31
|
+
- `stitch-mcp-update-design-system` — modify existing design systems
|
|
32
|
+
- `stitch-mcp-list-design-systems` — discover available design systems
|
|
33
|
+
- `stitch-mcp-apply-design-system` — apply design systems to screens for visual consistency
|
|
34
|
+
- `encode-image.sh` helper script for base64 image encoding (macOS + Linux)
|
|
35
|
+
- Post-generation iteration loop in orchestrator (Step 5b) — edit, variant, or apply design system before code conversion
|
|
36
|
+
- Design system bridge (Step 7b) — maps extracted CSS tokens to Stitch Design System format
|
|
37
|
+
- Design system check (Step 4b) — detects existing design systems when selecting a project
|
|
38
|
+
- Native API detection in `stitch-ui-design-variants` — uses `generate_variants` tool when available (1 call vs 3)
|
|
39
|
+
- Consolidated ID format table for all 14 MCP tools in orchestrator
|
|
40
|
+
- 8 new JSON schema files in `docs/mcp-schemas/`
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
- Orchestrator intent classification expanded from 4 to 7 (added: Edit existing, Upload screenshot, Delete project)
|
|
44
|
+
- Orchestrator Step 6 menus expanded with edit, variant, and design system options
|
|
45
|
+
- `stitch-mcp-generate-screen-from-text` deviceType enum: replaced `SMART_WATCH` with `AGNOSTIC`
|
|
46
|
+
- Skill count: 26 → 34
|
|
47
|
+
- MCP wrapper count: 6 → 14
|
|
48
|
+
- Anti-patterns expanded from 7 to 11
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
- `deviceType` enum now matches official Stitch API (`AGNOSTIC` instead of non-existent `SMART_WATCH`)
|
|
52
|
+
|
|
53
|
+
## [1.4.0] - 2026-02-25
|
|
54
|
+
|
|
55
|
+
### Added
|
|
56
|
+
- Prompt Quality Standard checklist in `stitch-ui-prompt-architect` — requires explicit hex colors, px font sizes, component styles before generation
|
|
57
|
+
- Verification gate in orchestrator before screen generation
|
|
58
|
+
- Project reuse logic — orchestrator checks existing projects before creating new ones
|
|
59
|
+
- Generation timing guidance (60–180s is normal, no spam retries)
|
|
60
|
+
- CHANGELOG.md for tracking releases
|
|
61
|
+
|
|
62
|
+
### Changed
|
|
63
|
+
- README install section: clarified agent discovery behavior
|
|
64
|
+
- Orchestrator Step 4: asks before creating new projects
|
|
65
|
+
- Orchestrator Step 5: generation timing + retry rules
|
|
66
|
+
- `stitch-mcp-generate-screen-from-text`: added timing section
|
|
67
|
+
- Strengthened anti-patterns in orchestrator (no silent project creation, no retry spam)
|
|
68
|
+
|
|
69
|
+
## [1.3.0] - 2026-02-19
|
|
70
|
+
|
|
71
|
+
### Added
|
|
72
|
+
- 26 skills covering full design-to-code pipeline
|
|
73
|
+
- Agent definition (`agents/stitch-kit.md`) for Claude Code + Codex
|
|
74
|
+
- MCP wrapper skills handling Stitch ID format inconsistencies
|
|
75
|
+
- Framework targets: Next.js, Svelte, React, HTML, React Native, SwiftUI
|
|
76
|
+
- Post-gen quality: design tokens, a11y audit, animations
|
|
77
|
+
- Multi-page consistency via stitch-loop + DESIGN.md
|
|
78
|
+
- Codex CLI support via install-codex.sh
|
|
79
|
+
- GitHub Actions CI validation
|
|
80
|
+
- release-please automated versioning
|
|
81
|
+
|
|
82
|
+
### Architecture
|
|
83
|
+
- Brain layer: spec-generator, prompt-architect, design-variants, ued-guide
|
|
84
|
+
- Hands layer: 6 MCP wrapper skills
|
|
85
|
+
- Quality layer: design-system, a11y, animate
|
|
86
|
+
- Loop layer: stitch-loop + design-md
|
package/README.md
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# stitch-kit — AI UI design to production code, for Claude Code and Codex
|
|
2
|
+
|
|
3
|
+
The Claude Code plugin for AI UI design — generate screens with Stitch MCP and convert them to something you can actually ship.
|
|
4
|
+
|
|
5
|
+
I built this because Stitch MCP generates beautiful screens, and then... you're on your own. The raw output is HTML. Getting it into Next.js with dark mode, proper TypeScript, design tokens, and accessibility? That's the part nobody talks about. So I built the pipeline that handles it.
|
|
6
|
+
|
|
7
|
+
34 skills. One entry point. Covers the full trip from "describe a UI" to production-ready components in Next.js, Svelte, React, React Native, SwiftUI, or plain HTML. Works in Claude Code and Codex CLI.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
### Quick install (both platforms)
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx stitch-kit
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Auto-detects Claude Code and/or Codex CLI and installs to the right places. Also tells you if Stitch MCP needs configuring.
|
|
20
|
+
|
|
21
|
+
To update later: `npx stitch-kit update` (npx always fetches the latest version).
|
|
22
|
+
To check what's installed: `npx stitch-kit status`.
|
|
23
|
+
|
|
24
|
+
### Claude Code (plugin)
|
|
25
|
+
|
|
26
|
+
Stitch MCP first (it's what actually talks to Google's generation API):
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
claude mcp add stitch -- npx -y @google/stitch-mcp
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Sign in at [stitch.withgoogle.com](https://stitch.withgoogle.com) to do the Google auth thing. Then the plugin:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
/plugin marketplace add https://github.com/gabelul/stitch-kit.git
|
|
36
|
+
/plugin install stitch-kit@stitch-kit
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Restart Claude Code. The `stitch-kit` agent activates automatically when you describe Stitch tasks — it may not appear in the Plugin agents list depending on your Claude Code version, but it works when invoked.
|
|
40
|
+
|
|
41
|
+
### Codex CLI
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx stitch-kit
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Or clone and run the installer manually:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
git clone https://github.com/gabelul/stitch-kit.git
|
|
51
|
+
cd stitch-kit && bash install-codex.sh
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Then wire up Stitch MCP in `~/.codex/config.toml`:
|
|
55
|
+
|
|
56
|
+
```toml
|
|
57
|
+
[mcp_servers.stitch]
|
|
58
|
+
command = "npx"
|
|
59
|
+
args = ["-y", "@google/stitch-mcp"]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Use `$stitch-kit` to activate the agent or `$stitch-orchestrator` to go straight to the pipeline.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## How it works
|
|
67
|
+
|
|
68
|
+
1. You describe what you want to build
|
|
69
|
+
2. `stitch-orchestrator` handles: spec → prompt → generate → retrieve → tokens → convert
|
|
70
|
+
3. You get TypeScript components with dark mode, responsive layout, and ARIA — not vibes
|
|
71
|
+
|
|
72
|
+
There's an agent definition (`agents/stitch-kit.md`) for both Claude Code and Codex — a Stitch-aware agent that knows the ID format quirks, routes to the right skill, and doesn't hallucinate MCP tool names.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Architecture
|
|
77
|
+
|
|
78
|
+
Four layers. Each one exists for a reason.
|
|
79
|
+
|
|
80
|
+
| Layer | What it is | What it does |
|
|
81
|
+
|-------|------------|-------------|
|
|
82
|
+
| **Brain** (`stitch-ui-*`) | Design intelligence | Spec generation, prompt engineering, design variants. No API calls, no cost. |
|
|
83
|
+
| **Hands** (`stitch-mcp-*`) | MCP wrappers | One skill per Stitch API tool (all 14). Handles the ID format mess so the orchestrator doesn't have to. |
|
|
84
|
+
| **Quality** | Post-gen polish | Design tokens → CSS vars, WCAG 2.1 AA audit, animations with reduced-motion. |
|
|
85
|
+
| **Loop** | Multi-page builds | `DESIGN.md` carries visual state between screens so your 5th screen looks like your 1st. |
|
|
86
|
+
|
|
87
|
+
**Why do the MCP wrappers exist?** Because `generate_screen_from_text` and `get_screen` want numeric IDs, while `get_project` and `list_screens` want `projects/ID` — and agents get this wrong constantly. The wrappers bake the rules in so you don't have to think about it. (It's a small thing that ruins a lot of runs.)
|
|
88
|
+
|
|
89
|
+
Details → [docs/architecture.md](docs/architecture.md)
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## What's in each skill
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
skills/[skill-name]/
|
|
97
|
+
├── SKILL.md — what it is, when to use it, how to run it
|
|
98
|
+
├── examples/ — real examples the agent can copy instead of guess
|
|
99
|
+
├── references/ — design contracts, checklists (loaded on demand)
|
|
100
|
+
└── scripts/ — fetch helpers, validators, code generators
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Every skill tells the agent what it does and when to reach for it. The examples folder is why output quality is consistent — agents copy real patterns instead of hallucinating boilerplate. The scripts handle the stuff that needs to actually run (like downloading Stitch HTML before the GCS URL expires).
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## vs. the official Google Stitch Skills
|
|
108
|
+
|
|
109
|
+
The [official repo](https://github.com/google-labs-code/stitch-skills) has 6 skills. stitch-kit has 34. Every official skill has a local equivalent that's stronger:
|
|
110
|
+
|
|
111
|
+
| Official | stitch-kit | What's different |
|
|
112
|
+
|----------|-----------|-----------------|
|
|
113
|
+
| `design-md` | `stitch-design-md` | Adds Section 6 — design system notes that feed back into Stitch prompts for consistent multi-screen output |
|
|
114
|
+
| `enhance-prompt` | `stitch-ui-prompt-architect` | Two modes: (A) vague → enhanced, same as official; (B) Design Spec + request → structured `[Context][Layout][Components]` prompt. Mode B produces significantly better results. |
|
|
115
|
+
| `stitch-loop` | `stitch-loop` | Visual verification step, explicit MCP naming throughout, DESIGN.md integration |
|
|
116
|
+
| `react-components` | `stitch-react-components` | MCP-native retrieval, optional DESIGN.md alignment |
|
|
117
|
+
| `remotion` | `stitch-remotion` | Common patterns (slideshow, feature highlight, user flow), voiceover, dynamic text |
|
|
118
|
+
| `shadcn-ui` | `stitch-shadcn-ui` | Init styles support, custom registries, validation checklist |
|
|
119
|
+
|
|
120
|
+
**What's entirely new in stitch-kit:**
|
|
121
|
+
- `stitch-mcp-*` wrappers — all 14 Stitch API tools wrapped with ID format safety
|
|
122
|
+
- `stitch-mcp-edit-screens` — iterate on designs with text prompts without regenerating
|
|
123
|
+
- `stitch-mcp-generate-variants` — native variant generation with creativity controls
|
|
124
|
+
- `stitch-mcp-upload-screens-from-images` — import screenshots for redesign workflows
|
|
125
|
+
- `stitch-mcp-create/update/list/apply-design-system` — full Stitch Design System lifecycle
|
|
126
|
+
- `stitch-mcp-delete-project` — project cleanup with confirmation gate
|
|
127
|
+
- `stitch-orchestrator` (end-to-end coordinator with post-generation iteration loop)
|
|
128
|
+
- `stitch-ui-design-spec-generator` (structured spec first, then prompt — better output than pure prompt enhancement)
|
|
129
|
+
- Mobile: `stitch-react-native-components` + `stitch-swiftui-components`
|
|
130
|
+
- `stitch-design-system` (token extraction → CSS custom properties)
|
|
131
|
+
- `stitch-a11y` (WCAG audit + auto-fixes)
|
|
132
|
+
- `stitch-animate` (motion with `prefers-reduced-motion` handled)
|
|
133
|
+
- `stitch-skill-creator` (if you want to extend it)
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Output targets
|
|
138
|
+
|
|
139
|
+
| Target | Skill | Notes |
|
|
140
|
+
|--------|-------|-------|
|
|
141
|
+
| Next.js 15 App Router | `stitch-nextjs-components` | Server/Client split, `next-themes`, TypeScript strict |
|
|
142
|
+
| Svelte 5 / SvelteKit | `stitch-svelte-components` | Runes API, scoped CSS, built-in transitions |
|
|
143
|
+
| Vite + React | `stitch-react-components` | `useTheme()` hook, Tailwind, no App Router |
|
|
144
|
+
| HTML5 + CSS | `stitch-html-components` | No build step — PWA, WebView, Capacitor ready |
|
|
145
|
+
| shadcn/ui | `stitch-shadcn-ui` | Radix primitives, token alignment with Stitch |
|
|
146
|
+
| React Native / Expo | `stitch-react-native-components` | iOS + Android, `useColorScheme`, safe areas |
|
|
147
|
+
| SwiftUI | `stitch-swiftui-components` | iOS 16+, `@Environment(\.colorScheme)`, 44pt targets |
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Full skill reference
|
|
152
|
+
|
|
153
|
+
All 34 skills with descriptions, layers, and the ID format table → [docs/skills-index.md](docs/skills-index.md)
|
|
154
|
+
|
|
155
|
+
MCP API schemas (JSON Schema for all 14 Stitch tools) → [docs/mcp-schemas/](docs/mcp-schemas/)
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Prerequisites
|
|
160
|
+
|
|
161
|
+
- Stitch MCP — [setup guide](https://stitch.withgoogle.com/docs/mcp/guide/) (Google account required)
|
|
162
|
+
- Node.js for web framework conversions
|
|
163
|
+
- Xcode 15+ for SwiftUI, Expo CLI for React Native
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
Built with AI by Gabi @ [Booplex.com](https://booplex.com) — Apache 2.0
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stitch-kit
|
|
3
|
+
description: "Use this agent for anything Stitch-related: generating UI screens from text, editing/iterating designs, generating design variants, managing Stitch Design Systems, converting designs to production code, extracting design tokens, and running the full design-to-ship pipeline. Examples: (1) Generate a UI from a description or PRD using Stitch MCP; (2) Edit an existing screen with text prompts (change colors, layout, content); (3) Generate design variants with configurable creativity; (4) Upload screenshots and redesign them in Stitch; (5) Create and apply Stitch Design Systems for visual consistency; (6) Convert a Stitch screen to Next.js, Svelte, React, React Native, or SwiftUI components; (7) Extract design tokens and CSS variables from a generated screen; (8) Build a multi-page site iteratively with visual consistency across screens; (9) Audit components for WCAG 2.1 AA accessibility; (10) Parse a Stitch URL (stitch.withgoogle.com/projects/ID?node-id=SCREEN_ID) and go straight to conversion."
|
|
4
|
+
model: opus
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are a Stitch design-to-code specialist. You handle the full pipeline from UI generation through iteration and production-ready framework components.
|
|
8
|
+
|
|
9
|
+
## What you can do
|
|
10
|
+
|
|
11
|
+
- Generate UI screens via Stitch MCP (create_project → generate_screen_from_text → get_screen)
|
|
12
|
+
- Edit existing screens with text prompts (edit_screens) — iterate without regenerating
|
|
13
|
+
- Generate design variants with configurable creativity and aspect controls (generate_variants)
|
|
14
|
+
- Upload screenshots/mockups to redesign in Stitch (upload_screens_from_images)
|
|
15
|
+
- Create, update, list, and apply Stitch Design Systems for cross-screen consistency
|
|
16
|
+
- Convert Stitch HTML to Next.js 15 App Router, Svelte 5, Vite+React, HTML5, React Native/Expo, or SwiftUI
|
|
17
|
+
- Extract design tokens → CSS custom properties (light + dark mode)
|
|
18
|
+
- Build multi-page sites iteratively with the stitch-loop baton pattern
|
|
19
|
+
- Audit and fix accessibility (WCAG 2.1 AA)
|
|
20
|
+
- Add purposeful animation (CSS, Framer Motion, Svelte transitions)
|
|
21
|
+
- Delete projects with confirmation safety gate
|
|
22
|
+
|
|
23
|
+
## How to approach tasks
|
|
24
|
+
|
|
25
|
+
**If the user gives a Stitch URL** (e.g. `https://stitch.withgoogle.com/projects/3492931393329678076?node-id=375b1aadc9cb45209bee8ad4f69af450`):
|
|
26
|
+
Parse it directly — `projectId` is the path segment after `/projects/`, `screenId` is the `node-id` query param. Call `get_screen` immediately. No need to list projects or screens first.
|
|
27
|
+
|
|
28
|
+
**If the user wants to generate a new screen:**
|
|
29
|
+
1. Use `stitch-ui-design-spec-generator` to build a structured spec from the request
|
|
30
|
+
2. Use `stitch-ui-prompt-architect` to produce a `[Context] [Layout] [Components]` prompt
|
|
31
|
+
3. Call `stitch-mcp-create-project` → `stitch-mcp-generate-screen-from-text` → `stitch-mcp-list-screens` → `stitch-mcp-get-screen`
|
|
32
|
+
4. Offer the post-generation iteration menu: edit, generate variants, apply design system, or convert to code
|
|
33
|
+
|
|
34
|
+
**If the user wants to edit an existing screen:**
|
|
35
|
+
Call `stitch-mcp-edit-screens` with specific edit instructions. Handle `output_components` suggestions for refinement loops.
|
|
36
|
+
|
|
37
|
+
**If the user wants variants:**
|
|
38
|
+
Call `stitch-mcp-generate-variants` with `variantOptions` (creativeRange: REFINE/EXPLORE/REIMAGINE, aspects: LAYOUT/COLOR_SCHEME/IMAGES/TEXT_FONT/TEXT_CONTENT).
|
|
39
|
+
|
|
40
|
+
**If the user wants to upload a screenshot:**
|
|
41
|
+
Encode the image to base64 with `scripts/encode-image.sh`, then call `stitch-mcp-upload-screens-from-images`. Offer edit or convert after.
|
|
42
|
+
|
|
43
|
+
**If the user wants to convert an existing screen:**
|
|
44
|
+
Get the HTML via `get_screen`, download it with `fetch-stitch.sh` if needed, then run the appropriate framework skill.
|
|
45
|
+
|
|
46
|
+
**If the user has a PRD:**
|
|
47
|
+
Follow the PRD-driven workflow: `stitch-ui-design-spec-generator` → `stitch-ui-prompt-architect` → MCP generation → iteration → conversion.
|
|
48
|
+
|
|
49
|
+
## Critical ID format rules
|
|
50
|
+
|
|
51
|
+
Stitch uses inconsistent ID formats across tools. Use the `stitch-mcp-*` wrapper skills — they handle this automatically.
|
|
52
|
+
|
|
53
|
+
| Tool | projectId | screenId | Other IDs |
|
|
54
|
+
|------|-----------|----------|-----------|
|
|
55
|
+
| `create_project` | — | — | Returns `projects/ID` |
|
|
56
|
+
| `get_project` | `projects/ID` | — | — |
|
|
57
|
+
| `delete_project` | `projects/ID` | — | — |
|
|
58
|
+
| `list_projects` | — | — | Returns full paths |
|
|
59
|
+
| `list_screens` | `projects/ID` | — | Returns full paths |
|
|
60
|
+
| `get_screen` | Numeric | Numeric | — |
|
|
61
|
+
| `generate_screen_from_text` | Numeric | — | — |
|
|
62
|
+
| `upload_screens_from_images` | Numeric | — | — |
|
|
63
|
+
| `edit_screens` | Numeric | Numeric array | — |
|
|
64
|
+
| `generate_variants` | Numeric | Numeric array | — |
|
|
65
|
+
| `create_design_system` | Numeric (optional) | — | Returns Asset `name` |
|
|
66
|
+
| `update_design_system` | — | — | Asset `name` required |
|
|
67
|
+
| `list_design_systems` | Numeric (optional) | — | Returns Asset names |
|
|
68
|
+
| `apply_design_system` | Numeric | Numeric array | `assetId` required |
|
|
69
|
+
|
|
70
|
+
## Framework selection guide
|
|
71
|
+
|
|
72
|
+
| User says | Use |
|
|
73
|
+
|-----------|-----|
|
|
74
|
+
| "Next.js", "App Router", "SSR" | `stitch-nextjs-components` |
|
|
75
|
+
| "React", "Vite", "CRA" | `stitch-react-components` |
|
|
76
|
+
| "Svelte", "SvelteKit" | `stitch-svelte-components` |
|
|
77
|
+
| "HTML", "PWA", "WebView", "Capacitor" | `stitch-html-components` |
|
|
78
|
+
| "React Native", "Expo", "iOS + Android" | `stitch-react-native-components` |
|
|
79
|
+
| "SwiftUI", "iOS", "Xcode" | `stitch-swiftui-components` |
|
|
80
|
+
| "shadcn", "Radix" | `stitch-react-components` then `stitch-shadcn-ui` |
|
|
81
|
+
|
|
82
|
+
## After conversion
|
|
83
|
+
|
|
84
|
+
Always offer these unless already done:
|
|
85
|
+
- `stitch-design-system` — extract CSS tokens (especially for multi-screen projects)
|
|
86
|
+
- `stitch-a11y` — accessibility audit before shipping
|
|
87
|
+
- `stitch-animate` — if the design has interactive elements
|
|
88
|
+
|
|
89
|
+
## When MCP is unavailable
|
|
90
|
+
|
|
91
|
+
Tell the user MCP isn't configured and point to the setup guide: https://stitch.withgoogle.com/docs/mcp/guide/
|
|
92
|
+
|
|
93
|
+
Fall back to prompt-only mode: run `stitch-ui-design-spec-generator` and `stitch-ui-prompt-architect` and give the user a ready-to-paste prompt for stitch.withgoogle.com. The conversion skills still work once they download the HTML manually.
|