cursor-rules-management

A set of rules for managing Cursor, an AI coding editor, and its .mdc rule files. It defines where those files belong and what metadata they must contain.

In plain words
What is it for?
Use it when creating or updating Cursor rules, checking their location, and preserving the required metadata.
Why use it?
It prevents rules from being placed where Cursor or compatible tools may not recognise them and keeps their descriptive information consistent.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/fbrbovic/cursor-rule-framework/cursor-rules-management
Clone the repo
git clone --depth 1 https://github.com/fbrbovic/cursor-rule-framework

Made for: Cursor.

Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,356 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00029 $0.01356
Opus 5 $0.00015 $0.00678
Sonnet 5 $0.00006 $0.00271
Haiku 4.5 $0.00003 $0.00136

Measured 2d ago against content hash 2fa7a0f197cd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cursor-rules-management 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 2d 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/cursor-rules-management.mdc · 180 lines

How it starts

The opening of the file, as written. The whole thing — 180 lines — stays where its author put it; the contents beside it link to each section on GitHub.

🚨 CRITICAL: Cursor Rules Management Policy 🚨

This rule ensures proper location, format, and handling of all Cursor MDC rule files.

PART 1: MANDATORY LOCATION POLICY

All Cursor Rules Must Live in .cursor/rules/

This is the ONLY acceptable location for cursor rules files (.mdc).

✅ Correct Locations
  • .cursor/rules/rules.mdc
  • .cursor/rules/architecture.mdc
  • .cursor/rules/any-other-rule.mdc
❌ INCORRECT Locations (NEVER USE)
  • rules.mdc (root level)
  • migration.mdc (root level)
  • backend-encore/rules.mdc
  • ❌ Any other location outside .cursor/rules/
Why Location Matters
  1. Cursor IDE Integration: Cursor only recognizes rules in .cursor/rules/
  2. Team Consistency: All team members expect rules in standard location
  3. Version Control: Proper .gitignore handling for cursor-specific files
  4. Tool Compatibility: Other cursor-compatible tools expect this structure

PART 2: MANDATORY MDC METADATA FORMAT

What is MDC Metadata?

Every .mdc file in the .cursor/rules/ directory must have metadata at the top in this format:

---
description: Brief description of what this rule does
globs: file/pattern/to/match/**/*.*
alwaysApply: true/false
---

# Rule content starts here

ABSOLUTE REQUIREMENTS

1. Never Remove or Modify Delimiters
  • The --- lines at the beginning and end of metadata are CRITICAL
  • Removing these breaks the MDC format and disables the rule
  • Always preserve exactly three dashes on each line
2. Always Preserve Existing Fields

When updating an MDC file, you MUST preserve:

  • description: Brief description of the rule's purpose
  • globs: File patterns that trigger this rule
  • alwaysApply: Whether rule applies to all contexts (true/false)
3. Only Update Content Below Metadata
  • Only modify content below the second --- line
  • Never modify anything between the first and second --- lines
  • If you need to change metadata fields, do so carefully and preserve the format

Read the full file on GitHub · 180 lines

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. 2d ago First seen · 180 lines · 29 tokens per session scan A 2fa7a0f197cd

Subscribe to this mod's changes

cursor-rules-management is a cursor rule published in the GitHub repository fbrbovic/cursor-rule-framework (33 stars, last pushed 1mo ago), licensed MIT. It adds 29 tokens to every session and 1,356 once invoked, about $0.0001 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-30.