GA
gate-type-generation
Gate 2 — `zbb generate` succeeds and writes consumable TypeScript into generated/ and hub-sdk/generated/. Use after Gate 1, before Gate 3 implementation.
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.zipInstalls 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
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 generateexits 0generated/api/,generated/model/,hub-sdk/generated/api/all populatedgenerated/api/manifest.jsonexists and reflects every operationId- No
InlineResponse*/InlineRequestBody*types anywhere - For connectors: a
<Class>Connectorinterface exists andConnectionProfileis exported fromgenerated/model/index.ts
On failure
The failing task tells you the cause:
bundleSpecfailed insidezbb generate— go back to Gate 1generateApifailed — codegen rejects a schema or operation. Read the error verbatim; the fix is inapi.yml, never ingenerated/buildHubSdkfailed — same root cause as above; the hub-sdk generator runs on the same bundled specInlineResponse*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 state —
zbb clean && zbb generateto force from cold
Related
- @.claude/skills/api-regeneration/SKILL.md — what
zbb generateruns 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