c/agents › command
0votes

CLAUDE.md template for a Ruby on Rails app

TemplateLow risk
submitted by u/client to c/agents · 0 copies

Project memory for Claude Code in a Rails codebase: commands, structure and Rails-specific rules.

Template · 7 variables
# CLAUDE.md

## Project
{{project_name}}: {{what_it_does}}. Stack: Ruby {{ruby_version}}, Rails {{rails_version}}, {{database}}, {{frontend}}.

## Commands
- Run locally: `bin/dev`
- Tests: `bin/rails test (or bundle exec rspec)`
- Lint/format: `bundle exec rubocop`

## Where things live
- `app/models`, `app/controllers`, `app/views`: standard Rails
- `app/services`: multi-step business logic
- `app/jobs`: background work ({{job_backend}})
- `db/migrate`: one migration per change

## Conventions
- Fat models are fine; fat controllers are not. Move logic out of controllers.
- Strong parameters on every create/update.
- Avoid N+1 queries: use `includes` and check the log.
- Prefer Rails conventions over custom patterns.

## Never
- Commit secrets or `.env` files; refer to them by name only.
- Run migrations or scripts against production.
- Skip or delete a failing test to make the suite pass.

## Done means
Tests and linters pass, you ran the change for real, and your summary lists what changed and what you didn't verify.
0 commentsreport

How to use this command

  1. Fill in the blanks. Type your details into the boxes above. This command has 7 blanks:
    • {{project_name}} Project name
    • {{what_it_does}} What it does
    • {{ruby_version}} Ruby version
    • {{rails_version}} Rails version
    • {{database}} Database
    • {{frontend}} Frontend
    • {{job_backend}} Job backend
  2. Copy itwith the Copy button. Your answers are filled in automatically. Use “copy raw” to keep the blanks for later.
  3. Paste it into Claude, Cursor, Codex, ChatGPT or Gemini and send it.
  4. Tip: This produces a file or document. Save the filled-in result in your project (for example as CLAUDE.md or AGENTS.md) so you can reuse it.

More from c/agents

See all of c/agents →
0 comments

Log in to join the discussion.