rails-architecture-patterns

rails-architecture-patterns is a skill for Claude Code, Codex from ag0os/rails-dev-plugin. It costs 77 tokens per session (1,297 once invoked), scanned A, original, MIT.

A planning guide for the overall structure of Ruby on Rails applications. It helps choose where code belongs and coordinates decisions across models, controllers, views, APIs, and other parts of the app.

In plain words
What is it for?
Use it when planning features, comparing design options such as service objects, concerns, database inheritance, or engines, and deciding which specialist guidance applies.
Why use it?
It reduces uncertainty when a feature could be designed in several ways. It helps avoid mixing unrelated responsibilities or choosing patterns without first understanding how the application is built.

Skill for Claude CodeCodex

Part of the rails-dev-plugin plugin — 19 skills, 11 agents shipped together

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 skills/ag0os/rails-dev-plugin/rails-architecture-patterns
Any agent
npx skills add ag0os/rails-dev-plugin --skill rails-architecture-patterns
Clone the repo
git clone --depth 1 https://github.com/ag0os/rails-dev-plugin

Made for: Claude Code, Codex.

Or install rails-dev-plugin, the plugin that ships this one along with the rest of its 19 skills, 11 agents.

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-architecture-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/ag0os/rails-dev-plugin/rails-architecture-patterns.svg)](https://agentmods.dev/skills/ag0os/rails-dev-plugin/rails-architecture-patterns)
Your own site
<a href="https://agentmods.dev/skills/ag0os/rails-dev-plugin/rails-architecture-patterns"><img src="https://agentmods.dev/badge/skills/ag0os/rails-dev-plugin/rails-architecture-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,297 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.00077 $0.01297
Opus 5 $0.00039 $0.00648
Sonnet 5 $0.00015 $0.00259
Haiku 4.5 $0.00008 $0.00130

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

Security

Grade A, and why

rails-architecture-patterns 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.

skills/rails-architecture-patterns/SKILL.md · 112 lines

How it starts

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

Rails Architecture Patterns

Architectural planning frameworks and decision guidance. Coordinate across domain skills and agents.

See patterns.md for detailed decision frameworks. Logic-placement and structural-smell fixes fork on Axis A — see decisions.native.md / decisions.extracted.md.

Resolve the Stack Axes First

Before recommending patterns, resolve the project's architecture axes via rails-stack-profiles (once per session):

  • Axis A — logic placement (native / extracted): drives where business logic lives and how structural smells are fixed. See decisions.native.md / decisions.extracted.md.
  • Axis B — delivery (html / api): drives view vs serializer choices and which domain skills apply.

Orthogonal facts — test framework, job backend, cache store, auth library — come from the project-conventions fingerprint, not from an architecture axis. Never infer them here.

Available Domain Skills and Agents

Domain Skill Agent Covers
Models rails-model-patterns rails-model ActiveRecord, associations, migrations, scopes
Controllers rails-controller-patterns rails-controller RESTful actions, params, routes, error handling
API rails-api-patterns rails-api API controllers, serialization, versioning, JWT
Services rails-service-patterns rails-service Service objects, result pattern, DI, external APIs
Jobs rails-jobs-patterns rails-jobs ActiveJob, Sidekiq, idempotency, batch processing
GraphQL rails-graphql-patterns rails-graphql Schema, mutations, DataLoader, subscriptions
Hotwire hotwire-patterns rails-hotwire Stimulus controllers, Turbo frames/streams
Views rails-views-patterns rails-views ERB, partials, helpers, caching, accessibility
Testing rails-testing-patterns rails-test RSpec, Minitest, system/integration tests
DevOps rails-devops-patterns rails-devops Docker, CI/CD, monitoring, security
Mailers rails-mailer-patterns (skill only) Action Mailer, previews, delivery, interceptors
Auth rails-auth-patterns (skill only) has_secure_password, Devise, sessions, password reset
Caching rails-caching-patterns (skill only) Fragment, low-level, HTTP caching, invalidation
Refactoring ruby-refactoring (skill only) Code smells, refactoring patterns
Object Design ruby-object-design (skill only) Class vs module, Struct, Data, design decisions

Read the full file on GitHub · 112 lines

Files

What ships with it

3 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.

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 · 112 lines · 77 tokens per session scan A 5f0993fb27ed

Subscribe to this mod's changes

rails-architecture-patterns is a skill published in the GitHub repository ag0os/rails-dev-plugin (5 stars, last pushed 3mo ago), licensed MIT. It adds 77 tokens to every session and 1,297 once invoked, about $0.0004 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 skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens