state-machine

state-machine is a skill for Claude Code, Codex from WellApp-ai/Well. It costs 14 tokens per session (919 once invoked), scanned A, original, MIT.

A method for documenting the possible states of an interactive user-interface component and the events that move it from one state to another.

In plain words
What is it for?
Use it before building or refactoring UI components to record current and expected behavior for loading, success, error, empty, selection, focus, and other states.
Why use it?
It exposes missing or inconsistent behavior, such as what should happen while data loads, an error appears, or a control is disabled.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/wellapp-ai/well/state-machine
Any agent
npx skills add WellApp-ai/Well --skill state-machine
Clone the repo
git clone --depth 1 https://github.com/WellApp-ai/Well

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for state-machine

README.md
[![agentmods](https://agentmods.dev/badge/skills/wellapp-ai/well/state-machine.svg)](https://agentmods.dev/skills/wellapp-ai/well/state-machine)
Your own site
<a href="https://agentmods.dev/skills/wellapp-ai/well/state-machine"><img src="https://agentmods.dev/badge/skills/wellapp-ai/well/state-machine.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 919 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00014 $0.00919
Opus 5 $0.00007 $0.00460
Sonnet 5 $0.00003 $0.00184
Haiku 4.5 $0.00001 $0.00092

Measured 4d ago against content hash c88b772ce795, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

state-machine scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

cursor-rules/skills/state-machine/SKILL.md · 133 lines

How it starts

The opening of the file, as written. The whole thing — 133 lines — stays where its author put it; the contents beside it link to each section on GitHub.

State Machine Skill

Document the state machine for UI components, comparing current behavior to expected behavior and mapping all state transitions.

When to Use

  • During Ask mode CONVERGE loop for stateful components
  • When refactoring existing components with complex state
  • Before implementing new interactive UI components

Instructions

Phase 1: Identify States

List all possible states for the component:

State Current Behavior Expected Behavior
Initial [What happens now] [What should happen]
Loading [Current loading UX] [Expected loading UX]
Success [Current success display] [Expected success display]
Error [Current error handling] [Expected error handling]
Empty [Current empty state] [Expected empty state]

Common States to Consider:

State Type Examples
Data states Initial, Loading, Success, Error, Empty, Stale
Interaction states Idle, Hover, Focus, Active, Disabled
Visibility states Hidden, Visible, Collapsed, Expanded
Selection states Unselected, Selected, Partially selected
Validation states Valid, Invalid, Pending validation

Phase 2: Map Transitions

Define what triggers each state change:

From To Trigger Side Effects
Initial Loading User action / Mount Start fetch
Loading Success Data received Populate UI
Loading Error Request failed Show error message
Loading Empty Empty response Show empty state
Error Loading Retry clicked Restart fetch
Success Loading Refresh clicked Refetch data

Phase 3: State Diagram

Create a Mermaid state diagram:

stateDiagram-v2
    [*] --> Initial
    Initial --> Loading : fetch
    Loading --> Success : data received
    Loading --> Error : request failed
    Loading --> Empty : no data
    Error --> Loading : retry
    Success --> Loading : refresh
    Empty --> Loading : refresh
    Success --> [*] : unmount

Read the full file on GitHub · 133 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 133 lines · 14 tokens per session scan A c88b772ce795

Subscribe to this mod's changes

state-machine is a skill published in the GitHub repository WellApp-ai/Well (339 stars, last pushed 28d ago), licensed MIT. It adds 14 tokens to every session and 919 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

scalar-design-system

Scalar's design system — design tokens, theming (@scalar/themes), CSS variables, and the @scalar/components library. Use when designing or implementing Scalar UI, especially with Paper (code-to-design / design-to-code), so output matches real Scalar tokens, colors, typography, spacing, and components instead of…

scalar/scalar · 68 tokens

vue-components

Build Vue 3 components with TypeScript and Tailwind using clean structure, composable logic, accessibility, and maintainable patterns.

scalar/scalar · 29 tokens

starter-dashboard

Scaffold a local Next.js Alpaca dashboard using the published @alpacahq/alpaca-trade-api SDK for paper Trading API and Market Data API workflows. Use when the user asks for starter-dashboard, a starter Alpaca dashboard, a local Trading API demo, a Market Data API dashboard, or a greenfield Next.js Alpaca SDK prototype.

alpacahq/alpaca-trade-api-js · 75 tokens

taste

Modern restaurant and hospitality design with bold food photography, rounded editorial layouts, layered midnight surfaces, vivid coral, emerald and violet accents, and no motion effects.

aimeos/pagible · 33 tokens

ui-visual-debugging

Use when modifying or visually debugging Nango frontend UI, including packages/webapp, packages/connect-ui, browser interactions, screenshots, and visual regressions. Prefer browser-controlled or headless Playwright checks; use Peekaboo only for native macOS, visible-browser, or Accessibility tree inspection.

NangoHQ/nango · 64 tokens

print-design-rules

Apply 3D-printing design rules when modelling geometry in Blender that will be printed — overhang limits, wall thickness, clearances between mating parts, hole sizing, fillets and chamfers, print-in-place gaps, part orientation. Use BEFORE generating or modifying geometry intended for FDM printing, and when reviewing…

seehiong/blender-mcp-bridge · 120 tokens