sdk

Generates typed frontend SDK from backend controller OpenAPI specifications.

4|Updated Jul 30, 2026
One-click install
npx skills add https://github.com/gabriellst/codm --skill sdk-gabriellst
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sdk
Source: https://github.com/gabriellst/codm/tree/main/.claude/skills/sdk
Command: npx skills add https://github.com/gabriellst/codm --skill sdk-gabriellst

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually writing frontend API types, hooks, and validation schemas after every backend change is error-prone and quickly drifts out of sync. This Skill regenerates the typed SDK directly from backend controller schemas so the frontend always matches the backend contract. ## Core Features & Use Cases - Automatic SDK Generation: Runs the Kubb-based pipeline to produce React Query hooks, TypeScript types, Zod schemas, and query key functions from controller InputSchema/OutputSchema definitions. - Contract Synchronization: Keeps frontend validation (route search params, form validators) aligned with the exact Zod contracts the backend enforces. - Troubleshooting Guidance: Covers common failures such as connection refused errors, controllers missing from the SDK, and stale generated output. - Use Case: After adding a new CreateProduct controller and wiring its router, run the Skill to regenerate the SDK, then immediately import useCreateProduct and its Zod schema in a React route. ## Quick Start Ask the agent to regenerate the SDK after your controller changes, ensuring the backend server is running first so the OpenAPI spec can be emitted.

Frequently Asked Questions about sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a typed SDK from backend controllers?

Start the backend server with bun dev or bun x nx run api:dev, then run bun sdk from the monorepo root. The pipeline emits the OpenAPI spec, runs Kubb generation, applies Zod refinement post-processing, and builds the SDK package.

When should I regenerate the frontend SDK?

Regenerate after creating or modifying controllers, changing InputSchema or OutputSchema, adding new errors or enums, or changing HTTP methods and paths. Skip regeneration when changes are limited to use cases, entities, repositories, docs, or tests.

Why are my new controllers not appearing in the generated SDK?

Controllers are missing when they are not exported in controllers/index.ts or their router is not wired into the ROUTERS map in packages/api/typescript/src/routers.ts. Fix the exports, restart the backend, and regenerate.

Why does SDK generation fail with a connection refused error?

Connection refused means the backend server is not running, since the OpenAPI spec is emitted from the live server. Start it with bun x nx run api:dev, wait for the startup message, then run bun sdk again.

Should I create local TypeScript types instead of using SDK types?

No, duplicating SDK types locally causes drift from the backend contract. Import types, enums, and Zod schemas directly from the SDK package, and infer item types from SDK response types rather than writing manual interfaces.