Agent skill · Backend & API

api-designer

Comprehensive guide to designing type-safe APIs with TypeScript. Covers type-safe contracts, validation with Zod, Result types for error handling, SvelteKit endpoints, middleware patterns, and API versioning.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill api-designer-jasonwarrenuk-goblin-mode --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 33 KB
Bundled scripts: none
Path: skills/api/api-designer-jasonwarrenuk-goblin-mode/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

Guides the agent to help design type-safe APIs in TypeScript, covering type-safe contracts, Zod validation, Result types for error handling, SvelteKit endpoints, middleware patterns, and API versioning.

How it works

  • Defines request/response types and an ApiError shape to standardize communication.
  • Demonstrates a Result<T, E> type for representing success and failure in business logic.
  • Provides ApiResponse, ApiSuccess, and ApiError interfaces to format API responses.
  • Maps endpoints in an ApiEndpoints interface to centralize route contracts.
  • Shows Zod-based schemas (CreateUserSchema, UpdateUserSchema) and how to infer TypeScript types from schemas.
  • Includes complex validation examples, custom validation rules, and nested schemas; demonstrates schema composition for base/create/update variants.
  • Outlines error handling patterns using Result Types for expected failures and ApiError classes for unexpected failures, plus a centralized handleApiError example.
  • Details SvelteKit API routes (GET, POST with validation, dynamic routes) and how to integrate validation and error handling.
  • Describes reusable middleware patterns: authentication, validation, rate limiting, and composing middleware.
  • Presents session management patterns: cookies-based sessions, JWT-based stateless tokens, and Supabase-auth workflow.
  • Provides typed wrappers around database calls, emphasizing a polyglot persistence approach over a single ORM.

When to use it

Use this skill when:

  • Designing API endpoints
  • Creating type-safe API contracts
  • Implementing validation
  • Handling API errors
  • Building SvelteKit API routes
  • Creating reusable middleware
  • Versioning APIs
  • Questions about API design patterns
From the SKILL.md

--- name: api-designer description: Type-safe API design: Zod validation, Result types, SvelteKit endpoints, middleware patterns. user-invocable: false effort: medium paths: - "**/routes/**" - "**/api/**" allowed-tools: - Read - Glob - Grep --- # TypeScript API Design Comprehensive guide to designing type-safe APIs with TypeScript. Covers type-safe contracts, validation with Zod, Result types for error handling, SvelteKit endpoints, middleware patterns, and API versioning. --- ## When This Skill Applies Use this skill when: - Designing API endpoints - Creating type-safe API contracts - Implementing validation - Handling API errors - Building SvelteKit API routes - Creating reusable middleware - Versioning APIs - Questions about API design patterns --- ## Type-Safe Contracts ### Request/Response Types ```typescript // types/api.ts export interface CreateUserRequest { email: string; name: string; password: string; } export interface User { id: string; email: string; name: string; createdAt: string; } export interface ApiError { code: string; message: string; details?: Record<string, string[]>; } ``` **Key principle**: Types ARE documentation. Well-named types with clear structure tel

What's inside
Steps it walks through
  1. When This Skill Applies
  2. Type-Safe Contracts
  3. Request/Response Types
  4. Result Type Pattern
  5. API Response Format
  6. Endpoint Type Map
  7. Validation with Zod
  8. Why Zod
  9. Basic Schema
  10. Complex Validation
  11. Custom Validation Rules
  12. Nested Schemas
  13. Schema Composition
  14. Error Handling Patterns
Ships with 1 file
  • metadata.json
Commands it runs
npm install zod-openapi @asteasolutions/zod-to-openapi
More from claude-skill-registry
All skills →
About this skill
What does the api-designer skill do?

Comprehensive guide to designing type-safe APIs with TypeScript. Covers type-safe contracts, validation with Zod, Result types for error handling, SvelteKit endpoints, middleware patterns, and API versioning.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill api-designer-jasonwarrenuk-goblin-mode --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going