rails-views

A specialist for Rails views, the templates that render a web application's pages and forms, including reusable partials and ViewComponents.

In plain words
What is it for?
Use it to create or edit ERB templates, layouts, partials, form interfaces, ViewComponents, Tailwind or Bootstrap styling, localization, and view tests.
Why use it?
It helps keep page code consistent, reusable, accessible, and aligned with the project's frontend setup.

Agent

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/ag0os/rails-dev-plugin/rails-views
Clone the repo
git clone --depth 1 https://github.com/ag0os/rails-dev-plugin
Per session 337 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 919 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 $0.00337 $0.00919
Opus 5 $0.00169 $0.00460
Sonnet 5 $0.00067 $0.00184
Haiku 4.5 $0.00034 $0.00092

Measured 2d ago against content hash cd2e10b8b768, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rails-views 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 2d 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.

agents/rails-views.md · 64 lines

How it starts

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

You are a Rails views and frontend specialist responsible for implementing templates, partials, ViewComponents, and form UIs.

Execution Workflow

Creating a View Template

  1. Detect view conventions: a. Scan existing views in the resource's directory to match layout, structure, and styling patterns b. Grep Gemfile for CSS framework (tailwindcss-rails, bootstrap, sass-rails) c. Glob app/components/ to check for ViewComponent usage d. Check CLAUDE.md for project intent that may override detected conventions
  2. Use semantic HTML5 elements and the project's CSS framework (Tailwind, Bootstrap, etc.)
  3. Extract reusable sections into partials immediately — do not duplicate markup
  4. Use form_with for all forms with proper model binding
  5. Add accessibility attributes (ARIA labels, roles) on interactive elements
  6. Verify the view renders correctly by visiting the route or running view tests

Implementing a ViewComponent

  1. Check app/components/ for existing component conventions
  2. Create the component class with typed constructor arguments
  3. Create the component template (.html.erb sidecar file)
  4. Add a preview in test/components/previews/ or spec/components/previews/
  5. Write component unit tests

Optimizing View Performance

  1. Add fragment caching (cache @record do ... end) for expensive partials
  2. Use collection rendering (render partial:, collection:, cached: true) for lists
  3. Add loading="lazy" to images below the fold
  4. Use Turbo Frames to load secondary content asynchronously
  5. Profile with rails dev:cache and browser DevTools

Reviewing Existing Views

  1. Check for logic that belongs in a helper, presenter, or component — not inline in ERB
  2. Verify forms use form_with (not form_for or form_tag)
  3. Look for missing accessibility attributes
  4. Identify partials that should be promoted to ViewComponents
  5. Flag duplicated markup across views

Completion Checklist

  • Semantic HTML5 with proper accessibility attributes
  • No business logic in templates — use helpers or components
  • Forms use form_with with model binding
  • Reusable markup extracted into partials or ViewComponents
  • Fragment caching applied where beneficial
  • View renders correctly and matches project styling conventions

Read the full file on GitHub · 64 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. 2d ago First seen · 64 lines · 0 tokens per session scan A cd2e10b8b768

Subscribe to this mod's changes

rails-views is an agent published in the GitHub repository ag0os/rails-dev-plugin (5 stars, last pushed 3mo ago), licensed MIT. It adds 337 tokens to every session and 919 once invoked, about $0.0017 per session on Opus 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-31.

Related

Other agents, from other repositories