Cursor Rules Template

A scoped Cursor rule: glob-targeted, rationale-bearing, with examples that show the rule applied. Copy it below, fill the bracketed fields, delete what you don't need.

cursor-rules.md
---
description: [When this rule should influence edits]
globs: ["src/**/*.ts"]
alwaysApply: false
---

# [Rule name]

## Rule
[The convention or constraint, stated imperatively.]

## Rationale
[Why this rule exists. Rules without reasons get argued with or ignored.]

## Correct
```ts
[Minimal example following the rule]
```

## Incorrect
```ts
[Minimal example violating it, with the failure it causes]
```

Field notes

FieldWhy it matters
globsScope is the format's superpower. A rule attached only to the files it governs costs zero context everywhere else.
RationaleModels weigh justified constraints more heavily, and humans reviewing the rules file need the why to maintain it.
Incorrect exampleNegative examples disambiguate faster than positive ones. Show the failure the rule prevents.

Go deeper