rails-conventions

rails-conventions is a skill for Claude Code from rootstrap/rails_api_base. It costs 71 tokens per session (1,868 once invoked), scanned A, original, MIT.

A set of conventions for writing and reviewing Ruby on Rails applications, a web framework built with the Ruby programming language. It covers common parts of a Rails project, such as routes, database models, configuration, views, and mailers.

In plain words
What is it for?
Use it when creating, reviewing, or editing Rails controllers, models, migrations, routes, views, mailers, configuration, translations, assets, or logging.
Why use it?
Rails projects can become inconsistent when each developer organizes these parts differently. These conventions provide a shared way to structure and maintain the code.

Skill for Claude Code

Written for Claude Code: paths in frontmatter.

Good fit Use it when creating, reviewing, or editing Rails controllers, models, migrations, routes, views, mailers, configuration, translations, assets, or logging.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rootstrap/rails_api_base/rails-conventions
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.

Any agent
npx skills add rootstrap/rails_api_base --skill rails-conventions
Clone the repo
git clone --depth 1 https://github.com/rootstrap/rails_api_base

Made for: Claude Code.

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-conventions

README.md
[![agentmods](https://agentmods.dev/badge/skills/rootstrap/rails_api_base/rails-conventions/github.svg)](https://agentmods.dev/skills/rootstrap/rails_api_base/rails-conventions)
Your own site
<a href="https://agentmods.dev/skills/rootstrap/rails_api_base/rails-conventions"><img src="https://agentmods.dev/badge/skills/rootstrap/rails_api_base/rails-conventions/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.

agentmods 80×15 button for rails-conventions

Your own site · 80×15
<a href="https://agentmods.dev/skills/rootstrap/rails_api_base/rails-conventions"><img src="https://agentmods.dev/badge/skills/rootstrap/rails_api_base/rails-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,868 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00071 $0.01868
Opus 5.5 $0.00028 $0.00747
Sonnet 5.5 $0.00014 $0.00374
Haiku 4.5 $0.00007 $0.00187

Measured 1mo ago against content hash 12abf296108e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rails-conventions 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 1mo 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.

.claude/skills/rails-conventions/SKILL.md · 156 lines

How it starts

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

Rails Conventions (Rootstrap)

Apply these whenever producing or modifying Rails-specific code. Full guide: https://github.com/rootstrap/tech-guides/blob/master/ruby/rails.md

Complements ruby-conventions (language-level style still applies).

Configuration

  • Custom initialization in config/initializers; one file per gem, named after the gem (e.g. carrierwave.rb).
  • Environment-specific settings in config/environments/; shared settings in config/application.rb.
  • Create a staging environment that mirrors production.
  • Extra YAML config under config/, loaded via Rails::Application.config_for(:yaml_file).
  • Append non-default assets to config.assets.precompile in production.rb (e.g. admin CSS/JS). application.* and non-JS/CSS assets are already included.

Routing

  • Prefer resources over custom routes; use :only/:except to limit routes.
    # bad
    get 'topics/:id', to: 'topics#show'
    # good
    resources :topics, only: :show
    
  • member/collection for extra RESTful actions; use block form when many.
  • Express associations with nested routes; use shallow: true beyond 1 level deep.
  • namespace to group related actions (e.g. admin).
  • Never use the wildcard match ':controller(/:action(/:id(.:format)))' route.
  • Avoid match unless mapping multiple HTTP verbs via :via.

Controllers

  • Keep controllers skinny — no business logic (belongs in models/services).
  • Each action should ideally call only one method beyond an initial find/new.
  • Share at most two instance variables between controller and view.

Rendering

  • Prefer templates/partials over render inline:.
  • render plain: over render text:.
  • Use HTTP status symbols, not numbers.
    # bad
    render status: 500
    # good
    render status: :forbidden
    

Models

  • Introduce non-ActiveRecord model classes freely; short, meaningful names.
  • Use ActiveAttr gem for non-persisted models needing AR-like behavior.
  • Keep models for business logic/persistence; move formatting/HTML concerns to decorators.

Read the full file on GitHub · 156 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. 1mo ago First seen · 156 lines · 71 tokens per session scan A 12abf296108e

Subscribe to this mod's changes

rails-conventions is a skill published in the GitHub repository rootstrap/rails_api_base (633 stars, last pushed yesterday), licensed MIT. It adds 71 tokens to every session and 1,868 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.

Related

Other skills, from other repositories

rails-load-defaults

Incrementally upgrade Rails config.loaddefaults by walking through each newframeworkdefaults config one at a time. Use this skill whenever the user mentions loaddefaults upgrade, newframeworkdefaults, framework defaults, or wants to bring their Rails app's default configuration up to match their Rails version. Also…

ombulabs/claude-code_rails-load-defaults-skill · 120 tokens

client-setup

Create a vanilla tRPC client with createTRPCClient (), configure link chain with httpBatchLink/httpLink, dynamic headers for auth, transformer on links (not client constructor). Infer types with inferRouterInputs and inferRouterOutputs. AbortController signal support. TRPCClientError typing.

trpc/trpc · 63 tokens

adapter-express

Mount tRPC as Express middleware with createExpressMiddleware() from @trpc/server/adapters/express. Access Express req/res in createContext via CreateExpressContextOptions. Mount at a path prefix like app.use('/trpc', ...). Avoid global express.json() conflicting with tRPC body parsing for FormData.

trpc/trpc · 67 tokens

trpc-router

Entry point for all tRPC skills. Decision tree routing by task: initTRPC.create(), t.router(), t.procedure, createTRPCClient, adapters, subscriptions, React Query, Next.js, links, middleware, validators, error handling, caching, FormData.

trpc/trpc · 59 tokens

rails-expert

Rails 7+ specialist that optimizes Active Record queries with includes/eagerload, implements Turbo Frames and Turbo Streams for partial page updates, configures Action Cable for WebSocket connections, sets up Sidekiq workers for background job processing, and writes comprehensive RSpec test suites. Use when building…

Jeffallan/claude-skills · 104 tokens

new

Create a new project to start development quickly.

clacky-ai/openclacky · 10 tokens