auto-state-machines

Enforce enum-based states and centralized transition validation for entity lifecycles.

6|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/Corvalis-LLC/Crow-Stack --skill auto-state-machines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auto-state-machines
Source: https://github.com/Corvalis-LLC/Crow-Stack/tree/main/skills/auto-state-machines
Command: npx skills add https://github.com/Corvalis-LLC/Crow-Stack --skill auto-state-machines

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This discipline enforces robust state management by converting ad-hoc booleans and string status fields into typed states with explicit transitions, preventing invalid or ambiguous lifecycles.

Core Features & Use Cases

  • Explicit state enums for entities with distinct phases
  • Centralized transition validation to prevent invalid moves
  • Per-state data and audit trails to reconstruct histories of state changes
  • Easy integration with databases and services for end-to-end lifecycle modeling

Quick Start

Define an Order lifecycle as an enum and implement transition validation with an append-only audit log

Frequently Asked Questions about auto-state-machines

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

FAQPage Schema
How do I enforce valid state transitions and prevent invalid lifecycle changes in my application?

You can enforce valid state transitions by defining explicit enum-based states and routing all changes through a centralized transition validation function. This approach prevents invalid moves and eliminates ambiguous lifecycles caused by ad-hoc booleans or string status fields.

What is the best way to track state machine history and audit trails for domain entities?

The best way to track state machine history is by implementing per-state data alongside an append-only audit log. This allows you to reconstruct the complete history of state changes and ensures full traceability for workflows and process lifecycles.

How do I replace ad-hoc boolean status fields with type-safe state enums for discrete stages?

Replace ad-hoc booleans with type-safe state enums by modeling distinct entity phases as explicit enumerations. This conversion enforces robust state management, ensuring type-safety and preventing ambiguous status representations across domain entities.

Can I integrate centralized transition validation with my existing database and service layers?

Yes, you can integrate centralized transition validation with databases and services. This end-to-end lifecycle modeling ensures that transition rules and per-state data constraints are consistently applied across your entire application architecture.

When should I use a centralized transition function instead of scattered status updates for workflows?

Use a centralized transition function when workflows or process lifecycles require strict correctness and traceability. It prevents invalid moves by validating state changes in one location, avoiding the errors caused by scattered and uncontrolled status updates.

Why does my workflow lifecycle allow invalid state moves, and how can per-state data fix it?

Invalid state moves occur when workflows lack centralized validation and rely on ad-hoc status fields. Implementing typed enums with per-state data and a centralized transition function enforces strict validation, preventing invalid moves and ensuring lifecycle correctness.