Skills for Real Engineers. Straight from my .agents directory.
principle-model-the-domain
Agent skill frombacknotprop/pstack
Apply when writing stateful logic, or when code branches a lot or repeats a shape assumption across files.
How to install principle-model-the-domain
npx skills add backnotprop/pstack# or add only this skill to Claude Code: copy the folder
skills/principle-model-the-domain/
# into
~/.claude/skills/principle-model-the-domain/ (all projects)
.claude/skills/principle-model-the-domain/ (one project)
1# Model the Domain23Encode the real domain in a data structure instead of scattering it across conditionals. A structure that matches the domain makes invalid states unrepresentable and deletes branches. Choosing it at write time is cheap. Recovering it later reads as a refactor and gets deferred.45Reach for:67- A state machine instead of scattered booleans, phases, or lifecycle checks.8- A typed model instead of loose parameters or repeated shape assumptions.9- A map, registry, lookup table, or discriminated union instead of branching spread across files.10- A reducer or command/event model instead of ad hoc state mutations.11- A module organized around one body of domain knowledge instead of a sequence such as load, validate, transform, and save. Execution order is not ownership.12- A small module boundary that gathers repeated behavior, ownership, or invariants.13- A queue, cache, index, graph, tree, or normalized collection where the access pattern calls for it.14- Any other structure that fits. When none fits, work out what the code must never allow and how the data gets read, then find the structure that encodes exactly that.1516Do not force an abstraction. Prefer boring code if the current shape is already clear, local, and unlikely to grow. Be skeptical of an abstraction that adds indirection without removing branches, duplicated rules, invalid states, or lifecycle risk.17…
Excerpt shown under the repository's MIT license.
More skills in pstack
Similar skill repositories
An agentic skills framework & software development methodology that works.
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
Public repository for Agent Skills
Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
An AI skill that provides design intelligence for building professional UI/UX across multiple platforms.
