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. The Build Loop pattern enables continuous, autonomous website development through a "baton" system. Each iteration: 1. Reads the current task from a baton file (`next-prompt.md`)
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:
Reads the current task from a baton file (next-prompt.md)
Generates a page using Stitch MCP tools
Integrates the page into the site structure
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 DESIGN.md file (generate one using the design-md skill if needed)
A SITE.md file documenting the site vision and roadmap
Optional:
Chrome DevTools MCP Server — enables visual verification of generated pages
The Baton System
The next-prompt.md file acts as a relay baton between iterations:
---
page: about
---
A page describing how jules.top tracking works.
**DESIGN SYSTEM (REQUIRED):**
[Copy from 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 DESIGN.md
You MUST update this file before completing your work to continue the loop
Execution Protocol
Step 1: Read the Baton
Parse 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
SITE.md
Site vision, Stitch Project ID, existing pages (sitemap), roadmap
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:
Discover namespace: Run list_tools to find the Stitch MCP prefix
Get or create project:
If stitch.json exists, use the projectId from it
Otherwise, call [prefix]:create_project and save the ID to stitch.json