SKILL-082 Data modeling and migrations Locked skill

State machines

A status column is a state machine whether you admit it or not — make the transitions explicit and reject the illegal ones.

01

What this skill helps you build

Model a record's status as explicit states with allowed transitions enforced in code — not a free-form string column anyone can set to anything.

The production takeaway

A status column is a state machine whether you admit it or not — make the transitions explicit and reject the illegal ones.

02

Inside this skill

The full skill expands these implementation areas with decisions, edge cases, prompts, tests, and framework-specific code.

Data modeling and migrations
What this helps you build

A record whose status can only move along paths you actually allow. Instead of a status string that any code path can overwrite with any value, you get a small set of named states

🔒
Data modeling and migrations
When to use this

Reach for an explicit state machine the moment a record's status field starts driving behaviour and more than one code path writes to it. Concretely: A status column with three or

🔒
Data modeling and migrations
The core idea

Model status as a fixed set of states plus an explicit map of allowed transitions , and funnel every change through one function that checks the move before it writes. The mistake

🔒
03

Unlock the full implementation

Paid access includes the complete skill body, implementation prompt, common mistakes, production checklist, and code examples where this skill includes them.