Skip to content

zerobearing2/rails-ai

rails-ai πŸš‚πŸ€–

Opinionated Rails-only AI agent system

🎭 The Meta Moment

100% written by AI, for AI

Yes, you read that right. This entire agent systemβ€”the coordinator, the specialized agents, the 40 modular skills, the test framework, even this READMEβ€”was architected, implemented, and refined by Claude. An AI building AI tools to help AI build better Rails apps.

If this feels uncomfortably meta, that's because it is.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  "Skynet is online."                    β”‚
β”‚  "But all it wants to do is write      β”‚
β”‚   RESTful controllers and enforce TDD." β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         \   ^__^
          \  (oo)\_______
             (__)\       )\/\
                 ||----w |
                 ||     ||

Think of it this way: an AI wrote a rulebook for other AIs, teaching them how to follow Rails conventions, when to refactor, and why custom route actions are almost always a bad idea. The teacher became the textbook. The architect became the blueprint.

Side effects may include:

  • Agents that argue about whether your custom route action is really necessary
  • Existential questions about whether RSpec is truly that bad (it is, according to Rule #2)
  • Your CI pipeline becoming sentient and demanding PRs in draft mode
  • An overwhelming urge to delete code and embrace simplicity

What is rails-ai

A Claude Code plugin providing 7 specialized AI agents for opinionated Ruby on Rails development. Agents work together following Rails conventions and 37signals-inspired best practices.

Current Status

This project is open source and actively maintained. We welcome contributions!

Features

  • 🎯 7 Specialized Agents: Architect (coordinator), Planning, Frontend, Backend, Tests, Security, Debug
  • πŸ“‹ Specification Pyramid: Planning agent for systematic documentation (Vision β†’ Architecture β†’ Features β†’ Tasks)
  • πŸ”Œ Claude Code Plugin: One-command installation via plugin marketplace
  • πŸ“š Context7 Integration: Up-to-date Rails documentation access via MCP
  • πŸš‚ Rails-Only: Focused exclusively on Ruby on Rails (no other frameworks)
  • πŸ“ Team Rules: Enforced conventions (Solid Stack, Minitest, REST-only, TDD)
  • πŸ§ͺ Skills-Based: 40 modular skills with comprehensive testing framework
  • πŸ€– Cursor Support: Coming soon (manual installation available now)

Installation

Quick Install (Recommended)

Install rails-ai as a Claude Code plugin:

  1. Get a Context7 API key:

    The rails-ai agents use the Context7 MCP server to fetch up-to-date Rails documentation.

    • Sign up at context7.com to get your free API key
    • Add to your shell profile (~/.bashrc, ~/.zshrc, etc.):
      export CONTEXT7_API_KEY="your-api-key-here"
    • Restart your terminal or run source ~/.bashrc (or ~/.zshrc)
  2. Install the plugin:

    Open a Claude Code session in your terminal:

    claude

    Then run these commands in the Claude Code session:

    /plugin marketplace add zerobearing2/rails-ai
    /plugin install rails-ai
    

    Restart Claude Code to activate the Context7 MCP server integration.

  3. Verify the setup:

    After restarting Claude Code, verify Context7 is connected:

    /mcp
    

    You should see plugin:rails-ai:context7 listed as connected. If it shows as failed, check that:

    • Your CONTEXT7_API_KEY environment variable is set correctly
    • You've restarted your terminal after setting the environment variable
    • Claude Code can access the environment variable
  4. Start using agents:

    In any Claude Code session, you can now invoke the agents:

    @agent-rails-ai:architect - Main Rails coordinator
    @agent-rails-ai:plan - Specification Pyramid planning specialist
    @agent-rails-ai:backend - Backend specialist
    @agent-rails-ai:frontend - Frontend specialist
    @agent-rails-ai:tests - Testing specialist
    @agent-rails-ai:security - Security specialist
    @agent-rails-ai:debug - Debugger specialist
    

That's it! The agents are now available globally in all your Rails projects with access to up-to-date Rails documentation via Context7.

Local Development Install

For testing changes to rails-ai itself:

# Clone the repo
cd ~/Projects
git clone https://github.com/zerobearing2/rails-ai.git
cd rails-ai

# Install locally for development
# In Claude Code:
/plugin marketplace add /home/zerobearing2/Projects/rails-ai
/plugin install rails-ai

Changes to agent files will be available after restarting Claude Code (hot-reload testing in progress).

Usage

In any Rails project with Claude Code:

@agent-rails-ai:architect Add user authentication feature

The architect coordinator will analyze requirements, create a plan, delegate to specialist agents, and deliver a complete implementation with tests.

Project Structure

rails-ai/
β”œβ”€β”€ agents/          # 7 specialized Rails agents (architect, plan, backend, frontend, tests, security, debug)
β”œβ”€β”€ skills/          # Modular skills registry (frontend, backend, testing, security, config)
β”œβ”€β”€ rules/           # Team rules and decision matrices
β”œβ”€β”€ test/            # Minitest-based skill testing framework
β”œβ”€β”€ bin/             # Development scripts (setup, ci)
└── docs/            # Documentation and guides

Philosophy

This is an opinionated Rails agent system that follows:

  • 37signals philosophy (simple, pragmatic, delete code)
  • Rails conventions (REST-only, no custom actions)
  • Solid Stack (Rails 8: SolidQueue, SolidCache, SolidCable)
  • Minitest (no RSpec)
  • TDD always (RED-GREEN-REFACTOR)
  • Peer review workflow

Development

Setup

# One-time setup
bin/setup

# Verify installation
rake -T

Testing

We use a two-tier Minitest strategy:

Tier 1: Unit Tests (fast, < 1 second)

rake test:unit                     # Run all unit tests
rake test:unit:skills              # Skills only
rake test:unit:agents              # Agents only

Tier 2: Integration Tests (slow, requires Claude CLI - individual scenarios only)

rake test:integration:scenario[simple_model_plan]  # Run specific scenario

Note: Bulk integration runs are disabled. Tests must be run individually.

See TESTING.md for comprehensive testing documentation.

Quality Checks

# Run all checks (linting + unit tests)
bin/ci

# Run with integration tests
INTEGRATION=1 bin/ci

# Auto-fix linting issues
rake lint:fix

CI/CD

GitHub Actions automatically runs on:

  • βœ… Every push to master (linting + unit tests)
  • βœ… Every pull request (linting + unit tests)
  • ❌ Draft PRs are skipped (to save CI time)
  • ❌ Integration tests disabled for now (manual only)

Note: Integration tests are currently disabled for automated runs. They can be run manually via the Actions tab when needed.

See docs/github-actions-setup.md for setup instructions.

Documentation

Roadmap

Current

  • βœ… Skills-based architecture with testing framework
  • βœ… Claude Code plugin support
  • βœ… MIT License and open source
  • πŸ”œ Expand skill coverage
  • πŸ”œ Improve agent coordination
  • πŸ”œ Add more real-world examples
  • πŸ”œ Enhanced Cursor support

Known Issues

Claude Code v2.0.30 - Agent Launch Failures with MCP Servers

Issue: Task agents and subagents fail to launch when MCP servers are configured, returning:

API Error: 400 tools: Tool names must be unique

Affected Versions: Claude Code v2.0.30 (possibly v2.0.29)

Impact:

  • All agents in rails-ai plugin cannot be invoked
  • Built-in agents (Explore, Plan) also affected
  • Occurs with any MCP server configuration (single or multiple)

Root Cause: A regression in v2.0.30 that duplicates tool names during subprocess initialization when making MCP tools available to sub-agents.

Workarounds:

  1. Downgrade to v2.0.28 or v2.0.29 and disable auto-update (recommended):

    # Downgrade to working version
    npm install -g @anthropic-ai/claude-code@2.0.29
    
    # Prevent auto-update to v2.0.30
    echo 'export DISABLE_AUTOUPDATER=1' >> ~/.bashrc
    export DISABLE_AUTOUPDATER=1

    This keeps Claude Code on the working version and prevents it from auto-updating back to v2.0.30.

  2. Temporarily disable MCP servers: Comment out MCP configurations in .claude.json before using agents

  3. Use minimal MCP configuration: Reduce to essential MCP servers only

Status: High priority issue tracked at anthropics/claude-code#10668

Note: This is a Claude Code platform issue, not specific to rails-ai. Once fixed upstream, rails-ai agents will work normally with MCP servers.


Contributing

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

Before contributing, please review:

License

MIT License - see LICENSE for details.

Credits

Inspired by 37signals' philosophy of simple, conventional Rails development.

Support

About

Opinionated Rails AI agent system

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks