What problem does it solve? Hand-rolled React state — loading flags, retry timers, cancellation guards, and stale async responses — scatters lifecycle logic across useState and useEffect, producing race conditions and leaked resources. This Skill models those temporal concerns as explicit XState 5 statecharts with clear ownership of effects, retries, and resource lifetimes. ## Core Features & Use Cases - Lifecycle modelling: Converts implicit async state (isSubmitting flags, polling timers, gesture handling) into typed actor machines with factories, injected ports, and discriminated event unions. - React integration: Structures @xstate/react usage with route-owned useActorRef, focused selectors, and clear rules for what stays in useState versus the machine. - Testing and diagramming: Drives real actors with fake ports to prove retries, cancellation, and exactly-once teardown, and renders legal Mermaid stateDiagram-v2 charts for every machine. - Use Case: When a form submission needs loading state, retries with backoff, cancellation, and protection against stale responses, use this Skill to design the actor machine, wire it into React, write boundary tests, and generate the statechart diagram. ## Quick Start Use the xstate skill to model this form submission flow — with loading, retry, and cancellation — as an XState 5 machine integrated with React.