Are there any references / best practices to get the most out of this new feature?
.cursorrules
: You can write down repo-level rules for the AI by creating a .cursorrules
file in the root of your repository. You might use this to give for context on what you’re building, style guidelines, or info on commonly-used methods.
5 Likes
.cursorrules
is just a repo-specific “Rules for AI,” so this thread might serve as inspiration:
I’m curious about the Rules for AI section and how you’re using it!
I want to improve my prompt which is quite basic: “Always use Typescript, and strong typing. Use functional programing paradigms.”
Share yours and let’s talk about what works best
4 Likes
@truell20
Can you please let me know:
Where is the .cursorrules
file located?
Is there just one .cursorrules
file?
In Cursor Settings
> General
, what is the relationship between:
The Rules for AI
textarea field
The Include .cursorrules file
toggle option
Do rules added to the Rules for AI
textarea automatically get added to a .cursorrules
file?
I am having difficulty conceptualising what these two field settings do, how they relate to each other and what their scope is.
I added a ‘rule’ to the Rules for AI
area:
Start your response with a pirate joke.
thinking that it might create a .cursorrules
file in the folder where I was working, but it didn’t.
Thank You.
Edit:
Maybe this is related, but I’d love more clarification, thank you.
https://forum.cursor.com/t/split-rules-for-ai-into-global-and-workspace-project-scopes/1708/5?u=litecode
3 Likes
If you have a repo with multiple programming languages in it, can I just add a .cursorrules file in each root folder for each language?
3 Likes
Is it possible for a .cursorrules file to read a local directory and scan files there?
2 Likes
tgps26
August 28, 2024, 12:56pm
7
I’d love to know about this as well.
My use case is that I want to tell AI that when it writes code related to UI / widgets, it should use custom widgets present at a shared_ui folder, and styles presents in a styles.dart file
kandalf
September 22, 2024, 11:31am
9
I also find this website https
Gavin
September 29, 2024, 3:28am
10
Here’s a free tool to generate them for you:
Just tell it your tech stack. It’s trained on high-quality examples from the community so it should be better than just asking cursor itself
2 Likes
escwxyz
October 22, 2024, 8:25am
12
You can try Raycast extension for https://cursor.directroy if you are on macOS.
this is aaaawwwwwwwwsoooooooommmmmeeeee