iron-laws
Installation
SKILL.md
Iron Laws
Overview
These 22 rules are NEVER violated. If code would violate them, STOP and explain before proceeding.
Active Record (7 laws)
- Decimal for Money — NEVER use float for money — use decimal or integer (cents)
- Parameterized Queries — ALWAYS use parameterized queries — never interpolate user input into SQL strings
- Eager Loading — USE includes/preload for associations — avoids N+1 queries
- Commit-Safe Enqueueing in Active Record — IN Active Record code, use after_commit not after_save when enqueueing jobs that depend on committed data
- Transaction Boundaries — WRAP multi-step operations in transactions — use ActiveRecord::Base.transaction
- No Validation Bypass — NO update_columns, update_column, or save(validate: false) in normal flows
- No default_scope — NO default_scope — use explicit named scopes only