active-record-patterns
CommunityApply safe Active Record patterns for reliable DB
Authorslbug
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Ruby on Rails projects often suffer from money fields stored as floats, N+1 queries, missing transaction boundaries, and weak locking strategies, leading to data corruption and performance issues.
Core Features & Use Cases
- Enforce Iron Laws such as using
decimalfor money, preventing N+1 queries with intentional preloading, and keeping invariants inside transactions. - Guidance on Migrations: ensure reversibility, safe foreign keys, and concurrent indexes for large tables.
- Transaction & Locking Best Practices: recommend optimistic or pessimistic locks, after_commit side‑effects, and isolation levels.
- Real‑world Example: In a billing system, the skill will flag float‑based
pricecolumns, suggestdecimalmigrations, and addselect_for_updatewhere race conditions exist.
Quick Start
Ask the active-record-patterns skill to analyze your app/models directory and suggest improvements for money fields, N+1 queries, and transaction safety.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 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: active-record-patterns Download link: https://github.com/slbug/claude-ruby-grape-rails/archive/main.zip#active-record-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.