Rails Cursor Rules Starter (Free)

Three Rails rules that fix the mistakes agents make most often, ready to drop into .cursor/rules/, plus a linter.

Rails Cursor Rules Starter (Free) cover

What it is

3 Cursor project rules for Rails you can drop into a repo today, plus lint_rules.py, which tells you why a Cursor rule isn't loading.

What you get

The screenshot is real output from the kit’s own commands. Tested from a fresh download of this exact zip: ./run_tests.sh ran 5 tests OK on Python 3.13 and 3.10.

Real terminal output from Rails Cursor Rules Starter: demo and passing tests

The rules (in .cursor/rules/)

RuleLoadsFirst instruction
rails-overview.mdcalwaysCheck the Rails version in Gemfile.lock before using an API
rails-controllers.mdcby file (app/controllers//*.rb)Rails 8+: use params.expect(post: [:title, :body]) instead of params.require(:post).permit(:title, :body)
rails-models.mdcby file (app/models//*.rb)Back every validation that matters with a database constraint (null: false, unique index, foreign key)

Install

Copy .cursor/rules/ into your project root (keep the .mdc extension). Then check them against your code:

python3 tools/lint_rules.py .cursor/rules --project .
./tools/demo.sh        # copies the rules into examples/sample-app and lints them
./run_tests.sh

Honest limits

  • Rules guide the model; they don't enforce anything.
  • Check version-specific advice against your installed versions.

Format and license

Zip, 11 KB, v1.0, 20 files. Free to use, modify and share for any purpose, including commercial work, as long as this notice stays in copies. Not affiliated with or endorsed by Cursor (Anysphere) or the Rails project.

FAQ

Rails 7 or 8?
Written for Rails 8 defaults; Rails 7 differences (require/permit instead of params.expect) are called out.
Is it really free?
Yes, free to use, change and share.
What's in the paid pack?
9 rules covering Active Record, safe migrations, params.expect and controllers, Solid Queue jobs, Hotwire views, security, tests and Kamal deploys.
How do I get the files?
Click Download free. The zip downloads straight away: no checkout, no account.
Do I have to sign up for the newsletter?
No. The form is optional and the download works without it.

Get Rails Cursor Rules Starter (Free)

Free Rails Cursor rules in .mdc format, checked against current Rails docs, plus a linter that shows why a rule isn't applying.

Pairs well with

Download$12

Cursor Rules for Supabase

8 Cursor rules for Supabase (Row Level Security policies and more), written against current docs. Installs in one command, exports AGENTS.md. $12 once.

View Cursor Rules for Supabase
DownloadFree

Supabase Cursor Rules Starter (Free)

Free Supabase Cursor rules in .mdc format, checked against current Supabase docs, plus a linter that shows why a rule isn't applying.

View Supabase Cursor Rules Starter (Free)
Download$29

Cursor Rules Stack Bundle

59 Cursor rules: Next.js 16, Django, Rails 8, Supabase and general rules for TypeScript, Python, Go and more. Detects each repo's stack. $29 once, $60 value.

View Cursor Rules Stack Bundle

Related