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,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
page: contact
|
|
3
|
+
---
|
|
4
|
+
A warm, inviting contact page for Oakwood Furniture Co.
|
|
5
|
+
|
|
6
|
+
**DESIGN SYSTEM (REQUIRED):**
|
|
7
|
+
- Platform: Web, Desktop-first
|
|
8
|
+
- Theme: Light, minimal, photography-first
|
|
9
|
+
- Background: Warm barely-there cream (#FCFAFA)
|
|
10
|
+
- Surface: Crisp very light gray (#F5F5F5) for cards
|
|
11
|
+
- Primary Accent: Deep muted teal-navy (#294056) for buttons and links
|
|
12
|
+
- Text Primary: Charcoal near-black (#2C2C2C) for headlines
|
|
13
|
+
- Text Secondary: Soft warm gray (#6B6B6B) for body copy
|
|
14
|
+
- Font: Modern sans-serif (Manrope or similar), clean and approachable
|
|
15
|
+
- Buttons: Subtly rounded corners (8px), comfortable padding
|
|
16
|
+
- Cards: Gently rounded corners (12px), whisper-soft shadows on hover
|
|
17
|
+
- Layout: Centered content, max-width container, generous whitespace
|
|
18
|
+
|
|
19
|
+
**Page Structure:**
|
|
20
|
+
1. **Header:** Navigation with logo, Shop, Collections, About, Contact (active)
|
|
21
|
+
2. **Hero Section:** Warm headline "Get in Touch" with a brief welcome message
|
|
22
|
+
3. **Contact Form:** Name, email, message fields with the teal-navy submit button
|
|
23
|
+
4. **Showroom Info:** Address, hours, and an embedded map or showroom photo
|
|
24
|
+
5. **Footer:** Sustainability, Craftsmanship, Shipping links, and social icons
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# stitch-loop — Usage Examples
|
|
2
|
+
|
|
3
|
+
## When to use
|
|
4
|
+
|
|
5
|
+
- User wants to **iteratively build a multi-page site** with Stitch (e.g. marketing site, product pages).
|
|
6
|
+
- You have or will create a `DESIGN.md` (via `stitch-design-md`) and a `SITE.md`.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## First-time setup
|
|
11
|
+
|
|
12
|
+
1. Create or identify a Stitch project; save project ID to `stitch.json`.
|
|
13
|
+
2. Generate `DESIGN.md` from an existing screen using `stitch-design-md`.
|
|
14
|
+
3. Create `SITE.md` with vision, sitemap, roadmap, creative freedom (see `examples/SITE.md`).
|
|
15
|
+
4. Create initial `next-prompt.md` with `page` frontmatter and full prompt including DESIGN SYSTEM block (see `examples/next-prompt.md`).
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Each iteration
|
|
20
|
+
|
|
21
|
+
1. Read `next-prompt.md` → generate page with Stitch MCP → save to `queue/`.
|
|
22
|
+
2. Move `queue/{page}.html` to `site/public/`; fix links and nav.
|
|
23
|
+
3. Update `SITE.md` (sitemap, roadmap, creative freedom).
|
|
24
|
+
4. Write next `next-prompt.md` so the next run continues the loop.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Example 1: Furniture e-commerce site
|
|
29
|
+
|
|
30
|
+
**User:** "Use Stitch to build my Oakwood Furniture site. I have DESIGN.md and SITE.md — run the loop until the roadmap is done."
|
|
31
|
+
|
|
32
|
+
**Skill activates because:** User explicitly mentions "Stitch" and wants multi-page iterative building.
|
|
33
|
+
|
|
34
|
+
**What the skill does:**
|
|
35
|
+
1. Reads `SITE.md` → identifies next page in roadmap (`contact.html`)
|
|
36
|
+
2. Reads `next-prompt.md` → uses it as the Stitch generation prompt
|
|
37
|
+
3. Calls `stitch-mcp-generate-screen-from-text` with the assembled prompt
|
|
38
|
+
4. Downloads HTML to `queue/contact.html` via `scripts/fetch-stitch.sh`
|
|
39
|
+
5. Validates nav consistency, moves to `site/public/contact.html`
|
|
40
|
+
6. Updates `SITE.md` — marks `contact.html` as `[x]`
|
|
41
|
+
7. Writes next `next-prompt.md` for the next page in roadmap
|
|
42
|
+
|
|
43
|
+
**Output:**
|
|
44
|
+
```
|
|
45
|
+
## Loop iteration complete: contact.html
|
|
46
|
+
|
|
47
|
+
**Stitch Screen:** projects/13534454087919359824/screens/abc123
|
|
48
|
+
**File:** site/public/contact.html
|
|
49
|
+
|
|
50
|
+
### What was built
|
|
51
|
+
Contact page with form, showroom info, and consistent nav.
|
|
52
|
+
|
|
53
|
+
### SITE.md updated
|
|
54
|
+
contact.html → [x] complete
|
|
55
|
+
|
|
56
|
+
### Next iteration
|
|
57
|
+
next-prompt.md → Product Detail Page
|
|
58
|
+
Run stitch-loop again to continue.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Example 2: SaaS landing site (starting fresh)
|
|
64
|
+
|
|
65
|
+
**User:** "Use Stitch to design and build a 5-page SaaS landing site for my project management tool."
|
|
66
|
+
|
|
67
|
+
**What the skill does:**
|
|
68
|
+
1. Creates a new Stitch project
|
|
69
|
+
2. Generates the homepage design
|
|
70
|
+
3. Calls `stitch-design-md` → extracts `DESIGN.md` with the visual system
|
|
71
|
+
4. Creates `SITE.md` with 5-page roadmap
|
|
72
|
+
5. Runs loop iterations for each page, maintaining visual consistency via `DESIGN.md` Section 6 in every prompt
|
|
73
|
+
|
|
74
|
+
**Tips:**
|
|
75
|
+
- Always include the full DESIGN SYSTEM block from `DESIGN.md` Section 6 in every `next-prompt.md`
|
|
76
|
+
- The `page:` frontmatter is used for file naming (e.g., `page: pricing` → `pricing.html`)
|
|
77
|
+
- `stitch.json` persists the project ID between sessions so you don't lose track
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stitch-mcp-apply-design-system
|
|
3
|
+
description: Applies a Stitch Design System to existing screens — updates their colors, fonts, and roundness to match the design system's theme. Requires an assetId from list or create operations.
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- "stitch*:*"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Stitch MCP — Apply Design System
|
|
9
|
+
|
|
10
|
+
Applies a previously created Stitch Design System to one or more screens. This updates the screen's visual theme (colors, font, roundness) to match the design system, ensuring visual consistency across a project.
|
|
11
|
+
|
|
12
|
+
## Critical prerequisite
|
|
13
|
+
|
|
14
|
+
**Only use this skill when the user explicitly mentions "Stitch".**
|
|
15
|
+
|
|
16
|
+
You must have:
|
|
17
|
+
1. A `projectId` (numeric)
|
|
18
|
+
2. One or more `screenId` values (numeric)
|
|
19
|
+
3. An `assetId` from a design system (from `list_design_systems` or `create_design_system`)
|
|
20
|
+
|
|
21
|
+
## When to use
|
|
22
|
+
|
|
23
|
+
- After creating a design system and wanting to apply it to screens
|
|
24
|
+
- User says "make all screens match this theme" or "apply the design system"
|
|
25
|
+
- The orchestrator's Step 5b stores an assetId and offers to apply it
|
|
26
|
+
- Ensuring visual consistency across a multi-screen project
|
|
27
|
+
|
|
28
|
+
## Call the MCP tool
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"name": "apply_design_system",
|
|
33
|
+
"arguments": {
|
|
34
|
+
"projectId": "3780309359108792857",
|
|
35
|
+
"selectedScreenIds": ["88805abc123def456", "99906xyz789ghi012"],
|
|
36
|
+
"assetId": "ds_abc123"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Parameter reference
|
|
42
|
+
|
|
43
|
+
### `projectId` — numeric ID only, no prefix
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
✅ "3780309359108792857"
|
|
47
|
+
❌ "projects/3780309359108792857"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### `selectedScreenIds` — array of numeric screen IDs
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
✅ ["88805abc123def456"]
|
|
54
|
+
❌ ["projects/123/screens/88805abc123def456"]
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
All selected screens will have the design system applied.
|
|
58
|
+
|
|
59
|
+
### `assetId` — the design system identifier
|
|
60
|
+
|
|
61
|
+
The `name` field from a design system asset, or just the ID portion:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
✅ "ds_abc123"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Get this from:
|
|
68
|
+
- `stitch-mcp-list-design-systems` → extract from the `name` field of each asset
|
|
69
|
+
- `stitch-mcp-create-design-system` → returned in the response `name` field
|
|
70
|
+
|
|
71
|
+
## Output
|
|
72
|
+
|
|
73
|
+
Returns updated screen data reflecting the applied design system.
|
|
74
|
+
|
|
75
|
+
## After applying
|
|
76
|
+
|
|
77
|
+
1. Re-fetch affected screens: `stitch-mcp-get-screen` for each screenId
|
|
78
|
+
2. Show updated screenshots to the user
|
|
79
|
+
3. Offer:
|
|
80
|
+
- "Edit the updated screens?" → `stitch-mcp-edit-screens`
|
|
81
|
+
- "Convert to code?" → framework conversion
|
|
82
|
+
- "Apply to more screens?" → another `apply_design_system` call
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stitch-mcp-create-design-system
|
|
3
|
+
description: Creates a reusable Stitch Design System from theme tokens — colors, fonts, roundness, saturation. Can be applied to future screens for visual consistency.
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- "stitch*:*"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Stitch MCP — Create Design System
|
|
9
|
+
|
|
10
|
+
Creates a new Stitch Design System — a reusable theme configuration that can be applied to any screen. This bridges the gap between local CSS token extraction (via `stitch-design-system`) and Stitch-native design tokens that persist across generations.
|
|
11
|
+
|
|
12
|
+
## Critical prerequisite
|
|
13
|
+
|
|
14
|
+
**Only use this skill when the user explicitly mentions "Stitch".**
|
|
15
|
+
|
|
16
|
+
## When to use
|
|
17
|
+
|
|
18
|
+
- After extracting CSS tokens via `stitch-design-system` and wanting to persist them in Stitch
|
|
19
|
+
- User wants consistent theming across multiple screens or projects
|
|
20
|
+
- The orchestrator's Step 7 offers to create a Stitch Design System from extracted tokens
|
|
21
|
+
- User explicitly asks to create a design system in Stitch
|
|
22
|
+
|
|
23
|
+
## Call the MCP tool
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"name": "create_design_system",
|
|
28
|
+
"arguments": {
|
|
29
|
+
"designSystem": {
|
|
30
|
+
"displayName": "SaaS Dashboard Theme",
|
|
31
|
+
"theme": {
|
|
32
|
+
"colorMode": "LIGHT",
|
|
33
|
+
"font": "DM_SANS",
|
|
34
|
+
"roundness": "ROUND_EIGHT",
|
|
35
|
+
"saturation": 3,
|
|
36
|
+
"customColor": "#6366F1",
|
|
37
|
+
"backgroundLight": "#FFFFFF",
|
|
38
|
+
"backgroundDark": "#18181B",
|
|
39
|
+
"description": "Professional SaaS aesthetic — clean, indigo accent, airy spacing"
|
|
40
|
+
},
|
|
41
|
+
"designTokens": "--color-primary: #6366F1;\n--color-bg: #FFFFFF;\n--font-family: 'DM Sans';",
|
|
42
|
+
"styleGuidelines": "Use indigo for interactive elements. Gray-50 backgrounds for cards. 8px border radius."
|
|
43
|
+
},
|
|
44
|
+
"projectId": "3780309359108792857"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Parameter reference
|
|
50
|
+
|
|
51
|
+
### `designSystem` — required object
|
|
52
|
+
|
|
53
|
+
| Field | Type | Required | Description |
|
|
54
|
+
|-------|------|----------|-------------|
|
|
55
|
+
| `displayName` | string | Yes | Human-readable name for the design system |
|
|
56
|
+
| `theme` | DesignTheme | Yes | Visual configuration — see below |
|
|
57
|
+
| `designTokens` | string | No | CSS custom properties or token definitions |
|
|
58
|
+
| `styleGuidelines` | string | No | Natural-language design rules |
|
|
59
|
+
|
|
60
|
+
### `theme` (DesignTheme) — the visual configuration
|
|
61
|
+
|
|
62
|
+
| Field | Type | Values | Description |
|
|
63
|
+
|-------|------|--------|-------------|
|
|
64
|
+
| `colorMode` | enum | `LIGHT`, `DARK` | Base appearance mode |
|
|
65
|
+
| `font` | enum | See font list below | Primary typeface |
|
|
66
|
+
| `roundness` | enum | `ROUND_FOUR`, `ROUND_EIGHT`, `ROUND_TWELVE`, `ROUND_FULL` | Border radius scale |
|
|
67
|
+
| `saturation` | int | 1–4 | Color vibrancy (1 = muted, 4 = vivid) |
|
|
68
|
+
| `customColor` | string | Hex color | Primary brand color |
|
|
69
|
+
| `backgroundLight` | string | Hex color | Light mode background |
|
|
70
|
+
| `backgroundDark` | string | Hex color | Dark mode background |
|
|
71
|
+
| `preset` | string | — | Optional preset theme name |
|
|
72
|
+
| `description` | string | — | Brief aesthetic description |
|
|
73
|
+
|
|
74
|
+
### Available fonts (28 options)
|
|
75
|
+
|
|
76
|
+
**Sans-serif:** `INTER`, `DM_SANS`, `GEIST`, `SORA`, `MANROPE`, `RUBIK`, `MONTSERRAT`, `WORK_SANS`, `SPACE_GROTESK`, `PLUS_JAKARTA_SANS`, `PUBLIC_SANS`, `SOURCE_SANS_THREE`, `NUNITO_SANS`, `ARIMO`, `HANKEN_GROTESK`, `IBM_PLEX_SANS`, `SPLINE_SANS`, `LEXEND`, `EPILOGUE`, `BE_VIETNAM_PRO`, `METROPOLIS`
|
|
77
|
+
|
|
78
|
+
**Serif:** `NOTO_SERIF`, `NEWSREADER`, `DOMINE`, `LIBRE_CASLON_TEXT`, `EB_GARAMOND`, `LITERATA`, `SOURCE_SERIF_FOUR`
|
|
79
|
+
|
|
80
|
+
### `projectId` — optional, numeric only
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
✅ "3780309359108792857"
|
|
84
|
+
❌ "projects/3780309359108792857"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
If provided, associates the design system with a specific project. If omitted, creates a global design system.
|
|
88
|
+
|
|
89
|
+
## Mapping CSS tokens to DesignTheme
|
|
90
|
+
|
|
91
|
+
When creating from extracted `design-tokens.css`:
|
|
92
|
+
|
|
93
|
+
| CSS Variable | → DesignTheme field |
|
|
94
|
+
|---|---|
|
|
95
|
+
| `--color-primary` | `customColor` |
|
|
96
|
+
| `--color-bg` or `--bg-light` | `backgroundLight` |
|
|
97
|
+
| `--bg-dark` | `backgroundDark` |
|
|
98
|
+
| `--font-family` | `font` (map to closest enum value) |
|
|
99
|
+
| `--radius` or `--border-radius` | `roundness` (4px→FOUR, 8px→EIGHT, 12px→TWELVE, 16px+→FULL) |
|
|
100
|
+
|
|
101
|
+
## Output
|
|
102
|
+
|
|
103
|
+
Returns an Asset object with a `name` field — **store this** for future `update_design_system` and `apply_design_system` calls:
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"name": "assets/ds_abc123",
|
|
108
|
+
"displayName": "SaaS Dashboard Theme",
|
|
109
|
+
"designSystem": { ... }
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## After creating
|
|
114
|
+
|
|
115
|
+
- Store the `name` value (e.g., `assets/ds_abc123`) — you'll need it for apply/update
|
|
116
|
+
- Offer: "Apply this design system to existing screens?" → `stitch-mcp-apply-design-system`
|
|
117
|
+
- The orchestrator stores this for automatic application in Step 5b
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stitch-mcp-create-project
|
|
3
|
+
description: Creates a new Stitch project container (a design workspace). Call this when starting a new design session to get a projectId for screen generation.
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- "stitch*:*"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Stitch MCP — Create Project
|
|
9
|
+
|
|
10
|
+
Creates a new Stitch project. A project is a container that holds one or more generated screens. You need a projectId before you can call `generate_screen_from_text`.
|
|
11
|
+
|
|
12
|
+
## Critical prerequisite
|
|
13
|
+
|
|
14
|
+
**Only use this skill when the user explicitly mentions "Stitch"** in their request. Never trigger Stitch operations silently during regular conversation.
|
|
15
|
+
|
|
16
|
+
## When to use
|
|
17
|
+
|
|
18
|
+
- Starting a new design task or app concept
|
|
19
|
+
- The user says "create a Stitch project", "start a new project in Stitch", "design X using Stitch"
|
|
20
|
+
- You need a `projectId` before calling `generate_screen_from_text`
|
|
21
|
+
- Starting work in a new domain (keep related screens in one project)
|
|
22
|
+
|
|
23
|
+
## Step 1: Extract a meaningful title
|
|
24
|
+
|
|
25
|
+
Infer a descriptive project title from the user's request:
|
|
26
|
+
|
|
27
|
+
| User says | → title |
|
|
28
|
+
|-----------|---------|
|
|
29
|
+
| "Design a pet adoption app" | `"PawPals"` or `"Pet Adoption App"` |
|
|
30
|
+
| "Make a login page" | `"Login Page"` |
|
|
31
|
+
| "SaaS dashboard for analytics" | `"Analytics Dashboard"` |
|
|
32
|
+
| "E-commerce product listing" | `"Product Listing"` |
|
|
33
|
+
|
|
34
|
+
If no clear name is evident, use a descriptive label: `"Design Project [date]"`.
|
|
35
|
+
|
|
36
|
+
## Step 2: Call the MCP tool
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"name": "create_project",
|
|
41
|
+
"arguments": {
|
|
42
|
+
"title": "[Descriptive project title]"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Step 3: Extract and store the project ID — CRITICAL
|
|
48
|
+
|
|
49
|
+
The tool returns a `name` field in the format `projects/NUMERIC_ID`. You must extract the numeric portion:
|
|
50
|
+
|
|
51
|
+
**Tool response:**
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"name": "projects/3780309359108792857",
|
|
55
|
+
"title": "Analytics Dashboard"
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Extract:**
|
|
60
|
+
- **Full name:** `projects/3780309359108792857` → use for `list_screens`, `get_project`
|
|
61
|
+
- **Numeric ID:** `3780309359108792857` → use for `generate_screen_from_text`, `get_screen`
|
|
62
|
+
|
|
63
|
+
Store both values. Announce to the user:
|
|
64
|
+
> "Created project **'Analytics Dashboard'** (ID: `3780309359108792857`). Ready to generate screens."
|
|
65
|
+
|
|
66
|
+
## ID format rules (critical — different tools need different formats)
|
|
67
|
+
|
|
68
|
+
| Tool | ID format required |
|
|
69
|
+
|------|-------------------|
|
|
70
|
+
| `generate_screen_from_text` | Numeric only: `3780309359108792857` |
|
|
71
|
+
| `get_screen` | Numeric only: `3780309359108792857` |
|
|
72
|
+
| `list_screens` | Full path: `projects/3780309359108792857` |
|
|
73
|
+
| `get_project` | Full path: `projects/3780309359108792857` |
|
|
74
|
+
|
|
75
|
+
## Integration
|
|
76
|
+
|
|
77
|
+
After creating a project, the next step is always `stitch-mcp-generate-screen-from-text` to generate the first screen.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stitch-mcp-delete-project
|
|
3
|
+
description: Permanently deletes a Stitch project and all its screens. Destructive — requires explicit user confirmation before calling.
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- "stitch*:*"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Stitch MCP — Delete Project
|
|
9
|
+
|
|
10
|
+
Permanently deletes a Stitch project and all its screens, designs, and history. This action is irreversible.
|
|
11
|
+
|
|
12
|
+
## Critical prerequisite
|
|
13
|
+
|
|
14
|
+
**Only use this skill when the user explicitly mentions "Stitch".**
|
|
15
|
+
|
|
16
|
+
**This is a destructive action.** You MUST ask the user to confirm before calling `delete_project`. Never auto-delete.
|
|
17
|
+
|
|
18
|
+
## When to use
|
|
19
|
+
|
|
20
|
+
- User explicitly asks to delete a Stitch project
|
|
21
|
+
- Cleaning up test/scratch projects after confirming with the user
|
|
22
|
+
- The orchestrator offers project cleanup and the user accepts
|
|
23
|
+
|
|
24
|
+
## Step 1: Confirm the project
|
|
25
|
+
|
|
26
|
+
Show the user what they're about to delete:
|
|
27
|
+
|
|
28
|
+
1. Call `stitch-mcp-get-project` with `projects/[ID]` to get the project title and screen count
|
|
29
|
+
2. Present: "You're about to permanently delete **[title]** ([N] screens). This cannot be undone. Proceed?"
|
|
30
|
+
3. Only continue if the user explicitly confirms
|
|
31
|
+
|
|
32
|
+
## Step 2: Call the MCP tool
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"name": "delete_project",
|
|
37
|
+
"arguments": {
|
|
38
|
+
"name": "projects/3780309359108792857"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### `name` — full path with `projects/` prefix
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
✅ "projects/3780309359108792857"
|
|
47
|
+
❌ "3780309359108792857"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
This follows the same format as `get_project` — both use `projects/ID`.
|
|
51
|
+
|
|
52
|
+
## After deleting
|
|
53
|
+
|
|
54
|
+
- Confirm: "Project **[title]** has been deleted."
|
|
55
|
+
- Offer: "Want to see your remaining projects?" → `stitch-mcp-list-projects`
|
|
56
|
+
- Do NOT attempt to access the deleted project's screens or data
|
|
57
|
+
|
|
58
|
+
## Anti-patterns
|
|
59
|
+
|
|
60
|
+
- **Never delete without explicit user confirmation** — even if the orchestrator suggests cleanup
|
|
61
|
+
- **Never delete multiple projects in a batch** without confirming each one
|
|
62
|
+
- **Never use numeric ID** — `delete_project` requires the full `projects/ID` path
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stitch-mcp-edit-screens
|
|
3
|
+
description: Edits existing Stitch screens with text prompts — the iteration tool. Change colors, layout, content, or style without regenerating from scratch. Supports refinement loops via output_components suggestions.
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- "stitch*:*"
|
|
6
|
+
- "Bash"
|
|
7
|
+
- "Read"
|
|
8
|
+
- "Write"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Stitch MCP — Edit Screens
|
|
12
|
+
|
|
13
|
+
Edits one or more existing screens using a text prompt. This is the primary iteration tool — instead of regenerating a screen from scratch (60–180s), you can refine what you already have with targeted changes.
|
|
14
|
+
|
|
15
|
+
## Critical prerequisite
|
|
16
|
+
|
|
17
|
+
**Only use this skill when the user explicitly mentions "Stitch".**
|
|
18
|
+
|
|
19
|
+
You must have both a `projectId` AND at least one `screenId` before calling this. If you don't:
|
|
20
|
+
- List screens via `stitch-mcp-list-screens` to find screen IDs
|
|
21
|
+
- Parse from context: `projects/123/screens/456` → projectId: `123`, screenId: `456`
|
|
22
|
+
|
|
23
|
+
## When to use
|
|
24
|
+
|
|
25
|
+
- User wants to modify an existing Stitch screen (change colors, layout, content, style)
|
|
26
|
+
- After generation, user says "make it darker", "change the font", "move the nav to the side"
|
|
27
|
+
- The orchestrator's Step 5b offers "Edit this screen"
|
|
28
|
+
- Any iterative refinement on a Stitch design
|
|
29
|
+
|
|
30
|
+
## Call the MCP tool
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"name": "edit_screens",
|
|
35
|
+
"arguments": {
|
|
36
|
+
"projectId": "3780309359108792857",
|
|
37
|
+
"selectedScreenIds": ["88805abc123def456"],
|
|
38
|
+
"prompt": "Change the background to dark mode (#09090B). Make the primary color indigo (#818CF8). Increase the font size of the header to 32px bold.",
|
|
39
|
+
"deviceType": "DESKTOP",
|
|
40
|
+
"modelId": "GEMINI_3_PRO"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Parameter reference
|
|
46
|
+
|
|
47
|
+
### `projectId` — numeric ID only, no prefix
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
✅ "3780309359108792857"
|
|
51
|
+
❌ "projects/3780309359108792857"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### `selectedScreenIds` — array of numeric screen IDs
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
✅ ["88805abc123def456"]
|
|
58
|
+
❌ ["projects/123/screens/88805abc123def456"]
|
|
59
|
+
❌ ["screens/88805abc123def456"]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Select one or more screens to edit. All selected screens receive the same edit instruction.
|
|
63
|
+
|
|
64
|
+
### `prompt` — the edit instruction
|
|
65
|
+
|
|
66
|
+
Apply the same quality bar as generation prompts:
|
|
67
|
+
- Be specific: "Change background to #09090B" not "make it darker"
|
|
68
|
+
- Name exact components: "the header navigation" not "the top part"
|
|
69
|
+
- Include values: hex colors, px sizes, specific content text
|
|
70
|
+
- One focused change per call produces better results than many changes at once
|
|
71
|
+
|
|
72
|
+
### `deviceType` — optional
|
|
73
|
+
|
|
74
|
+
Same enum as `generate_screen_from_text`: `MOBILE`, `DESKTOP`, `TABLET`, `AGNOSTIC`
|
|
75
|
+
|
|
76
|
+
### `modelId` — optional
|
|
77
|
+
|
|
78
|
+
| Value | Use when |
|
|
79
|
+
|-------|---------|
|
|
80
|
+
| `GEMINI_3_PRO` | Complex edits — layout changes, multi-component updates |
|
|
81
|
+
| `GEMINI_3_FLASH` | Simple edits — color swaps, text changes, quick iterations |
|
|
82
|
+
|
|
83
|
+
## Handling `output_components`
|
|
84
|
+
|
|
85
|
+
The response may contain `output_components` with suggestions:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"outputComponents": [
|
|
90
|
+
{ "text": "I've updated the background color and adjusted contrast ratios." },
|
|
91
|
+
{ "suggestion": "Would you also like me to update the sidebar to match the dark theme?" }
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**When you see suggestions:**
|
|
97
|
+
1. Present them to the user
|
|
98
|
+
2. If the user accepts: call `edit_screens` again with the suggestion as the new `prompt`
|
|
99
|
+
3. This creates a natural refinement loop — keep going until the user is satisfied
|
|
100
|
+
|
|
101
|
+
## Timing
|
|
102
|
+
|
|
103
|
+
Same as generation: 60–180 seconds is normal.
|
|
104
|
+
- Do NOT retry during this window
|
|
105
|
+
- Do NOT assume failure if it takes > 60 seconds
|
|
106
|
+
- Each call creates a new edit — retries mean duplicate edits
|
|
107
|
+
|
|
108
|
+
## After editing
|
|
109
|
+
|
|
110
|
+
1. Re-fetch the screen: `stitch-mcp-get-screen` with the same projectId and screenId
|
|
111
|
+
2. Show the updated screenshot to the user
|
|
112
|
+
3. Offer:
|
|
113
|
+
- "Continue editing?" → another `edit_screens` call
|
|
114
|
+
- "Generate variants of this version?" → `stitch-mcp-generate-variants`
|
|
115
|
+
- "Convert to code?" → framework conversion workflow
|
|
116
|
+
|
|
117
|
+
## Anti-patterns
|
|
118
|
+
|
|
119
|
+
- **Never send vague edit prompts** — "make it better" will produce unpredictable results
|
|
120
|
+
- **Never use `projects/ID` format** for projectId or screenId — both must be numeric
|
|
121
|
+
- **Never batch unrelated edits** — "change the color AND completely redo the layout" works poorly
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stitch-mcp-generate-screen-from-text
|
|
3
|
+
description: Generates a high-fidelity UI screen or wireframe from a text prompt using Stitch. This is the core text-to-UI generation tool — the heart of the Stitch workflow.
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- "stitch*:*"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Stitch MCP — Generate Screen from Text
|
|
9
|
+
|
|
10
|
+
Generates a UI design screen from a structured text prompt. This is the central action in any Stitch workflow — everything before it (spec generation, prompt assembly) is preparation, and everything after it (screen retrieval, code conversion) is follow-through.
|
|
11
|
+
|
|
12
|
+
## Critical prerequisite
|
|
13
|
+
|
|
14
|
+
**Only use this skill when the user explicitly mentions "Stitch".**
|
|
15
|
+
|
|
16
|
+
You must have a `projectId` before calling this. If you don't have one:
|
|
17
|
+
- Create a new project via `stitch-mcp-create-project`
|
|
18
|
+
- Or find an existing project via `stitch-mcp-list-projects`
|
|
19
|
+
|
|
20
|
+
## When to use
|
|
21
|
+
|
|
22
|
+
- User asks to "design", "generate", "create", or "make" a screen using Stitch
|
|
23
|
+
- The orchestrator has assembled a prompt via `stitch-ui-prompt-architect`
|
|
24
|
+
- User provides specific visual requirements and wants a Stitch-generated result
|
|
25
|
+
|
|
26
|
+
## Call the MCP tool
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"name": "generate_screen_from_text",
|
|
31
|
+
"arguments": {
|
|
32
|
+
"projectId": "3780309359108792857",
|
|
33
|
+
"prompt": "[Full structured prompt — see below]",
|
|
34
|
+
"deviceType": "MOBILE",
|
|
35
|
+
"modelId": "GEMINI_3_PRO"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Parameter reference
|
|
41
|
+
|
|
42
|
+
### `projectId` — numeric ID only, no `projects/` prefix
|
|
43
|
+
```
|
|
44
|
+
✅ "3780309359108792857"
|
|
45
|
+
❌ "projects/3780309359108792857"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### `prompt` — use the `[Context] [Layout] [Components]` structure
|
|
49
|
+
```
|
|
50
|
+
[Context & Style]
|
|
51
|
+
[Device] [Mode] [screen type] for [product]. [aesthetic]. [theme]. [colors]. [font].
|
|
52
|
+
|
|
53
|
+
[Layout]
|
|
54
|
+
[Describe the structural arrangement]
|
|
55
|
+
|
|
56
|
+
[Components]
|
|
57
|
+
[Specific named UI components with details]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
For best results, use the `stitch-ui-prompt-architect` skill to assemble the prompt before calling this tool.
|
|
61
|
+
|
|
62
|
+
### `deviceType`
|
|
63
|
+
| Value | Use when |
|
|
64
|
+
|-------|---------|
|
|
65
|
+
| `MOBILE` | Mobile app, phone-sized UI (default if uncertain) |
|
|
66
|
+
| `DESKTOP` | Web dashboard, landing page, SaaS UI |
|
|
67
|
+
| `TABLET` | Tablet-specific layout |
|
|
68
|
+
| `AGNOSTIC` | Not tied to a specific device — responsive/fluid layout |
|
|
69
|
+
|
|
70
|
+
### `modelId`
|
|
71
|
+
| Value | Use when |
|
|
72
|
+
|-------|---------|
|
|
73
|
+
| `GEMINI_3_PRO` | **Recommended** — high-fidelity, complex layouts, production quality |
|
|
74
|
+
| `GEMINI_3_FLASH` | Wireframes, rapid iteration, when speed matters more than quality |
|
|
75
|
+
|
|
76
|
+
## After generating
|
|
77
|
+
|
|
78
|
+
This tool returns session info but **not the actual screenshot/HTML**. To retrieve the design:
|
|
79
|
+
1. Call `stitch-mcp-list-screens` with `projects/[projectId]` to find the new screen
|
|
80
|
+
2. Call `stitch-mcp-get-screen` with the `projectId` and `screenId` to get the screenshot and HTML
|
|
81
|
+
|
|
82
|
+
## Prompt quality checklist
|
|
83
|
+
|
|
84
|
+
Before calling this tool, verify the prompt:
|
|
85
|
+
- [ ] Specifies device type consistently with `deviceType` parameter
|
|
86
|
+
- [ ] Names specific components (not "some buttons" — "primary 'Sign In' button")
|
|
87
|
+
- [ ] Includes colors (hex codes or clear color names)
|
|
88
|
+
- [ ] Uses realistic content (not Lorem Ipsum)
|
|
89
|
+
- [ ] Specifies light or dark mode explicitly
|
|
90
|
+
|
|
91
|
+
## Timing
|
|
92
|
+
|
|
93
|
+
Stitch generation takes 60–180 seconds. This is normal behavior, not a timeout.
|
|
94
|
+
- Do NOT retry during this window
|
|
95
|
+
- Do NOT assume failure if it takes > 60 seconds
|
|
96
|
+
- If it fails: wait 60 seconds, retry ONCE max
|
|
97
|
+
- Each call creates a new generation — retries mean duplicate screens
|
|
98
|
+
|
|
99
|
+
## References
|
|
100
|
+
|
|
101
|
+
- `examples/desktop.md` — Desktop dashboard prompts (SaaS analytics, admin panel)
|
|
102
|
+
- `examples/mobile.md` — Mobile app prompts (login, social feed, e-commerce)
|