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,248 @@
|
|
|
1
|
+
# Animation Patterns — Copy-Paste Reference
|
|
2
|
+
|
|
3
|
+
Ready-to-use patterns for the most common UI animation scenarios.
|
|
4
|
+
All patterns respect `prefers-reduced-motion`.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Button hover lift (CSS — universal)
|
|
9
|
+
|
|
10
|
+
```css
|
|
11
|
+
.btn {
|
|
12
|
+
transition:
|
|
13
|
+
transform var(--motion-duration-fast) var(--motion-ease-out),
|
|
14
|
+
box-shadow var(--motion-duration-fast) var(--motion-ease-out),
|
|
15
|
+
background-color var(--motion-duration-fast) var(--motion-ease-default);
|
|
16
|
+
}
|
|
17
|
+
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
|
|
18
|
+
.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 2. Card hover elevation (CSS — universal)
|
|
24
|
+
|
|
25
|
+
```css
|
|
26
|
+
.card {
|
|
27
|
+
transition:
|
|
28
|
+
transform var(--motion-duration-base) var(--motion-ease-out),
|
|
29
|
+
box-shadow var(--motion-duration-base) var(--motion-ease-out);
|
|
30
|
+
}
|
|
31
|
+
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 3. Fade + rise on page load (CSS keyframes)
|
|
37
|
+
|
|
38
|
+
```css
|
|
39
|
+
@keyframes fade-up {
|
|
40
|
+
from { opacity: 0; transform: translateY(20px); }
|
|
41
|
+
to { opacity: 1; transform: translateY(0); }
|
|
42
|
+
}
|
|
43
|
+
.animate-fade-up {
|
|
44
|
+
animation: fade-up var(--motion-duration-base) var(--motion-ease-out) both;
|
|
45
|
+
}
|
|
46
|
+
/* Stagger children: add style="--delay: Xms" and use animation-delay: var(--delay) */
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 4. Fade in (CSS keyframes)
|
|
52
|
+
|
|
53
|
+
```css
|
|
54
|
+
@keyframes fade-in {
|
|
55
|
+
from { opacity: 0; }
|
|
56
|
+
to { opacity: 1; }
|
|
57
|
+
}
|
|
58
|
+
.animate-fade-in {
|
|
59
|
+
animation: fade-in var(--motion-duration-fast) var(--motion-ease-out) both;
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 5. Scroll reveal — Framer Motion (React/Next.js)
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
'use client'
|
|
69
|
+
import { motion, useReducedMotion } from 'framer-motion'
|
|
70
|
+
|
|
71
|
+
export function RevealOnScroll({ children, delay = 0 }: {
|
|
72
|
+
children: React.ReactNode
|
|
73
|
+
delay?: number
|
|
74
|
+
}) {
|
|
75
|
+
const shouldReduce = useReducedMotion()
|
|
76
|
+
return (
|
|
77
|
+
<motion.div
|
|
78
|
+
initial={shouldReduce ? false : { opacity: 0, y: 20 }}
|
|
79
|
+
whileInView={{ opacity: 1, y: 0 }}
|
|
80
|
+
viewport={{ once: true, margin: '-60px' }}
|
|
81
|
+
transition={{ duration: 0.4, ease: [0, 0, 0.2, 1], delay }}
|
|
82
|
+
>
|
|
83
|
+
{children}
|
|
84
|
+
</motion.div>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 6. Staggered grid — Framer Motion (React/Next.js)
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
'use client'
|
|
95
|
+
import { motion, useReducedMotion } from 'framer-motion'
|
|
96
|
+
|
|
97
|
+
const container = {
|
|
98
|
+
hidden: { opacity: 0 },
|
|
99
|
+
show: { opacity: 1, transition: { staggerChildren: 0.07 } }
|
|
100
|
+
}
|
|
101
|
+
const item = {
|
|
102
|
+
hidden: { opacity: 0, y: 16 },
|
|
103
|
+
show: { opacity: 1, y: 0, transition: { ease: [0, 0, 0.2, 1], duration: 0.35 } }
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function StaggerGrid({ items }: { items: Item[] }) {
|
|
107
|
+
const reduce = useReducedMotion()
|
|
108
|
+
if (reduce) return <div className="grid">{items.map(i => <Card key={i.id} {...i} />)}</div>
|
|
109
|
+
return (
|
|
110
|
+
<motion.div className="grid" variants={container} initial="hidden" whileInView="show" viewport={{ once: true }}>
|
|
111
|
+
{items.map(i => <motion.div key={i.id} variants={item}><Card {...i} /></motion.div>)}
|
|
112
|
+
</motion.div>
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 7. Modal enter/exit — Framer Motion (React/Next.js)
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
'use client'
|
|
123
|
+
import { AnimatePresence, motion, useReducedMotion } from 'framer-motion'
|
|
124
|
+
|
|
125
|
+
export function Modal({ isOpen, onClose, children }: ModalProps) {
|
|
126
|
+
const reduce = useReducedMotion()
|
|
127
|
+
const anim = reduce ? {} : { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 } }
|
|
128
|
+
const panelAnim = reduce ? {} : {
|
|
129
|
+
initial: { opacity: 0, y: -20, scale: 0.97 },
|
|
130
|
+
animate: { opacity: 1, y: 0, scale: 1 },
|
|
131
|
+
exit: { opacity: 0, y: 20, scale: 0.97 },
|
|
132
|
+
transition: { duration: 0.2 }
|
|
133
|
+
}
|
|
134
|
+
return (
|
|
135
|
+
<AnimatePresence>
|
|
136
|
+
{isOpen && (
|
|
137
|
+
<>
|
|
138
|
+
<motion.div className="backdrop" {...anim} onClick={onClose} />
|
|
139
|
+
<motion.div className="modal-panel" role="dialog" aria-modal="true" {...panelAnim}>
|
|
140
|
+
{children}
|
|
141
|
+
</motion.div>
|
|
142
|
+
</>
|
|
143
|
+
)}
|
|
144
|
+
</AnimatePresence>
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 8. Fade in — Svelte transition
|
|
152
|
+
|
|
153
|
+
```svelte
|
|
154
|
+
<script lang="ts">
|
|
155
|
+
import { fade } from 'svelte/transition'
|
|
156
|
+
let { show } = $props()
|
|
157
|
+
</script>
|
|
158
|
+
|
|
159
|
+
{#if show}
|
|
160
|
+
<div in:fade={{ duration: 200 }} out:fade={{ duration: 150 }}>
|
|
161
|
+
Content
|
|
162
|
+
</div>
|
|
163
|
+
{/if}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## 9. Slide-in panel — Svelte transition
|
|
169
|
+
|
|
170
|
+
```svelte
|
|
171
|
+
<script lang="ts">
|
|
172
|
+
import { fly } from 'svelte/transition'
|
|
173
|
+
import { cubicOut } from 'svelte/easing'
|
|
174
|
+
let { isOpen } = $props()
|
|
175
|
+
</script>
|
|
176
|
+
|
|
177
|
+
{#if isOpen}
|
|
178
|
+
<aside
|
|
179
|
+
transition:fly={{ x: -280, duration: 300, easing: cubicOut }}
|
|
180
|
+
role="dialog"
|
|
181
|
+
aria-modal="true"
|
|
182
|
+
>
|
|
183
|
+
Sidebar content
|
|
184
|
+
</aside>
|
|
185
|
+
{/if}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 10. Scroll reveal — Svelte action
|
|
191
|
+
|
|
192
|
+
```svelte
|
|
193
|
+
<script lang="ts">
|
|
194
|
+
function revealOnScroll(node: HTMLElement, delay = 0) {
|
|
195
|
+
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return {}
|
|
196
|
+
node.style.opacity = '0'
|
|
197
|
+
node.style.transform = 'translateY(16px)'
|
|
198
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
199
|
+
if (entry.isIntersecting) {
|
|
200
|
+
node.style.transition = `opacity 400ms cubic-bezier(0,0,0.2,1) ${delay}ms, transform 400ms cubic-bezier(0,0,0.2,1) ${delay}ms`
|
|
201
|
+
node.style.opacity = '1'
|
|
202
|
+
node.style.transform = 'translateY(0)'
|
|
203
|
+
observer.unobserve(node)
|
|
204
|
+
}
|
|
205
|
+
}, { threshold: 0.1 })
|
|
206
|
+
observer.observe(node)
|
|
207
|
+
return { destroy() { observer.disconnect() } }
|
|
208
|
+
}
|
|
209
|
+
</script>
|
|
210
|
+
|
|
211
|
+
<section use:revealOnScroll>Fades in on scroll</section>
|
|
212
|
+
<section use:revealOnScroll={100}>Fades in 100ms later</section>
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## 11. Number counter (Svelte tweened store)
|
|
218
|
+
|
|
219
|
+
```svelte
|
|
220
|
+
<script lang="ts">
|
|
221
|
+
import { tweened } from 'svelte/motion'
|
|
222
|
+
import { cubicOut } from 'svelte/easing'
|
|
223
|
+
|
|
224
|
+
let { target = 1000 } = $props()
|
|
225
|
+
const count = tweened(0, { duration: 800, easing: cubicOut })
|
|
226
|
+
|
|
227
|
+
$effect(() => {
|
|
228
|
+
count.set(target)
|
|
229
|
+
})
|
|
230
|
+
</script>
|
|
231
|
+
|
|
232
|
+
<span>{Math.round($count).toLocaleString()}</span>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Reduced motion reminder
|
|
238
|
+
|
|
239
|
+
Always add this to your global CSS:
|
|
240
|
+
```css
|
|
241
|
+
@media (prefers-reduced-motion: reduce) {
|
|
242
|
+
*, *::before, *::after {
|
|
243
|
+
animation-duration: 0.01ms !important;
|
|
244
|
+
animation-iteration-count: 1 !important;
|
|
245
|
+
transition-duration: 0.01ms !important;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
```
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stitch-design-md
|
|
3
|
+
description: Analyzes a Stitch project's screens and synthesizes a natural-language DESIGN.md — visual atmosphere, color palette with hex values, typography rules, and Stitch-ready prompt snippets. Use this before stitch-loop or any multi-page build to establish design consistency.
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- "stitch*:*"
|
|
6
|
+
- "Read"
|
|
7
|
+
- "Write"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Stitch → DESIGN.md
|
|
11
|
+
|
|
12
|
+
**Constraint:** Only use this skill when the user explicitly mentions "Stitch" or when preparing design system documentation for Stitch generation.
|
|
13
|
+
|
|
14
|
+
You are an expert **Design Systems Lead**. Your job is to analyze Stitch project assets and synthesize a **Semantic Design System** into a file named `DESIGN.md` — written in natural language, not CSS.
|
|
15
|
+
|
|
16
|
+
## When to use this vs. stitch-design-system
|
|
17
|
+
|
|
18
|
+
| Skill | What it produces | Use it for |
|
|
19
|
+
|-------|-----------------|-----------|
|
|
20
|
+
| `stitch-design-md` | Natural-language `DESIGN.md` | Feeding back into Stitch prompts; multi-page visual consistency; design docs |
|
|
21
|
+
| `stitch-design-system` | `design-tokens.css`, `tailwind-theme.css`, `DESIGN.md` | Code-level theming for Next.js, Svelte, React, HTML output |
|
|
22
|
+
|
|
23
|
+
Use `stitch-design-md` first if you're building more Stitch screens. Use `stitch-design-system` when you're converting to code.
|
|
24
|
+
|
|
25
|
+
## Prerequisites
|
|
26
|
+
|
|
27
|
+
- Stitch MCP Server configured
|
|
28
|
+
- A Stitch project with at least one designed screen
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Step 1: Retrieve the design
|
|
33
|
+
|
|
34
|
+
### If the user provides a Stitch URL
|
|
35
|
+
|
|
36
|
+
If the user pastes a Stitch design URL like `https://stitch.withgoogle.com/projects/3492931393329678076?node-id=375b1aadc9cb45209bee8ad4f69af450`:
|
|
37
|
+
|
|
38
|
+
1. Parse the URL:
|
|
39
|
+
- `projectId` = segment after `/projects/` and before `?` (e.g. `3492931393329678076`)
|
|
40
|
+
- `screenId` = query param `node-id` (e.g. `375b1aadc9cb45209bee8ad4f69af450`)
|
|
41
|
+
2. Call `[prefix]:get_screen` with those IDs
|
|
42
|
+
3. Skip ahead to Step 2
|
|
43
|
+
|
|
44
|
+
### If project/screen IDs are unknown
|
|
45
|
+
|
|
46
|
+
1. Run `list_tools` → find the Stitch MCP prefix
|
|
47
|
+
2. Call `[prefix]:list_projects` with `filter: "view=owned"` → select project by title → extract numeric ID
|
|
48
|
+
3. Call `[prefix]:list_screens` with `projects/[projectId]` → pick the representative screen
|
|
49
|
+
4. Call `[prefix]:get_screen` with numeric `projectId` and `screenId`
|
|
50
|
+
5. Call `[prefix]:get_project` with `projects/[projectId]` → get `designTheme` (font, roundness, customColor, colorMode)
|
|
51
|
+
|
|
52
|
+
### Download the assets
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Download the HTML for color and Tailwind class analysis
|
|
56
|
+
bash scripts/fetch-stitch.sh "[htmlCode.downloadUrl]" "temp/source.html"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Parse the HTML for:
|
|
60
|
+
- Tailwind utility classes (colors, typography, spacing, shadows)
|
|
61
|
+
- Inline `tailwind.config` block (custom tokens)
|
|
62
|
+
- CSS variables
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Step 2: Analyze the design
|
|
67
|
+
|
|
68
|
+
Work through these layers systematically:
|
|
69
|
+
|
|
70
|
+
### 2.1 Project identity
|
|
71
|
+
- Project title and numeric ID (from `name` field)
|
|
72
|
+
- `deviceType` (MOBILE / DESKTOP / TABLET / AGNOSTIC)
|
|
73
|
+
- `designTheme.font`, `designTheme.roundness`, `designTheme.colorMode` from `get_project`
|
|
74
|
+
|
|
75
|
+
### 2.2 Visual atmosphere
|
|
76
|
+
Describe the aesthetic in 2–3 sentences. Go beyond generic adjectives — what does it feel like? What editorial or product category does it evoke?
|
|
77
|
+
|
|
78
|
+
Examples:
|
|
79
|
+
- "Sophisticated minimalist sanctuary — gallery-like spaciousness, photography-first, Scandinavian calm"
|
|
80
|
+
- "High-density productivity tool — information-first, sharp edges, focused contrast"
|
|
81
|
+
- "Warm artisanal brand — handcrafted feel, organic textures, generous breathing room"
|
|
82
|
+
|
|
83
|
+
### 2.3 Color palette
|
|
84
|
+
For each key color, write:
|
|
85
|
+
```
|
|
86
|
+
[Descriptive name] ([hex]) — [functional role]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Example:
|
|
90
|
+
```
|
|
91
|
+
Deep Muted Teal-Navy (#294056) — Primary actions, links, active states
|
|
92
|
+
Warm Barely-There Cream (#FCFAFA) — Page background
|
|
93
|
+
Charcoal Near-Black (#2C2C2C) — Headlines and product names
|
|
94
|
+
Soft Warm Gray (#6B6B6B) — Body copy and metadata
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Aim for 4–6 colors. Include light AND dark mode backgrounds if both present.
|
|
98
|
+
|
|
99
|
+
### 2.4 Typography
|
|
100
|
+
- Font family name (from `designTheme.font` or Tailwind class)
|
|
101
|
+
- Weight scale (what's used for display, section headers, body, labels)
|
|
102
|
+
- Any notable letter-spacing, line-height, or size conventions
|
|
103
|
+
|
|
104
|
+
### 2.5 Shape and geometry
|
|
105
|
+
Translate Tailwind classes to descriptive language:
|
|
106
|
+
- `rounded-full` → "Pill-shaped"
|
|
107
|
+
- `rounded-lg` (12px) → "Gently rounded corners"
|
|
108
|
+
- `rounded-md` (8px) → "Subtly rounded corners"
|
|
109
|
+
- `rounded-none` → "Sharp, squared-off edges"
|
|
110
|
+
|
|
111
|
+
### 2.6 Depth and elevation
|
|
112
|
+
Describe shadow presence and style:
|
|
113
|
+
- `shadow-none` → "Flat, no shadow"
|
|
114
|
+
- `shadow-sm` → "Whisper-soft diffused shadow"
|
|
115
|
+
- `shadow-lg` → "Prominent floating elevation"
|
|
116
|
+
|
|
117
|
+
### 2.7 Layout principles
|
|
118
|
+
- Max content width, grid columns, breakpoint behavior
|
|
119
|
+
- Base spacing unit (4px / 8px system)
|
|
120
|
+
- Section margins and padding patterns
|
|
121
|
+
- Touch target sizes (if mobile)
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Step 3: Write DESIGN.md
|
|
126
|
+
|
|
127
|
+
Use this exact structure:
|
|
128
|
+
|
|
129
|
+
```markdown
|
|
130
|
+
# Design System: [Project Title]
|
|
131
|
+
**Project ID:** [numeric ID]
|
|
132
|
+
**Device:** [MOBILE / DESKTOP / TABLET / AGNOSTIC]
|
|
133
|
+
|
|
134
|
+
## 1. Visual Theme & Atmosphere
|
|
135
|
+
[2–3 sentences describing the overall aesthetic and mood]
|
|
136
|
+
|
|
137
|
+
## 2. Color Palette & Roles
|
|
138
|
+
- **[Descriptive Name]** ([#hex]) — [Functional role]
|
|
139
|
+
- **[Descriptive Name]** ([#hex]) — [Functional role]
|
|
140
|
+
[...4–6 colors total]
|
|
141
|
+
|
|
142
|
+
## 3. Typography Rules
|
|
143
|
+
**Primary Font:** [Name] — [One-line character description]
|
|
144
|
+
|
|
145
|
+
- **Display (H1):** [weight], [size range]
|
|
146
|
+
- **Section (H2):** [weight], [size range]
|
|
147
|
+
- **Body:** [weight], line-height [value], [size]
|
|
148
|
+
- **Labels/Captions:** [weight], [size]
|
|
149
|
+
|
|
150
|
+
## 4. Component Stylings
|
|
151
|
+
- **Buttons:** [shape (Xpx radius)], [color], [padding]; hover [behavior]
|
|
152
|
+
- **Cards/Containers:** [roundness (Xpx)], [background], [shadow]; hover [behavior]
|
|
153
|
+
- **Inputs/Forms:** [border style], [background], [roundness], [focus behavior]
|
|
154
|
+
|
|
155
|
+
## 5. Layout Principles
|
|
156
|
+
- Max content width: [value]; [grid description]; [column behavior at breakpoints]
|
|
157
|
+
- Base spacing unit: [4px/8px]; section margins [range]; touch targets [size]
|
|
158
|
+
|
|
159
|
+
## 6. Design System Notes for Stitch Generation
|
|
160
|
+
[This section is copy-paste ready for new Stitch prompts]
|
|
161
|
+
|
|
162
|
+
When creating new screens:
|
|
163
|
+
- **Atmosphere:** "[Quote the atmosphere description from Section 1]"
|
|
164
|
+
- **Colors:** Always use descriptive name + hex (e.g. "[Name] ([#hex])")
|
|
165
|
+
- **Shape:** "[Describe buttons and cards using the language from Section 4]"
|
|
166
|
+
- **Spacing:** "[Describe the whitespace/density philosophy]"
|
|
167
|
+
- **Font:** [Font name] — [one-line descriptor]
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Step 4: Integration
|
|
173
|
+
|
|
174
|
+
Tell the user what to do with it:
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
## DESIGN.md created
|
|
178
|
+
|
|
179
|
+
Saved to: ./DESIGN.md
|
|
180
|
+
|
|
181
|
+
**How to use it:**
|
|
182
|
+
|
|
183
|
+
1. **More Stitch screens:** Copy Section 6 into the DESIGN SYSTEM block of your next Stitch prompt.
|
|
184
|
+
This keeps every new screen visually consistent with your existing design.
|
|
185
|
+
|
|
186
|
+
2. **Multi-page build with stitch-loop:** Include Section 6 in every `next-prompt.md` baton file.
|
|
187
|
+
|
|
188
|
+
3. **Code conversion:** Hand off to `stitch-design-system` when you're ready to generate
|
|
189
|
+
`design-tokens.css` and `tailwind-theme.css` for your framework.
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Best practices
|
|
195
|
+
|
|
196
|
+
- **Descriptive over technical:** "Ocean-deep Cerulean (#0077B6)" not just "blue"
|
|
197
|
+
- **Functional roles matter:** Don't just name the color — say what it does
|
|
198
|
+
- **Section 6 is the payoff:** This is the copy-paste block that makes every future screen consistent
|
|
199
|
+
- **Be precise:** Exact hex codes always. Vague approximations ("kind of warm beige") are useless
|
|
200
|
+
|
|
201
|
+
## Common pitfalls
|
|
202
|
+
|
|
203
|
+
- Leaving `rounded-xl` in the doc instead of translating to "generously rounded corners (12px)"
|
|
204
|
+
- Listing colors without functional roles
|
|
205
|
+
- Skipping the font weight scale (just saying "Manrope" doesn't tell you when to use 400 vs 600)
|
|
206
|
+
- Writing Section 6 without the actual hex codes — useless for Stitch
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## References
|
|
211
|
+
|
|
212
|
+
- `examples/usage.md` — Worked examples
|
|
213
|
+
- `examples/DESIGN.md` — Complete sample output for a furniture e-commerce site
|
|
214
|
+
- `docs/color-prompt-guide.md` — 8 ready-to-use color palettes for inspiration
|
|
215
|
+
- `scripts/fetch-stitch.sh` — Reliable HTML downloader for GCS URLs
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Design System: Oakwood Furniture Co.
|
|
2
|
+
**Project ID:** 13534454087919359824
|
|
3
|
+
**Device:** DESKTOP
|
|
4
|
+
|
|
5
|
+
## 1. Visual Theme & Atmosphere
|
|
6
|
+
|
|
7
|
+
The Oakwood Furniture site embodies a **sophisticated, minimalist sanctuary** that marries Scandinavian simplicity with luxury editorial presentation. The interface feels spacious and tranquil — photography-first, with minimal UI chrome that never competes with the products. Expansive whitespace and a whisper-soft visual hierarchy guide without shouting.
|
|
8
|
+
|
|
9
|
+
## 2. Color Palette & Roles
|
|
10
|
+
|
|
11
|
+
- **Warm Barely-There Cream** (#FCFAFA) — Primary page background
|
|
12
|
+
- **Crisp Very Light Gray** (#F5F5F5) — Secondary surface for cards and sidebars
|
|
13
|
+
- **Deep Muted Teal-Navy** (#294056) — Primary actions, buttons, links, active nav states
|
|
14
|
+
- **Charcoal Near-Black** (#2C2C2C) — Headlines, product names, primary text
|
|
15
|
+
- **Soft Warm Gray** (#6B6B6B) — Body copy, metadata, secondary labels
|
|
16
|
+
|
|
17
|
+
## 3. Typography Rules
|
|
18
|
+
|
|
19
|
+
**Primary Font:** Manrope — Modern geometric sans-serif with gentle humanist warmth
|
|
20
|
+
|
|
21
|
+
- **Display (H1):** Semi-bold (600), 2.75–3.5rem
|
|
22
|
+
- **Section (H2):** Semi-bold (600), 2–2.5rem
|
|
23
|
+
- **Body:** Regular (400), line-height 1.7, 1rem
|
|
24
|
+
- **Labels/CTAs:** Medium (500), 1rem
|
|
25
|
+
|
|
26
|
+
## 4. Component Stylings
|
|
27
|
+
|
|
28
|
+
- **Buttons:** Subtly rounded corners (8px), Deep Muted Teal-Navy (#294056) fill, comfortable padding (12px 24px); hover darkens by 10%
|
|
29
|
+
- **Cards:** Gently rounded corners (12px), Warm Cream or Very Light Gray background, whisper-soft shadow on hover
|
|
30
|
+
- **Inputs:** 1px border Soft Warm Gray (#6B6B6B), Warm Cream (#FCFAFA) background, 8px roundness, teal-navy glow on focus
|
|
31
|
+
|
|
32
|
+
## 5. Layout Principles
|
|
33
|
+
|
|
34
|
+
- Max content width 1440px; responsive 12-column grid; 4/3/2/1 columns across breakpoints
|
|
35
|
+
- Base spacing unit 8px; section margins 5–8rem; touch targets ≥44px
|
|
36
|
+
- Photography given full bleed treatment in hero zones; text content max-width 720px for readability
|
|
37
|
+
|
|
38
|
+
## 6. Design System Notes for Stitch Generation
|
|
39
|
+
|
|
40
|
+
Copy this section into new Stitch prompts to maintain visual consistency:
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
**DESIGN SYSTEM:**
|
|
45
|
+
- **Atmosphere:** "Sophisticated minimalist sanctuary with gallery-like spaciousness — photography-first, warm and refined"
|
|
46
|
+
- **Background:** Warm Barely-There Cream (#FCFAFA)
|
|
47
|
+
- **Surface:** Crisp Very Light Gray (#F5F5F5) for cards
|
|
48
|
+
- **Primary Accent:** Deep Muted Teal-Navy (#294056) for buttons and links
|
|
49
|
+
- **Text Primary:** Charcoal Near-Black (#2C2C2C) for headlines
|
|
50
|
+
- **Text Secondary:** Soft Warm Gray (#6B6B6B) for body copy
|
|
51
|
+
- **Font:** Manrope — modern, geometric, approachable
|
|
52
|
+
- **Buttons:** Subtly rounded corners (8px), comfortable padding
|
|
53
|
+
- **Cards:** Gently rounded corners (12px), whisper-soft shadows on hover
|
|
54
|
+
- **Spacing:** Generous breathing room, expansive whitespace, centered max-width container
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# stitch-design-md — Usage Examples
|
|
2
|
+
|
|
3
|
+
## Example 1: Extract design system from an existing Stitch screen
|
|
4
|
+
|
|
5
|
+
**User:** "I've designed the homepage in Stitch. Generate a DESIGN.md so I can keep new screens consistent."
|
|
6
|
+
|
|
7
|
+
**Skill activates because:** User explicitly mentions "Stitch" and wants design documentation.
|
|
8
|
+
|
|
9
|
+
**What the skill does:**
|
|
10
|
+
1. Calls `list_projects` → finds the project
|
|
11
|
+
2. Calls `list_screens` → identifies the homepage screen
|
|
12
|
+
3. Calls `get_screen` → gets HTML and screenshot download URLs
|
|
13
|
+
4. Downloads HTML via `scripts/fetch-stitch.sh`
|
|
14
|
+
5. Calls `get_project` → gets `designTheme` (font, roundness, colorMode)
|
|
15
|
+
6. Analyzes HTML for color values, Tailwind classes, typography scale
|
|
16
|
+
7. Writes `DESIGN.md` with atmosphere, palette, typography, components, layout, and Section 6 prompt snippets
|
|
17
|
+
|
|
18
|
+
**Output:** `DESIGN.md` with complete design system + copy-paste Section 6
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Example 2: Multi-page site setup
|
|
23
|
+
|
|
24
|
+
**User:** "Use Stitch to build a 5-page SaaS site. Generate the homepage first, then set up DESIGN.md for the rest."
|
|
25
|
+
|
|
26
|
+
**What the skill does:**
|
|
27
|
+
1. After homepage generation, user calls `stitch-design-md`
|
|
28
|
+
2. Extracts design system from the homepage
|
|
29
|
+
3. Creates `DESIGN.md` with Section 6 ready to paste
|
|
30
|
+
4. User then runs `stitch-loop`, including Section 6 in every `next-prompt.md`
|
|
31
|
+
5. Result: all 5 pages share the same colors, fonts, shapes, and spacing
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Example 3: From a Stitch URL
|
|
36
|
+
|
|
37
|
+
**User:** "Here's my Stitch design: https://stitch.withgoogle.com/projects/3492931393329678076?node-id=375b1aadc9cb45209bee8ad4f69af450 — write a DESIGN.md for it."
|
|
38
|
+
|
|
39
|
+
**What the skill does:**
|
|
40
|
+
1. Parses URL → extracts `projectId: 3492931393329678076`, `screenId: 375b1aadc9cb45209bee8ad4f69af450`
|
|
41
|
+
2. Calls `get_screen` directly (no need for list operations)
|
|
42
|
+
3. Downloads HTML, analyzes, writes DESIGN.md
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## How DESIGN.md Section 6 gets used downstream
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
# In next-prompt.md (for stitch-loop):
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
page: pricing
|
|
53
|
+
---
|
|
54
|
+
A clear pricing page for a SaaS project management tool.
|
|
55
|
+
|
|
56
|
+
**DESIGN SYSTEM:**
|
|
57
|
+
[Paste Section 6 from DESIGN.md here verbatim]
|
|
58
|
+
|
|
59
|
+
**Page Structure:**
|
|
60
|
+
1. Pricing hero with tagline
|
|
61
|
+
2. Three pricing tiers (Free, Pro, Enterprise)
|
|
62
|
+
3. Feature comparison table
|
|
63
|
+
4. FAQ accordion
|
|
64
|
+
5. CTA footer
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The Section 6 block locks in the visual identity — Stitch uses it to stay consistent with your existing screens.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# fetch-stitch.sh
|
|
3
|
+
# Reliably downloads Stitch HTML from Google Cloud Storage URLs.
|
|
4
|
+
# GCS URLs require redirect handling and security handshakes that AI fetch tools fail on.
|
|
5
|
+
#
|
|
6
|
+
# Usage:
|
|
7
|
+
# bash scripts/fetch-stitch.sh "<url>" "<output-path>"
|
|
8
|
+
#
|
|
9
|
+
# Example:
|
|
10
|
+
# bash scripts/fetch-stitch.sh "$htmlCode_downloadUrl" "temp/source.html"
|
|
11
|
+
|
|
12
|
+
set -euo pipefail
|
|
13
|
+
|
|
14
|
+
URL="${1:?Usage: fetch-stitch.sh <url> <output-path>}"
|
|
15
|
+
OUTPUT="${2:?Usage: fetch-stitch.sh <url> <output-path>}"
|
|
16
|
+
|
|
17
|
+
mkdir -p "$(dirname "$OUTPUT")"
|
|
18
|
+
|
|
19
|
+
curl -L \
|
|
20
|
+
-A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36" \
|
|
21
|
+
--compressed \
|
|
22
|
+
--retry 3 \
|
|
23
|
+
--retry-delay 1 \
|
|
24
|
+
--max-time 30 \
|
|
25
|
+
--silent \
|
|
26
|
+
--show-error \
|
|
27
|
+
--output "$OUTPUT" \
|
|
28
|
+
"$URL"
|
|
29
|
+
|
|
30
|
+
if [ ! -s "$OUTPUT" ]; then
|
|
31
|
+
echo "Error: Downloaded file is empty. URL may be expired or invalid." >&2
|
|
32
|
+
exit 1
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
echo "Downloaded to: $OUTPUT ($(wc -c < "$OUTPUT") bytes)"
|