type-driven

Encode domain invariants as types using typestate patterns and discriminated unions.

5|2|Updated Nov 17, 2025
One-click install
npx skills add https://github.com/OutlineDriven/odin-gemini-cli-extension --skill type-driven
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: type-driven
Source: https://github.com/OutlineDriven/odin-gemini-cli-extension/tree/main/skills/type-driven
Command: npx skills add https://github.com/OutlineDriven/odin-gemini-cli-extension --skill type-driven

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Type-driven development helps prevent runtime bugs by encoding business invariants as types, so invalid states are unrepresentable and proofs live with code.

Core Features & Use Cases

  • Encode invariants in types to prevent invalid values at compile time.
  • Model domain workflows with typestate and discriminated unions for exhaustive handling.
  • Use parse, don't validate patterns to preserve proof obligations across boundaries.

Quick Start

Provide a typed design for a core domain and ensure all cases are exhaustively handled by the compiler.

Frequently Asked Questions about type-driven

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

FAQPage Schema
How do I encode business invariants in types to prevent invalid states?

Type-driven development encodes invariants in types to prevent invalid states by making illegal values unrepresentable, moving proof obligations into the type system so errors are caught at compile time.

What is the parse don't validate pattern for type safety?

The parse, don't validate pattern preserves proof obligations across boundaries by parsing untrusted input into validated types once, ensuring subsequent code receives guaranteed valid data without redundant runtime checks.

How do I model domain workflows with typestate and discriminated unions?

Model domain workflows with typestate and discriminated unions to represent valid state transitions and domain rules, enabling the compiler to enforce exhaustive handling of all possible workflow cases.

Does type-driven development work for language-agnostic static typing design?

Type-driven development supports language-agnostic static typing design through a neutral workflow of plan, create, verify, and implement steps, applying type-first principles across different programming languages.

When should I use type-driven design instead of runtime validation?

Use type-driven design instead of runtime validation when you need to prevent runtime bugs by encoding business invariants as types, ensuring invalid states are unrepresentable and proofs live with code.