stitch-sdk-readme

Générer ou mettre à jour le README pour le Stitch SDK. Utiliser la structure Bookstore Test et sourcer l'API actuelle depuis la base de code. Utiliser lorsque le README doit…

npx skills add https://github.com/google-labs-code/stitch-sdk --skill stitch-sdk-readme

Stitch SDK README Generator

This skill produces the README for @google/stitch-sdk. It combines a structural strategy (the Bookstore Test) with instructions for sourcing the current API from the codebase — so the README stays accurate as the SDK evolves.


How to Source the Current API

Do not hard-code the API surface. Read it from the codebase at invocation time:

What you needWhere to find it
Public exports (full surface)packages/sdk/src/index.ts
Domain class methods + signaturesSource files for each exported class (sdk.ts, project.ts, screen.ts)
Generated method bindingspackages/sdk/generated/domain-map.jsonbindings[] array
Handwritten methodsMethods in class source files that aren't in domain-map bindings (e.g. Screen.edit, Screen.variants)
AI SDK tools adapterpackages/sdk/src/ai.ts → subpath entry for stitchTools()
Generated tool definitionspackages/sdk/generated/src/tool-definitions.ts → JSON Schema for each tool
Tool client methodspackages/sdk/src/client.ts
Error codespackages/sdk/src/spec/errors.tsStitchErrorCode
Config optionspackages/sdk/src/spec/client.tsStitchConfigSchema
Proxy configpackages/sdk/src/proxy/core.ts

After reading these files, you have the complete API surface. Structure it using the Bookstore Test template below.


The Bookstore Test

A reader decides whether to use a library the same way a person decides to buy a book: they glance at the cover, read the inner flap, then commit to reading the book. The README must earn the reader's attention at each stage.

The Cover

A single sentence stating what problem this library solves — not what the library is. The reader should recognize their own situation. No taglines, no badges, no logos.

For this SDK, the cover is about generating UI from text and extracting HTML/screenshots programmatically.

Good: "Generate UI screens from text prompts and extract their HTML and screenshots programmatically." Bad: "The official TypeScript SDK for Google Stitch, a powerful AI-powered UI generation platform."

The Inner Flap

Immediately show the library in use. Code first, not setup.

Primary workflow — the punchline everything in the SDK exists to produce:

project(id) → generate → getHtml

Show this as the first code block, with one line noting the env var requirement. Do not show installation, imports, or config before this. Show callTool("create_project", ...) separately for project creation.

Secondary workflows — reveal depth progressively:

  1. Listing and iterating over existing projects/screens
  2. Editing a screen and generating variants
  3. Tool access via singleton (stitch.listTools(), stitch.callTool()) — zero setup
  4. Explicit configuration via StitchToolClient (custom API key, base URL)
  5. AI SDK integration via stitchTools() — import from @google/stitch-sdk/ai, show generateText with tools: stitchTools() and stepCountIs

Rules for this section:

  • No setup first. One line mentioning STITCH_API_KEY is enough before the first example.
  • Dual install paths. Show npm install @google/stitch-sdk first (core SDK, standalone). Then show npm install @google/stitch-sdk ai for AI SDK users. The ai package is only needed when importing from @google/stitch-sdk/ai.
  • Straightforward language. No "powerful", "seamless", "robust", "enterprise-grade".
  • Working examples. Every code block must be valid, runnable code — not fragments with // ... elisions.
  • Progressive complexity. Simplest invocation first, then deeper capabilities.

Reading the Book

The reader is committed. Document the full API as a reference.

Structure by class in this order: StitchProjectDesignSystemScreenStitchToolClienttoolDefinitions / toolMapstitchTools() (AI SDK) → StitchProxystitch singleton.

Each entry should have:

  • What it does (one line)
  • Usage example (minimal, runnable)
  • Parameters (table)
  • Return type and error behavior

Setup, authentication, and configuration go here — after the reader has already decided the library is worth using.

Tone

Write like a colleague explaining their work to another engineer. Be direct. Be specific. Don't sell — inform. If a feature has limitations, state them. If setup is complex, say so.


Validation

After generating the README, verify:

  • Can a reader understand what the library does in under 10 seconds?
  • Is there a runnable code example within the first scroll?
  • Does setup/config appear after the first code example?
  • Is every code block valid, copy-pasteable code?
  • Is the language descriptive rather than promotional?
  • Does the reference section cover every public export from index.ts?
  • Every method name in examples exists in its class source file
  • Every import in examples matches an export in index.ts
  • All three modalities are documented: domain classes (scripts), StitchToolClient (agents), stitchTools() (AI SDK)

Anti-patterns

Anti-patternWhy it fails
Leading with badges, logos, or status shieldsVisual noise before the reader knows what the library does
"Getting Started" as the first sectionForces setup before demonstrating value
Feature bullet lists without codeTells instead of shows
"Easy to use", "simple", "just works"Self-congratulatory claims that invite skepticism
Long install/config blocks before any usageAsks for investment before demonstrating return
Collapsible sections hiding core API docsBuries the content committed readers came for
Hard-coding the API in docs without sourcingGoes stale when tools are added

Plus de skills de google-labs-code

remotion
google-labs-code
We need to translate the given English text into French, preserving the name "remotion" (which appears as "Remotion" in the text, but we preserve it as is). The instruction says: "Preserve product names, protocol names, URLs, numbers, and technical terms." So "Remotion" is a product name, keep it. Also "Stitch" is a product name? It says "Stitch app designs" - likely a product name, keep as "Stitch". Also "ScreenSlide", "WalkthroughComposition" are component names, keep as is. "zoom effects", "fade transitions", "text overlays" are technical terms, translate? The instruction says "technical terms" - but these are common terms. However, the instruction says "Preserve ... technical terms" - meaning do not translate? Actually it says "Preserve product names, protocol names, URLs, numbers, and technical terms." So technical terms should be preserved as is. But "zoom effects" might be considered a technical term? Possibly keep as "zoom effects
official
ink
google-labs-code
Moteur de rendu terminal Ink pour json-render qui transforme des spécifications JSON en interfaces utilisateur terminal interactives. À utiliser lorsque vous travaillez avec @json-render/ink, construisez des interfaces utilisateur terminal à partir de…
official
stitch-sdk-pipeline
google-labs-code
Exécutez le pipeline complet de génération du SDK Stitch. À utiliser lorsqu'un nouvel outil est ajouté ou que le SDK doit être régénéré de bout en bout.
official
typed-service-contracts
google-labs-code
Architecture standard for building robust, type-safe TypeScript services using the "Spec and Handler" pattern. Use when building CLIs, libraries, or complex…
official
agent-dx-cli-scale
google-labs-code
A scoring scale for evaluating how well a CLI is designed for AI agents, based on the "Rewrite Your CLI for AI Agents" principles.
official
ink
google-labs-code
Rendu terminal ink pour json-render qui transforme les spécifications JSON en interfaces terminal interactives. À utiliser avec @json-render/ink, pour créer des interfaces terminal à partir de…
official
stitch-sdk-bug-bash
google-labs-code
Find bugs in the Stitch SDK using a real API key. Covers standard functional edges and tricky situations.
official
stitch-sdk-development
google-labs-code
Develop the Stitch SDK. Covers the generation pipeline, dual modality (agent vs SDK), error handling, and Traffic Light (Red-Green-Yellow) implementation…
official