Agent skill · Backend & API

api-designer

This skill should be used when the user mentions "API design", "TypeScript API", "type-safe API", "endpoint design", "API validation", "Zod", discusses creating APIs, type safety, error handling, or API architecture. Addresses designing clean, type-safe APIs with validation, error handling, and documentation.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill api-designer-jasonwarrenuk-claude-code-config --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
Version: 1.0.0
Path: skills/api/api-designer-jasonwarrenuk-claude-code-config/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

Conveys concrete TypeScript API design guidance, including type-safe contracts, a Result type pattern, standardized ApiResponse formats, and examples for SvelteKit API routes, validation with Zod, and error handling. It includes endpoint mappings, validation schemas, error classes, and middleware patterns. It focuses on creating type-safe APIs with validation, error handling, and documentation.

How it works

The skill instructs the agent to:

  • Define request/response types (e.g., CreateUserRequest, User, ApiError) and show how types serve as documentation.
  • Use a Result<T, E> union for expected failures and demonstrate consumption patterns.
  • Define ApiResponse<T> as a union of ApiSuccess and ApiError to standardize API responses.
  • Map endpoints in an ApiEndpoints interface, detailing HTTP methods, paths, and associated request/response types.
  • Provide Zod-based validation schemas (CreateUserSchema, UpdateUserSchema) and how to infer TypeScript types from schemas.
  • Show error handling patterns with two categories: Result types for expected failures and ApiError/other error classes for exceptional cases.
  • Present a centralized handleApiError function example to standardize error responses.
  • Describe SvelteKit API routes (GET, POST, PATCH, DELETE) with examples for fetching, creating, updating, and deleting resources, integrating validation and error handling.
  • Outline reusable middleware (authentication, validation, rate limiting, composition) and show how to apply them in route handlers.
  • Include session management patterns (cookies, JWT, Supabase) with usage notes.
  • Mention the typed database wrappers approach for persistence and provide starter wrappers for table interactions.

When to use it

Use this skill when:

  • You are designing API endpoints
  • You want type-safe API contracts
  • You need validation and error handling patterns
  • You are building SvelteKit API routes
  • You seek reusable middleware patterns and API versioning guidance
  • You model API behavior with a consistent response format and documented contracts

What it can touch

The skill demonstrates usage of:

  • TypeScript interfaces and types (e.g., CreateUserRequest, User, ApiError)
  • Zod schemas (CreateUserSchema, UpdateUserSchema)
  • SvelteKit route handlers and utilities (GET/POST/PATCH/DELETE handlers, +server.ts files)
  • Middleware functions (requireAuth, validateRequest, rateLimit, compose)
  • Session management utilities (cookies, JWT, Supabase auth)
  • Centralized error handling (handleApiError) and error classes (ApiError, ValidationError, NotFoundError, etc.)
  • API endpoint mappings (ApiEndpoints)

Caveats

  • The material is a code-focused guide with examples; it does not guarantee production-ready implementations and leaves room for integration details (e.g., actual DB calls, integration with your data layer).
  • It specifies license and tool usage (MIT, claude-code) but does not include runtime guarantees outside the examples.
  • It emphasizes Zod-based validation and TypeScript-first patterns, which require appropriate tooling in the consuming project.
From the SKILL.md

# 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 tell the story. ### Result Type Pattern ```typescript // For expected failures (not found, validation, etc.) export type Result<T, E = string> = | { success: true; data: T } | { success: false; error: E }; // Usage function findUser(id: string): Re

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?

This skill should be used when the user mentions "API design", "TypeScript API", "type-safe API", "endpoint design", "API validation", "Zod", discusses creating APIs, type safety, error handling, or API architecture. Addresses designing clean, type-safe APIs with validation, error handling, and documentation.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill api-designer-jasonwarrenuk-claude-code-config --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