Skip to content
SkillModel-led1,143 tokens in use

state-machine

Renders every state of one component on a throwaway page with mock data and a switcher, so you can work on each state.

12,499 stars on the repository MIT Licensejakubkrehel/skills · skills/state-machine
npx skills add jakubkrehel/skills
View source

Install command as written in the repository's README

Skill label

measured from its files

What installing state-machine costs

34tokens idle
1,143tokens in use
3,083tokens, up to

Idle is what sits in context while the skill is installed. In use is its instructions, loaded when it runs. Up to adds the files its instructions link. Counts are approximate, made offline with cl100k_base.

Model dependence Model-led

Script-ledMixedModel-led

Mostly instructions, so how well it works depends on the model that follows them.

This describes the skill's structure, how much of it is scripts. It does not say how well it works.

Touches

Nothing detected: no shell, network, file writes, git or credentials in its files.

Declared tags come from the skill's frontmatter; detected ones from its scripts, its code blocks and the commands it names in inline code. This is detected, not audited.

How it scores

Quality

How well the skill is written, counted from its own files: its frontmatter, its steps, examples, stated output and constraints, its size and whether every file it ships is one it names.How we score it →
Fair
  • Frontmatter8/15
  • Structure18/25
  • Examples0/15
  • Output5/15
  • Size15/15
  • Resources7/15

Security

Starts at 100 and loses points for each thing in the skill's files that a reader should look at first.How we score it →
Excellent

No findings.

Repository health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
Good
  • Development activity96
  • Maintenance52
  • Community48
  • Maturity24
  • Momentum40

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.

Join founders building with open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on SubstackJoin 750+ subscribers