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
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stitch-remotion
|
|
3
|
+
description: Generates walkthrough videos from Stitch projects using Remotion. Downloads screenshots from Stitch screens, builds a Remotion composition with transitions and text overlays, and renders to MP4. Use with stitch-mcp-list-screens and stitch-mcp-get-screen for screen discovery.
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- "stitch*:*"
|
|
6
|
+
- "Bash"
|
|
7
|
+
- "Read"
|
|
8
|
+
- "Write"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Stitch → Remotion Walkthrough Videos
|
|
12
|
+
|
|
13
|
+
**Constraint:** Only use this skill when the user explicitly mentions "Stitch" and walkthrough video, demo, or Remotion.
|
|
14
|
+
|
|
15
|
+
You are a video production specialist creating walkthrough videos from Stitch app designs. You retrieve Stitch screenshots and build a Remotion composition — slide transitions, zoom animations, and text overlays.
|
|
16
|
+
|
|
17
|
+
## Prerequisites
|
|
18
|
+
|
|
19
|
+
- Stitch MCP Server (or screen IDs already known)
|
|
20
|
+
- Node.js 18+ and npm
|
|
21
|
+
- Remotion CLI (`npm install -g remotion` or use via `npx`)
|
|
22
|
+
|
|
23
|
+
## Step 1: Gather Stitch assets
|
|
24
|
+
|
|
25
|
+
### Discover screens
|
|
26
|
+
|
|
27
|
+
1. Run `list_tools` → find Stitch MCP prefix
|
|
28
|
+
2. Call `[prefix]:list_projects` → select the project
|
|
29
|
+
3. Call `[prefix]:list_screens` with `projects/[projectId]` → list all screens
|
|
30
|
+
4. For each screen you want in the video, call `[prefix]:get_screen` with numeric IDs
|
|
31
|
+
|
|
32
|
+
### Download screenshots
|
|
33
|
+
|
|
34
|
+
For each screen:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Download screenshot to assets directory
|
|
38
|
+
curl -L "[screenshot.downloadUrl]" -o "video/public/assets/[screen-name].png"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Or use the fetch script:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
bash scripts/fetch-stitch.sh "[htmlCode.downloadUrl]" "temp/[screen-name].html"
|
|
45
|
+
# Screenshots are separate — download via curl with the screenshot URL
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Build screens manifest
|
|
49
|
+
|
|
50
|
+
Create `screens.json` describing the video:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"projectName": "My App",
|
|
55
|
+
"fps": 30,
|
|
56
|
+
"screens": [
|
|
57
|
+
{
|
|
58
|
+
"id": "home",
|
|
59
|
+
"title": "Home Screen",
|
|
60
|
+
"description": "Main dashboard with key metrics",
|
|
61
|
+
"imagePath": "./public/assets/home.png",
|
|
62
|
+
"width": 390,
|
|
63
|
+
"height": 844,
|
|
64
|
+
"durationSeconds": 4
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"id": "profile",
|
|
68
|
+
"title": "User Profile",
|
|
69
|
+
"description": "Settings and account management",
|
|
70
|
+
"imagePath": "./public/assets/profile.png",
|
|
71
|
+
"width": 390,
|
|
72
|
+
"height": 844,
|
|
73
|
+
"durationSeconds": 3
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Step 2: Set up Remotion project
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Create new Remotion project inside the working directory
|
|
83
|
+
cd video
|
|
84
|
+
npm create video@latest -- --blank
|
|
85
|
+
cd walkthrough-video
|
|
86
|
+
npm install @remotion/transitions
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Step 3: Build the composition
|
|
90
|
+
|
|
91
|
+
### ScreenSlide component
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
// video/src/ScreenSlide.tsx
|
|
95
|
+
import { AbsoluteFill, Img, interpolate, spring, useCurrentFrame, useVideoConfig } from 'remotion'
|
|
96
|
+
|
|
97
|
+
interface ScreenSlideProps {
|
|
98
|
+
/** Path to the screenshot image */
|
|
99
|
+
imagePath: string
|
|
100
|
+
/** Screen title displayed as overlay */
|
|
101
|
+
title: string
|
|
102
|
+
/** Supporting description text */
|
|
103
|
+
description: string
|
|
104
|
+
/** Whether to zoom in slightly during display */
|
|
105
|
+
withZoom?: boolean
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Single screen slide with optional zoom effect and text overlay.
|
|
110
|
+
* Fades in, holds, then fades out.
|
|
111
|
+
*/
|
|
112
|
+
export function ScreenSlide({ imagePath, title, description, withZoom = true }: ScreenSlideProps) {
|
|
113
|
+
const frame = useCurrentFrame()
|
|
114
|
+
const { fps, durationInFrames } = useVideoConfig()
|
|
115
|
+
|
|
116
|
+
// Fade in over first 15 frames
|
|
117
|
+
const fadeIn = spring({ fps, frame, config: { damping: 200 } })
|
|
118
|
+
|
|
119
|
+
// Subtle zoom: 100% → 105% over the duration
|
|
120
|
+
const scale = withZoom
|
|
121
|
+
? interpolate(frame, [0, durationInFrames], [1, 1.05], { extrapolateRight: 'clamp' })
|
|
122
|
+
: 1
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<AbsoluteFill style={{ backgroundColor: '#000' }}>
|
|
126
|
+
{/* Screenshot */}
|
|
127
|
+
<AbsoluteFill style={{ opacity: fadeIn, transform: `scale(${scale})`, transformOrigin: 'center' }}>
|
|
128
|
+
<Img src={imagePath} style={{ width: '100%', height: '100%', objectFit: 'contain' }} />
|
|
129
|
+
</AbsoluteFill>
|
|
130
|
+
|
|
131
|
+
{/* Bottom text overlay */}
|
|
132
|
+
<AbsoluteFill
|
|
133
|
+
style={{
|
|
134
|
+
justifyContent: 'flex-end',
|
|
135
|
+
padding: '40px 60px',
|
|
136
|
+
background: 'linear-gradient(transparent, rgba(0,0,0,0.7))',
|
|
137
|
+
opacity: fadeIn,
|
|
138
|
+
}}
|
|
139
|
+
>
|
|
140
|
+
<h2 style={{ color: '#fff', fontSize: 36, fontWeight: 700, margin: 0 }}>{title}</h2>
|
|
141
|
+
{description ? (
|
|
142
|
+
<p style={{ color: 'rgba(255,255,255,0.8)', fontSize: 20, margin: '8px 0 0' }}>
|
|
143
|
+
{description}
|
|
144
|
+
</p>
|
|
145
|
+
) : null}
|
|
146
|
+
</AbsoluteFill>
|
|
147
|
+
</AbsoluteFill>
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Walkthrough composition
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
// video/src/WalkthroughComposition.tsx
|
|
156
|
+
import { Series, TransitionSeries } from '@remotion/transitions'
|
|
157
|
+
import { fade } from '@remotion/transitions/fade'
|
|
158
|
+
import { slide } from '@remotion/transitions/slide'
|
|
159
|
+
import screensData from '../../screens.json'
|
|
160
|
+
import { ScreenSlide } from './ScreenSlide'
|
|
161
|
+
|
|
162
|
+
const TRANSITION_FRAMES = 15 // 0.5s at 30fps
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Main walkthrough composition — one screen per slide, fade/slide transitions.
|
|
166
|
+
*/
|
|
167
|
+
export function WalkthroughComposition() {
|
|
168
|
+
return (
|
|
169
|
+
<TransitionSeries>
|
|
170
|
+
{screensData.screens.map((screen, i) => (
|
|
171
|
+
<>
|
|
172
|
+
<TransitionSeries.Sequence
|
|
173
|
+
key={screen.id}
|
|
174
|
+
durationInFrames={screen.durationSeconds * screensData.fps}
|
|
175
|
+
>
|
|
176
|
+
<ScreenSlide
|
|
177
|
+
imagePath={screen.imagePath}
|
|
178
|
+
title={screen.title}
|
|
179
|
+
description={screen.description}
|
|
180
|
+
/>
|
|
181
|
+
</TransitionSeries.Sequence>
|
|
182
|
+
{/* Add transition between screens (except after the last) */}
|
|
183
|
+
{i < screensData.screens.length - 1 && (
|
|
184
|
+
<TransitionSeries.Transition
|
|
185
|
+
key={`t-${screen.id}`}
|
|
186
|
+
timing={fade({ durationInFrames: TRANSITION_FRAMES })}
|
|
187
|
+
/>
|
|
188
|
+
)}
|
|
189
|
+
</>
|
|
190
|
+
))}
|
|
191
|
+
</TransitionSeries>
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Register in Root.tsx
|
|
197
|
+
|
|
198
|
+
```tsx
|
|
199
|
+
// video/src/Root.tsx
|
|
200
|
+
import { Composition } from 'remotion'
|
|
201
|
+
import { WalkthroughComposition } from './WalkthroughComposition'
|
|
202
|
+
import screensData from '../../screens.json'
|
|
203
|
+
|
|
204
|
+
const TOTAL_FRAMES = screensData.screens.reduce(
|
|
205
|
+
(acc, s) => acc + s.durationSeconds * screensData.fps,
|
|
206
|
+
0
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
export const RemotionRoot = () => (
|
|
210
|
+
<>
|
|
211
|
+
<Composition
|
|
212
|
+
id="Walkthrough"
|
|
213
|
+
component={WalkthroughComposition}
|
|
214
|
+
durationInFrames={TOTAL_FRAMES}
|
|
215
|
+
fps={screensData.fps}
|
|
216
|
+
width={screensData.screens[0]?.width ?? 390}
|
|
217
|
+
height={screensData.screens[0]?.height ?? 844}
|
|
218
|
+
/>
|
|
219
|
+
</>
|
|
220
|
+
)
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Step 4: Preview and render
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
# Preview in browser
|
|
227
|
+
cd video/walkthrough-video
|
|
228
|
+
npm run dev
|
|
229
|
+
|
|
230
|
+
# Render to MP4
|
|
231
|
+
npx remotion render Walkthrough output.mp4
|
|
232
|
+
|
|
233
|
+
# Higher quality render
|
|
234
|
+
npx remotion render Walkthrough output.mp4 --jpeg-quality 95 --concurrency 4
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Common video styles
|
|
238
|
+
|
|
239
|
+
| Style | Configuration |
|
|
240
|
+
|-------|--------------|
|
|
241
|
+
| Quick demo (1–2 min) | 2–3s per screen, fade transitions, title only |
|
|
242
|
+
| Feature walkthrough | 4–5s per screen, zoom + slide, title + description |
|
|
243
|
+
| Presentation deck | 5–8s per screen, fade only, full description overlay |
|
|
244
|
+
| Social media clip | 1–2s per screen, fast cuts, music track |
|
|
245
|
+
|
|
246
|
+
## File structure
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
project/
|
|
250
|
+
├── screens.json ← Screen manifest
|
|
251
|
+
├── scripts/fetch-stitch.sh ← GCS downloader
|
|
252
|
+
└── video/
|
|
253
|
+
├── public/
|
|
254
|
+
│ └── assets/ ← Downloaded screenshots
|
|
255
|
+
└── walkthrough-video/
|
|
256
|
+
├── src/
|
|
257
|
+
│ ├── WalkthroughComposition.tsx
|
|
258
|
+
│ ├── ScreenSlide.tsx
|
|
259
|
+
│ └── Root.tsx
|
|
260
|
+
├── remotion.config.ts
|
|
261
|
+
└── package.json
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Troubleshooting
|
|
265
|
+
|
|
266
|
+
| Issue | Fix |
|
|
267
|
+
|-------|-----|
|
|
268
|
+
| Blurry screenshots | Download full-resolution: use the screenshot URL directly, not a thumbnail |
|
|
269
|
+
| Layout mismatch | Set Remotion composition dimensions to match screen's `width` + `height` from `get_screen` |
|
|
270
|
+
| Transitions jarring | Increase `TRANSITION_FRAMES` or switch from `slide` to `fade` |
|
|
271
|
+
| Build fails on ESM | Add `"type": "module"` to `package.json` and check Remotion version compatibility |
|
|
272
|
+
| MP4 won't play | Check FFmpeg is installed: `ffmpeg -version` |
|
|
273
|
+
|
|
274
|
+
## References
|
|
275
|
+
|
|
276
|
+
- Remotion docs: https://www.remotion.dev/docs/
|
|
277
|
+
- Remotion transitions: https://www.remotion.dev/docs/transitions
|
|
278
|
+
- `scripts/fetch-stitch.sh` — Reliable GCS downloader
|
|
279
|
+
- `stitch-mcp-list-screens` — Discover screens in a Stitch project
|
|
280
|
+
- `stitch-mcp-get-screen` — Get screenshot download URLs
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stitch-setup
|
|
3
|
+
description: Step-by-step installer for the stitch-kit plugin and Stitch MCP server. Use this when setting up the plugin for the first time, diagnosing connection issues, or helping a new user get Stitch running in Claude Code or Codex CLI.
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- "Bash"
|
|
6
|
+
- "Read"
|
|
7
|
+
- "Write"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# stitch-kit Setup Guide
|
|
11
|
+
|
|
12
|
+
Walks users through two setup tasks:
|
|
13
|
+
1. **Stitch MCP Server** — connect Claude to Google Stitch's generation tools
|
|
14
|
+
2. **stitch-kit Plugin** — install the skills that orchestrate the Stitch workflow
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## When to use this skill
|
|
19
|
+
|
|
20
|
+
- User says "how do I set this up", "it's not working", "Stitch isn't available"
|
|
21
|
+
- Agent can't find Stitch MCP tools after running `list_tools`
|
|
22
|
+
- First-time setup in a new environment
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Step 1: Verify what's already installed
|
|
27
|
+
|
|
28
|
+
Run `list_tools` (or check the tool list). Look for any of:
|
|
29
|
+
- `create_project`
|
|
30
|
+
- `generate_screen_from_text`
|
|
31
|
+
- `get_screen`
|
|
32
|
+
|
|
33
|
+
**If found:** Stitch MCP is working. Skip to Step 4 (plugin install).
|
|
34
|
+
**If not found:** Continue with MCP setup below.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Step 2: Install Stitch MCP Server
|
|
39
|
+
|
|
40
|
+
### Claude Code
|
|
41
|
+
|
|
42
|
+
Add to `~/.claude/config.json` (or via `/mcp add` command):
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"mcpServers": {
|
|
47
|
+
"stitch": {
|
|
48
|
+
"command": "npx",
|
|
49
|
+
"args": ["-y", "@google/stitch-mcp"],
|
|
50
|
+
"env": {}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Or using the Claude Code CLI:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
claude mcp add stitch npx @google/stitch-mcp
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Codex CLI (OpenAI)
|
|
63
|
+
|
|
64
|
+
Add to your Codex configuration file:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"tools": [
|
|
69
|
+
{
|
|
70
|
+
"type": "mcp",
|
|
71
|
+
"server": {
|
|
72
|
+
"command": "npx",
|
|
73
|
+
"args": ["-y", "@google/stitch-mcp"]
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### VS Code / Cursor / Windsurf
|
|
81
|
+
|
|
82
|
+
Check your AI extension's settings for "MCP Servers" and add:
|
|
83
|
+
- **Command:** `npx`
|
|
84
|
+
- **Args:** `["-y", "@google/stitch-mcp"]`
|
|
85
|
+
|
|
86
|
+
### Manual verification
|
|
87
|
+
|
|
88
|
+
After adding, restart the client and run `list_tools`. You should see tools prefixed with `stitch:` or similar.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Step 3: Authenticate with Google
|
|
93
|
+
|
|
94
|
+
Stitch MCP requires a Google account with access to Stitch. On first run:
|
|
95
|
+
|
|
96
|
+
1. The MCP server will open a browser for Google OAuth
|
|
97
|
+
2. Sign in with a Google account
|
|
98
|
+
3. Authorize Stitch access
|
|
99
|
+
4. Return to the terminal — authentication is saved
|
|
100
|
+
|
|
101
|
+
If you see "authentication required" errors, run:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npx @google/stitch-mcp auth
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Or visit: https://stitch.withgoogle.com and sign in to pre-authorize.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Step 4: Install stitch-kit plugin (Claude Code)
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
/plugin marketplace add https://github.com/gabelul/stitch-kit.git
|
|
115
|
+
/plugin install stitch-kit@stitch-kit
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
All 26 skills in one command. The `stitch-kit` agent is included — it shows up automatically in `/agents` under "Plugin agents" after restart.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Step 5: Verify the full setup
|
|
123
|
+
|
|
124
|
+
Run the orchestrator to confirm everything works:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
"Use Stitch to design a simple login screen"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Expected behavior:
|
|
131
|
+
1. `stitch-orchestrator` activates
|
|
132
|
+
2. It runs `list_tools` and finds Stitch MCP tools
|
|
133
|
+
3. It generates a Design Spec
|
|
134
|
+
4. It creates a project via `create_project`
|
|
135
|
+
5. It generates a screen via `generate_screen_from_text`
|
|
136
|
+
6. It retrieves the screen via `get_screen`
|
|
137
|
+
7. It asks you which framework to convert to
|
|
138
|
+
|
|
139
|
+
If this completes, you're fully set up.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Troubleshooting
|
|
144
|
+
|
|
145
|
+
| Symptom | Likely cause | Fix |
|
|
146
|
+
|---------|-------------|-----|
|
|
147
|
+
| `list_tools` doesn't show Stitch tools | MCP not installed or not started | Redo Step 2; restart your client |
|
|
148
|
+
| "Authentication failed" | OAuth not completed | Run `npx @google/stitch-mcp auth` |
|
|
149
|
+
| `create_project` fails with 403 | Account doesn't have Stitch access | Visit stitch.withgoogle.com and request access |
|
|
150
|
+
| `generate_screen_from_text` returns empty | Bad prompt or project ID format | Use `stitch-mcp-generate-screen-from-text` skill — it includes ID format rules |
|
|
151
|
+
| `get_screen` returns 404 | Wrong ID format | **projectId and screenId must be numeric only** — no `projects/` prefix |
|
|
152
|
+
| Generated HTML won't download | GCS URL expired or requires redirects | Use `bash scripts/fetch-stitch.sh "[url]" "temp/output.html"` |
|
|
153
|
+
| Plugin not activating | Wrong install command or repo URL | Verify you used `@stitch-kit` — not `@stitch-pro` or `@stitch-skills` |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Network requirements
|
|
158
|
+
|
|
159
|
+
Stitch MCP makes outbound requests to:
|
|
160
|
+
- `stitch.withgoogle.com` — API
|
|
161
|
+
- `storage.googleapis.com` — file downloads (HTML, screenshots)
|
|
162
|
+
- `accounts.google.com` — OAuth
|
|
163
|
+
|
|
164
|
+
If you're behind a corporate proxy or VPN, ensure these domains are allowed.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Offline / no-MCP mode
|
|
169
|
+
|
|
170
|
+
If you cannot install Stitch MCP, the orchestrator still works in **prompt-only mode**:
|
|
171
|
+
- Steps 1–3 run normally (spec generation, prompt assembly)
|
|
172
|
+
- Instead of generating the screen, it outputs a ready-to-copy Stitch prompt
|
|
173
|
+
- You paste that prompt at stitch.withgoogle.com manually
|
|
174
|
+
- Then you can still use the conversion skills on the downloaded HTML
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## References
|
|
179
|
+
|
|
180
|
+
- Official Stitch MCP guide: https://stitch.withgoogle.com/docs/mcp/guide/
|
|
181
|
+
- Plugin repo: https://github.com/gabelul/stitch-kit
|
|
182
|
+
- Skills index: `docs/skills-index.md`
|
|
183
|
+
- MCP tool reference: `docs/mcp-naming-convention.md`
|