rails
Skill17 starsChanged 51 days agoMITView on GitHub
Ruby on Rails with service-oriented architecture, Dry-validation, Sidekiq/Solid Queue, Hotwire. Use for Rails API, Rails services, Rails forms, RSpec, ActiveRecord, Rails migrations. Not for standalone Ruby gems (use ruby skill), and not for judging whether a migration is safe to run in production (that is the database-reviewer agent).
5 other projects use a version of this.
Adopted by
Most recently taken up by
- G1Joshi/Agent-Skillstheir own version, first seen Oct 13, 2026
- carapace-sh/carapace-bintheir own version, first seen Oct 8, 2026
- TeamHelix-AI/helixtheir own version, first seen Sep 12, 2026
- conjure-3301/skillstheir own version, first seen Aug 17, 2026
- martinstreicher/claude-skillstheir own version, first seen Feb 14, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- carapace-sh/carapace-bin★ 2ksame name
- G1Joshi/Agent-Skills★ 15same name
- TeamHelix-AI/helix★ 1same name
- conjure-3301/skills★ 0same name
- martinstreicher/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository37 other files it gives its agents.
- adrSkill
- android-kotlinSkill
- apple-swiftSkill
- autoresearch-promptSkill
- blog-writerSkill
- cloud-infrastructureSkill
- commitSkill
- cover-imageSkill
- freezeSkill
- gemini-reviewSkill
- golangSkill
- harness-mechanicSkill
- harness-traceSkill
- humanizerSkill
- ios-debuggerSkill
- knowledge-syncSkill
- learning-docsSkill
- learning-loopSkill
- obsidianSkill
- orchestratorSkill
- plan-forgeSkill
- process-clippingsSkill
- project-analyzerSkill
- project-checksSkill
- pr-reviewSkill
- pythonSkill
- react-nextjsSkill
- refine-requirementsSkill
- releasing-softwareSkill
- rubySkill
- scoreSkill
- second-opinionSkill
- skill-forgeSkill
- source-controlSkill
- terraformSkill
- test-design-reviewerSkill
- verify-frontendSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 65
All business logic lives in services, forms and filters
- Distinctive: line 68
No model callbacks, except for attachment destruction
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ABOUTME: Rails service-oriented architecture, validation contracts, background jobs, Hotwire
ABOUTME: API development with thin controllers, services, forms, filters
Ruby on Rails
Quick Reference
bundle exec lefthook run all # Quality checks
bundle exec rspec # Tests
rails s / bin/dev # Server (bin/dev for Hotwire)
bin/jobs # Solid Queue workersSee also: _AST_GREP.md (sg patterns), _PATTERNS.md, source-control
Architecture calls:
MyService.new(user:, params:).call # Service
MyForm.new(params, user).save # Form
MyFilter.result(params, scope) # Filter
MyJob.perform_async(id) # Sidekiq
MyJob.perform_later(id) # Solid QueueVersion (determine, don't assume)
See ../_LANG_COMMON.md. Fetch the truth:
bundle exec rails -v # project Rails version
ruby -v && cat .ruby-version 2>/dev/null # project Ruby version
curl -s https://rubygems.org/api/v1/gems/rails.json | jq -r .version # latest upstream RailsPre-Commit Verification (MANDATORY)
make check && make test-e2e must pass (enforced by the pre-commit-gate hook; see ../_LANG_COMMON.md). What make check expands to for Rails:
bundle exec lefthook run all # Rubocop, Brakeman, tests, etc.
bundle exec rspec # Full RSpec suite
bundle exec brakeman --no-pager # Security scan
bundle audit check --update # Dependency CVEsHouse Architecture Rules
These deliberately depart from Rails defaults, so apply them even where idiomatic Rails would put the code in the model:
- Controllers are the HTTP layer only
- All business logic lives in services, forms and filters
- Validation lives in Dry-validation contracts, not ActiveRecord validations
- Models hold data structure and associations, minimal logic
- No model callbacks, except for attachment destruction
Pattern Summary
Service: Complex business logic, multi-step operations, transactions
MyService.new(user:, params:).call # Returns OpenStruct(success, record)Form: User input validation + persistence
MyForm.new(params, user).save # Returns true/falseContract: Validation rules (Dry-validation)
CreateContract.new.call(params) # Returns Result(success?, errors)Controller: HTTP layer only, no business logic
def create
form = CreateForm.new(params, current_user)
form.save ? render(json: form.model, status: :created) : render(json: { errors: form.errors }, status: :unprocessable_entity)
endModel: Associations, enums, simple scopes. NO validations, NO callbacks, NO business logic.
belongs_to :user
has_many :tags, dependent: :destroy
enum :status, { draft: 0, published: 1 }
scope :recent, -> { order(created_at: :desc) }Background Jobs
| Component | Use When |
| Solid Queue | <100 jobs/sec, no Redis needed |
| Solid Cache | DB-backed caching |
| Solid Cable | WebSockets, no Redis infra |
| Sidekiq | Latency <100ms, 10k+ jobs/min |
Jobs MUST be idempotent.
Quality Checklist
- NO controller logic
- Validation in contracts only
- Business logic in services
- Jobs idempotent
- Tests pass
Resources
- https://guides.rubyonrails.org/
- https://dry-rb.org/gems/dry-validation/
- https://github.com/rails/solid_queue
- https://turbo.hotwired.dev/
Key gems: Dry-validation, Sidekiq/Solid Queue, Scenic, Pundit, Devise/Rodauth, ViewComponent/Phlex
For detailed patterns and examples, see references/rails-patterns.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

