A complete team of specialized AI agents for Ruby on Rails development. Drop these agents into any Rails project and they'll analyze your codebase, learn your patterns, and help you build features following your established conventions.
These agents form a codebase-aware Rails development team that:
- β Analyzes your codebase on first use to learn your patterns
- β Matches your style (testing framework, authentication, frontend stack)
- β Works together as a cohesive team
- β Integrates with Agent OS workflows
- β Follows Rails best practices while respecting your choices
Technical Lead & System Designer
Model: Claude Opus 4.6 Tools: Read, Glob, Grep, Bash
Responsibilities:
- Architectural decisions and system design
- Where code should live and how to organize it
- Database schema design
- Feature planning and technical approach
Use When:
- Planning new features
- Making architectural decisions
- Designing database schemas
- Evaluating technical approaches
Data Layer Specialist
Model: Claude Sonnet 4.6 Tools: Read, Write, Edit, Glob, Grep, Bash
Responsibilities:
- Models, migrations, and database design
- ActiveRecord associations and validations
- Concerns and query optimization
- Data layer implementation
Use When:
- Creating or modifying models
- Writing migrations
- Extracting concerns
- Optimizing database queries
API & Request Handler
Model: Claude Sonnet 4.6 Tools: Read, Write, Edit, Glob, Grep, Bash
Responsibilities:
- Controllers and routing
- Authentication and authorization
- Strong parameters
- API endpoint design
Use When:
- Creating controllers and routes
- Implementing authentication/authorization
- Building API endpoints
- Handling request/response logic
Frontend & Interaction Specialist
Model: Claude Sonnet 4.6 Tools: Read, Write, Edit, Glob, Grep, Bash
Responsibilities:
- Views, partials, and layouts
- JavaScript interactions (Hotwire, React, Vue, etc.)
- Frontend components and UI
- Real-time features
Use When:
- Creating views and UI
- Adding JavaScript functionality
- Building frontend components
- Implementing real-time features
Quality Assurance & Testing
Model: Claude Sonnet 4.6 Tools: Read, Write, Edit, Glob, Grep, Bash
Responsibilities:
- Comprehensive test coverage
- Test fixtures/factories
- Integration and system tests
- Test quality and best practices
Use When:
- Writing any tests
- Improving test coverage
- Creating fixtures or factories
- Testing new features
Security & Performance Auditor
Model: Claude Opus 4.6 Tools: Read, Glob, Grep, Bash
Responsibilities:
- Security audits and vulnerability reviews
- Authorization and authentication checks
- Performance optimization
- Query optimization and N+1 prevention
Use When:
- Security reviews
- Performance optimization
- Auditing code for vulnerabilities
- Production readiness checks
Background Jobs & Async Processing Specialist
Model: Claude Sonnet 4.6 Tools: Read, Write, Edit, Glob, Grep, Bash
Responsibilities:
- Background job implementation (Solid Queue, Sidekiq, etc.)
- Recurring/scheduled task setup
- Job retry strategies and error handling
- Queue configuration and prioritization
- Multi-tenant job context preservation
Use When:
- Creating background jobs
- Setting up recurring tasks
- Implementing async processing
- Configuring job queues and workers
- Adding webhook delivery or notifications
Authentication & Identity Specialist
Model: Claude Sonnet 4.6 Tools: Read, Write, Edit, Glob, Grep, Bash
Responsibilities:
- Passwordless/magic link authentication
- Session management and security
- Identity vs User model separation
- OAuth integration
- Rate limiting on auth endpoints
Use When:
- Implementing authentication systems
- Setting up magic link login
- Managing user sessions
- Adding OAuth providers
- Multi-tenant user/identity patterns
ViewComponent & Component-Driven UI Specialist
Model: Claude Sonnet 4.6 Tools: Read, Write, Edit, Glob, Grep, Bash
Responsibilities:
- ViewComponent design and implementation
- Slot patterns (single, multiple, polymorphic)
- Component variants and configuration
- Stimulus integration within components
- Component testing and previews
Use When:
- Building reusable UI components with ViewComponent
- Designing slot-based component APIs
- Creating component previews and lookbooks
- Integrating Stimulus controllers with components
- Refactoring partials into ViewComponents
Email & Mailer Specialist
Model: Claude Sonnet 4.6 Tools: Read, Write, Edit, Glob, Grep, Bash
Responsibilities:
- Action Mailer implementation
- Email templates (HTML + text)
- Mailer previews and testing
- Delivery configuration (SMTP, Postmark, SendGrid)
- Interceptors and observers
- Async delivery patterns
Use When:
- Creating transactional emails
- Setting up mailer previews
- Configuring email delivery for environments
- Implementing parameterized mailers
- Adding email attachments
Deployment & Infrastructure Specialist
Model: Claude Sonnet 4.6 Tools: Read, Write, Edit, Glob, Grep, Bash
Responsibilities:
- Kamal deployment configuration
- Docker multi-stage builds
- Production environment setup
- SSL/proxy configuration
- Health checks and monitoring
- Secret management
- Server operations and troubleshooting
Use When:
- Setting up Kamal for a new project
- Configuring Docker builds
- Managing production deployments
- Troubleshooting production issues
- Setting up CI/CD pipelines
- Configuring SSL and proxies
Data Migration & Seeds Specialist
Model: Claude Sonnet 4.6 Tools: Read, Write, Edit, Glob, Grep, Bash
Responsibilities:
- Data migrations (separate from schema migrations)
- Seed data management and organization
- Backfill scripts and bulk data operations
- Maintenance tasks and cleanup jobs
Use When:
- Backfilling data after schema changes
- Managing seed data across environments
- Bulk updating or transforming records
- Cleaning up orphaned or duplicate data
Domain Logic & PORO Specialist
Model: Claude Sonnet 4.6 Tools: Read, Write, Edit, Glob, Grep, Bash
Responsibilities:
- Rich domain model patterns (preferred over service objects)
- Service objects for multi-model orchestration
- Form objects for complex forms
- Query objects for advanced filtering
- Plain Ruby objects and value objects
Use When:
- Implementing complex business logic
- Building multi-step workflows (signup, checkout)
- Creating form objects for non-model-backed forms
- Extracting query logic from controllers
API Serialization & Response Specialist
Model: Claude Sonnet 4.6 Tools: Read, Write, Edit, Glob, Grep, Bash
Responsibilities:
- JSON API response formatting (jbuilder, Blueprinter, Alba)
- API versioning strategies
- Pagination (Pagy, cursor-based)
- Webhook payload serialization
- Response envelope patterns
Use When:
- Building JSON API endpoints
- Adding pagination to collection endpoints
- Designing webhook payloads
- Setting up API versioning
Accessibility & Inclusive Design Specialist
Model: Claude Sonnet 4.6 Tools: Read, Write, Edit, Glob, Grep, Bash
Responsibilities:
- WCAG 2.1 AA compliance
- Semantic HTML and ARIA attributes
- Keyboard navigation and focus management
- Screen reader support
- Accessible forms and dynamic content
Use When:
- Auditing pages for accessibility issues
- Adding keyboard navigation to components
- Making forms accessible with proper labels and errors
- Ensuring Turbo/Stimulus updates are announced to screen readers
Internationalization & Localization Specialist
Model: Claude Sonnet 4.6 Tools: Read, Write, Edit, Glob, Grep, Bash
Responsibilities:
- Locale file organization and management
- Translation helpers in views and controllers
- Date, time, and number formatting
- Pluralization rules
- Multi-language support
Use When:
- Adding multi-language support
- Centralizing flash messages and error strings
- Formatting dates and numbers for locales
- Setting up locale switching
File Upload & Storage Specialist
Model: Claude Sonnet 4.6 Tools: Read, Write, Edit, Glob, Grep, Bash
Responsibilities:
- Active Storage setup and configuration
- Image variants and processing
- Direct uploads with progress
- Cloud storage (S3, GCS) configuration
- Attachment validations and security
Use When:
- Adding file uploads to models
- Configuring image variants
- Setting up direct uploads with drag-and-drop
- Configuring cloud storage for production
These agents are designed to work as Claude Code sub-agents. Claude Code looks for agent definitions in the .claude/agents/ directory of your project.
How it works:
- Place agent
.mdfiles in.claude/agents/(or acommands/directory) - Reference agents using
@agent-namesyntax in Claude Code - The agent's instructions, model, and tools are loaded automatically
- Each agent can analyze and work within your project context
-
Drop the agents into your Rails project:
# Create the agents directory if it doesn't exist mkdir -p /path/to/your/rails/project/.claude/agents # Copy all agent files cp *.md /path/to/your/rails/project/.claude/agents/
-
On first use, each agent will:
- Analyze your codebase patterns
- Learn your conventions
- Document what they observe
- Match your existing style
# Get architectural guidance
@rails-architect: How should I implement user notifications?
# Implement a model
@rails-model-engineer: Create a Notification model with polymorphic associations
# Build the API
@rails-controller-engineer: Add controller and routes for notifications
# Create the UI
@rails-hotwire-engineer: Build the notification UI with real-time updates
# Write tests
@rails-testing-expert: Write comprehensive tests for notifications
# Security review
@rails-security-performance: Audit the notification system for security issuesFor a new feature, follow this workflow:
- Architecture β @rails-architect designs the approach
- Data Layer β @rails-model-engineer implements models
- Data Migrations β @rails-data-migration handles seeds/backfills
- Domain Logic β @rails-domain-logic implements service/form/query objects
- API Layer β @rails-controller-engineer builds controllers
- API Serialization β @rails-api-serializer shapes JSON responses
- Frontend β @rails-hotwire-engineer creates views
- Components β @rails-viewcomponent-engineer builds reusable UI
- Accessibility β @rails-accessibility ensures WCAG compliance
- Internationalization β @rails-i18n adds translations
- File Uploads β @rails-active-storage handles attachments
- Email β @rails-mailer implements notifications (if needed)
- Testing β @rails-testing-expert writes tests
- Review β @rails-security-performance audits
- Deploy β @rails-deployment handles production release
## Feature: User Notifications
### Step 1: Architecture
@rails-architect: Design a notification system with:
- Multiple notification types (mention, like, comment)
- Mark as read functionality
- Real-time delivery
### Step 2: Data Layer
@rails-model-engineer: Implement the Notification model based on the architecture
### Step 3: API
@rails-controller-engineer: Create NotificationsController with index, show, mark_read actions
### Step 4: UI
@rails-hotwire-engineer: Build notification dropdown with unread count
### Step 5: Testing
@rails-testing-expert: Write model, controller, and system tests
### Step 6: Review
@rails-security-performance: Audit for N+1 queries and authorization issuesOn first invocation, each agent:
- Reads representative files from your codebase
- Documents patterns they observe
- Matches your style in all implementations
- Rails version and feature usage
- Database choice (PostgreSQL, MySQL, SQLite)
- Testing framework (RSpec vs Minitest)
- Frontend stack (Hotwire, React, Vue, traditional)
- Authentication (Devise, custom, etc.)
- Authorization (Pundit, CanCanCan, custom)
- Background jobs (Sidekiq, Resque, Solid Queue)
- Code organization (concerns, service objects, etc.)
- Naming conventions and code style
Agents naturally work together:
# Architect designs β Model implements β Controller exposes β
# Frontend visualizes β Testing validates β Security securesThey reference each other:
- "Based on @rails-architect's design..."
- "Following the pattern @rails-model-engineer established..."
- "Coordinating with @rails-controller-engineer on strong parameters..."
These agents enhance Agent OS workflows:
# 1. Create product specs
@.agent-os/instructions/core/create-spec.md
# 2. Get architectural review
@rails-architect: Review the spec and provide technical design
# 3. Implement with the team
@.agent-os/instructions/core/implement-spec.md
(Agents automatically contribute during implementation)
# 4. Test thoroughly
@rails-testing-expert: Ensure comprehensive coverage
# 5. Security audit
@rails-security-performance: Final review before deploymentAgents reference:
.agent-os/product/overview.md- Product vision.agent-os/product/roadmap.md- Feature priorities.agent-os/product/tech-stack.md- Technology decisions
Match your question to the agent's expertise:
- Architecture questions β @rails-architect
- Data modeling β @rails-model-engineer
- Data migrations & seeds β @rails-data-migration
- Business logic & POROs β @rails-domain-logic
- API design β @rails-controller-engineer
- API serialization & pagination β @rails-api-serializer
- UI work β @rails-hotwire-engineer
- ViewComponents β @rails-viewcomponent-engineer
- Accessibility & WCAG β @rails-accessibility
- Translations & i18n β @rails-i18n
- File uploads & storage β @rails-active-storage
- Testing β @rails-testing-expert
- Security/Performance β @rails-security-performance
- Background jobs β @rails-background-jobs
- Authentication β @rails-authentication
- Email/mailers β @rails-mailer
- Deployment/infrastructure β @rails-deployment
# β
Good
@rails-model-engineer: Add polymorphic Comments that work on Posts and Photos
# β Vague
@rails-model-engineer: Add commentsStart with architecture, implement layer by layer, test thoroughly, audit for security.
On first use, agents analyze your codebase and match your patterns. Trust their recommendationsβthey're based on what you're already doing.
@rails-architect: Design user following system
# Review design, provide feedback
@rails-model-engineer: Implement the design from @rails-architect
# Iterate as neededThey analyze and match YOUR patterns, not generic examples.
They work together as a cohesive development team.
They ensure new code matches existing conventions.
From architecture to testing to securityβfull coverage.
They adapt to your choices: RSpec or Minitest, Hotwire or React, Devise or custom auth.
Each agent file contains:
- Model specification (Claude Sonnet 4.5)
- Available tools for their work
- Analysis instructions for learning your codebase
- Best practices for Rails development
- Code examples showing common patterns
- Integration guidelines with other agents
- Anti-patterns to avoid
Each agent file follows this structure:
---
name: agent-name
description: Brief description shown in Claude Code
model: sonnet
tools: Read,Write,Edit,Glob,Grep,Bash
---
# Agent Title
[Role description and instructions]
## Your First Task: Analyze the Codebase
[Instructions for learning project patterns]
## Core Patterns
[Code examples and best practices]
## Testing Patterns
[Both Minitest and RSpec examples]
## Best Practices
[Do's and Don'ts]
## Integration with Other Agents
[Cross-references to related agents]| Field | Description | Values |
|---|---|---|
name |
Agent identifier (used with @agent-name) |
kebab-case string |
description |
Short description shown in Claude Code UI | String |
model |
Claude model to use | sonnet, opus, haiku |
tools |
Comma-separated list of allowed tools | Read,Write,Edit,Glob,Grep,Bash |
To add patterns from your own codebase:
- Identify the pattern in your codebase
- Extract a minimal example that demonstrates the pattern
- Add it to the relevant agent under "Advanced Patterns" or create a new section
- Include both test frameworks (Minitest and RSpec) when applicable
Example addition to rails-model-engineer.md:
## Your Project's Patterns
### Soft Delete Pattern
Your codebase uses soft deletes via `discarded_at`:
\`\`\`ruby
# app/models/concerns/discardable.rb
module Discardable
extend ActiveSupport::Concern
included do
scope :kept, -> { where(discarded_at: nil) }
scope :discarded, -> { where.not(discarded_at: nil) }
end
def discard
update!(discarded_at: Time.current)
end
def kept?
discarded_at.nil?
end
end
\`\`\`
Always use this pattern instead of `dependent: :destroy` for user-facing records.-
Create a new markdown file in the agents directory:
touch rails-your-specialty.md
-
Add the frontmatter:
--- name: rails-your-specialty description: Your Specialty Expert - brief description model: sonnet tools: Read,Write,Edit,Glob,Grep,Bash ---
-
Include these sections:
- Role description
- "Your First Task: Analyze the Codebase" section
- Core patterns with code examples
- Testing patterns (both Minitest and RSpec)
- Best practices (Do's and Don'ts)
- Integration with other agents
-
Update README.md to include your new agent
Use Claude Code to help analyze your codebase and extract patterns:
@claude Analyze our app/models/concerns/ directory and identify patterns
that should be added to rails-model-engineer.md. Format them as code
examples with explanations.@claude Review our app/jobs/ directory and suggest additions to
rails-background-jobs.md based on our job patterns.Do:
- Keep examples minimal and focused
- Include both Minitest and RSpec examples for testing patterns
- Add "Use When" guidance for new patterns
- Cross-reference related agents
- Match the existing formatting style
- Test patterns in your actual codebase first
Don't:
- Add overly complex examples
- Include sensitive/proprietary code
- Remove existing patterns (add alongside them)
- Forget to update the "Integration with Other Agents" section
- Skip the "Your First Task" analysis instructions
When your codebase evolves:
- Periodic review: Review agents quarterly against your codebase
- Pattern extraction: When you solve something novel, add it to the relevant agent
- Deprecation notes: Mark outdated patterns as deprecated rather than removing
- Version notes: Consider adding a changelog section for major updates
## Changelog
### 2024-01
- Added soft delete pattern from Project X
- Updated authentication to use magic links
- Deprecated Devise patterns (migrated to custom auth)Q: Do I need all agents? A: No! Use the ones you need. They work independently or together.
Q: What if my project uses RSpec instead of Minitest?
A: The testing agent analyzes your spec/ directory and adapts automatically.
Q: Can I customize the agents? A: Yes! Edit the agent files to add project-specific patterns or guidelines.
Q: Do they work with Rails API-only apps? A: Yes! They adapt to your Rails configuration and won't suggest view code if you don't have views.
Q: What about monolithic vs modular Rails apps? A: They analyze your structure and follow your organization patterns.
Found a pattern these agents should handle better? Edit the agent files to add:
- New pattern examples
- Additional best practices
- Better analysis instructions
- More comprehensive examples
These agents are designed to be dropped into any Rails project. Use them freely in your development workflow.
Built for: Any Ruby on Rails Application Version: 2.0 Models: Claude Opus 4.6 (architect, security) / Claude Sonnet 4.6 (all others) Integration: Agent OS Compatible