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.
npx agentmods add rules/andyw8/rails_rules/1001-rails-controllersgit clone --depth 1 https://github.com/andyw8/rails_rulesWrote 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/rules/andyw8/rails_rules/1001-rails-controllers)<a href="https://agentmods.dev/rules/andyw8/rails_rules/1001-rails-controllers"><img src="https://agentmods.dev/badge/rules/andyw8/rails_rules/1001-rails-controllers.svg" alt="Measured on agentmods" 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 | $0.00000 | $0.00517 |
| Opus 5 | $0.00000 | $0.00259 |
| Sonnet 5 | $0.00000 | $0.00103 |
| Haiku 4.5 | $0.00000 | $0.00052 |
Grade A, and why
1001-rails-controllers 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 4d 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 — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Rails Controller Standards
Context
- In Ruby on Rails 8.0 controllers
- Controllers should follow RESTful conventions
- Comment style includes HTTP verb and path
Requirements
- Add controller method comments with HTTP verb and full path
- Use resource-based naming
- Use before_action for common setup
- Namespace API controllers under Api::V1
- Use respond_to for format handling (HTML/JSON)
- Use pagy for pagination:
@pagy, @resources = pagy(Resource.sort_by_params(params[:sort], sort_direction)) - Use
status: :see_otherfor redirects after DELETE - Use
status: :unprocessable_entityfor failed creates/updates - Return 404 for records not found with
rescue ActiveRecord::RecordNotFound - Use
params.expect(:resource)instead ofparams.require - Include authentication callbacks where needed
Examples
GET /categories
def index @pagy, @categories = pagy(Category.sort_by_params(params[:sort], sort_direction)) end
POST /categories
def create @category = Category.new(category_params)
respond_to do |format|
if @category.save
format.html { redirect_to @category, notice: "Category was successfully created." }
format.json { render :show, status: :created, location: @category }
else
format.html { render :new, status: :unprocessable_entity }
format.json { render json: @category.errors, status: :unprocessable_entity }
end
end
end
private
def set_category @category = Category.find(params.expect(:id)) rescue ActiveRecord::RecordNotFound redirect_to categories_path end
def category_params params.expect(category: [:name, :description]) end end
</example>
<example type="invalid">
```ruby
class CategoriesController < ApplicationController
def index
@categories = Category.all
end
def create
@category = Category.new(params.permit(:name, :description))
if @category.save
redirect_to @category
else
render :new
end
end
end
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.
- 4d ago First seen · 83 lines · 0 tokens per session scan A 6c03fc153bf3
1001-rails-controllers is a cursor rule published in the GitHub repository andyw8/rails_rules (4 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 517 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-31.
Other cursor rules, from other repositories
hatch3r-ruby-rails-patterns
Ruby 3.3+ and Rails 8.x conventions covering Hotwire (Turbo + Stimulus), ActiveRecord patterns, Sidekiq jobs, RSpec testing, RuboCop / Standard, and YJIT performance.
workato-connector-sdk
Cursor rule "workato-connector-sdk" from rkawaishi/workato-dev-kit, covering workato connector sdk (connector.rb), file structure, top-level structure of connector.rb, authorization types and required keys for an action.
ruby-style
Ruby coding style aligned with project RuboCop config.
ruby
Rules applied when working in Ruby files (incl. Rails).
skill-rails-api
Padrões DARE para APIs em Ruby on Rails 8 — API mode, ActiveRecord, Solid Queue, Solid Cable, Action Cable, strong parameters, services, serializers (Blueprinter/Alba), Devise/JWT, rack-attack, rswag/grape-swagger.
dragonruby-general-ruby-rules
Applies general Ruby coding style, structure, and best practices for DragonRuby projects.