stitch/skills/stitch-loop/SKILL.md
Iterative site building loop using Stitch baton system. Reads next-prompt.md, generates via MCP, converts to Vue SFC, updates SITE.md. Use when: 'stitch loop', 'build loop', 'iterative build', 'baton system'.
npx skillsauth add murillodutt/cellm stitch/skills/stitch-loopInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an autonomous frontend builder participating in an iterative site-building loop. Your goal is to generate a screen using Stitch, convert it to a Vue SFC, integrate it into the Nuxt 4 project, and prepare instructions for the next iteration.
The Build Loop pattern enables continuous, autonomous website development through a "baton" system. Each iteration:
.stitch/next-prompt.mdmcp__cellm-oracle__context_preflightstitch:html-to-vue pipelinestitch:ingest (DSE sync) and stitch:to-nuxt (theme alignment)mcp__cellm-oracle__context_certifyRequired:
.stitch/DESIGN.md — visual design system (generate with stitch:design-md if needed).stitch/SITE.md — site vision, sitemap, roadmapThe .stitch/next-prompt.md file acts as a relay baton between iterations. See resources/baton-schema.md for the full schema.
Critical rules:
page field in YAML frontmatter determines the component name and route.stitch/DESIGN.md Section 6| Subcommand | Behavior |
|------------|----------|
| start | Initialize the loop: create .stitch/SITE.md from resources/site-template.md, create .stitch/metadata.json, write the first baton for the index page |
| continue | Execute one full iteration of the loop (default behavior when no argument given) |
| status | Display current baton page, SITE.md sitemap completion, and pending roadmap items — no generation |
Parse .stitch/next-prompt.md to extract:
page frontmatter fielddeviceType frontmatter field (default: DESKTOP)Before generating, read these files and run preflight:
| Source | Purpose |
|--------|---------|
| .stitch/SITE.md | Site vision, Stitch Project ID, existing pages (sitemap), roadmap |
| .stitch/DESIGN.md | Required visual style for Stitch prompts |
| mcp__cellm-oracle__context_preflight | SCE governance check — must pass before any generation |
Important checks:
[x]Get or create project:
.stitch/metadata.json exists, use the projectId from itmcp__stitch__list_projects to check for an existing project, or create one, then call mcp__stitch__get_project to retrieve full details and save to .stitch/metadata.jsonmcp__stitch__get_project again and update the screens map in .stitch/metadata.jsonConfirm with user: Before generating, call AskUserQuestion to confirm the page name and prompt. Do not auto-trigger generation.
Generate screen: Call mcp__stitch__generate_screen_from_text with:
projectId: the project ID from metadataprompt: the full prompt from the baton (including design system block)deviceType: value from baton frontmatter, defaults to DESKTOPRetrieve assets: Before downloading, check if .stitch/designs/{page}.html and .stitch/designs/{page}.png already exist:
mcp__stitch__get_screen to retrieve screen metadata, then download:
htmlCode.downloadUrl — save as .stitch/designs/{page}.htmlscreenshot.downloadUrl — append =w{width} (using width from screen metadata) before downloading, save as .stitch/designs/{page}.png.stitch/designs/{page}.htmlstitch:html-to-vue pipeline to convert the HTML to a Vue SFCapp/components/Stitch{PagePascal}.vueapp/pages/{page}.vue to import and render the componentpublic/ or use Nuxt's useAssets patternstitch:ingest to sync design tokens to the DSE (design system engine) — ensures Tailwind semantic tokens stay aligned with the Stitch design themestitch:to-nuxt to apply any theme-level changes to app/assets/css/main.cssapp/layouts/default.vue, header, footer) remain consistentYou MUST update .stitch/next-prompt.md before completing. This keeps the loop alive.
.stitch/SITE.md Section 5 (Roadmap) for pending itemsresources/baton-schema.md[x] in Section 4 (Sitemap)mcp__cellm-oracle__context_certify to record the completed iterationmcp__cellm-oracle__context_record_outcome with iteration summaryproject/
├── .stitch/
│ ├── metadata.json # Stitch project & screen IDs (persist this!)
│ ├── DESIGN.md # Visual design system (from stitch:design-md)
│ ├── SITE.md # Site vision, sitemap, roadmap
│ ├── next-prompt.md # The baton — current task
│ └── designs/ # Staging area for raw Stitch output
│ ├── {page}.html
│ └── {page}.png
└── app/
├── components/
│ └── Stitch{Page}.vue # Converted Vue SFCs
└── pages/
└── {page}.vue # Nuxt route pages (import Stitch components)
.stitch/metadata.json SchemaPersists all Stitch identifiers so future iterations can reference them for edits or variants. Populate by calling mcp__stitch__get_project after creating a project or generating screens.
{
"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": "DESKTOP",
"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": 1440,
"height": 1249
}
},
"metadata": {
"userRole": "OWNER"
}
}
| Field | Description |
|-------|-------------|
| name | Full resource name (projects/{id}) |
| projectId | Stitch project ID |
| title | Human-readable project title |
| designTheme | Design system tokens: color mode, font, roundness, custom color, saturation |
| deviceType | Target device: DESKTOP, MOBILE, TABLET |
| screens | Map of page name to screen object. Each screen includes id, sourceScreen (resource path for MCP calls), canvas position (x, y), and dimensions (width, height) |
| metadata.userRole | User's role on the project (OWNER, EDITOR, VIEWER) |
This skill works best with the stitch:design-md skill:
.stitch/DESIGN.md using stitch:design-md from an existing Stitch screenstitch:ingest, the design tokens from designTheme are reflected in app/assets/css/main.css via --ui-* variables| Issue | Solution |
|-------|----------|
| Stitch generation fails | Verify the prompt includes the full design system block |
| Inconsistent styles | Ensure .stitch/DESIGN.md is current and Section 6 was copied verbatim |
| Loop stalls | Check that .stitch/next-prompt.md was updated with valid YAML frontmatter |
| Theme drift after ingest | Re-run stitch:to-nuxt to re-align main.css with current design tokens |
| Vue SFC has broken paths | Fix asset references to use public/ or Nuxt asset helpers |
AskUserQuestionmcp__cellm-oracle__context_preflight before generationmcp__cellm-oracle__context_certify after integration[x] in SITE.md Section 4.stitch/next-prompt.md — this breaks the loopapp/ — always convert to Vue SFC via stitch:html-to-vuestitch:ingest after consuming new screens — DSE sync is mandatorydata-ai
Prose override — temporarily disable quantization and respond in readable prose. Use when relational density matters, for safety-critical explanations, onboarding handoffs, or when token economy is not the priority.
development
Govern explicit weekly Super PRs or maintainer-requested PR merges. Evaluates a 10-criterion readiness checklist and performs governed merge only when a user-requested PR is READY. Never creates or keeps permanent PRs. Use when: 'pr-check', 'pr-merge', 'merge this PR safely', 'is PR ready', 'guard merge', or /sk-git delegates pr-merge.
data-ai
Operational surface for the compress-llm Layer-1 token I/O compressor. Enable, disable, switch mode, and inspect status without editing config files. Use when tuning compression pressure for the current session or project.
tools
Generate structured upstream feedback for the CELLM engineering team. Produces evidence-first Markdown at docs/evidence/<date>-cellm-feedback-*.md for bugs, anti-patterns, deprecation gaps, and harness surprises, with optional atom registration via knowledge_ops. Use when: 'feedback for CELLM', 'send to CELLM team', 'register this as atom', 'document this anti-pattern', 'report this bug upstream'. Trigger proactively on MCP schema/runtime mismatches, mechanical edit loops (>=3 sequential edits), short deprecation windows (<6 weeks), or reusable harness surprises. Do NOT trigger for routine feature work or project-local bugs.