active-record-patterns

Installation
SKILL.md

Active Record Patterns

Iron Laws

  1. Use decimal or integer cents for money.
  2. Prevent N+1 queries with intentional preload strategy.
  3. Put invariants inside transactions and use locks when races matter.
  4. Prefer after_commit for external side effects.
  5. Keep schema constraints aligned with application validations.

Default Moves

  • use foreign keys and indexes deliberately
  • choose includes, preload, or eager_load intentionally
  • use find_each for large backfills and batch work
  • use optimistic or pessimistic locking where correctness depends on it
  • make migrations reversible and production-safe
Installs
2
GitHub Stars
7
First Seen
Apr 15, 2026
active-record-patterns — slbug/claude-ruby-grape-rails