Stitch Build Loop SkillSAFE
A library of Agent Skills designed to work with the Stitch MCP server. Each skill follows the Agent Skills open standard, for compatibility with coding agents such as Antigravity, Gemini CLI, Claude Code, Cursor.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
Teaches agents to iteratively build websites using Stitch with an autonomous baton-passing loop pattern.
Install
npx skills add google-labs-code/stitch-skills --skill stitch-loop --global
What It Does
Enables continuous, autonomous website development through a "baton" system:
- Agent reads task from
next-prompt.md - Generates page via Stitch MCP tools
- Integrates into site structure
- Writes next task to continue the loop
Prerequisites
- Stitch MCP Server access
- A
DESIGN.mdfile (generate with thedesign-mdskill) - A
SITE.mdfile for project context
Example Prompt
Read my next-prompt.md and generate the page using Stitch, then prepare the next iteration.
Skill Structure
stitch-loop/ ├── SKILL.md — Core pattern instructions ├── README.md — This file ├── resources/ │ ├── baton-schema.md — Baton file format spec │ └── site-template.md — SITE.md/DESIGN.md templates └── examples/ ├── next-prompt.md — Example baton └── SITE.md — Example site constitution
Works With
- `design-md` skill: Generate
DESIGN.mdfrom existing Stitch screens - CI/CD: GitHub Actions can trigger new iterations on push
- Agent chains: Dispatch to other agents (Jules, etc.)
Learn More
See SKILL.md for complete instructions.
32484555efabOBSERVED · 2026-10-26Install
Commands as the repository documents them. They are shown, not run.
npx skills add google-labs-code/stitch-skills --skill stitch-loop --global
What it tells the agent
The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.
---
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:
| File | Purpose |
|------|---------|
| `.stitch/SITE.md` | Site vision, **Stitch Project ID**, existing pages (sitemap), roadmap |
| `.stitch/DESIGN.md` | Required 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.
### 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/DETrust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | NA |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (0)
No findings outside the package's declared scope.
Gates applied: no_behavioural_pass.
32484555efabfull audit observations/trust-audit/skill/google-labs-code__stitch-loop.json · Report an issue / request a re-scanAudit history
Every audit this skill has had.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-26 | 32484555efab | SAFE | B | 89 | first audit |
Questions
What does the stitch-loop — google-labs-code/stitch-skills skill do?
A library of Agent Skills designed to work with the Stitch MCP server. Each skill follows the Agent Skills open standard, for compatibility with coding agents such as Antigravity, Gemini CLI, Claude Code, Cursor.
Is stitch-loop — google-labs-code/stitch-skills safe to install?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.
What can stitch-loop — google-labs-code/stitch-skills access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
How current is this page?
The grade is for one exact copy of the source (32484555efab), read on 2026-10-26. The repository is watched, and a new audit runs when it changes — this is the first audit.
Add this badge to your README
Shows this page's audit result and links back to it. It updates when the audit does.
[](https://modelsatlas.com/skills/google-labs-code/stitch-loop/)
Not your listing, or something out of date? Claim or update your listing.