state-records-patterns
OfficialReplace booleans with rich state models.
Software Engineering#database migrations#domain-driven design#state modeling#audit history#query scopes#rails activerecord#workflow transitions
AuthorLaunchPadLab
Version1.0.0
Installs0
System Documentation
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.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: state-records-patterns Download link: https://github.com/LaunchPadLab/ai-bank/archive/main.zip#state-records-patterns Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.