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.
---
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
| Field | Why it matters |
|---|---|
| globs | Scope is the format's superpower. A rule attached only to the files it governs costs zero context everywhere else. |
| Rationale | Models weigh justified constraints more heavily, and humans reviewing the rules file need the why to maintain it. |
| Incorrect example | Negative examples disambiguate faster than positive ones. Show the failure the rule prevents. |