← Discover MCPs and Agents
r
AgentAI & MLGitHub

rails_ai_agents

Specialized AI skills, agents, rules and hooks for modern Rails AI driven-development + Spec-Driven-Development kit + MCP

Links

README

From the repo.

Rails AI Agents

A production-ready Claude Code setup for Ruby on Rails development: 19 specialized agents, 26 slash commands (including the SDD kit), 18 skills, 14 rules (11 path-scoped + 3 always-on), 1 MCP, and 6 lifecycle hooks. Drop it into your project and your AI assistant instantly knows Rails conventions, TDD workflows, and production patterns.

Also includes:

  • Spec Driven Development (SDD) kit — a full specification-to-implementation pipeline + lightweight mode for bug fixes.
  • a separate 37signals-style conventions pack (.claude_37signals/) for teams that prefer rich models + Minitest over the default layered setup.
  • Claude Code Extensibility Guide
  • and more!

Latest Updates

  • Add caveman rule with full intensity level (token reduction)
  • Add plan, review, and PR artifact commands.
  • Add tmux session launcher script for Rails development.

Quick Start

# Most projects: copy the default .claude/ directory into your Rails project
cp -r .claude/ /path/to/your-rails-app/.claude/
If you want...Copy
Default setup (layered architecture, RSpec, Pundit, PostgreSQL).claude/
37signals-style conventions (rich models, concerns, Minitest).claude_37signals/ instead of .claude/
Spec Driven Development commands (/sdd:*, /sdd-change:*).specify/ in addition to your chosen .claude* pack
Statuslinestatusline/
Sentry integrationmcp/sentry_monitor/

.specify/ is optional unless you want the SDD workflow. .claude_37signals/ is currently a conventions pack (instructions, agents, skills, rules, settings), while the slash-command set documented below lives under .claude/commands/.

OpenAI Codex and GitHub Copilot Support

This repo includes a practical setup for both OpenAI Codex and GitHub Copilot (including different Copilot-backed models such as GPT, Claude, and Gemini), while keeping .claude/ as the canonical source.

  • AGENTS.md is the shared high-level project instruction file.
  • .agents/skills/ is the mirrored skills directory used by Codex and reusable from Copilot.
  • .claude/skills/ remains the canonical source for shared skills.
  • .github/copilot-instructions.md is the Copilot entrypoint.
  • .github/instructions/claude-rules/ contains generated path-scoped bridge files that point back to .claude/rules/.

Because Codex skill discovery is currently unreliable with symlinks, this repo includes a local sync script that copies Claude skills into real directories:

scripts/sync_claude_skills_to_codex.sh
scripts/sync_claude_rules_to_copilot.sh

Run these scripts after adding, removing, or renaming any skill or rule. If Codex or Copilot is already running, restart or reload the chat session to pick up updates.

What's Inside

Agents (.claude/agents/)

19 specialist agents, each with permissionMode: acceptEdits, memory: project, maxTurns limits, and WHEN/WHEN NOT descriptions for auto-delegation.

AgentDomainModel
model-agentActiveRecord models, validations, associations, scopessonnet
controller-agentThin RESTful controllers, strong params, Punditsonnet
service-agentService objects, Result pattern, SOLIDsonnet
migration-agentSafe, reversible database migrationshaiku
policy-agentPundit authorization policiessonnet
form-agentMulti-model forms, wizard formssonnet
query-agentComplex queries, N+1 preventionsonnet
presenter-agentView logic separation with SimpleDelegatorsonnet
viewcomponent-agentReusable, tested UI componentssonnet
job-agentBackground jobs with Solid Queuesonnet
mailer-agentActionMailer with previews and templatessonnet
turbo-agentTurbo Frames, Streams, Drivesonnet
stimulus-agentStimulus controllerssonnet
tailwind-agentTailwind CSS stylingsonnet
rspec-agentRSpec testssonnet
implementation-agentTDD GREEN phase orchestrator (worktree isolation)sonnet
tdd-refactoring-agentTDD REFACTOR phasesonnet
lint-agentRuboCop linting and auto-correctionhaiku
database-reviewerPostgreSQL query optimization, schema design, performancesonnet

Commands (.claude/commands/)

26 slash commands across 4 namespaces. See also SDD commands below.

Standalone (7)

CommandPurpose
/feature-specStructured interview to write a complete spec with Gherkin scenarios
/feature-spec-reviewScores specs, identifies gaps, generates missing scenarios
/feature-planConverts spec into TDD implementation plan with PR breakdown
/feature-tdd-implementationGuides full Red-Green-Refactor TDD workflow
/frame-problemReframes vague requests into clear problems
/prompt-improverScores and rewrites vague prompts into specific, actionable ones
/catchup"Welcome back" report on a feature branch — commits, authors, themes, and risks since the dev's last contribution

Sentry Commands (.claude/commands/sentry/)

CommandPurpose
/sentry:monitorCheck for new production errors and propose fixes
/sentry:fix-errorLaunch a background agent in an isolated worktree to fix a Sentry error
/sentry:fix-statusList all active Sentry fix branches and their status
/sentry:reportGenerate a markdown summary of Sentry error status for standups or PRs
/sentry:resolveResolve, ignore, or reopen a Sentry issue after a fix is deployed

Skills (.claude/skills/)

18 skills with reference docs. Two patterns: task skills (user-invocable workflows) and knowledge skills (auto-loaded conventions).

SkillTypePurpose
code-reviewTaskSOLID analysis, N+1 detection, anti-patterns (read-only)
security-auditTaskOWASP Top 10 audit with Brakeman (runs with opus)
accessibility-reviewTaskWCAG 2.2 AA audit with axe-core / Lighthouse / Pa11y, progressive-disclosure references for ARIA patterns and Rails snippets (runs with opus)
codex-reviewTaskIndependent second opinion from OpenAI Codex CLI on plans, diffs, or specs
dependabot-reviewTaskReviews Dependabot gem upgrade PRs for breaking changes and merge readiness
behavioral-guidelinesKnowledgeGuidelines to reduce common LLM coding mistakes (auto-loaded)
rails-architectureKnowledgeLayered architecture decisions (runs with opus)
postgres-patternsKnowledgePostgreSQL query optimization, schema design, indexing, and security
authentication-flowKnowledgeRails 8 built-in authentication
caching-strategiesKnowledgeFragment, Russian doll, low-level caching
performance-optimizationKnowledgeN+1 detection, query optimization
extraction-timingKnowledgeWhen and how to extract services, queries, concerns
action-cable-patternsKnowledgeWebSocket real-time features
active-storage-setupKnowledgeFile uploads and variants
api-versioningKnowledgeRESTful API design
i18n-patternsKnowledgeInternationalization
solid-queue-setupKnowledgeBackground job configuration
rails-concernKnowledgeShared behavior with concerns

Rules (.claude/rules/)

14 rules: 11 path-scoped (auto-load when Claude works on matching files) and 3 always-on.

Path-scoped (11)

RuleScoped to
models.mdapp/models/**, spec/models/**, spec/factories/**
controllers.mdapp/controllers/**, spec/requests/**
services.mdapp/services/**, spec/services/**
queries.mdapp/queries/**, spec/queries/**
policies.mdapp/policies/**, spec/policies/**
jobs.mdapp/jobs/**, spec/jobs/**
mailers.mdapp/mailers/**, spec/mailers/**
migrations.mddb/migrate/**, db/schema.rb
views.mdapp/views/**, app/components/**, app/presenters/**
testing.mdspec/**
anti-patterns.mdapp/**/*.rb, spec/**/*.rb

Always-on (3)

RulePurpose
principles.mdKISS, DRY, YAGNI, SRP, and Rails architecture principles
cli.mdRails CLI commands reference (dev server, tests, db, generators)
cli-tools.mdPreferred CLI tools: rg over grep, fd over find

Hooks (.claude/settings.json)

HookEventWhat it does
SessionStartSession beginsInjects project context (branch, Ruby/Rails version, pending migrations)
PostToolUseAfter Edit/WriteAuto-formats Ruby files with RuboCop
PreToolUseBefore BashBlocks destructive commands (rm -rf, DROP TABLE, force push to main)
TaskCompletedTask marked doneQuality gate: reminds to run tests and linting
StopResponse endsDesktop notification

Settings

  • Agent Teams enabled (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS)
  • JSON Schema for editor autocomplete
  • Smart model routing: opus for architecture/security, sonnet for coding, haiku for linting

Statusline (statusline/)

A two-line statusline that surfaces the signals you actually need while working: git state, model, and usage budgets.

Statusline

  • Line 1 — current branch (with a marker when the working tree is dirty), model name, and reasoning effort level
  • Line 2 — context window usage, 5-hour rate-limit usage with reset countdown, 7-day rate-limit usage with reset countdown
  • Color-coded thresholds — green under 50%, yellow 50–79%, red at 80%+ so you can see budget pressure at a glance

Wire it up in ~/.claude/settings.json:

{
  "statusLine": {
    "type": "command",
    "command": "bash /absolute/path/to/statusline/statusline.sh"
  }
}

Spec Driven Development (SDD) Kit

A structured specification-to-implementation pipeline powered by 11 slash commands. SDD enforces a disciplined workflow: define what you're building before writing code, validate requirements quality, then implement from a task plan.

SDD Commands (.claude/commands/sdd/)

CommandPurpose
/sdd:constitutionCreate or update the project constitution — core principles and governance rules
/sdd:specifyGenerate a feature specification from a natural language description
/sdd:clarifyAsk up to 5 targeted questions to reduce ambiguity in the spec
/sdd:spec-reviewAdversarial review of the spec from security, performance, edge-case, scalability, and compliance perspectives
/sdd:checklistGenerate a requirements quality checklist
/sdd:planCreate a technical implementation plan with research, data model, and contracts
/sdd:tasksBreak the plan into dependency-ordered, executable tasks organized by user story
/sdd:analyzeRead-only consistency analysis across spec, plan, and tasks
/sdd:implementExecute the task plan phase-by-phase with progress tracking
/sdd:implement-subagentsSame as implement, but spawns a fresh-context subagent per task to prevent context rot on large features
/sdd:validatePost-implementation drift detection — verifies code implements what the spec promises (4-layer hybrid, no annotations needed)

SDD Workflow

/sdd:constitution                  # 1. Define project principles (once)
/sdd:specify user authentication   # 2. Write the feature spec
/sdd:clarify                       # 3. Resolve ambiguities (optional)
/sdd:spec-review                   # 4. Adversarial review from 5 perspectives (optional)
/sdd:checklist security            # 5. Validate requirements quality (optional)
/sdd:plan                          # 6. Generate technical plan + data model
/sdd:tasks                         # 7. Break into ordered tasks
/sdd:analyze                       # 8. Cross-artifact consistency check
/sdd:implement                     # 9. Execute tasks with verification
# Or for large features:
/sdd:implement-subagents           # 9. Fresh-context subagent per task (prevents context rot)
/sdd:validate                      # 10. Verify implementation matches spec (post-implementation)

Each command hands off to the next via suggested prompts. The pipeline creates a specs/<branch-name>/ directory with all artifacts:

specs/001-user-auth/
├── spec.md           # Feature specification (/sdd:specify)
├── plan.md           # Implementation plan (/sdd:plan)
├── research.md       # Technical research & decisions (/sdd:plan)
├── data-model.md     # Entity definitions (/sdd:plan)
├── quickstart.md     # Integration scenarios (/sdd:plan)
├── contracts/        # Route and API contracts (/sdd:plan)
├── tasks.md          # Executable task list (/sdd:tasks)
├── checklists/       # Requirements quality checklists (/sdd:checklist)
└── validation-report.md  # Post-implementation drift report (/sdd:validate)

SDD Infrastructure (.specify/)

The .specify/ directory contains the scaffolding that powers SDD commands. It is optional for normal prompting; you only need it for the /sdd:* and /sdd-change:* workflows:

  • templates/ — Markdown templates for specs, plans, tasks, checklists, constitutions, and agent context files
  • scripts/bash/ — Shell scripts for branch creation, prerequisite checking, plan setup, and agent context updates
  • memory/ — Persistent project state (constitution, lessons learned across features)
  • init-options.json — Configuration (branch numbering mode, AI agent type)

SDD supports extensibility via .specify/extensions.yml for before/after hooks on any command, template overrides in .specify/templates/overrides/, and presets in .specify/presets/.

Key SDD Concepts

  • Constitution — Non-negotiable project principles validated at every planning gate
  • Lessons Learned — Cross-feature learnings accumulate in .specify/memory/lessons-learned.md and feed into future planning and implementation
  • Adversarial Spec Review/sdd:spec-review challenges the spec from security, performance, edge-case, scalability, and compliance perspectives before planning begins
  • Specs are stakeholder-facing — No implementation details; focus on WHAT and WHY
  • Checklists are "unit tests for English" — They validate requirements quality, not implementation correctness
  • Tasks organized by user story — Each story is independently implementable and testable (MVP-first)
  • Fresh-context implementation/sdd:implement-subagents spawns a clean subagent per task, preventing context rot on large features
  • Post-implementation validation/sdd:validate uses a 4-layer hybrid approach (structural scan, test mapping, AI semantic analysis, acceptance test generation) to verify the code matches the spec — works on day one, no code annotations needed

SDD Small-Change (Lightweight Mode)

For bug fixes and small features that don't need the full SDD ceremony. Three commands, no plan, no checklists, no analysis — just specify, task, implement.

Commands (.claude/commands/sdd-change/)

CommandPurpose
/sdd-change:specifyCreate a minimal change spec (problem, fix, acceptance criteria, files affected)
/sdd-change:tasksGenerate a flat 3-8 task list from the change spec
/sdd-change:implementExecute tasks sequentially with validation

Workflow

/sdd-change:specify Fix login timeout — sessions expire after 5min instead of 30
/sdd-change:tasks
/sdd-change:implement

When to Use Which

SituationUse
Bug fix, patch, tweak/sdd-change:specify
New feature, multi-story epic/sdd:specify
Refactor touching 1-3 files/sdd-change:specify
Refactor touching 6+ files/sdd:specify

The lightweight pipeline warns you if your change looks too complex (>3 acceptance criteria or >6 files affected) and suggests switching to the full pipeline.

Scripts (scripts/)

ScriptPurpose
start_rails_tmux.shOpen (or reuse) a tmux session with a three-pane main-vertical layout: editor on the left, bin/dev (or bin/rails server) top-right, bin/rails console bottom-right. Idempotent — re-running attaches to the existing session and auto-restarts any pane that has dropped back to a shell prompt.
sync_claude_skills_to_codex.shMirror .claude/skills/ into .agents/skills/ for OpenAI Codex compatibility
sync_claude_rules_to_copilot.shGenerate .github/instructions/claude-rules/ bridge files from .claude/rules/ for GitHub Copilot

MCP Servers (mcp/)

Custom MCP servers that extend Claude Code with external integrations.

ServerPurposeDocs
sentry_monitorExposes Sentry production errors as Claude Code tools — query issues, map stack traces to local files, detect new errors with persistent state tracking, PII redaction by defaultREADME

Documentation

DocumentPurpose
Your First SDD FeatureStep-by-step onboarding walkthrough for new developers using the SDD kit
SDD Team Scalability AnalysisRisks, gaps, and roadmap for scaling SDD to a 30-developer team
Rails Development PrinciplesUniversal software principles, Rails doctrine, modern Rails 8 architecture, testing, security, and performance
Prompt Engineering for Claude CodeWriting effective prompts for Claude Code in web development, with Rails-specific patterns
Claude Code Extensibility GuideAll extension mechanisms: CLAUDE.md, skills, hooks, subagents, Agent Teams, MCP servers, and plugins
Claude Code Frontmatter ReferenceYAML frontmatter syntax for configuring agents, skills, and commands in .claude/ files
MCP Servers for RailsExtending Claude Code with Model Context Protocol servers for Rails, databases, and APIs
PRD Best PracticesWriting effective Product Requirements Documents in agile, AI-in-the-loop environments
Technical Design DocumentsTDDs, ADRs, and Engineering RFCs for agentic SDLC teams
Design SpecificationsUI/UX design specs and API specifications (OpenAPI) for frontend/backend contracts
Specification Document HierarchyReference map showing which documents answer which core questions
AI Terminology Glossary289 AI/ML terms across 25 categories — also available as a browsable HTML version

License

MIT

Collected info

  • 664 stars
  • 82 forks
  • Language: Shell
  • Source updated: 9/17/2026