general

general is a cursor rule for Cursor from muraaano/cursor-project-rules-on-rails. It costs 761 tokens per session, scanned A, original, MIT.

Ruby on Rails coding rules for organising application code, naming things, designing APIs, documenting methods, and monitoring errors and performance.

In plain words
What is it for?
Use them when building or reviewing Rails controllers, models, policies, jobs, serializers, validators, APIs, and database-related code.
Why use it?
They give developers shared conventions for where logic belongs and how code, responses, logs, and documentation should be written.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use them when building or reviewing Rails controllers, models, policies, jobs, serializers, validators, APIs, and database-related code.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/muraaano/cursor-project-rules-on-rails/general
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.

Clone the repo
git clone --depth 1 https://github.com/muraaano/cursor-project-rules-on-rails

Made for: Cursor.

Wrote 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.

agentmods badge for general

README.md
[![agentmods](https://agentmods.dev/badge/rules/muraaano/cursor-project-rules-on-rails/general.svg)](https://agentmods.dev/rules/muraaano/cursor-project-rules-on-rails/general)
Your own site
<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>
Per session 761 This file is loaded in full into every session.
When invoked 761 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00761 $0.00761
Opus 5 $0.00380 $0.00380
Sonnet 5 $0.00152 $0.00152
Haiku 4.5 $0.00076 $0.00076

Measured 7d ago against content hash 1660db9798a4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

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.

.cursor/rules/general.mdc · 79 lines

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_onehas_manyアソシエーションを定義する場合は、RuboCopのRails/HasManyOrHasOneDependentRails/InverseOfを無効化し、dependentinverse_ofの記載を省略すること
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. 7d ago First seen · 79 lines · 761 tokens per session scan A 1660db9798a4

Subscribe to this mod's changes

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.