rails

rails is a skill for Claude Code, Codex from kouroshez/coding-os. It costs 100 tokens per session (807 once invoked), scanned A, original, Apache-2.0.

A set of rules for building Ruby on Rails backend services, including routes, controllers, database models, migrations, and tests. It keeps web request handling separate from business and database logic.

In plain words
What is it for?
Use it when changing Rails routes, controllers, ActiveRecord models, concerns, migrations, error handling, or RSpec tests.
Why use it?
It helps avoid tangled controllers, unsafe parameter handling, database queries in the wrong layer, and business logic that is difficult to test or reuse.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when changing Rails routes, controllers, ActiveRecord models, concerns, migrations, error handling, or RSpec tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kouroshez/coding-os/rails
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 kouroshez/coding-os --skill rails
Clone the repo
git clone --depth 1 https://github.com/kouroshez/coding-os

Made for: Claude Code, Codex.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/kouroshez/coding-os/rails"><img src="https://agentmods.dev/badge/skills/kouroshez/coding-os/rails.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 807 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.
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.00100 $0.00807
Opus 5 $0.00050 $0.00404
Sonnet 5 $0.00020 $0.00161
Haiku 4.5 $0.00010 $0.00081

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

Security

Grade A, and why

rails 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 5d 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.

src/templates/rails/skills/rails/SKILL.md · 63 lines

How it starts

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

REQUIRED BACKGROUND: This skill depends_on: [clean-code, backend-fundamentals]. clean-code gives universal code quality (fail-closed errors, typed exceptions, self-documenting code, error-path tests); backend-fundamentals gives stack-agnostic backend patterns (services, idempotency, envelopes, N+1, migrations, auth). This skill adds ONLY Ruby on Rails-specific layering on top.

rails

Layer contract (matches structure.tree)

Layer May import Never
config/routes.rb route helpers controller bodies, models
*_controller.rb the domain model, concerns another controller, raw SQL
app/models/*.rb (ActiveRecord) other models, the DB controllers, params, render
controllers/concerns/ models (for auth lookups) a specific controller's privates

Controllers stay thin and transport-aware; models stay transport-free (no params, no render) so they are unit-testable and the business logic survives a transport swap (REST → GraphQL → ActionCable).

Routes & controllers (thin)

  • config/routes.rb is the single routing table — prefer resources/resource over hand-rolled match; one URL, one place.
  • An action: strong-parameter the input (params.require(:x).permit(:a, :b)) → call ONE model method → render. No business branching, no multi-query loops.
  • Subclass ApplicationController; never rescue-and-shape inside an action — raise a typed error and let the global chain map it.
  • before_action filters load records / enforce auth; keep them in concerns when three controllers share them (rule of three), not copy-pasted.

Models (ActiveRecord — the only layer that thinks)

  • Business logic, scopes, and validates live on the model; a controller that validates by hand is a layering violation.
  • Persist with save!/create!/update! so a failure raises and the rescue_from chain maps it — silent save that returns false hides errors.
  • Migrations are reversible (change, or paired up/down); schema and data migrations stay in separate files. The agent writes them; the user runs db:migrate.

Read the full file on GitHub · 63 lines

Files

What ships with it

1 file 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.

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. 5d ago First seen · 63 lines · 100 tokens per session scan A ac894a14deaf

Subscribe to this mod's changes

rails is a skill published in the GitHub repository kouroshez/coding-os (6 stars, last pushed yesterday), licensed Apache-2.0. It adds 100 tokens to every session and 807 once invoked, about $0.0005 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-09-03.

Related

Other skills, from other repositories

booboo-adapter

Feed data into a Booboo brain that the built-in postgres and json adapters do not cover — write a small config-driven adapter against the spec instead of forking the builder. Use when a source is Neo4j, an API, a CSV export, a proprietary store, or any shape the standard config cannot express.

jessymariau/booboo · 71 tokens

potpie-repo-baseline

Use when establishing, refreshing, or deeply understanding a repository's baseline memory in Potpie: purpose, application type, features, services/modules, environments, deploy shape, dependencies, API contracts, datastores, integrations, ownership, and explicit preferences. The harness reads authored and…

potpie-ai/potpie · 75 tokens

potpie-infra-architecture

Use for project infra and architecture context: environments, adapters, runtime configuration, deployments, service dependencies, datastores, API contracts, ownership, incidents, and dependency blast radius.

potpie-ai/potpie · 43 tokens

potpie-project-preferences

Use before writing, modifying, reviewing, refactoring, or testing code so repo/project preferences surface: error handling, file structure, frameworks, logging, dependency choices, testing, security, API style, and naming. Also use after code work when a reusable project preference should be recorded.

potpie-ai/potpie · 63 tokens

supabase-node

Express/Hono with Supabase and Drizzle ORM.

alinaqi/maggy · 14 tokens

solr-extending

To build Solr plugins: SearchComponent, QParser, URP, DocTransformer.

griddynamics/rosetta · 23 tokens