awesome-cursor-rules-mdc is a generator that creates Cursor MDC rule files from structured library information, using semantic search and language models to gather and organize guidance. Developers use it to produce reusable rules for libraries in Cursor, and the catalogue includes 200 of those rules.
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.
npx agentmods add rules/sanjeed5/awesome-cursor-rules-mdc/rubygit clone --depth 1 https://github.com/sanjeed5/awesome-cursor-rules-mdcWrote 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.
[](https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/ruby)<a href="https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/ruby"><img src="https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/ruby.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.02400 | $0.02400 |
| Opus 5 | $0.01200 | $0.01200 |
| Sonnet 5 | $0.00480 | $0.00480 |
| Haiku 4.5 | $0.00240 | $0.00240 |
Grade A, and why
ruby 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.
How it starts
The opening of the file, as written. The whole thing — 465 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Ruby Best Practices
Our team adheres to a strict set of Ruby best practices, primarily enforced by RuboCop and aligned with the official Ruby and Rails Style Guides. This document serves as your definitive reference for writing clean, efficient, and maintainable Ruby code.
1. Code Organization & Structure
Adhere to the Single Responsibility Principle (SRP) and keep files focused.
1.1 Single Class/Module Per File
Each Ruby file must define a single class or module. Name the file using snake_case corresponding to the CamelCase class/module name.
❌ BAD
# user.rb
class User; end
class UserProfile; end
✅ GOOD
# user.rb
class User; end
# user_profile.rb
class UserProfile; end
1.2 Rails Directory Structure
Follow Rails' "convention over configuration" for project structure.
❌ BAD
# app/services/user_management/create_user.rb
# app/validators/email_validator.rb
✅ GOOD
# app/services/user_management/create_user.rb (for complex logic)
# app/validators/email_validator.rb (standard Rails convention)
1.3 Configuration Files
Place custom initialization code in config/initializers. Keep gem-specific initializers in separate files named after the gem.
❌ BAD
# config/initializers/app_setup.rb
# Contains setup for CarrierWave, Sidekiq, and custom app config.
✅ GOOD
# config/initializers/carrierwave.rb
# config/initializers/sidekiq.rb
# config/initializers/custom_app_config.rb
2. Formatting
Consistency is paramount. RuboCop enforces these rules automatically.
2.1 Indentation & Line Length
Use two-space soft tabs. Limit lines to 120 characters to balance readability and screen real estate.
❌ BAD
def long_method_name(param1, param2, param3, param4, param5, param6, param7) # > 120 chars
puts "This line is indented with four spaces."
end
✅ GOOD
def long_method_name(param1, param2, param3, param4, param5, param6, param7)
puts "This line is indented with two spaces."
end
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.
- yesterday First seen · 465 lines · 2,400 tokens per session scan A c36550d1ee4e
ruby is a cursor rule published in the GitHub repository sanjeed5/awesome-cursor-rules-mdc (3,571 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 2,400 tokens to every session, about $0.0120 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-09-03.
Other cursor rules, from other repositories
ruby-style
Ruby coding style aligned with project RuboCop config.
hatch3r-ruby-rails-patterns
Ruby 3.3+ and Rails 8.x conventions covering Hotwire (Turbo + Stimulus), ActiveRecord patterns, Sidekiq jobs, RSpec testing, RuboCop / Standard, and YJIT performance.
workato-connector-sdk
Cursor rule "workato-connector-sdk" from rkawaishi/workato-dev-kit, covering workato connector sdk (connector.rb), file structure, top-level structure of connector.rb, authorization types and required keys for an action.
skill-rails-api
Padrões DARE para APIs em Ruby on Rails 8 — API mode, ActiveRecord, Solid Queue, Solid Cable, Action Cable, strong parameters, services, serializers (Blueprinter/Alba), Devise/JWT, rack-attack, rswag/grape-swagger.
ruby
Idiomatic Ruby: blocks, RSpec, clean patterns.
dragonruby-best-practices-cursorrules-prompt-file
Cursor rules for DragonRuby development with best practices integration.