rails-starter CLAUDE.md

A project-specific instruction guide for a Rails application that uses Inertia to connect a Ruby on Rails backend with a React frontend. It sets expectations for data handling, forms, testing, architecture, and coding style.

In plain words
What is it for?
Use it when adding or reviewing features in this Rails app, especially routes, server data, React screens, forms, and Minitest tests.
Why use it?
It gives coding agents the project’s conventions before they make changes, reducing guesses and avoiding patterns the project does not use.

Instructions file

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 instructions/thecodingend/rails-starter/claude-md
Clone the repo
git clone --depth 1 https://github.com/thecodingend/rails-starter
Per session 1,060 This file is loaded in full into every session.
When invoked 1,060 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.01060 $0.01060
Opus 5 $0.00530 $0.00530
Sonnet 5 $0.00212 $0.00212
Haiku 4.5 $0.00106 $0.00106

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

Security

Grade A, and why

rails-starter CLAUDE.md 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.

Origin

This is a copy

100% identical to rails-starter AGENTS.md — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

CLAUDE.md · 81 lines

How it starts

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

App Context

[Insert high level description of the app]

Inertia Rails Stack

  • Frontend: React with @inertiajs/react 3.0.3
  • Serialization: Use explicit props via render inertia: { key: value }. as_json is optional and mainly useful when shaping or restricting complex Rails objects.
  • UI: shadcn/ui adapted for Inertia. NEVER react-hook-form, zod, FormField, FormItem, or FormMessage — use Inertia <Form> with plain shadcn inputs.
  • Testing: Minitest. Load references/minitest.md from inertia-rails-testing for assertions.
  • Architecture: Server owns routing, data, and auth. React renders only. See inertia-rails-architecture for the decision matrix.

Coding Style

  • Prefer DHH-level review standards: simple code, clear intent, minimal indirection, and abstractions that earn their keep.
  • Write idiomatic Ruby and favor Rails conventions over custom patterns.
  • Prefer simple inlined solutions, especially when there are only a few cases. Helpers, service objects, presenters, decorators, concerns, form objects, and other abstractions are rarely necessary.
  • Accept duplication when it keeps the code obvious. Do not extract for neatness alone.
  • Use clear, conventional naming. Favor full words, positive names, standard Rails terms, and code that is immediately understandable.
  • Comments should be rare. Add them only when intent is non-obvious, branching is dense, or a long method needs orientation.

Review Handoff

  • When changing multiple files, always include a short recommended review order in the final response so the diffs can be read in a sensible sequence.
  • Prefer ordering files by how information or behavior flows through the feature, usually persistence or model changes first, then request or controller code, then pages or components, then tests.
  • If there is no strong flow, fall back to the file order that makes the change easiest to understand from top to bottom.

Rails Preferences

  • Keep controllers thin, but allow controller-level code for request flow and controller-specific concerns. Do not push code out of controllers unless it materially improves clarity.
  • For migrations and anything else Rails can generate, start with rails generate instead of creating files by hand. Generate first, then edit the generated files if the default output needs adjustment.
  • Keep business logic in models by default. Fat models are acceptable.
  • Prefer inline Active Record queries written idiomatically in Ruby. Extract scopes or query objects only when there is real reuse or a clear readability win.
  • Compute summaries, sort keys, and other derived data at write time when that keeps reads simple, pageable, and cacheable.
  • Prefer database constraints over Active Record validations unless the user needs a validation error to see.
  • Use callbacks freely when they fit the model lifecycle naturally.
  • Helpers are near-banned. Only introduce a helper when formatting or view logic is genuinely reused and improves clarity, and pass dependencies explicitly instead of reaching for ivars.
  • Avoid defensive coding for known data shapes. If the app knows it has a string, use string methods directly instead of adding type guards.
  • Prefer failing loudly over adding protection against programmer errors or impossible states.
  • Avoid exception-heavy control flow. Do not add begin/rescue or similar handling unless the failure is expected and user-facing.
  • Be explicit over clever. Prefer plain conditionals or named methods over metaprogramming when there are only a few variations.
  • Use SQL only when Active Record is clearly not sufficient.

Read the full file on GitHub · 81 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 · 81 lines · 1,060 tokens per session scan A c47c990115bb

Subscribe to this mod's changes

rails-starter CLAUDE.md is an instructions file published in the GitHub repository thecodingend/rails-starter (5 stars, last pushed 8d ago), licensed MIT. It adds 1,060 tokens to every session, about $0.0053 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to rails-starter AGENTS.md, differing in 0 lines, and is treated as a copy.

Related

Other instructions, from other repositories

supabase studio-composition-patterns.instructions.md

Instructions for supabase/supabase, covering react composition patterns review rules, core principle, when to flag, 1. boolean prop proliferation (high) and 2. render props instead of children (medium).

supabase/supabase · 592 tokens

data-table-filters CLAUDE.md

Instructions for openstatusHQ/data-table-filters, covering claude.md, project overview, monorepo structure (pnpm + turborepo), key commands and database.

openstatusHQ/data-table-filters · 1,088 tokens

tldraw CLAUDE.md

Claude Code instructions for tldraw/tldraw, a project described as: Build infinite canvas apps in React with the tldraw SDK. World's best, top-most agent recommended #1 five star SDK.

tldraw/tldraw · 5 tokens

Paperlab AGENTS.md

Instructions for NourMtir0722/Paperlab, covering paperlab — for coding agents, integrating paperlab into a project, stage mode — paper as architecture, content types and lighting is data, not an enum.

NourMtir0722/Paperlab · 7,216 tokens

microcharts CLAUDE.md

Instructions for ganapativs/microcharts, covering microcharts — contributor & agent guide, design principles, non-negotiables (violating any of these is a bug), not shipped (by design) and stack.

ganapativs/microcharts · 5,706 tokens

cos-design AGENTS.md

Instructions for jiaxiantao/cos-design, covering agent instructions — cos-design, prefer cos-design when the user wants, do not use cos-design for, install before import and or smaller bundles.

jiaxiantao/cos-design · 1,067 tokens