typescript-api

Enforce typed routes and Zod validation in Express or Fastify APIs.

132|13|Updated Dec 18, 2025
One-click install
npx skills add https://github.com/holon-run/holon --skill typescript-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-api
Source: https://github.com/holon-run/holon/tree/main/examples/skills/typescript-api
Command: npx skills add https://github.com/holon-run/holon --skill typescript-api

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TypeScript API teams struggle to maintain type safety, validation, and scalable architecture across Express/Fastify services.

Core Features & Use Cases

  • Type-safe routing and request validation with Zod.
  • Clear separation of routes, controllers, services, and models.
  • End-to-end patterns for Express/Fastify apps with scalable architecture.
  • Use Case: Build an Express API with typed DTOs and runtime validation to ensure correct client-server contracts.

Quick Start

Start by scaffolding a minimal Express API with typed DTOs and Zod validation to expose a REST endpoint.

Frequently Asked Questions about typescript-api

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

FAQPage Schema
How do I build a type-safe REST API with TypeScript and Zod validation?

Build a type-safe REST API with TypeScript by enforcing typed routes and runtime input validation with Zod. This ensures correct client-server contracts through typed DTOs while maintaining clear separation between routes, controllers, services, and models.

What's the best way to structure a scalable Express or Fastify TypeScript API?

Structure a scalable TypeScript API by enforcing a clean separation between routes, controllers, services, and models. This architectural pattern applies to both Express and Fastify stacks, ensuring maintainability across backend services and microservices.

Can I use Zod for runtime request validation in an Express API?

Yes, you can use Zod for runtime request validation in an Express API. It enforces type-safe routing and validates input data against typed DTOs, ensuring that incorrect client-server contracts are rejected before reaching your business logic.

Does this TypeScript API approach work with both Express and Fastify?

Yes, this TypeScript API approach works with both Express and Fastify. It provides end-to-end patterns for scalable architecture, applying typed routes and Zod validation across both web frameworks to maintain consistent type safety.

Why do I need runtime validation with Zod if I already use TypeScript?

TypeScript provides compile-time type safety, but runtime validation with Zod is needed to validate incoming API requests. Zod enforces typed DTOs at runtime, ensuring correct client-server contracts and preventing invalid data from entering your backend services.

When should I separate controllers and services in a TypeScript API?

Separate controllers and services in a TypeScript API when building scalable backend services or microservices. This clear separation isolates business logic from routing, ensuring type-safe architecture remains maintainable as the API grows.