Engineering Cursor AI Tooling

How to Write Cursor Rules

Give Cursor a project context profile to load on every request — stack conventions, glossary, and never-assume rules — saved as your .cursorrules file.

Overview

Cursor is only as good as the context it has, and an empty repo gives it none — so it guesses your conventions. This builds a project context profile aimed at Cursor: the overview, the stack-inferred conventions, a glossary, and the never-assume rules, with the install note pointing at your repo-root .cursorrules file. The example loads a TypeScript React/Node app. Open it in the Project Context Builder and switch the project details to your own; the Cursor output target writes the rules in the right place.

How to use this resource

  1. Open the example in the tool

    It loads with realistic inputs already filled in.

  2. Swap in your own details

    Adjust the inputs and options to match your case.

  3. Generate and copy

    Produce the output and paste it where you need it.

Why This Works

  • Cursor reads repo rules on every request, so the context travels with the code for the whole team
  • Stack detection turns "React, TypeScript, Postgres" into the conventions those tools imply, automatically
  • The never-assume rules stop Cursor guessing the things it gets wrong most often

Best for

  • Setting up Cursor for an existing repo
  • Sharing one rules file across a team
  • Stopping Cursor from breaking project conventions

Not for

  • A one-off task prompt — use a template instead
  • Defining an AI persona — use the System Prompt Generator

FAQ

Where does the generated Cursor rules file need to go in my repo?

At the repo root as .cursorrules (or .cursor/rules/project.mdc); the profile's own header says save it there "so Cursor loads it for every request." Project Context Builder writes the rules for that target, and because Cursor reads repo rules on each request, the file travels with the code so every teammate gets the same context.

What stops Cursor from guessing my project's conventions with this file?

The ## Never Assume block spells out the guesses to avoid: do not add a dependency without checking package.json, do not assume the schema before writing a query, do not hand-write SQL when a Prisma query exists. Paired with ## Team Conventions inferred from the stack (React, Express, Prisma, TypeScript), it turns "the codebase uses function components" into an explicit rule rather than a hope.

Is a .cursorrules file the right place to define how the AI should behave, like tone and escalation?

It is not; this profile is project KNOWLEDGE, not behavior, and the AI USAGE NOTES say for a task persona (role, tone, escalation) build a System Prompt in the System Prompt Generator instead. The .cursorrules file carries durable facts like the Glossary and "all dates are stored and compared in UTC"; continuing an in-progress task in a new chat is the Context Handoff Builder's job.

More resources from Project Context Builder

Resources that pair well

Related tools

Tip: Save time by exploring related resources and tools that integrate with this resource.