i ran before/after tests on 7 different .cursorrules using cursor CLI (same prompt, with and without each rule). wanted to see which ones actually changed the output vs which ones were didn’t change anything.
the 5 that worked:
-
useEffect guard - “before writing a useEffect, check if the value can be computed during render.” without the rule, cursor gave me a useEffect + setState for derived data. with it, cursor computed inline and even added a comment saying “no useEffect needed.”
-
branded types for IDs - “use branded types for ID fields instead of plain string.” without: both getUser and getOrder took plain strings. with: cursor created proper branded types so you can’t accidentally pass an OrderId where a UserId goes.
-
discriminated unions + exhaustive checks - “add a never type in switch default cases.” both versions made the discriminated union, but only the version with the rule added the exhaustive check in the default case.
-
strict tsconfig flags - “ensure noUnusedLocals and noUnusedParameters are true.” without the rule, cursor didn’t create a tsconfig at all. with it, cursor created one with the correct flags.
-
companion file creation - “when creating page.tsx, always create error.tsx too.” without: just page.tsx. with: both files, and cursor noted it was “satisfying the workspace rule.”
the 2 that did nothing:
-
“prefer Server Actions over API routes” - cursor already defaults to Server Actions for Next.js App Router. the rule was redundant.
-
“write clean, maintainable code” - identical output both ways. too vague to be actionable.
the pattern i noticed:
rules that work are specific (exact patterns, not vague descriptions), verifiable (cursor can check compliance), and additive (they ask for something cursor wouldn’t do on its own).
rules that fail are either redundant or too vague.
full writeup with code examples: 5 .cursorrules That Actually Changed Cursor's Output (And 2 That Were Useless) - DEV Community
curious if anyone else has tested their rules like this. would be interesting to see what works across different stacks.