
stitch-sdk-pipeline
Run the full Stitch SDK generation pipeline. Use when a new tool is added, or the SDK needs to be regenerated end-to-end.
- Installs
- 163
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/google-labs-code/stitch-sdk --skill stitch-sdk-pipeline- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads stitch-sdk-pipeline automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Stitch SDK Pipeline
This skill orchestrates the full SDK generation pipeline — from capturing MCP tool schemas to publishing a tested, validated package. Use this when:
- The Stitch MCP server adds or changes tools
- You need to regenerate the SDK from scratch
- You want to verify the pipeline is healthy
[!IMPORTANT] Stage 2 is the only step requiring agent intelligence. All other stages are deterministic scripts. For Stage 2, use the
stitch-sdk-domain-designskill.
Prerequisites
STITCH_API_KEYenvironment variable setbuninstalled- Working directory: project root (
stitch-sdk/)
Pipeline Stages
Stage 1: Capture Tool Schemas 🤖
// turbo
npm run capture
Connects to the Stitch MCP server, calls tools/list, and writes the raw schemas to packages/sdk/generated/tools-manifest.json. Updates the manifest section of stitch-sdk.lock.
Output: packages/sdk/generated/tools-manifest.json (includes inputSchema + outputSchema for every tool)
When to skip: If tools-manifest.json is already up to date and no server-side changes occurred.
Stage 2: Domain Design 🧠 (Agent)
Use the stitch-sdk-domain-design skill for this stage.
Read tools-manifest.json and edit packages/sdk/generated/domain-map.json to map tools → classes → methods.
Key decisions at this stage:
- Which class owns each tool?
- What are the arg routing rules (self, param, computed, selfArray)?
- What is the response projection path?
- Should the method cache data from the construction response?
Input: tools-manifest.json + scripts/ir-schema.ts (the canonical IR contract)
Output: packages/sdk/generated/domain-map.json
When to skip: If domain-map.json already has the correct bindings and you only changed ir-schema.ts or generate-sdk.ts.
Stage 3: Generate TypeScript 🤖
// turbo
npm run generate
Validates the IR (Zod schema) and every projection (against outputSchema), then emits TypeScript files via ts-morph into packages/sdk/generated/src/.
Output: packages/sdk/generated/src/*.ts + updated stitch-sdk.lock
If this fails with a projection error, go back to Stage 2 and fix domain-map.json.
Stage 4: Build 🤖
// turbo
npm run build
TypeScript compilation: packages/sdk/ → packages/sdk/dist/.
Stage 5: Unit Tests 🤖
// turbo
npm run test
Runs core unit tests (vitest) — mocked callTool, verifying generated method signatures, caching, and error handling.
Stage 6: Script Tests 🤖
// turbo
npm run test:scripts
Runs contract tests (IR schema acceptance/rejection) and logic tests (expression builders) using bun:test.
Stage 7: E2E Tests 🤖
npm run test:e2e
Live API tests against the built package. Requires STITCH_API_KEY (and GEMINI_API_KEY for AI SDK tests). Two test suites:
live.test.ts— Direct SDK calls: create projects, generate screens, verify responses.ai-sdk-e2e.test.ts— AI SDK integration viastitchTools(): Gemini autonomously calls Stitch tools, generates designs, extracts HTML + Tailwind config, produces modular React components, validates via SWC, and scaffolds a Vite preview app at.stitch/preview/.
Stage 8: Lock Validation 🤖
// turbo
npm run validate:generated
Verifies that stitch-sdk.lock hashes match the actual generated files. Catches drift (someone edited generated files manually or forgot to regenerate).
[!IMPORTANT] Always run after Stage 3 (Generate). If you run Capture (Stage 1) then Validate without re-generating, the hashes will mismatch because the manifest hash changed.
Stage 9: Skill Audit 🧠 (Agent)
After the pipeline passes, audit agent skills for freshness. Read the current source of truth and update any skills that reference stale methods, args, or examples.
Inputs:
packages/sdk/src/index.ts(public surface)- Generated class files in
packages/sdk/generated/src/ packages/sdk/src/spec/errors.ts(error codes)packages/sdk/src/spec/client.ts(config schema)
Skills to audit (in priority order):
stitch-sdk-usage— highest churn, references specific methods and constructor signaturesstitch-sdk-readme— must documentstitchTools(),toolDefinitions, and AI SDK integration examplesstitch-sdk-development— check cache examples match current domain-map patternsstitch-sdk-domain-design— check code examples in the cache section
Skills to skip: stitch-sdk-pipeline (self-referential), red-green-yellow (generic methodology).
What to check:
- Every method name in a code example exists on its class
- Every import in an example matches an export in
index.ts - Constructor signatures match the actual constructors
- Config fields match
StitchConfigSchema - Error codes match
StitchErrorCode
When to skip: If only infrastructure code changed (packages/sdk/src/client.ts, packages/sdk/src/proxy/) and no public API surface changed.
Quick Reference
Full pipeline (script stages only)
npm run pipeline
Runs Stage 1 → 3 → 4 → 5 in sequence. Does not include Stage 2 (agent), Stage 7 (e2e), or Stage 9 (skill audit).
Starting from a specific stage
| Scenario | Start from |
|---|---|
| New tool added to MCP server | Stage 1 |
| Need to change how a tool maps to a method | Stage 2 |
Changed ir-schema.ts or generate-sdk.ts | Stage 3 |
Changed code in packages/sdk/src/ (client, errors) | Stage 4 |
| Just want to verify everything works | Stage 5 |
| Changed AI SDK tools adapter or tool definitions | Stage 5 |
| Public API surface changed | Stage 9 |
Key files
| File | Location | Role |
|---|---|---|
tools-manifest.json | packages/sdk/generated/ | Raw MCP tool schemas (Stage 1 output) |
domain-map.json | packages/sdk/generated/ | IR: tool → class → method mappings (Stage 2 output) |
tool-definitions.ts | packages/sdk/generated/src/ | Generated JSON Schema tool definitions for AI SDK |
tools-adapter.ts | packages/sdk/src/ | stitchTools() — AI SDK v6 adapter (imported via @google/stitch-sdk/ai) |
ir-schema.ts | scripts/ | Zod schema defining valid IR structure |
tool-schema.ts | scripts/ | TypeScript types for JSON Schema |
generate-sdk.ts | scripts/ | ts-morph codegen (Stage 3) |
stitch-sdk.lock | packages/sdk/generated/ | Integrity hashes for drift detection |
stitch-html.ts | packages/sdk/test/helpers/ | Stitch HTML parser (Tailwind config + font extraction) |
component-validator.ts | packages/sdk/test/helpers/ | SWC AST validator for generated React components |
FAQ
What does the stitch-sdk-pipeline skill do?
Run the full Stitch SDK generation pipeline. Use when a new tool is added, or the SDK needs to be regenerated end-to-end.
How do I install stitch-sdk-pipeline?
Run npx skills add https://github.com/google-labs-code/stitch-sdk --skill stitch-sdk-pipeline in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/stitch-sdk-pipeline/ (personal) or .claude/skills/stitch-sdk-pipeline/ (project).
Which AI agents can use stitch-sdk-pipeline?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is stitch-sdk-pipeline safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains stitch-sdk-pipeline?
It is published by google-labs-code in google-labs-code/stitch-sdk, and it is an official skill from the maker of the technology it covers. It has 163 recorded installs.
More from google-labs-code/stitch-sdk
stitch-sdk-usage
google-labs-code/stitch-sdk
Use the Stitch SDK to generate, edit, and iterate on UI screens from text prompts, manage projects, and retrieve screen HTML/images. Use when the user wants to consume the SDK in their application.
stitch-sdk-readme
google-labs-code/stitch-sdk
Generate or update the README for the Stitch SDK. Use the Bookstore Test structure and source the current API from the codebase. Use when the README needs to be written or updated.
stitch-sdk-development
google-labs-code/stitch-sdk
Develop the Stitch SDK. Covers the generation pipeline, dual modality (agent vs SDK), error handling, and Traffic Light (Red-Green-Yellow) implementation workflow. Use when adding features, fixing bugs, or understanding the architecture.
stitch-sdk-domain-design
google-labs-code/stitch-sdk
Design the domain model for the Stitch SDK. Use when mapping MCP tools to domain classes and bindings in domain-map.json. This is Stage 2 of the generation pipeline.
tdd-red-green-refactor
google-labs-code/stitch-sdk
Enforces a disciplined Red-Green-Refactor (TDD) workflow in TypeScript/Node.js. Use this whenever creating new features, fixing bugs, or migrating logic to ensure high-quality, verifiable implementations.
stitch-sdk-bug-bash
google-labs-code/stitch-sdk
Find bugs in the Stitch SDK using a real API key. Covers standard functional edges and tricky situations.
Popular testing & qa skills
tdd
mattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
grilling
mattpocock/skills
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
migrate-to-shoehorn
mattpocock/skills
Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.
run-train
lllllllama/rigorpilot-skills
Rigor Train skill for deep learning research repositories. Use when a documented or selected training command should be run conservatively for startup verification, short-run verification, full kickoff, or resume, with command, config, seed, log, checkpoint, status, and metric evidence written to standardized trainoutputs/. Do not use for environment setup, exploratory sweeps, speculative idea implementation, or end-to-end orchestration.
test-driven-development
obra/superpowers
Use when implementing any feature or bugfix, before writing implementation code
finishing-a-development-branch
obra/superpowers
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work