# matthewp/robot

🤖 A functional, immutable Finite State Machine library

Repository: https://github.com/matthewp/robot
Canonical: https://ross.abutalabs.com/products/robot
Homepage: https://regularhuman.dev
Language: JavaScript
License: BSD-2-Clause
License Family: permissive
Last push: 2026-08-22T17:38:32+00:00

## Health v2 (maintenance only)
Score: 85/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 59, longevity 100
- inputs: {"age_days": 2550, "days_push": 11, "days_rel": 278, "gap_med": 0, "n_releases_24m": 18}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2197, forks 97 (observed 2026-08-28T04:06:25.297405+00:00)

## What it is
Robot (robot3) is a small (~1KB) functional and immutable finite state machine library for JavaScript. It brings declarative state management to UI applications with integrations for React, Preact, Haunted, and other frameworks.

## Use cases
- manage complex UI state with finite state machines
- model toggle, loading, and async states declaratively
- prevent invalid states in frontend components
- use a state machine with React or Preact via hooks
- handle async invocations and context in application state
- replace boolean flags with explicit state transitions

## When to choose
- you want a tiny, dependency-free state machine library
- you prefer a functional API over options objects
- you need declarative state management for UI components
- you use React, Preact, or Haunted and want machine integration

## When to avoid
- you need a full-featured statechart solution with actors and hierarchical states
- your team prefers Redux-style global stores
- you need server-side or non-JavaScript state machine tooling

## Facets
- artifact type: library
- maturity: stable
- function: state-management, web-framework
- domain: frontend, web-development, developer-tools
- platform: browser
- tags: finite-state-machine, immutable, functional, tiny-footprint, react-integration, preact-integration, nodejs, javascript

## Member repositories
- matthewp/robot (main) score 85

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:25.297405+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:47:09.977174+00:00, confidence not recorded.
  - readme: https://github.com/matthewp/robot (fetched 2026-08-28T04:06:25.297405+00:00, sha dce7aa42b36e)
  - homepage: https://regularhuman.dev (fetched 2026-08-29T10:27:46.988931+00:00, sha c98f2d1cd5d3)
  - site_page: https://regularhuman.dev/docs (fetched 2026-08-29T10:27:47.041641+00:00, sha 6efb0d6e6b34)
- Data as of 2026-08-30T08:39:29.467469+00:00.
