creating-cursor-rules

Guidance for writing Cursor IDE rule files, which tell Cursor how to work within a project.

In plain words
What is it for?
Use it when starting or improving project rules, converting guidelines into Cursor format, or agreeing on shared coding decisions.
Why use it?
It helps turn vague coding preferences into specific instructions that keep AI-generated code consistent with the project.

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/pr-pm/prpm/creating-cursor-rules
Clone the repo
git clone --depth 1 https://github.com/pr-pm/prpm

Made for: Cursor.

Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,043 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.00016 $0.04043
Opus 5 $0.00008 $0.02021
Sonnet 5 $0.00003 $0.00809
Haiku 4.5 $0.00002 $0.00404

Measured yesterday against content hash 66af177e160a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

creating-cursor-rules 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.

.cursor/rules/creating-cursor-rules.mdc · 677 lines

How it starts

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

Creating Cursor Rules - Meta Rule

Overview

This is a meta-rule for creating effective .cursor/rules files. Apply these principles when writing or improving Cursor IDE rules for your project.

When to Use

Use when:

  • Starting a new project and setting up .cursor/rules
  • Improving existing project rules
  • Converting skills or guidelines to Cursor format
  • Team needs consistent coding standards

Don't use for:

  • Claude Code skills (those go in .claude/skills/)
  • One-time instructions (just ask directly)
  • User-specific preferences (those go in global settings)

Core Principles

1. Be Specific and Actionable

# ❌ BAD - Vague
Write clean code with good practices.

# ✅ GOOD - Specific
Use functional components with TypeScript.
Define prop types with interfaces, not inline types.
Extract hooks when logic exceeds 10 lines.

2. Focus on Decisions, Not Basics

# ❌ BAD - Obvious
Use semicolons in JavaScript.
Indent with 2 spaces.

# ✅ GOOD - Decision guidance
Choose Zustand for global state, React Context for component trees.
Use Zod for runtime validation at API boundaries only.
Prefer server components except for: forms, client-only APIs, animations.

3. Organize by Concern

# ✅ GOOD Structure

## Tech Stack
- Next.js 14 with App Router
- TypeScript strict mode
- Tailwind CSS for styling

## Code Style
- Functional components only
- Named exports (no default exports)
- Co-locate tests with source files

## Patterns
- Use React Server Components by default
- Client components: mark with "use client" directive
- Error handling: try/catch + toast notification

## Project Conventions
- API routes in app/api/
- Components in components/ (flat structure)
- Types in types/ (shared), components/*/types.ts (local)

Rule Anatomy

MDC Format and Metadata

Cursor rules are written in MDC (.mdc) format, which supports YAML frontmatter metadata and markdown content. The metadata controls how and when rules are applied.

Read the full file on GitHub · 677 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. yesterday First seen · 677 lines · 16 tokens per session scan A 66af177e160a

Subscribe to this mod's changes

creating-cursor-rules is a cursor rule published in the GitHub repository pr-pm/prpm (120 stars, last pushed 2mo ago), licensed MIT. It adds 16 tokens to every session and 4,043 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.