npx skills add ...
npx skills add jezweb/claude-skills --skill design-loop
Autonomous multi-page site builder using a baton-passing loop. Each iteration reads a task from .design/next-prompt.md, generates a page in HTML/Tailwind, integrates it into the site, verifies visually, then writes the next task to keep the loop alive. Use whenever the user asks to build an entire site autonomously, build all pages of a site, generate multiple pages in sequence, or run a 'design loop' / 'baton loop' / 'autonomous site build' — even if they say 'just keep going' or 'build the next page' or 'next page' mid-flow.
npx skills add jezweb/claude-skills --skill design-loop
Build complete multi-page websites through an autonomous loop. Each iteration reads a task, generates a page, integrates it, verifies it visually, then writes the next task to keep going.
The Design Loop uses a "baton" pattern — a file (.design/next-prompt.md) acts as a relay baton between iterations. Each cycle:
This is orchestration-agnostic. The loop can be driven by:
.design/next-prompt.md changes| Backend | Setup | Quality | Speed | Best for |
|---|---|---|---|---|
| Claude (default) | Zero dependencies | Great — production-ready HTML/Tailwind | Fast | Most projects, full code control |
| Google Stitch | npm install @google/stitch-sdk + API key | Higher fidelity AI designs | ~10-20s/screen | Design-heavy projects, visual polish |
At the start of each loop, check if Stitch is available:
@google/stitch-sdk is installed: ls node_modules/@google/stitch-sdk 2>/dev/nullSTITCH_API_KEY is set in .dev.vars or environment.design/metadata.json exists (contains Stitch project ID)If all three are present, use Stitch. Otherwise, fall back to Claude generation.
Install: npm install @google/stitch-sdk. Set STITCH_API_KEY in environment or .dev.vars.
Device types: "MOBILE" | "DESKTOP" | "TABLET" | "AGNOSTIC". Model selection: pass "GEMINI_3_PRO" | "GEMINI_3_FLASH" as third arg to generate().
Other operations: stitch.projects() lists projects, project.screens() lists screens, project.getScreen("id") fetches one.
getHtml() and getImage() return download URLs. Append =w1280 to image URLs for full resolution. Auth: STITCH_API_KEY required (or STITCH_ACCESS_TOKEN + GOOGLE_CLOUD_PROJECT for OAuth). Errors throw StitchError with codes: AUTH_FAILED, NOT_FOUND, RATE_LIMITED.
Save Stitch identifiers to .design/metadata.json so future iterations can reference them:
Stitch integration tips:
.design/metadata.json — don't create a new project each iterationscreen.edit() for refinements rather than full regenerationIf .design/ doesn't exist yet, create the project scaffolding:
Ask the user for:
/design-system)Create the project files:
design-system skill to extract from an existing site.design/next-prompt.md) for the homepageIf .design/next-prompt.md already exists, parse it and continue the loop.
.design/next-prompt.md has YAML frontmatter + a prompt body:
| Field | Required | Purpose |
|---|---|---|
page | Yes | Output filename (without .html) |
layout | No | standard, wide, sidebar — defaults to standard |
Before generating, read:
| File | What to check |
|---|---|
.design/SITE.md | Section 4 (Sitemap) — don't recreate existing pages |
.design/DESIGN.md | Colour palette, typography, component styles |
Existing pages in site/public/ | Header/footer/nav patterns to match |
Critical: Read the most recent page's HTML to extract the exact header, navigation, and footer markup. New pages must use identical shared elements.
Generate a complete HTML file using Tailwind CSS (via CDN). The page must:
.design/DESIGN.md exactlyWrite the generated file to site/public/{page}.html.
If Stitch SDK is available:
project.generate(prompt, deviceType) to generate the screenscreen.getHtml() to .design/designs/{page}.htmlscreen.getImage() to .design/screenshots/{page}.pngsite/public/{page}.html.design/metadata.json with the new screen IDFor iterative edits on an existing Stitch screen, use screen.edit(prompt) instead of regenerating.
After generating the new page:
href="#" with real page URLsIf Playwright CLI or Chrome MCP is available:
npx serve site/public -p 3456.design/screenshots/{page}-desktop.png and {page}-mobile.pngIf no browser automation is available, skip to Step 6.
Edit .design/SITE.md:
[x] {page}.html — {description}You MUST update .design/next-prompt.md before completing. This keeps the loop alive.
Choose the next page:
Write the baton with:
page, optional layout).design/DESIGN.md Section 6If the site is complete (all roadmap items done, no more ideas):
page: _complete and a summary of what was builtThe loop ends when:
[x] in SITE.md Section 4)page: _completeOn completion, output a summary:
The #1 risk in multi-page generation is drift — pages looking slightly different. Prevent this:
| Element | Rule |
|---|---|
| Header/Nav | Copy exact HTML from the most recent page. Never regenerate. |
| Footer | Same — copy verbatim, only change active page indicator |
| Tailwind config | If using <script> config block, it must be identical across pages |
| Colour values | Always use the exact hex codes from DESIGN.md, never approximate |
| Font imports | Same Google Fonts <link> tag across all pages |
| Spacing scale | Consistent padding/margin values (document in DESIGN.md) |
Use these to transform vague user requests into precise design instructions when writing baton prompts.
| Vague Term | Professional Terminology |
|---|---|
| "menu at the top" | "sticky navigation bar with logo and menu items" |
| "big photo" | "full-width hero section with focal-point imagery" |
| "list of things" | "responsive card grid with hover states and subtle elevation" |
| "button" | "primary call-to-action button with hover transition" |
| "form" | "form with labelled input fields, validation states, and submit button" |
| "picture area" | "hero section with background image or video" |
| "sidebar" | "collapsible side navigation with icon-label pairings" |
| "popup" | "modal dialog with overlay and smooth entry animation" |
| "footer stuff" | "footer with sitemap links, contact info, and legal notices" |
| "cards" | "content cards with consistent padding, rounded corners, and shadow" |
| "tabs" | "tabbed interface with active indicator and smooth content transition" |
| "search" | "search input with icon, placeholder text, and results dropdown" |
| "pricing" | "pricing comparison cards with highlighted recommended tier" |
| "testimonials" | "testimonial carousel or grid with avatar, quote, and attribution" |
| Basic Vibe | Enhanced Description |
|---|---|
| "Modern" | "Clean, minimal, generous whitespace, high-contrast typography" |
| "Professional" | "Sophisticated, trustworthy, subtle shadows, restricted premium palette" |
| "Fun / Playful" | "Vibrant, rounded corners, bold accent colours, bouncy animations" |
| "Dark Mode" | "High-contrast accents on deep slate or near-black backgrounds" |
| "Luxury" | "Elegant, spacious, fine lines, serif headers, high-fidelity photography" |
| "Tech / Cyber" | "Futuristic, neon accents, glassmorphism, monospaced typography" |
| "Warm / Friendly" | "Soft colours, rounded shapes, handwritten accents, inviting imagery" |
| "Bold / Industrial" | "Strong typography, high contrast, geometric shapes, dark backgrounds" |
| "Organic / Natural" | "Earth tones, soft textures, organic shapes, nature photography" |
| "Editorial" | "Magazine-like layouts, strong typographic hierarchy, generous leading" |
| Description | Tailwind | Visual Effect |
|---|---|---|
| Pill-shaped | rounded-full | Buttons, tags, badges |
| Softly rounded | rounded-xl | Cards, containers, modals |
| Gently rounded | rounded-lg | Inputs, smaller elements |
| Sharp / precise | rounded-none or rounded-sm | Technical, brutalist aesthetic |
| Glassmorphism | backdrop-blur-md bg-white/10 border border-white/20 | Overlays, nav bars |
| Frosted | backdrop-blur-sm bg-white/80 | Subtle glass effect |
| Elevation | Description | Tailwind |
|---|---|---|
| Flat | No shadows, colour blocking and borders | shadow-none |
| Whisper-soft | Diffused, barely visible lift | shadow-sm |
| Subtle | Gentle shadow for card elevation | shadow-md |
| Floating | High-offset, soft shadow | shadow-lg or shadow-xl |
| Dramatic | Strong shadow for hero elements or modals | shadow-2xl |
| Inset | Inner shadow for pressed or nested elements | shadow-inner |
| Section Density | Description | Tailwind |
|---|---|---|
| Tight | Compact, information-dense | py-8 md:py-12 |
| Balanced | Standard section spacing | py-12 md:py-16 |
| Generous | Breathing room, premium feel | py-16 md:py-24 |
| Dramatic | Statement spacing, luxury/editorial | py-24 md:py-32 |
Use this when bootstrapping a new project. Write to .design/SITE.md:
Generate using the design-system skill, or create manually. Write to .design/DESIGN.md:
.design/next-prompt.md (breaks the loop)[x] in SITE.md sitemaphref="#" placeholders left in nav instead of real URLs