← ClaudeAtlas

state-machineslisted

Finds the implicit state machines in an app: status, state, stage, phase, and step fields, groups of booleans that act like one status, and flows spread across UI, mutations, webhooks, and scheduled jobs. Reports every state, every function that moves it, who can trigger each move, and the problems, then proposes an explicit transition map. Report only by default. Use when the user says find the implicit state machines, audit status fields, map the order or onboarding flow, or when a status bug, a skipped step, or a double run refund, payout, or email shows up.
waynesutton/builder-skills · ★ 404 · Data & Documents · score 89
Install: claude install-skill waynesutton/builder-skills
# State machines An implicit state machine is a field, or a group of fields, that moves through stages with no written list of allowed moves. The list exists anyway. It is spread across every function that writes the field, and nobody has read it in one place. This skill reads it in one place. It writes a report. It changes no code until the user picks a machine to fix. Most of what it finds is product design and bugs. The part an attacker can use belongs to `sec-check` rule 21. ## What counts - A field named `status`, `state`, `stage`, `phase`, or `step` (draft, pending, paid, shipped, refunded). - A group of booleans that act like one status: `isPaid`, `isApproved`, `isRejected`, `isPublished`. - A timestamp that doubles as a flag: `paidAt`, `deletedAt`, `completedAt`, `verifiedAt`. - A flow spread across UI, mutations, webhooks, and scheduled jobs: onboarding, checkout, invites, approvals, AI jobs, uploads. ## Run the audit Work at the repo root with the whole repo open. On a Convex app, start with `convex/schema.ts`, then `convex/**/*.ts`, `convex/http.ts`, and `convex/crons.ts`. 1. **Find the fields.** Search the schema and types: ```bash rg -n "\b(status|state|stage|phase|step)\b\s*[:=]" convex src --glob '!**/_generated/**' rg -n "\bis[A-Z]\w+:\s*v\.(boolean|optional)" convex/schema.ts rg -n "\w+At:\s*v\.(number|optional)" convex/schema.ts ``` Group booleans and timestamps on the same table that describe one lifecycle. Each group is one mach