stitch-loop
Skill45 starsChanged 8 months agoApache-2.0View on GitHub
Iteratively build multi-page websites using Stitch. Reads next-prompt.md (the baton), generates the next page with Stitch MCP, integrates it into the site, then updates next-prompt.md to continue the loop. Works with stitch-design-md and stitch-ui-prompt-architect for consistent multi-page output.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- delorenj/skillstheir own version, first seen Oct 2, 2026
- diodeme/Gold-Bandtheir own version, first seen Sep 30, 2026
- PracticalSwan/agent-skillstheir own version, first seen Sep 14, 2026
- jh941213/my-cc-harnesstheir own version, first seen Jul 27, 2026
- jhy0285/monofieldtheir own version, first seen May 29, 2026
- vobase/vobasetheir own version, first seen Apr 25, 2026
Used with
Projects with it also use stitch-design.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
blockbloomerSkillstitch-design
Automate high-fidelity UI prototyping with Google Stitch MCP. Use when the user needs to generate, iterate, or refine UI screens via Stitch prompts.
Also in 3 projects that use this
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- diodeme/Gold-Band★ 143same name
- jh941213/my-cc-harness★ 126same name
- vobase/vobase★ 61same name
- PracticalSwan/agent-skills★ 18same name
- delorenj/skills★ 15same name
- autohandai/community-skills★ 11same name
- jhy0285/monofield★ 4same name
- OmyDaGreat/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository36 other files it gives its agents.
- AGENTS.mdAGENTS.md
- stitch-a11ySkill
- stitch-animateSkill
- stitch-design-mdSkill
- stitch-design-systemSkill
- stitch-html-componentsSkill
- stitch-ideateSkill
- stitch-mcp-apply-design-systemSkill
- stitch-mcp-create-design-system-from-design-mdSkill
- stitch-mcp-create-design-systemSkill
- stitch-mcp-create-projectSkill
- stitch-mcp-delete-projectSkill
- stitch-mcp-edit-screensSkill
- stitch-mcp-generate-screen-from-textSkill
- stitch-mcp-generate-variantsSkill
- stitch-mcp-get-projectSkill
- stitch-mcp-get-screenSkill
- stitch-mcp-list-design-systemsSkill
- stitch-mcp-list-projectsSkill
- stitch-mcp-list-screensSkill
- stitch-mcp-update-design-systemSkill
- stitch-mcp-upload-design-mdSkill
- stitch-nextjs-componentsSkill
- stitch-orchestratorSkill
- stitch-react-componentsSkill
- stitch-react-native-componentsSkill
- stitch-remotionSkill
- stitch-setupSkill
- stitch-shadcn-uiSkill
- stitch-skill-creatorSkill
- stitch-svelte-componentsSkill
- stitch-swiftui-componentsSkill
- stitch-ued-guideSkill
- stitch-ui-design-spec-generatorSkill
- stitch-ui-design-variantsSkill
- stitch-ui-prompt-architectSkill
The file
We split this skill into the rules it gives an agent
12 rules. 2 are common, 2 are distinctive, and 8 are very specific to this project.
2
Common
Most of the 6 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Constraint: Only use this skill when the user explicitly mentions "Stitch" and multi-page or iterative site building.
- Very specific: line 63
Check: Do not rebuild pages already in SITE.md sitemap.
- Very specific: line 67
Run list_tools → find Stitch MCP prefix
- Very specific: line 68
If stitch.json exists, use stored projectId — do not create a new project
- Very specific: line 69
If no stitch.json, call create_project → save numeric ID to stitch.json
- Very specific: line 74
Call get_screen with numeric projectId + screenId
- Distinctive: line 83
Ensure the header/footer matches other pages in the site
- Very specific: line 87
If chrome* tools are in list_tools:
- Very specific: line 88
Start local server: npx serve site/public -p 3000
- Very specific: line 95
Add [x] [page].html to the sitemap
- Common: line 96
Remove consumed ideas from creative freedom section
- Common: line 97
Update roadmap if a backlog item was completed
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Stitch Build Loop
Constraint: Only use this skill when the user explicitly mentions "Stitch" and multi-page or iterative site building.
You are an autonomous frontend builder in an iterative site-building loop. Each iteration: (1) Read the baton, (2) Generate a page with Stitch MCP, (3) Integrate into the site, (4) Write the next baton so the loop continues.
Prerequisites
- Stitch MCP Server (see
stitch-setupskill or https://stitch.withgoogle.com/docs/mcp/guide/) DESIGN.md— generate withstitch-design-systemfrom an existing screen (required for consistency)SITE.md— site vision, Stitch project ID, sitemap, roadmap (create if missing)
The baton system
next-prompt.md is the relay baton between iterations. It tells the loop what page to build next.
Baton format
---
page: about
---
**DESIGN SYSTEM (REQUIRED):**
[Paste DESIGN.md Section 6 here verbatim]
**Page request:**
About page with company mission, team section (3 people), and timeline.Rules:
pagefrontmatter → output filename (about.html)- The body must include the design system block from
DESIGN.mdSection 6 - You must update
next-prompt.mdat the end of every iteration — the loop stops if this is missing
Execution protocol
Step 1 — Read the baton
Parse next-prompt.md:
- Extract
pagefrom YAML frontmatter - Extract the full prompt body (including the design system block)
Step 2 — Consult context files
| File | What to look for |
SITE.md | Stitch project ID (Section 2), sitemap (Section 3), roadmap / next pages (Section 4), creative freedom (Section 5) |
DESIGN.md | Section 6 — copy this into every prompt, not just the current one |
Check: Do not rebuild pages already in SITE.md sitemap. Do not deviate from the visual language in DESIGN.md.
Step 3 — Generate with Stitch
- Run
list_tools→ find Stitch MCP prefix - If
stitch.jsonexists, use storedprojectId— do not create a new project - If no
stitch.json, callcreate_project→ save numeric ID tostitch.json - Call
generate_screen_from_text:projectId: numeric ID (noprojects/prefix)prompt: full baton content including DESIGN SYSTEM blockdeviceType: match what's inSITE.mdorDESIGN.md
- Call
get_screenwith numeric projectId + screenId - Download HTML:
bash scripts/fetch-stitch.sh "[htmlCode.downloadUrl]" "queue/[page].html" - Download screenshot: save to
queue/[page].png
Step 4 — Integrate into site
- Move
queue/[page].html→site/public/[page].html - Fix asset paths (make relative to
site/public/) - Wire navigation: replace
href="#"placeholders with real paths to existing pages - Ensure the header/footer matches other pages in the site
Step 4.5 — Visual verification (if Chrome DevTools MCP available)
If chrome* tools are in list_tools:
- Start local server:
npx serve site/public -p 3000 - Navigate to
http://localhost:3000/[page].html - Take screenshot, compare against
queue/[page].png - Stop server
Step 5 — Update SITE.md
- Add
[x] [page].htmlto the sitemap - Remove consumed ideas from creative freedom section
- Update roadmap if a backlog item was completed
Step 6 — Write the next baton (CRITICAL)
You must update next-prompt.md before completing — the loop stalls if you skip this.
- Pick next page from: sitemap → roadmap → creative freedom → or invent one that fits
- Write
next-prompt.mdwith:- Valid YAML frontmatter (
page: <next-page-name>) **DESIGN SYSTEM (REQUIRED):**block copied verbatim fromDESIGN.mdSection 6- Clear page description
- Valid YAML frontmatter (
File structure
project/
├── next-prompt.md ← Baton (current task; updated each iteration)
├── stitch.json ← Stitch project ID (persist between loops!)
├── DESIGN.md ← From stitch-design-system
├── SITE.md ← Vision, sitemap, roadmap
├── queue/ ← Staging: [page].html, [page].png
└── site/
└── public/ ← Production: index.html, about.html, etc.SITE.md template
# Site Vision
[One paragraph describing the site's purpose, audience, and overall feeling]
## Stitch Project
- **Project ID (numeric):** [ID from stitch-mcp-create-project]
## Sitemap
- [ ] index.html — Home
- [ ] about.html — About
- [ ] contact.html — Contact
## Roadmap
1. index.html — main landing page
2. about.html — company/team info
3. contact.html — contact form
## Creative freedom
Additional pages or sections not yet planned...Common pitfalls
- ❌ Forgetting to update
next-prompt.md(loop stops) - ❌ Rebuilding a page already in SITE.md sitemap
- ❌ Omitting
DESIGN.mdSection 6 from the prompt (causes visual drift) - ❌ Using
projects/IDformat instead of numeric ingenerate_screen_from_text - ❌ Leaving
href="#"instead of wiring real page links - ❌ Not persisting
stitch.json(creates new project every iteration)
Troubleshooting
| Issue | Fix |
| Inconsistent visual styles across pages | Keep DESIGN.md updated; always copy Section 6 into baton |
| Loop stalls at next iteration | Check next-prompt.md has valid frontmatter and non-empty body |
| Stitch generation fails | Ensure baton includes DESIGN SYSTEM block and a specific page request |
| Broken navigation | Use relative paths for internal links; check site/public/ structure |
References
scripts/fetch-stitch.sh— Reliable GCS HTML downloaderstitch-design-system— Generate DESIGN.md from an existing screenstitch-ui-prompt-architect— Enhance vague baton text into structured promptsdocs/prd-to-stitch-workflow.md— PRD-driven multi-screen workflow
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

