omgskills Get the Mac app
Skill

typed-service-contracts

@google-labs-code 27k stars Updated 2026-07-27 Author match: High

Architecture standard for building robust, type-safe TypeScript services using the "Spec and Handler" pattern. Use when building CLIs, libraries, or complex business logic.

Install

Install this Claude and Codex skill with the command below. The command stays visible even when copy support is unavailable.

Install command
git clone https://github.com/google-labs-code/design.md /tmp/design.md && ln -s /tmp/design.md/.agents/skills/typed-service-contracts ~/.claude/skills/typed-service-contracts

View on GitHub

From README

Typed Service Contracts (Spec & Handler Pattern) This skill defines a Vertical Slice Architecture backed by Design by Contract (DbC) principles. It treats application logic as rigorously defined Units of Work where inputs are parsed (not just validated) and errors are treated as values (Result Pattern) rather than exceptions. When to use this skill Building CLIs or Libraries: When you need strict boundaries between user input and system logic. Complex Validation: When inputs require transformation (parsing) before being useful (e.g., ensuring a string is a valid file path). High-Reliability Requirements: When you cannot afford unhandled runtime exceptions and need exhaustive error handling. Testing Focus: When you want to separate data validation tests from business logic tests. Architecture Components The Spec (spec.ts) The "Contract" or "Port". It defines the What. It must contain: Input Schema: A Zod schema that parses raw input into a valid DTO.

More from this repo

More skills