Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/el-feo/ai-contextnpx agentmods add skills/el-feo/ai-context/rails-generatorsWrote 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.
[](https://agentmods.dev/skills/el-feo/ai-context/rails-generators)<a href="https://agentmods.dev/skills/el-feo/ai-context/rails-generators"><img src="https://agentmods.dev/badge/skills/el-feo/ai-context/rails-generators/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/el-feo/ai-context/rails-generators"><img src="https://agentmods.dev/badge/skills/el-feo/ai-context/rails-generators.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00083 | $0.03660 |
| Opus 5.5 | $0.00033 | $0.01464 |
| Sonnet 5.5 | $0.00017 | $0.00732 |
| Haiku 4.5 | $0.00008 | $0.00366 |
Grade A, and why
rails-generators 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 3mo 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.
How it starts
The opening of the file, as written. The whole thing — 458 lines — stays where its author put it; the contents beside it link to each section on GitHub.
<quick_start> <basic_generator> Create a simple service object generator:
# lib/generators/service/service_generator.rb
module Generators
class ServiceGenerator < Rails::Generators::NamedBase
source_root File.expand_path('templates', __dir__)
def create_service_file
template 'service.rb.tt', "app/services/#{file_name}_service.rb"
end
def create_service_test
template 'service_test.rb.tt', "test/services/#{file_name}_service_test.rb"
end
end
end
Template file (templates/service.rb.tt):
class <%= class_name %>Service
def initialize
end
def call
# Implementation goes here
end
end
Invoke with: rails generate service payment_processor
</basic_generator>
<usage_pattern>
Generator location: lib/generators/[name]/[name]_generator.rb
Template location: lib/generators/[name]/templates/
Test location: test/generators/[name]_generator_test.rb
</usage_pattern>
</quick_start>
- Enforce architectural patterns: Service objects, form objects, presenters, query objects
- Reduce boilerplate: API controllers with standard CRUD, serializers, policy objects
- Maintain consistency: Team conventions for file structure, naming, and organization
- Automate complex setup: Multi-file features with migrations, tests, and documentation
- Override Rails defaults: Customize scaffold behavior for your application's needs </when_to_create>
<rails_8_updates>
Rails 8 introduced the authentication generator (rails generate authentication) which demonstrates modern generator patterns including ActionCable integration, controller concerns, mailer generation, and comprehensive view scaffolding. Study Rails 8 built-in generators for current best practices.
</rails_8_updates>
Rails::Generators::Base: Simple generators without required argumentsRails::Generators::NamedBase: Generators requiring a name argument (providesname,class_name,file_name,plural_name)
class ServiceGenerator < Rails::Generators::NamedBase
# Automatically provides: name, class_name, file_name, plural_name
end
</step_1>
<step_2> Define source root and options:
source_root File.expand_path('templates', __dir__)
class_option :namespace, type: :string, default: nil, desc: "Namespace for the service"
class_option :skip_tests, type: :boolean, default: false, desc: "Skip test files"
Access options with: options[:namespace]
</step_2>
<step_3> Add public methods (executed in definition order):
def create_service_file
template 'service.rb.tt', service_file_path
end
def create_test_file
return if options[:skip_tests]
template 'service_test.rb.tt', test_file_path
end
private
def service_file_path
if options[:namespace]
"app/services/#{options[:namespace]}/#{file_name}_service.rb"
else
"app/services/#{file_name}_service.rb"
end
end
</step_3>
<step_4>
Create ERB templates (.tt extension):
<% if options[:namespace] -%>
module <%= options[:namespace].camelize %>
class <%= class_name %>Service
def call
# Implementation
end
end
end
<% else -%>
class <%= class_name %>Service
def call
# Implementation
end
end
<% end -%>
Important: Use <%% to output literal <% in generated files. See references/templates.md for template patterns.
</step_4>
<step_5> Test the generator (see Testing section):
What ships with it
13 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/api-generator.md 8.6 KB
- references/application-templates.md 9.1 KB
- references/examples.md 5.0 KB
- references/file-actions.md 13 KB
- references/hooks.md 8.8 KB
- references/model-generator.md 11 KB
- references/multitenant-template.md 14 KB
- references/namespacing.md 5.3 KB
- references/scaffold-generator.md 8.0 KB
- references/service-generator.md 17 KB
- references/templates.md 5.5 KB
- references/testing-rails.md 18 KB
- references/testing-rspec.md 6.5 KB
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.
- 3mo ago First seen · 458 lines · 83 tokens per session scan A ec541dd5a321
rails-generators is a skill published in the GitHub repository el-feo/ai-context (12 stars, last pushed 10d ago), licensed MIT. It adds 83 tokens to every session and 3,660 once invoked, about $0.0003 per session on Opus 5.5. 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.
rails-generators compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| rails-generatorsel-feo/ai-context | Skill | 12 | 10d ago | MIT | A | 83 | Claude Code |
| newclacky-ai/openclacky | Skill | 1.2k | yesterday | MIT | A | 10 | Claude Code |
| dhh-rails-styledavekilleen/Dex | Skill | 522 | yesterday | MIT | A | 115 | Claude Code |
| rspec-conventionsrootstrap/rails_api_base | Skill | 635 | 18d ago | MIT | A | 82 | Claude Code |
| ruby-patternssoftspark/ai-toolkit | Skill | 180 | 13d ago | Apache-2.0 | A | 60 | Claude Code |
| rigor-rbs-contractrigortype/rigor | Skill | 108 | yesterday | MPL-2.0 | A | 95 | Claude Code, Codex |
| rails-devtech-leads-club/agent-skills | Skill | 7.2k | 4d ago | none | A | 199 | Claude Code, Codex |