activerecord-patterns
OfficialLean ActiveRecord patterns for Rails models.
Authorrockcodelabs
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill codifies best practices to keep Rails ActiveRecord models thin, moving business logic into service objects and ensuring robust validations, associations, scopes, and queries.
Core Features & Use Cases
- Keep models thin: data and persistence only, with business logic delegated to services.
- Solid validations and associations: define clear constraints and relationships to prevent leakage of logic.
- Query optimization: use scopes and eager loading to avoid N+1 problems and improve performance.
- Testing guidance: provide structured model and integration tests to ensure correctness.
Quick Start
Analyze your current models, start extracting business logic into services, and write tests following the patterns described in this Skill.
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: activerecord-patterns Download link: https://github.com/rockcodelabs/kw-app/archive/main.zip#activerecord-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.