AI WebLink

Blog/Published 2026-08-21

Pin project style in Cursor with a rules file: start with bans

A short rules file cuts surprise abstractions during refactors. You still read the diff.

Without rules, Cursor is a keen junior: tests go green, a banned store appears, or errors vanish into an empty catch.

Do not write “you are a world-class engineer.” Write facts the repo already has: folders, commands, banned imports.

Four blocks in v1

Then give a bounded job: “only utils/date.ts and its tests.” If the diff leaves that tree, the rule is soft or the ask is wide.

  1. Layout: where source, tests, and docs live; where logic must not go.
  2. Commands: which test or lint must run after an edit.
  3. Bans: libraries, patterns, file size.
  4. Language: comments and commit messages, so you do not get two dialects.

Review the rules file too

When the model edits rules, review that hunk alone. It will delete a ban to make the task easy.

Keep rules in version control. That beats each person typing “we do not use that library” into chat.

Rules are not an access-control system. Secrets and production stay on your old path.

Related reviews

Related tutorials

Pin project style in Cursor with a rules file: start with bans | AI WebLink