api-contract

Centralize HTTP endpoint definitions with EmberApi SSOT for typed server and client implementations.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/aitchwhy/dotfiles --skill api-contract-aitchwhy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-contract
Source: https://github.com/aitchwhy/dotfiles/tree/main/config/agents/skills/api-contract
Command: npx skills add https://github.com/aitchwhy/dotfiles --skill api-contract-aitchwhy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Defines a single source of truth for API contracts, enabling consistent server and client implementations.

Core Features & Use Cases

  • Centralized API contracts from effect.platform
  • Strong typing across server handlers and clients
  • Supports generation of OpenAPI specs

Quick Start

Create a contract and implement handlers accordingly.

Frequently Asked Questions about api-contract

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

FAQPage Schema
How do I create a single source of truth for my API contract?

Define your API contract using EmberApi to centralize endpoint definitions. This creates a single source of truth that server handlers and clients can both reference, eliminating contract drift and ensuring type safety across your HTTP API.

Can I share typed API definitions across TypeScript packages?

Yes. Use EmberApi with HttpApiBuilder to define contracts in a shared domain package. Both server-side handlers and client-side consumers import the same typed contract, enabling cross-package consistency without duplication.

How do I ensure my server handlers and API clients stay in sync?

Build typed server handlers with HttpApiBuilder and clients with HttpApiClient from the same contract definition. Both derive their types from the shared contract, so schema changes propagate automatically to both sides.

What's the best way to validate API boundaries at runtime in TypeScript?

Use Schema.decodeUnknown for runtime boundary decoding with BetterAuth parsing. This validates incoming data against your contract schema before it reaches handlers, catching type mismatches at the API edge.

Does this approach generate OpenAPI documentation?

Yes. The centralized API contract from effect.platform can generate OpenAPI specs, giving you auto-generated API documentation that stays synchronized with your actual typed implementations.