stitch-loop

Generate website pages from baton prompts and integrate them into the site.

2|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/cassioalexandre/agf --skill stitch-loop-cassioalexandre
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stitch-loop
Source: https://github.com/cassioalexandre/agf/tree/main/.agents/skills/stitch/stitch-loop
Command: npx skills add https://github.com/cassioalexandre/agf --skill stitch-loop-cassioalexandre

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of repeatedly building and updating website pages by coordinating Stitch generation with a continuous “baton” workflow that keeps moving from one task to the next.

Core Features & Use Cases

  • Baton-driven iterations: Reads the next page task (including required design system context) from .stitch/next-prompt.md and uses its page field to determine the output filename.
  • Stitch-based page generation: Creates or reuses a Stitch project, generates a screen from the baton prompt, downloads HTML and screenshots, and preserves stitched identifiers in .stitch/metadata.json.
  • Site integration & bookkeeping: Moves generated HTML into site/public/, fixes asset paths, updates .stitch/SITE.md sitemap/roadmap, and writes the updated baton for the next iteration.

Quick Start

Have an AI agent run this skill in your Stitch project directory to read .stitch/next-prompt.md, generate the specified page with Stitch, integrate it into site/public/, update .stitch/SITE.md, and write the next baton task.

Frequently Asked Questions about stitch-loop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate iterative website page generation with a continuous task loop?

Iterative website page generation is automated by reading a baton prompt file, calling Stitch MCP tools to generate screens, and rewriting the prompt to sustain a continuous task loop.

What is a baton prompt workflow for design system site integration?

A baton prompt workflow drives design system site integration by sequentially parsing YAML frontmatter from a prompt file, generating pages via Stitch, and rewriting the file for the next iteration.

How do I generate multiple website pages while respecting an existing sitemap and design system?

You generate multiple website pages by parsing the next task from a baton file, using Stitch to create screens that respect the existing sitemap and design system, then updating the sitemap after integration.

Do I need a specific directory structure to use Stitch MCP tools for site integration?

Yes, site integration requires a specific directory structure containing a `.stitch/` folder with `SITE.md`, `DESIGN.md`, `next-prompt.md`, and `metadata.json`, alongside a `site/public/` directory for HTML outputs.

How do I keep generated HTML assets and sitemap metadata updated during website generation?

Generated HTML assets and sitemap metadata are kept updated by moving downloaded HTML into `site/public/`, fixing asset paths, persisting identifiers in `metadata.json`, and updating the sitemap and roadmap files.

Why does my baton loop stop after generating one Stitch screen?

A baton loop stops after generating one Stitch screen if the workflow fails to rewrite the `.stitch/next-prompt.md` file, which is required to pass the next task context to the following iteration.