Back to skills
SKILL.md
Rails
ASecurityBuild reliable Rails apps avoiding ActiveRecord traps, N+1 queries, and callback pitfalls.
- 17 stars
- 0 votes
- 0 copies
- 4 views
- Added September 6, 2026
Security analysis
100/100Pro scans all 8 files and shows the line behind each finding
npx -y skills add clawic/skills --skill rails --agent claude-codeAre you the author of Rails?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/clawic-rails)---
name: Rails
slug: rails
version: 1.0.1
description: Build reliable Rails apps avoiding ActiveRecord traps, N+1 queries, and callback pitfalls.
homepage: https://clawic.com/skills/rails
metadata:
clawdbot:
emoji: 🛤️
requires:
bins:
- rails
os:
- linux
- darwin
- win32
displayName: Rails
---
## Quick Reference
| Topic | File |
|-------|------|
| N+1, callbacks, validations, scopes | `activerecord.md` |
| Strong params, filters, render | `controllers.md` |
| Route conflicts, constraints | `routing.md` |
| Partials, helpers, caching, XSS | `views.md` |
| ActiveJob, Sidekiq, retries | `jobs.md` |
| Mass assignment, CSRF, SQL injection | `security.md` |
## Critical Rules
- `save` returns false on failure — `save!` raises, check return or use bang
- `update_all`/`delete_all` skip callbacks and validations — data corruption if unaware
- `find_each` for batches — `Model.all.each` loads entire table into memory
- `redirect_to` doesn't halt execution — code after it runs, use `and return`
- `dependent: :destroy` missing — orphan records accumulate forever
- `default_scope` pollutes all queries including joins — almost always wrong
- Callbacks chain silently — `throw :abort` stops save but returns false, not exception
- `includes` without `references` in `where` string — N+1 still happens
- `||=` memoization caches nil/false — use `defined?(@var) ? @var : @var = compute`
- `has_many through:` vs `has_and_belongs_to_many` — latter has no join model for attrs
- Nested `before_action` — multiple inheritance makes flow unreadable
- `render` doesn't stop action — code continues, duplicate render crashes
Files in this skill
- SKILL.md
- _meta.json
- activerecord.md
- controllers.md
- jobs.md
- routing.md
- security.md
- views.md
Attribution
Related skills
View all in tools →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.