# domain-modeling

> Model business invariants with strict TypeScript types and tagged unions

- **Publisher**: Matt Pocock (Verified Publisher)
- **Upstream GitHub Repository**: https://github.com/mattpocock/skills/tree/main/skills/engineering/domain-modeling
- **skills.sh Listing**: https://skills.sh/mattpocock/skills/domain-modeling
- **License**: MIT
- **GitHub Stars**: 329,578
- **Canonical Web Page**: https://builderthread.dev/skill/mattpocock/skills/domain-modeling
- **Parent Topic**: [typescript](https://builderthread.dev/skill/for/typescript.md)
- **Last Audited**: 2026-11-21
- **Supported Coding Agents**: Claude Code, Cursor, Codex, Windsurf

## Overview
Teaches coding agents to encode domain rules, transitions, and illegal-state guards directly in the TypeScript type system before implementing handlers or UI.

Inspect the full upstream `SKILL.md` source and license on GitHub before installing: https://github.com/mattpocock/skills/tree/main/skills/engineering/domain-modeling

## Install Command
```bash
npx skills add mattpocock/skills --skill domain-modeling
```

## When to Use This Skill
- Designing core SaaS entities, billing states, or workflow transitions in TypeScript
- Eliminating loose optional fields and conflicting boolean flags
- Aligning TypeScript domain models with PRD requirements before coding

## Focus Areas
- Discriminated unions
- Branded ID types
- State transition modeling
- Compile-time invariants

## Upstream Package Files
- `skills/engineering/domain-modeling/SKILL.md`

---

## Ship With a Private Starter Repo, Living PRD & MCP Tasks

Builderthread pairs verified stack skills with a cited market brief, living PRD, private GitHub starter repo, and ordered MCP tasks for Claude Code, Cursor, and Codex.

- Supported languages: Rust, TypeScript, React Native (Expo), Python
- Starter stacks: Next.js SaaS, Hono API, FastAPI AI, Expo mobile, Tauri Rust desktop, WXT Chrome extension
- Start now: https://builderthread.dev/auth/signup
