ClaudeOnRails: A framework for Ruby on Rails developers using Claude Code

5 hours ago 2

A Rails development framework that leverages claude-swarm to create an intelligent team of AI agents specialized in different aspects of Rails development.

Instead of managing personas manually, ClaudeOnRails automatically orchestrates a swarm of specialized agents that work together like a real development team. Simply describe what you want to build, and the swarm handles the rest.

ClaudeOnRails creates a team of specialized AI agents:

  • Architect: Coordinates development and makes high-level decisions
  • Models: Handles ActiveRecord, migrations, and database design
  • Controllers: Manages routing and request handling
  • Views: Creates UI templates and manages assets
  • Services: Implements business logic and service objects
  • Tests: Ensures comprehensive test coverage
  • DevOps: Handles deployment and infrastructure

Each agent works in their specific domain (directory) and can collaborate with other agents to implement complex features.

Add to your Rails application's Gemfile:

group :development do gem 'claude-on-rails' end

Then run:

bundle install rails generate claude_on_rails:swarm

This will:

  • Analyze your Rails project structure
  • Generate a customized swarm configuration
  • Create agent-specific prompts
  • Set up your development environment

Start Your Development Swarm

# In your Rails project directory claude-swarm

Natural Language Development

Once the swarm is running, just describe what you want to build in the Claude interface:

> Add user authentication with email confirmation [The architect coordinates the implementation across all agents] > Create a shopping cart with Stripe payment integration [Complex features are automatically broken down and implemented] > Optimize the dashboard - it's loading too slowly [Performance improvements across the stack] > Build a RESTful API for our mobile app with JWT auth [API development with authentication]

The swarm automatically:

  • Analyzes your request
  • Delegates to appropriate specialists
  • Implements across all layers (models, controllers, views, tests)
  • Follows Rails best practices
  • Ensures test coverage

Traditional Rails Development with AI

When using AI assistants for Rails development, you typically need to:

  • Manually coordinate different aspects of implementation
  • Switch contexts between models, controllers, views, and tests
  • Ensure consistency across different parts of your application
  • Remember to implement tests, security, and performance considerations

With ClaudeOnRails, you simply describe what you want in natural language:

> Create a user system with social login

The swarm automatically:

  • Creates models with proper validations and associations
  • Implements controllers with authentication logic
  • Builds views with forms and UI components
  • Adds comprehensive test coverage
  • Handles security considerations
  • Optimizes database queries

All coordinated by specialized agents working together.

After running the generator, you'll have:

your-rails-app/ ├── claude-swarm.yml # Swarm configuration ├── CLAUDE.md # Project-specific Claude config └── .claude-on-rails/ └── prompts/ # Agent-specific prompts ├── architect.md ├── models.md ├── controllers.md └── ...

The generated claude-swarm.yml can be customized:

instances: architect: description: "Your project-specific architect description" connections: [models, controllers, custom_agent] custom_agent: description: "Specialized agent for your domain" directory: ./app/custom prompt_file: .claude-on-rails/prompts/custom.md

Customize agent behavior by editing prompts in .claude-on-rails/prompts/:

  • Add project-specific conventions
  • Include domain knowledge
  • Define coding standards
  • Automatic Agent Selection: No need to choose which persona to use
  • Collaborative Implementation: Agents work together like a real team
  • Rails-Aware: Deep understanding of Rails conventions and best practices
  • Project Adaptation: Detects your project structure and adapts accordingly
  • Test-Driven: Automatic test generation for all code
  • Performance Focus: Built-in optimization capabilities
  • Ruby 2.7+
  • Rails 6.0+
  • Claude Code CLI (npm install -g @anthropic-ai/claude-code)
  • claude_swarm gem (automatically installed as a dependency)

See the examples directory for:

  • E-commerce platform development
  • API-only applications
  • Real-time features with Turbo/Stimulus
  • Performance optimization workflows

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

MIT License - see LICENSE for details.

Read Entire Article