Stateless is a library for creating state machines in C# code.
State machines are useful for modeling workflows, game logic, protocol handling, and other systems with distinct states and transitions, but building them correctly requires careful management of state validity and transition rules. Stateless solves this by providing a fluent API that lets developers define states, triggers, and transitions declaratively in code. The library enforces valid state transitions at runtime and handles guard conditions, entry and exit actions, and hierarchical states, reducing boilerplate and the risk of invalid state combinations.
Stateless suits projects where state management logic is complex enough to benefit from explicit modeling but not so large that a visual state machine tool is necessary. It works well for workflow engines, game state management, device drivers, and protocol implementations. The library is particularly valuable when you want compile-time type safety and the ability to keep state machine definitions close to the code that uses them, rather than in separate configuration files or diagrams.
The project maintains a steady stream of commits addressing bug fixes and feature requests. Pull requests receive thoughtful review with discussion of implementation details and edge cases. Issues are regularly triaged and responded to, with maintainers engaging directly on questions about usage patterns and design decisions. The codebase shows active refinement of existing functionality rather than pursuit of major new features, suggesting a focus on stability and reliability for users already depending on the library.