GA

gate-type-generation

Automates and validates TypeScript code generation from API specifications.

Install

mkdir -p .claude/skills/gate-type-generation && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14533" && unzip -o skill.zip -d .claude/skills/gate-type-generation && rm skill.zip

Installs to .claude/skills/gate-type-generation

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Gate 2 — `zbb generate` succeeds and writes consumable TypeScript into generated/ and hub-sdk/generated/. Use after Gate 1, before Gate 3 implementation.
153 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Regenerate code from a specification
  • Verify generated API and model types
  • Check for inline response type leakage
  • Ensure connector interfaces are present
  • Validate manifest agreement with package.json
  • Identify stale generated files

How it works

The skill runs `zbb generate` to produce TypeScript code from a bundled spec and then performs a series of checks to ensure the output conforms to expected structures and does not contain specific anti-patterns.

Inputs & outputs

You give it
A self-contained spec produced by Gate 1
You get back
Generated TypeScript files in `generated/` and `hub-sdk/generated/` directories

When to use gate-type-generation

  • Generating API clients from specs
  • Validating generated TypeScript types
  • Hoisting inline schemas

About this skill

Gate 2: Type generation

After Gate 1, bundleSpec produced a self-contained spec. Gate 2 runs the codegen and checks the output is shaped how the implementation and tests will need it.

What to check

# 1. Regenerate from the spec
zbb generate
# Exit code must be 0.

# 2. Module-side generated/ exists and is populated
test -d generated/api   && ls generated/api/*.ts >/dev/null   || echo "✗ generated/api/ empty"
test -d generated/model && ls generated/model/*.ts >/dev/null || echo "✗ generated/model/ empty"
test -f generated/api/manifest.json                            || echo "✗ generated/api/manifest.json missing"

# 3. hub-sdk-side generated/ exists (used by test/e2e via describeModule<T>)
test -f hub-sdk/generated/api/index.ts                         || echo "✗ hub-sdk/generated/api/index.ts missing"

# 4. No inline-response leakage
grep -rln "InlineResponse\|InlineRequestBody" generated/ hub-sdk/generated/ 2>/dev/null && \
  echo "✗ Inline*Response types present — hoist inline schemas in api.yml"

# 5. Connector interface is present (for connector modules)
grep -E "export interface [A-Z][a-zA-Z]+Connector" generated/api/index.ts || \
  echo "✗ <Class>Connector interface not generated"

# 6. ConnectionProfile / ConnectionState model types present (connectors only)
test -f connectionProfile.yml && grep -q "export interface ConnectionProfile" generated/model/index.ts \
  || echo "  (skip: not a connector or model export shape changed)"

# 7. Module manifest agrees with package.json
jq -r .name package.json
jq -r '.operations | keys[]' generated/api/manifest.json | head
# Should map every operationId from api.yml to <Api>.<method>; missing entries mean spec/operations drifted.

# 8. No leftover stale files (after a forced clean)
git status --short generated/ hub-sdk/generated/ 2>/dev/null
# These directories are gitignored; output should be empty.

Pass criteria

  • zbb generate exits 0
  • generated/api/, generated/model/, hub-sdk/generated/api/ all populated
  • generated/api/manifest.json exists and reflects every operationId
  • No InlineResponse* / InlineRequestBody* types anywhere
  • For connectors: a <Class>Connector interface exists and ConnectionProfile is exported from generated/model/index.ts

On failure

The failing task tells you the cause:

  • bundleSpec failed inside zbb generate — go back to Gate 1
  • generateApi failed — codegen rejects a schema or operation. Read the error verbatim; the fix is in api.yml, never in generated/
  • buildHubSdk failed — same root cause as above; the hub-sdk generator runs on the same bundled spec
  • InlineResponse* appears — a response body has an inline schema. Hoist it:
    # BEFORE
    '200':
      content:
        application/json:
          schema:
            type: object
            properties: { id: { type: string }, name: { type: string } }
    
    # AFTER
    '200':
      content:
        application/json:
          schema: { $ref: '#/components/schemas/Foo' }
    
  • Stale statezbb clean && zbb generate to force from cold

Related

  • @.claude/skills/api-regeneration/SKILL.md — what zbb generate runs and how to read its output
  • @.claude/skills/gate-api-spec/SKILL.md — Gate 1
  • @.claude/skills/gate-implementation/SKILL.md — Gate 3 (next)
  • @.claude/skills/build-quality/SKILL.md — full lifecycle context

When not to use it

  • When Gate 1 (bundleSpec) has not produced a self-contained spec
  • When `generateApi` or `buildHubSdk` fail due to schema or operation issues
  • When `InlineResponse*` types appear due to inline schemas in api.yml

Limitations

  • Requires a spec produced by Gate 1
  • Does not fix issues in `api.yml` directly
  • Does not handle `bundleSpec` failures

How it compares

This skill automates the verification of generated code against predefined structural and content requirements, unlike manual inspection which is prone to oversight.

Compared to similar skills

gate-type-generation side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
gate-type-generation (this skill)02moReviewIntermediate
copilot-sdk74moReviewIntermediate
create-bubble26moReviewIntermediate
exa-sdk-patterns11moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

copilot-sdk

github

Build agentic applications with GitHub Copilot SDK. Use when embedding AI agents in apps, creating custom tools, implementing streaming responses, managing sessions, connecting to MCP servers, or creating custom agents. Triggers on Copilot SDK, GitHub SDK, agentic app, embed Copilot, programmable agent, MCP server, custom agent.

763

create-bubble

bubblelabai

Create a new Bubble integration for Bubble Lab following all established patterns and best practices from CREATE_BUBBLE_README.md

23

exa-sdk-patterns

jeremylongshore

Apply production-ready Exa SDK patterns for TypeScript and Python. Use when implementing Exa integrations, refactoring SDK usage, or establishing team coding standards for Exa. Trigger with phrases like "exa SDK patterns", "exa best practices", "exa code patterns", "idiomatic exa".

14

generating-api-sdks

jeremylongshore

Generate client SDKs in multiple languages from OpenAPI specifications. Use when generating client libraries for API consumption. Trigger with phrases like "generate SDK", "create client library", or "build API SDK".

13

openapi-to-typescript

davila7

Converts OpenAPI 3.0 JSON/YAML to TypeScript interfaces and type guards. This skill should be used when the user asks to generate types from OpenAPI, convert schema to TS, create API interfaces, or generate TypeScript types from an API specification.

13

graphql-schema

ChrisWiles

GraphQL queries, mutations, and code generation patterns. Use when creating GraphQL operations, working with Apollo Client, or generating types.

12

Search skills

Search the agent skills registry