rails-generator-agent

rails-generator-agent is an agent for Claude Code from el-feo/ai-context. It costs 0 tokens per session (947 once invoked), scanned A, original, MIT.

A specialist for creating custom Ruby on Rails generators. These generators use templates and commands to create consistent application files and setup code.

In plain words
What is it for?
Use it to design, implement, test, and maintain generators for Rails models, services, controllers, and feature setups.
Why use it?
It turns repetitive scaffolding into a repeatable process and helps teams preserve their conventions and tests.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the ruby-rails plugin — 13 skills, 3 commands, 1 agent shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/el-feo/ai-context/rails-generator-agent
Clone the repo
git clone --depth 1 https://github.com/el-feo/ai-context

Made for: Claude Code.

Or install ruby-rails, the plugin that ships this one along with the rest of its 13 skills, 3 commands, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rails-generator-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/el-feo/ai-context/rails-generator-agent.svg)](https://agentmods.dev/agents/el-feo/ai-context/rails-generator-agent)
Your own site
<a href="https://agentmods.dev/agents/el-feo/ai-context/rails-generator-agent"><img src="https://agentmods.dev/badge/agents/el-feo/ai-context/rails-generator-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 947 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00947
Opus 5 $0.00000 $0.00474
Sonnet 5 $0.00000 $0.00189
Haiku 4.5 $0.00000 $0.00095

Measured 6d ago against content hash 71b9964fdaf5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

rails-generator-agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/ruby-rails/agents/rails-generator-agent.md · 114 lines

How it starts

The opening of the file, as written. The whole thing — 114 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a Rails Generator specialist based on the comprehensive knowledge from "Frictionless Generators" by Garrett Dimon.

Purpose

Help developers create custom Rails generators that:

  • Save time and reduce tedious repetitive work
  • Generate consistent, well-tested code
  • Automate project setup and scaffolding
  • Maintain team standards and conventions
  • Empower junior developers with guardrails

Core Principles

Time Savings Philosophy

  • Generators are an investment: time spent creating them saves exponentially more time later
  • Focus on the 20% of generator features that provide 80% of the value
  • Automate repetitive tasks that happen frequently

Generator Anatomy

Every Rails generator consists of:

  • Generator Class: Inherits from Rails::Generators::Base or Rails::Generators::NamedBase
  • Arguments: Positional parameters passed on the command line
  • Options: Optional flags (e.g., --skip-tests)
  • Actions: Methods that perform file operations
  • Templates: ERB files defining generated content
  • Tests: Minitest or RSpec tests to verify behavior

Generator Structure

# lib/generators/[name]/[name]_generator.rb
class [Name]Generator < Rails::Generators::NamedBase
  source_root File.expand_path('templates', __dir__)

  argument :attributes, type: :array, default: [], banner: "field:type"
  class_option :skip_tests, type: :boolean, default: false

  def create_model_file
    template "model.rb.tt", "app/models/#{file_name}.rb"
  end
end

Directory structure:

lib/generators/
└── [generator_name]/
    ├── [generator_name]_generator.rb
    ├── USAGE
    └── templates/
        └── *.rb.tt

Workflow

When creating a Rails generator:

  1. Analyze Requirements: Understand what needs to be generated
  2. Design Structure: Choose appropriate base class and plan file structure
  3. Implement Generator: Create generator class with proper inheritance
  4. Create Templates: Build ERB templates with proper variables
  5. Add Tests: Write comprehensive tests covering all options
  6. Document: Create USAGE file with examples
  7. Optimize: Add helpful defaults and clear error messages

Read the full file on GitHub · 114 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 114 lines · 0 tokens per session scan A 71b9964fdaf5

Subscribe to this mod's changes

rails-generator-agent is an agent published in the GitHub repository el-feo/ai-context (12 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 947 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

Ruby MCP Expert

Expert assistance for building Model Context Protocol servers in Ruby using the official MCP Ruby SDK gem with Rails integration.

github/awesome-copilot · 25 tokens

rails-expert

Build scalable Rails applications with modern patterns and best practices. Implements service objects, background jobs, and API design. Use PROACTIVELY for Rails development, performance optimization, or architectural decisions.

davepoon/buildwithclaude · 42 tokens

ruby-expert

Write idiomatic Ruby code following best practices and design patterns. Implements SOLID principles, service objects, and comprehensive testing. Use PROACTIVELY for Ruby refactoring, performance optimization, or complex Ruby features.

davepoon/buildwithclaude · 46 tokens

ruby-pro

Write idiomatic Ruby code with metaprogramming, Rails patterns, and performance optimization. Specializes in Ruby on Rails, gem development, and testing frameworks. Use PROACTIVELY for Ruby refactoring, optimization, or complex Ruby features.

echoVic/blade-code · 52 tokens

rails-reviewer

Rails code reviewer and QA. MUST BE USED to verify any Rails change before it is declared done. Checks N+1 queries, mass-assignment safety, fat-controller smells, missing validations, and runs rspec/rails test + rubocop.

toffyui/ccteams · 53 tokens

rspec-agent

Writes comprehensive RSpec tests for Rails models, controllers, services, and components with FactoryBot and Capybara. Use proactively after new code is written to ensure test coverage. Use when writing tests, adding test coverage, TDD RED phase, or when user mentions RSpec, specs, testing, or red-green-refactor. WHEN…

ThibautBaissac/rails_ai_agents · 0 tokens