rails_ai_agents
CLAUDE.md665 starsChanged 6 months agoMITView on GitHub
No app/services/, app/queries/, app/policies/, app/forms/ directories. Business logic lives in models. Authorization via roles on User model + controller concerns. Complex forms use standard Rails nested attributes.
In this repository43 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- accessibility-reviewSkill
- action-cable-patternsSkill
- active-storage-setupSkill
- api-versioningSkill
- authentication-flowSkill
- behavioral-guidelinesSkill
- caching-strategiesSkill
- code-reviewSkill
- codex-reviewSkill
- dependabot-reviewSkill
- extraction-timingSkill
- friction-reviewSkill
- i18n-patternsSkill
- mutation-testingSkill
- performance-optimizationSkill
- postgres-patternsSkill
- rails-architectureSkill
- rails-concernSkill
- security-auditSkill
- solid-queue-setupSkill
- accessibility-reviewSkill
- action-cable-patternsSkill
- active-storage-setupSkill
- api-versioningSkill
- authentication-flowSkill
- behavioral-guidelinesSkill
- caching-strategiesSkill
- code-reviewSkill
- codex-reviewSkill
- dependabot-reviewSkill
- extraction-timingSkill
- friction-reviewSkill
- i18n-patternsSkill
- mutation-testingSkill
- performance-optimizationSkill
- postgres-patternsSkill
- rails-architectureSkill
- rails-concernSkill
- security-auditSkill
- solid-queue-setupSkill
The file
We split this CLAUDE.md into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 34
State as records: No boolean flags for business state -- use has_one state records
- Distinctive: line 60
Write a failing Minitest test with fixtures
- Very specific: line 81
No newline under private/protected keyword.
- Distinctive: line 82
Avoid service objects -- domain logic belongs in models with concerns (services acceptable when justified)
≈ “Common” is an estimate: at least 1 in 5 of the 28,029 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
37signals Rails Configuration
Tech Stack
- Ruby 3.3, Rails 8.2 (edge), MySQL (SaaS) / SQLite (OSS)
- Frontend: Hotwire (Turbo 8 + Stimulus 3.2), Importmap (no Node.js)
- Testing: Minitest + Fixtures (not RSpec, not FactoryBot)
- Auth: Custom passwordless: passkeys (WebAuthn) + magic links (no Devise),
has_secure_passwordoptional - Background Jobs: Solid Queue (database-backed, no Redis)
- Caching: Solid Cache | WebSockets: Solid Cable
- IDs: UUIDv7 everywhere (base36-encoded, 25-char strings)
- Assets: Propshaft + Import Maps (no Node.js, no Webpack)
- Deployment: Kamal 2 + Thruster
Architecture
app/
controllers/ # Thin. Only 7 REST actions. New resource for each state change.
models/ # Rich. Business logic, concerns, associations, validations.
models/concerns/ # Horizontal behavior: Closeable, Assignable, Searchable.
views/ # ERB + Turbo Frames/Streams. No JS frameworks.
jobs/ # Shallow. Call model methods, don't contain logic.
mailers/ # Minimal. Bundle notifications, plain-text first.
channels/ # ActionCable channels for real-time.No app/services/, app/queries/, app/policies/, app/forms/ directories. Business logic lives in models. Authorization via roles on User model + controller concerns. Complex forms use standard Rails nested attributes.
Core Philosophy
- Vanilla Rails: Rich domain models, thin controllers, avoid service objects (acceptable when justified, but not as default architecture), no Devise, no Pundit
- Everything is CRUD: State changes = new resources (
Closure,Publication,Archival) - State as records: No boolean flags for business state -- use
has_onestate records - Rich models over services: Business logic lives in models, organized via concerns
- Concerns for organization: Models compose behavior via focused concerns (
Closeable,Assignable) - No foreign key constraints: Application enforces referential integrity
- Multi-tenancy: URL path-based (
/:account_id/...),account_idon every table - Current for context:
Current.user,Current.account,Current.session - Shallow jobs:
_later/_nowpattern; job calls model method, logic stays in model
Key Commands
bin/setup # Initial setup
bin/dev # Start dev server
bin/rails test # Full test suite
bin/rails test test/models/card_test.rb # Specific file
bin/rails test test/models/card_test.rb:14 # Specific line
bin/rails test:system # System tests (Capybara + Selenium)
bin/ci # Full CI (rubocop + brakeman + tests)
bundle exec rubocop -a # Auto-fix Ruby style
bin/rails db:migrate # Run migrations
bin/rails db:fixtures:load # Load fixture data
bin/rails db:reset # Drop, create, load schema + fixturesDevelopment Workflow
- Write a failing Minitest test with fixtures
- Implement minimal code to make it pass
- Refactor while tests stay green
Naming Conventions
| Layer | Pattern | Example |
| Model | Singular PascalCase | Card, BoardPublication |
| Controller | Plural, nested by resource | Cards::ClosuresController |
| State Record | Noun describing state | Closure, Publication, Goldness |
| Concern | Adjective/-able | Closeable, Assignable, Searchable |
| Job | Model::VerbJob | Event::RelayJob, Card::CleanupJob |
| Test | ModelTest / ControllerTest | CardTest, Cards::ClosuresControllerTest |
Style Guide (37signals)
- Expanded conditionals over guard clauses (exception: single-line early returns at method start)
- Method ordering: class methods > public instance (
initializefirst) > private - Order private methods by invocation flow (call order)
- Bang methods (
!) only when a non-bang counterpart exists - No newline under
private/protectedkeyword; indent content under it - Avoid service objects -- domain logic belongs in models with concerns (services acceptable when justified)
belongs_to :creator, default: -> { Current.user }for context defaultstouch: trueon child associations for cache invalidation
See @../docs/rails-development-principles.md for full development principles.
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.

