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.
git clone --depth 1 https://github.com/muraaano/cursor-project-rules-on-railsWrote 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/muraaano/cursor-project-rules-on-rails/general)<a href="https://agentmods.dev/rules/muraaano/cursor-project-rules-on-rails/general"><img src="https://agentmods.dev/badge/rules/muraaano/cursor-project-rules-on-rails/general.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.1 | $0.00761 | $0.00761 |
| Opus 5 | $0.00380 | $0.00380 |
| Sonnet 5 | $0.00152 | $0.00152 |
| Haiku 4.5 | $0.00076 | $0.00076 |
Grade A, and why
general 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 7d 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.
What it actually says
コーディング規約
Ruby on Rails全体に関わるコーディングのルールです。 より具体的なルールは、それぞれのファイルに記載されています。(controllers.mdcなど)
アプリケーション構成
app/controllers/: API エンドポイントの制御app/serializers/: APIレスポンスのシリアライズapp/decorators/: オブジェクトの表示ロジックapp/jobs/: 非同期処理app/models/: モデルapp/policies/: 認可ロジックapp/validators/: カスタムバリデーション
責務の分離
- 認可ロジックは
policiesに配置 - 表示に関するロジックは
decoratorsに配置
命名規則
- クラス名は目的を明確に表す名前をつける
- メソッド名は動詞で始める
- 副作用があるメソッド(データの作成・更新・削除など)には末尾に「!」をつける
- 変数名は意味が分かりやすい名前をつける
共通処理の抽出
- 複数のモデルで使用される共通のバリデーションは基底クラスに実装する
- 共通のバリデータは再利用可能な形で実装する
API設計
レスポンス形式
- JSON シリアライザとして Blueprinter を使用
- API スキーマ検証には Committee Rails を使用
エラーハンドリング
- 適切なHTTPステータスコードを使用
- エラーレスポンスは一貫した形式で返す
監視とロギング
ログ
- 重要な操作は必ずログを残す
パフォーマンス監視
- NewRelic でパフォーマンスを監視
- 重要なクエリやエンドポイントはモニタリングを設定
エラー監視
- Sentry でエラーを捕捉・監視
- 重要なエラーは適切な優先度で通知を設定
Ruby コーディングスタイル
ドキュメンテーションコメント
- メソッドには、Yard記法でドキュメンテーションコメントをつける
- @returnもしくは@raiseは必ず記述する
- 引数がある場合は @paramを記述する
- その他、日本語での説明コメントは不要
Active Record
- リレーション先のカラムでの絞り込みは
.mergeを使うこと - 特定のスコープを持つ
has_oneやhas_manyアソシエーションを定義する場合は、RuboCopのRails/HasManyOrHasOneDependentとRails/InverseOfを無効化し、dependentとinverse_ofの記載を省略すること
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.
- 7d ago First seen · 79 lines · 761 tokens per session scan A 1660db9798a4
general is a cursor rule published in the GitHub repository muraaano/cursor-project-rules-on-rails (2 stars, last pushed 1y ago), licensed MIT. It adds 761 tokens to every session, about $0.0038 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.
Other cursor rules, from other repositories
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.
graftcode-ruby
Mandatory Graftcode architecture rules for building Ruby backend services (plain classes exposed via Graftcode Gateway, not REST). Ruby is a supported gg runtime but has no dedicated Quick Start yet.
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.
rails
Rails: thin controllers, service objects, Turbo.
models
Thin AR models — validations, scopes, enums; naming → naming-rails.mdc.