
- Updated
Write Cursor project rules for your codebase
This prompt writes project rules for Cursor's agent, split into small files by topic and scoped to the right folders. It includes a rule to ask before adding new dependencies, a common source of trouble.
Help me write project rules for Cursor (files in .cursor/rules) for this codebase. Stack: [e.g. React Native, Expo, TypeScript] Conventions: [e.g. functional components, Zustand for state, styles in a separate file] Things the AI keeps getting wrong: [e.g. uses old API, adds new libraries] Split the rules into a few small files by topic, and say which files or folders each one should apply to. Each rule should be one clear instruction with a short reason. Add a rule telling the AI to ask before adding a new dependency.
Add a rule every time the AI makes the same mistake twice. Rules work best when they come from real problems.
Get a better result
A small set of rule files split by topic, each with a clear scope for the files it applies to, one-line instructions with short reasons, and a rule that makes the AI ask before adding a dependency.
The rules are long and vague, like “write clean code”.
Fix: Keep each rule to one instruction you could check in a diff, such as “use named exports, not default exports”, with a reason in a few words.
- One big file mixes everything and applies everywhere. Ask for separate files for testing, styling and data fetching, each scoped to its own folders so the AI only reads what it needs.
- Rules contradict the code that already exists. Paste two or three real files and say “write rules that match how this code is already written, and flag anything that conflicts”.
Paste the last three pieces of AI code you had to fix and ask “write one rule for each problem, so the AI will not repeat it”. Rules built from real misses are the ones that last.
Shorten every rule to one line and one reason. Group them by folder, and mark the three rules that matter most for this project.
Guides that use this prompt
More chat & writing prompts
See all 465 →More like this
- Understand a new codebase fastClaude · ChatGPT · Claude Code
- Do a large refactor in small safe stepsClaude Code · Cursor
- Let an AI agent fix failing tests properlyClaude Code · Cursor
- Grammar rule explained with examplesChatGPT · Gemini · Claude
- Choose a tech stack for your projectClaude · ChatGPT · Gemini



