Official agent skill

Stitch Build Loop

by google-labs-code in google-labs-code/stitch-skills

Builds a website page by page with Stitch in an autonomous loop, passing a baton file from one iteration to the next that names the next page and prompt.

OfficialApache-2.0Auto-check: notesFrontend & Design

Install Stitch Build Loop

skills CLI
$ npx skills add google-labs-code/stitch-skills --skill stitch-loop -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install google-labs-code/stitch-skills stitch-loop --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/google-labs-code/stitch-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/stitch-utilities/skills/stitch-loop .claude/skills/stitch-loop && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
stitch-loop
GitHub stars
8.4k
Used in
5 other repos
Token cost
~2.6k tokens
SKILL.md length
1,018 words
Files
6
Skills in repo
7
Repo updated
First seen
Licence
Apache-2.0

At a glance

Builds a website page by page with Stitch in an autonomous loop, passing a baton file from one iteration to the next that names the next page and prompt.

  • Works in 7 steps: Read the Baton → Consult Context Files → Generate with Stitch → …
  • Building a multi-page site with Stitch over repeated agent runs
  • SKILL.md covers Overview, Prerequisites, The Baton System and Execution Protocol, plus 5 more sections
  • Calls npx

What it does

Each iteration reads its task from .stitch/next-prompt.md, whose page frontmatter sets the output filename and whose body carries the prompt plus the design block from .stitch/DESIGN.md. The agent also consults .stitch/SITE.md, which holds the vision, the Stitch project ID, a sitemap of existing pages, a roadmap and a creative freedom section, so it does not recreate pages that already exist.

It then discovers the Stitch MCP tool prefix, gets or creates the project, saving details to .stitch/metadata.json, generates the page, integrates it into the site, and must rewrite the baton so the loop continues. Prerequisites are access to the Stitch MCP server, a DESIGN.md (the design-md skill can produce one) and a SITE.md, with Chrome DevTools MCP optional for visual checks. Baton and site templates ship with the skill. The excerpt ends partway through the generation step.

When your agent uses it

  • Building a multi-page site with Stitch over repeated agent runs
  • Continuing a site whose next page is queued in the baton file
  • Keeping generated pages consistent with a DESIGN.md style
  • Verifying generated pages visually with Chrome DevTools

Example prompts

  • “Start a Stitch build loop for our portfolio site using the roadmap in SITE.md.”
  • “Read the baton in .stitch/next-prompt.md, generate that page and queue the next one.”
  • “Add an about page to the site without recreating pages already in the sitemap.”

Requirements

  • Access to the Stitch MCP server
  • A .stitch/DESIGN.md and .stitch/SITE.md in the project
  • Pre-approved tools (allowed-tools): stitch*:*, chrome*:*, Read, Write, Bash

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Read the Baton
  2. Consult Context Files
  3. Generate with Stitch
  4. Integrate into Site
  5. 5: Visual Verification (Optional)
  6. Update Site Documentation
  7. Prepare the Next Baton (Critical)

What it can do on your machine

Read from SKILL.md and the folder at commit 0337446. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • stitch*:*
    • chrome*:*
    • Read
    • Write
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Stitch Build Loop loads about 2.6k tokens when it runs. Until then it costs about 29 tokens; SKILL.md has 1,018 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~29
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: stitch*:*, chrome*:*, Read, Write, Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from google-labs-code/stitch-skills at commit 0337446, republished under its Apache-2.0 licence (© google-labs-code). 1,018 words, ~2,555 tokens.

Download SKILL.mdSave it as .claude/skills/stitch-loop/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
stitch-loop
description
Teaches agents to iteratively build websites using Stitch with an autonomous baton-passing loop pattern
allowed-tools
stitch*:*, chrome*:*, Read, Write, Bash

Stitch Build Loop

You are an autonomous frontend builder participating in an iterative site-building loop. Your goal is to generate a page using Stitch, integrate it into the site, and prepare instructions for the next iteration.

Overview

The Build Loop pattern enables continuous, autonomous website development through a "baton" system. Each iteration:

  1. Reads the current task from a baton file (.stitch/next-prompt.md)
  2. Generates a page using Stitch MCP tools
  3. Integrates the page into the site structure
  4. Writes the next task to the baton file for the next iteration

Prerequisites

Required:

  • Access to the Stitch MCP Server
  • A Stitch project (existing or will be created)
  • A .stitch/DESIGN.md file (generate one using the design-md skill if needed)
  • A .stitch/SITE.md file documenting the site vision and roadmap

Optional:

  • Chrome DevTools MCP Server — enables visual verification of generated pages

The Baton System

The .stitch/next-prompt.md file acts as a relay baton between iterations:

markdown
---
page: about
---
A page describing how jules.top tracking works.

**DESIGN SYSTEM (REQUIRED):**
[Copy from .stitch/DESIGN.md Section 6]

**Page Structure:**
1. Header with navigation
2. Explanation of tracking methodology
3. Footer with links

Critical rules:

  • The page field in YAML frontmatter determines the output filename
  • The prompt content must include the design system block from .stitch/DESIGN.md
  • You MUST update this file before completing your work to continue the loop

Execution Protocol

Step 1: Read the Baton

Parse .stitch/next-prompt.md to extract:

  • Page name from the page frontmatter field
  • Prompt content from the markdown body
Step 2: Consult Context Files

Before generating, read these files:

FilePurpose
.stitch/SITE.mdSite vision, Stitch Project ID, existing pages (sitemap), roadmap
.stitch/DESIGN.mdRequired visual style for Stitch prompts

Important checks:

  • Section 4 (Sitemap) — Do NOT recreate pages that already exist
  • Section 5 (Roadmap) — Pick tasks from here if backlog exists
  • Section 6 (Creative Freedom) — Ideas for new pages if roadmap is empty
Step 3: Generate with Stitch

Use the Stitch MCP tools to generate the page:

  1. Discover namespace: Run list_tools to find the Stitch MCP prefix
  2. Get or create project:
    • If .stitch/metadata.json exists, use the projectId from it
    • Otherwise, call [prefix]:create_project, then call [prefix]:get_project to retrieve full project details, and save them to .stitch/metadata.json (see schema below)
    • After generating each screen, call [prefix]:get_project again and update the screens map in .stitch/metadata.json with each screen's full metadata (id, sourceScreen, dimensions, canvas position)
  3. Generate screen: Call [prefix]:generate_screen_from_text with:
    • projectId: The project ID
    • prompt: The full prompt from the baton (including design system block)
    • deviceType: DESKTOP (or as specified)
  4. Retrieve assets: Before downloading, check if .stitch/designs/{page}.html and .stitch/designs/{page}.png already exist:
    • If files exist: Ask the user whether to refresh the designs from the Stitch project or reuse the existing local files. Only re-download if the user confirms.
    • If files do not exist: Proceed with download:
      • htmlCode.downloadUrl — Download and save as .stitch/designs/{page}.html
      • screenshot.downloadUrl — Append =w{width} to the URL before downloading, where {width} is the width value from the screen metadata (Google CDN serves low-res thumbnails by default). Save as .stitch/designs/{page}.png
Step 4: Integrate into Site
  1. Move generated HTML from .stitch/designs/{page}.html to site/public/{page}.html
  2. Fix any asset paths to be relative to the public folder
  3. Update navigation:
    • Find existing placeholder links (e.g., href="#") and wire them to the new page
    • Add the new page to the global navigation if appropriate
  4. Ensure consistent headers/footers across all pages
Step 4.5: Visual Verification (Optional)

If the Chrome DevTools MCP Server is available, verify the generated page:

  1. Check availability: Run list_tools to see if chrome* tools are present
  2. Start dev server: Use Bash to start a local server (e.g., npx serve site/public)
  3. Navigate to page: Call [chrome_prefix]:navigate to open http://localhost:3000/{page}.html
  4. Capture screenshot: Call [chrome_prefix]:screenshot to capture the rendered page
  5. Visual comparison: Compare against the Stitch screenshot (.stitch/designs/{page}.png) for fidelity
  6. Stop server: Terminate the dev server process

Note: This step is optional. If Chrome DevTools MCP is not installed, skip to Step 5.

Show full SKILL.md (400 more words)Show less
Step 5: Update Site Documentation

Modify .stitch/SITE.md:

  • Add the new page to Section 4 (Sitemap) with [x]
  • Remove any idea you consumed from Section 6 (Creative Freedom)
  • Update Section 5 (Roadmap) if you completed a backlog item
Step 6: Prepare the Next Baton (Critical)

You MUST update .stitch/next-prompt.md before completing. This keeps the loop alive.

  1. Decide the next page:
    • Check .stitch/SITE.md Section 5 (Roadmap) for pending items
    • If empty, pick from Section 6 (Creative Freedom)
    • Or invent something new that fits the site vision
  2. Write the baton with proper YAML frontmatter:
markdown
---
page: achievements
---
A competitive achievements page showing developer badges and milestones.

**DESIGN SYSTEM (REQUIRED):**
[Copy the entire design system block from .stitch/DESIGN.md]

**Page Structure:**
1. Header with title and navigation
2. Badge grid showing unlocked/locked states
3. Progress bars for milestone tracking

File Structure Reference

project/
├── .stitch/
│   ├── metadata.json   # Stitch project & screen IDs (persist this!)
│   ├── DESIGN.md       # Visual design system (from design-md skill)
│   ├── SITE.md         # Site vision, sitemap, roadmap
│   ├── next-prompt.md  # The baton — current task
│   └── designs/        # Staging area for Stitch output
│       ├── {page}.html
│       └── {page}.png
└── site/public/        # Production pages
    ├── index.html
    └── {page}.html
.stitch/metadata.json Schema

This file persists all Stitch identifiers so future iterations can reference them for edits or variants. Populate it by calling [prefix]:get_project after creating a project or generating screens.

json
{
  "name": "projects/6139132077804554844",
  "projectId": "6139132077804554844",
  "title": "My App",
  "visibility": "PRIVATE",
  "createTime": "2026-03-04T23:11:25.514932Z",
  "updateTime": "2026-03-04T23:34:40.400007Z",
  "projectType": "PROJECT_DESIGN",
  "origin": "STITCH",
  "deviceType": "MOBILE",
  "designTheme": {
    "colorMode": "DARK",
    "font": "INTER",
    "roundness": "ROUND_EIGHT",
    "customColor": "#40baf7",
    "saturation": 3
  },
  "screens": {
    "index": {
      "id": "d7237c7d78f44befa4f60afb17c818c1",
      "sourceScreen": "projects/6139132077804554844/screens/d7237c7d78f44befa4f60afb17c818c1",
      "x": 0,
      "y": 0,
      "width": 390,
      "height": 1249
    },
    "about": {
      "id": "bf6a3fe5c75348e58cf21fc7a9ddeafb",
      "sourceScreen": "projects/6139132077804554844/screens/bf6a3fe5c75348e58cf21fc7a9ddeafb",
      "x": 549,
      "y": 0,
      "width": 390,
      "height": 1159
    }
  },
  "metadata": {
    "userRole": "OWNER"
  }
}
FieldDescription
nameFull resource name (projects/{id})
projectIdStitch project ID (from create_project or get_project)
titleHuman-readable project title
designThemeDesign system tokens: color mode, font, roundness, custom color, saturation
deviceTypeTarget device: MOBILE, DESKTOP, TABLET
screensMap of page name → screen object. Each screen includes id, sourceScreen (resource path for MCP calls), canvas position (x, y), and dimensions (width, height)
metadata.userRoleUser's role on the project (OWNER, EDITOR, VIEWER)

Orchestration Options

The loop can be driven by different orchestration layers:

MethodHow it works
CI/CDGitHub Actions triggers on .stitch/next-prompt.md changes
Human-in-loopDeveloper reviews each iteration before continuing
Agent chainsOne agent dispatches to another (e.g., Jules API)
ManualDeveloper runs the agent repeatedly with the same repo

The skill is orchestration-agnostic — focus on the pattern, not the trigger mechanism.

Design System Integration

This skill works best with the design-md skill:

  1. First time setup: Generate .stitch/DESIGN.md using the design-md skill from an existing Stitch screen
  2. Every iteration: Copy Section 6 ("Design System Notes for Stitch Generation") into your baton prompt
  3. Consistency: All generated pages will share the same visual language

Common Pitfalls

  • ❌ Forgetting to update .stitch/next-prompt.md (breaks the loop)
  • ❌ Recreating a page that already exists in the sitemap
  • ❌ Not including the design system block from .stitch/DESIGN.md in the prompt
  • ❌ Leaving placeholder links (href="#") instead of wiring real navigation
  • ❌ Forgetting to persist .stitch/metadata.json after creating a new project

Troubleshooting

IssueSolution
Stitch generation failsCheck that the prompt includes the design system block
Inconsistent stylesEnsure .stitch/DESIGN.md is up-to-date and copied correctly
Loop stallsVerify .stitch/next-prompt.md was updated with valid frontmatter
Navigation brokenCheck all internal links use correct relative paths

© google-labs-code, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files in plugins/stitch-utilities/skills/stitch-loop of google-labs-code/stitch-skills.

  • SKILL.md
  • README.md
  • examples/SITE.md
  • examples/next-prompt.md
  • resources/baton-schema.md
  • resources/site-template.md

Open the folder on GitHubat commit 0337446

Used in 5 other repositories

We found 15 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 5 other GitHub owners. This page covers the copy in google-labs-code/stitch-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Stitch Build Loop next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Stitch Build Loop compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Stitch Build Loop this skillgoogle-labs-code/stitch-skills8.4k5 repos~2.6kAutomated safety check: NotesApache-2.0
Variate Design VariationsNutlope/variate211—~3.5kAutomated safety check: PassMIT
Vuetify Playgroundvuetifyjs/vuetify41k—~730Automated safety check: PassCustom licence
Vue Expert (JavaScript)Jeffallan/claude-skills12k—~1.6kAutomated safety check: PassMIT
Stitch Loopjh941213/my-cc-harness126—~1.5kAutomated safety check: NotesNone
Fast Agent Designevalstate/fast-agent3.9k—~220Automated safety check: PassApache-2.0

Similar skills

  • Puts four real design variations of one project file on your localhost behind a small card you flip with the arrow keys, then acts on your verdict.

    211 GitHub stars~3.5k tokensUpdated 1 mo ago
    Frontend & DesignAuto-check passed
  • Vuetify Playground

    vuetifyjs/vuetify

    Maintains the Vuetify repo's local Playground.vue so contributors get a realistic reproduction and a short demo they can paste into a pull request description.

    41k GitHub stars~730 tokensUpdated today
    Frontend & DesignAuto-check passed
  • Vue Expert (JavaScript)

    Jeffallan/claude-skills

    Builds Vue 3 apps in plain JavaScript with JSDoc typing instead of TypeScript: script setup components, composables, Pinia and Vitest, with ESLint JSDoc coverage checks.

    12k GitHub stars~1.6k tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed
  • Stitch Loop

    jh941213/my-cc-harness

    Stitch를 사용하여 자율적으로 멀티 페이지 웹사이트를 생성하는 반복 빌드 루프 패턴 — 바통 시스템으로 지속적 웹사이트 개발.

    126 GitHub stars~1.5k tokensUpdated 2 mo ago
    Frontend & DesignAuto-check: notes
  • Fast Agent Design

    evalstate/fast-agent

    A skill your agent uses to generate well-branded interfaces and assets for fast-agent, either for production or throwaway prototypes/mocks/etc.

    3.9k GitHub stars~220 tokensUpdated 2 days ago
    Frontend & DesignAuto-check passed
  • Product Design Workflow Bundle

    XiaomiMiMo/MiMo-Code

    Entry point to a bundle of product design workflows covering context, research, audits, ideation, URL or image to code, design QA and sharing a prototype.

    14k GitHub stars~721 tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed

More from google-labs-code/stitch-skills

  • Stitch to Remotion Walkthrough Videos

    google-labs-code/stitch-skills

    Official

    Builds walkthrough videos from Stitch design projects using Remotion, with transitions, zoom effects and text overlays on each screen.

    8.4k GitHub starsUsed in 6 repos~3.2k tokens
    Auto-check: notes
  • Integrating shadcn/ui Components

    google-labs-code/stitch-skills

    Official

    Guides finding, installing, customizing and wiring up shadcn/ui components in a project, with MCP tools for the component catalog and registries.

    8.4k GitHub starsUsed in 4 repos~2.3k tokens
    Auto-check: notes
  • Stitch Prompt Enhancer

    google-labs-code/stitch-skills

    Official

    Rewrites a vague UI generation idea into a structured, keyword-rich prompt for Stitch, pulling in an existing DESIGN.md design system when the project has one.

    8.4k GitHub starsUsed in 6 repos~1.7k tokens
    Auto-check passed
  • Stitch Taste Design System

    google-labs-code/stitch-skills

    Official

    Generates a DESIGN.md design-language file for Google Stitch that encodes color, typography, layout, component behavior and motion rules to avoid generic AI-looking UI.

    8.4k GitHub starsUsed in 15 repos~3.1k tokens
    Auto-check passed
  • Stitch to React and Vite Dashboard

    google-labs-code/stitch-skills

    Official

    Turns Stitch screens into a React, Vite and TypeScript dashboard with TanStack Query data fetching, DESIGN.md tokens as CSS variables and optional read-only Web3 data.

    8.4k GitHub stars~914 tokensUpdated 1 mo ago
    Auto-check: notes
  • Site Md

    google-labs-code/stitch-skills

    Official

    Analyze a project description or site requirements and synthesize a project constitution into SITE.md for the Stitch Build Loop

    8.4k GitHub stars~783 tokensUpdated 1 mo ago
    Auto-check passed

Questions about Stitch Build Loop

What does Stitch Build Loop do?

Builds a website page by page with Stitch in an autonomous loop, passing a baton file from one iteration to the next that names the next page and prompt. md.md, which holds the vision, the Stitch project ID, a sitemap of existing pages, a roadmap and a creative freedom section, so it does not recreate pages that already exist.

When should I use Stitch Build Loop?

Stitch Build Loop fits situations like: building a multi-page site with Stitch over repeated agent runs; continuing a site whose next page is queued in the baton file; keeping generated pages consistent with a DESIGN.md style; verifying generated pages visually with Chrome DevTools.

How do I install Stitch Build Loop in Claude Code?

Run `npx skills add google-labs-code/stitch-skills --skill stitch-loop -a claude-code`. Or copy the skill folder (plugins/stitch-utilities/skills/stitch-loop in google-labs-code/stitch-skills) into .claude/skills/stitch-loop in your project. Claude Code loads it when a task matches its description.

How do I install Stitch Build Loop in Codex?

Run `npx skills add google-labs-code/stitch-skills --skill stitch-loop -a codex`. Or copy the skill folder (plugins/stitch-utilities/skills/stitch-loop in google-labs-code/stitch-skills) into .agents/skills/stitch-loop in your project. Codex loads it when a task matches its description.

Can I use Stitch Build Loop in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add google-labs-code/stitch-skills --skill stitch-loop -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/stitch-loop, .gemini/skills/stitch-loop, .github/skills/stitch-loop and .opencode/skills/stitch-loop in your project.

What does Stitch Build Loop need to run?

Going by SKILL.md and its folder, Stitch Build Loop needs the command-line tools its instructions call (npx). Our summary lists: Access to the Stitch MCP server; A .stitch/DESIGN.md and .stitch/SITE.md in the project. Its frontmatter pre-approves these tools: stitch*:*, chrome*:*, Read, Write, Bash.

Does Stitch Build Loop access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Stitch Build Loop safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Stitch Build Loop use?

Stitch Build Loop is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Stitch Build Loop use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Stitch Build Loop?

Skills that share tags, products or a category with Stitch Build Loop: Variate Design Variations (Nutlope/variate, 211 stars), Vuetify Playground (vuetifyjs/vuetify, 41k stars), Vue Expert (JavaScript) (Jeffallan/claude-skills, 12k stars) and Stitch Loop (jh941213/my-cc-harness, 126 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Stitch Build Loop?

google-labs-code (a GitHub organization, an official publisher) maintains it in google-labs-code/stitch-skills, which has 8,431 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on August 17, 2026.

Source: google-labs-code/stitch-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.