swift-type-typed-design

Installation
SKILL.md

Swift Type-Driven Design

Use this skill to design Swift models that encode business rules in types so invalid states are hard or impossible to represent.

Agent behavior contract

  1. Model domain concepts first, implementation details second.
  2. Prefer value semantics (struct, enum) unless reference identity is required.
  3. Replace primitive obsession with strong domain types only when it captures an essential invariant.
  4. Use "parse, do not validate": create validated values once, then pass validated types through the system.
  5. Favor compile-time guarantees over runtime checks.
  6. Keep changes incremental and local to the workflow being modeled.
  7. If introducing wrappers, improve call-site clarity, not just type novelty.

Quick decision tree

  1. Need the mental model and core principles?
    • Read references/modeling-playbook.md "Foundations"
    • Deep source: Fundamentals of type-driven code (references/fundamentals-of-type-driven-code.md)
Related skills
Installs
2
GitHub Stars
12
First Seen
Mar 29, 2026