effect-machine Skill

Build and run type-safe state machines as Effect actors.

53|Updated Jan 25, 2026
One-click install
npx skills add https://github.com/cevr/effect-machine --skill effect-machine-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-machine Skill
Source: https://github.com/cevr/effect-machine/tree/main
Command: npx skills add https://github.com/cevr/effect-machine --skill effect-machine-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

effect-machine Skill helps you model complex workflows as typed state machines (states, events, and transitions) and then run them safely as Effect-powered actors, avoiding scattered callback logic and “one status field” pitfalls.

Core Features & Use Cases

  • Schema-first modeling: define State and Event schemas, then build transitions in a type-safe way.
  • Deterministic transition wiring: use .on(...) for normal transitions, .onAny(...) for wildcard fallbacks, and .reenter(...) when you must re-run lifecycle even if the state tag doesn’t change.
  • Stateful async behavior: attach state-scoped work via .spawn(...), run machine-lifetime work via .background(...), and schedule timeouts/postponed events with .timeout(...) and .postpone(...).
  • Typed replies and coordination: use actor.call(...) for transition receipts and actor.ask(...) for typed Event.reply(...) replies.

Quick Start

Build a checkout-style machine by defining State, Event, and Slot schemas, wiring transitions with .on(...), marking terminal states with .final(...), and then running it via Machine.spawn(...) followed by actor.start.

Frequently Asked Questions about effect-machine Skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build type-safe state machines with async state entry effects?

Type-safe state machines with async state entry effects are built using schema-first State and Event definitions. You attach state-scoped async work via the .spawn() transition builder and run machine-lifetime work using .background().

What is the best way to manage timeouts and postponed event buffering in event-driven workflows?

Timeouts and postponed event buffering in event-driven workflows are managed using the .timeout() and .postpone() transition builders. This allows scheduling deferred events and buffering inputs until specific states are reached.

How do I coordinate typed replies between actors in an async workflow?

Typed replies between actors in async workflows are coordinated using actor.call() for transition receipts and actor.ask() for typed Event.reply() responses. Additional synchronization uses send, waitFor, and awaitFinal.

Can I run guarded or conditional transitions in Effect actors?

Guarded or conditional transitions are supported in Effect actors by wiring deterministic transition logic. You use .on() for normal transitions, .onAny() for wildcard fallbacks, and .reenter() to re-run state lifecycle hooks.

How do I test complex state machine transitions and supervision patterns?

State machine transitions and supervision/restart patterns are tested via simulate and harness utilities. This validates schema-first state definitions, slot provisioning, and supervised actor restarts without scattered callback logic.