state-machine takes one component, finds the states its code can reach (loading, empty, error, typical, long, plan tier, role, feature flags), and builds a scratch route that shows the real component in each of them. Mock data shaped like the product feeds every state, and a switcher flips between them.
It is a workbench for the visual work on each state. The page lives in one folder and is deleted in one step when you are done. You invoke it yourself by command.
What You Get
- A scratch route in your app holding the real component, untouched, in a container as wide as it is in production
- A written list of states named the way the product talks about them, grouped under headings
- Product-shaped mock data fed in through props or the app’s own data seam
- A switcher driven by a __state search param, so each state is a link, with arrow key stepping and an H key to hide it
- A one-step removal of the page, fixtures and any seam you approved
Common Use Cases
- Polishing the empty and error states of a data table
- Checking a billing card across plan tiers and roles
- Seeing a component with loading and pending requests held still
- Recording screenshots of each state for a design review
What Makes It Unique
It builds only the states the code can reach and lists design states the code lacks as missing. Data goes in at the component’s own boundary, so the page tests the path production takes. The switcher sits visibly outside the design system with a dark neutral surface, and it uses a grouped list that stays readable with thirty states.
Under The Hood
The skill is written instructions plus one reference file with the switcher markup and CSS. The agent reads your component and data code, then writes new files in your project: a scratch route, fixtures and the switcher, all in one folder. It may add a data seam to your code only after asking you. It loads the page in a browser if one is available to check each state, and deleting the folder removes the setup later. It does not run scripts of its own or call outside services.