rails-starter AGENTS.md

Project-specific coding instructions for a Rails application that uses Inertia and React. They describe the app's frontend, server-side responsibilities, interface conventions, testing approach, and preferred Ruby style.

In plain words
What is it for?
Use them when building or reviewing features, tests, routes, data passed to pages, and user interfaces in the rails-starter application.
Why use it?
They give coding agents and developers consistent rules for changing this particular project without guessing how its parts should work together.

Instructions file for CodexOpenCode

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/agents-md
Clone the repo
git clone --depth 1 https://github.com/thecodingend/rails-starter

Made for: Codex, OpenCode.

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 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.01060 $0.01060
Opus 5 $0.00530 $0.00530
Sonnet 5 $0.00212 $0.00212
Haiku 4.5 $0.00106 $0.00106

Measured yesterday 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 AGENTS.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 yesterday.

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

Copies of this mod

1 near-identical copy found in the catalogue:

AGENTS.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. yesterday First seen · 81 lines · 1,060 tokens per session scan A c47c990115bb

Subscribe to this mod's changes

rails-starter AGENTS.md is an instructions file published in the GitHub repository thecodingend/rails-starter (5 stars, last pushed 7d 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. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

buildNext

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

Instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,040 tokens

langchain AGENTS.md

Instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens