mk:stitch
Generates a new UI design from a text prompt with Stitch AI and exports HTML, a screenshot and a DESIGN.md handoff.
| Source | .claude/skills/stitch/SKILL.md |
| Owner | utility |
| Runtime | claude-code |
| Risk | medium |
| Phase | on-demand |
What it does
mk:stitch generates a high-fidelity UI design from a text prompt through the Stitch service, then exports Tailwind HTML, a PNG screenshot and a DESIGN.md that mk:frontend-design implements. It is for a new design with no source to start from. It is disabled without a Stitch API key.
When not to use it
| Need | Use |
|---|---|
| A design already exists in Figma | mk:figma |
| Designing or building from text without Stitch | mk:frontend-design |
Setup
Set STITCH_API_KEY (an sk_... key from the Stitch settings page) in the project env file, then install the scripts once:
cd ${CLAUDE_SKILL_DIR}/scripts && npm installThe scripts need tsx. Each one stops with exit 1 before any network request if the key or tsx is missing. references/stitch-setup.md covers optional variables and MCP setup.
Usage
| Task | Command |
|---|---|
| Check quota | npx tsx ${CLAUDE_SKILL_DIR}/scripts/stitch-quota.ts check |
| Generate | npx tsx ${CLAUDE_SKILL_DIR}/scripts/stitch-api-call.ts generate "<prompt>" |
| Export and write | npx tsx ${CLAUDE_SKILL_DIR}/scripts/stitch-api-call.ts export <screen-id> | npx tsx ${CLAUDE_SKILL_DIR}/scripts/stitch-write-output.ts |
Generate returns screenId, projectId, imageUrl and quota data. The skill shows you the imageUrl and asks for your approval before exporting.
Steps
- Check quota. Exit code 2 means it is exhausted, and the skill routes to
mk:frontend-design. - Generate, review the screenshot with the user, then export and write.
- Hand
DESIGN.mdtomk:frontend-design.
Outputs go under tasks/designs/. See references/stitch-operations.md for the exact paths and references/design-to-code-pipeline.md for variants and iteration.
Limits
The export is HTML and Tailwind only, with no React, Vue or Svelte. Layouts are not responsive and there are no animations. Quota is tracked locally and can differ from real usage.
Gotchas
- If you hit
RATE_LIMITEDwhile the tracker shows credits, runstitch-quota.ts reset. Quota limits and paid tiers change, so readreferences/quota-management.mdbefore deciding on quota. - The optional MCP setup goes in your runtime's MCP config (
.mcp.jsonat the project root on Claude Code). Reference the key as${STITCH_API_KEY}there and never paste the raw key into the file. stitch-write-output.tsaccepts only Google CDN domains. If Stitch changes domains, updateALLOWED_CDN_SUFFIXESin that script.