What problem does it solve?
This Skill helps you eliminate fragile boolean state columns by modeling state as dedicated records that capture current status, change time, actor identity, and reasons/history.
Core Features & Use Cases
- State as records (not booleans): Use a related “state record” (for example, a Closure/Publication/Goldness) so state queries become reliable and expressive.
- Metadata-rich transitions: Track created_at, who made the change, and optional notes/reason to support auditability and user-facing UI.
- Query and UI patterns: Provide consistent scopes for open/closed or published/private combinations, and show how to render state-aware views and toggle actions.
- Migration guidance: Includes step-by-step migration/backfill strategy for converting existing boolean columns to state-record tables.
Quick Start
Ask an AI to generate a state-record model and Rails concerns for a resource you want to manage with open/closed behavior, including scopes, controller routes for create/destroy transitions, and view logic showing who changed the state and when.