# Good examples of .cursorrules file?

**URL:** <https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346>\
**Category:** Discussions\
**Created:** [April 17, 2024, 5:55pm UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346 "2024-04-17T17:55:37Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![epicwhale](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@epicwhale](https://forum.cursor.com/u/epicwhale)\
**Post date:** [April 17, 2024, 5:55pm UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/1 "2024-04-17T17:55:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![truell20](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/truell20/32/28583_2.png) [@truell20](https://forum.cursor.com/u/truell20)\
**Post date:** [April 17, 2024, 10:04pm UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/2 "2024-04-17T22:04:11Z")

</div>

`.cursorrules` is just a repo-specific “Rules for AI,” so this thread might serve as inspiration:

> [@Share your "Rules for AI"](https://forum.cursor.com/t/share-your-rules-for-ai/2377):
>
> 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 slight_smile

---

<div class="post-metadata">

**Author:** ![litecode](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/litecode/32/2966_2.png) [@litecode](https://forum.cursor.com/u/litecode)\
**Post date:** [July 21, 2024, 11:56am UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/3 "2024-07-21T11:56:16Z")

</div>

@truell20

Can you please let me know:

1. Where is the `.cursorrules` file located?

2. Is there just one `.cursorrules` file?

3. In `Cursor Settings` \> `General`, what is the relationship between:

- The `Rules for AI` textarea field
- The `Include .cursorrules file` toggle option

1. 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.

 ![curserrules and rulesforai](https://us1.discourse-cdn.com/cursor1/original/2X/d/d7ac3ba2731c98b8caccd2caddfb2b917f4f6e4f.png)

**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](https://forum.cursor.com/t/split-rules-for-ai-into-global-and-workspace-project-scopes/1708/5)

---

<div class="post-metadata">

**Author:** ![darink](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/darink/32/10842_2.png) [@darink](https://forum.cursor.com/u/darink)\
**Post date:** [July 24, 2024, 12:16am UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/4 "2024-07-24T00:16:38Z")

</div>

@litecode

1. Create a .cursorrules in the root of your repo. It’s like a .gitignore.

2. Yes.

3. Rules for AI is global, if .cursorrules present in repo, will be appended (i guess? maybe prepended) to rules for AI.

4. No. Rules for AI is like how you want your ai model to respond in any scenario/context, not just current repo.

---

<div class="post-metadata">

**Author:** ![stefandevo](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/stefandevo/32/2597_2.png) [@stefandevo](https://forum.cursor.com/u/stefandevo)\
**Post date:** [July 26, 2024, 7:21am UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/5 "2024-07-26T07:21:06Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dayvough](https://avatars.discourse-cdn.com/v4/letter/d/cab0a1/32.png) [@dayvough](https://forum.cursor.com/u/dayvough)\
**Post date:** [August 28, 2024, 4:08am UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/6 "2024-08-28T04:08:19Z")

</div>

Is it possible for a .cursorrules file to read a local directory and scan files there?

---

<div class="post-metadata">

**Author:** ![tgps26](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@tgps26](https://forum.cursor.com/u/tgps26)\
**Post date:** [August 28, 2024, 12:56pm UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/7 "2024-08-28T12:56:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [August 28, 2024, 4:57pm UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/8 "2024-08-28T16:57:08Z")

</div>

I’ll leave it here: [https://cursor.directory/](https://cursor.directory/)

---

<div class="post-metadata">

**Author:** ![kandalf](https://avatars.discourse-cdn.com/v4/letter/k/eb8c5e/32.png) [@kandalf](https://forum.cursor.com/u/kandalf)\
**Post date:** [September 22, 2024, 11:31am UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/9 "2024-09-22T11:31:54Z")

</div>

I also find this website [https](https://dotcursorrules.com/)

---

<div class="post-metadata">

**Author:** ![Gavin](https://avatars.discourse-cdn.com/v4/letter/g/439d5e/32.png) [@Gavin](https://forum.cursor.com/u/Gavin)\
**Post date:** [September 29, 2024, 3:28am UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/10 "2024-09-29T03:28:32Z")

</div>

Here’s a free tool to generate them for you:

> **[Cursor Rule Maker](https://cursorrules.agnt.one/chat)**
>
> Create custom cursor instructions from your tech stack

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

---

<div class="post-metadata">

**Author:** ![escwxyz](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/escwxyz/32/9311_2.png) [@escwxyz](https://forum.cursor.com/u/escwxyz)\
**Post date:** [October 22, 2024, 8:25am UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/12 "2024-10-22T08:25:23Z")

</div>

You can try Raycast extension for [https://cursor.directroy](https://cursor.directroy) if you are on macOS.

> **[Raycast Store: Cursor Directory](https://www.raycast.com/escwxyz/cursor-directory)**
>
> Your cursor.directory in Raycast

---

<div class="post-metadata">

**Author:** ![CheeStudio](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/cheestudio/32/1714_2.png) [@CheeStudio](https://forum.cursor.com/u/CheeStudio)\
**Post date:** [November 19, 2024, 12:33am UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/13 "2024-11-19T00:33:00Z")

</div>

this is aaaawwwwwwwwsoooooooommmmmeeeee

---

<div class="post-metadata">

**Author:** ![Br3n0k](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Br3n0k](https://forum.cursor.com/u/Br3n0k)\
**Post date:** [December 22, 2024, 9:30pm UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/14 "2024-12-22T21:30:52Z")

</div>

I don’t think I’ll ever be able to say that I thought this was a bit of a useless feature, but now in version 44.8, I had a significant gain in logic in the flow of my software because I adopted the idea of ​​cursor rules, I took many prompts from [cursor.directory](https://cursor.directory/) and adapted them for each of my projects. And I also added the option to include the .cursorrules file to add the key and import a prompt within the codebase logic, this made the language models better understand the codebase indexing and apply more correct logic to my workflow.

 ![Captura de tela 2024-12-22 182735](https://us1.discourse-cdn.com/cursor1/original/3X/3/b/3b21bfae2766f4aa0bfbec84a23ee913b57649a1.png)  
 ![Captura de tela 2024-12-22 182820](https://us1.discourse-cdn.com/cursor1/original/3X/e/f/efb5929ee6f240100f4f20453374f5ec50bef187.png)  
 ![Captura de tela 2024-12-22 182846](https://us1.discourse-cdn.com/cursor1/original/3X/9/2/92a9e3e5c24a4446951ce473830000ddd8cefcd5.png)

the result was really surprisingly better, not to mention the option of interacting with the lints… this is fantastic in composer and yolo mode.  
I believe that in the future the only thing that should be considered is migrating the electron cursor core to a low-level language like rust or c++, in order to improve the application’s performance, because the software line seems to have started to get very good.

---

<div class="post-metadata">

**Author:** ![razbakov](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/razbakov/32/19554_2.png) [@razbakov](https://forum.cursor.com/u/razbakov)\
**Post date:** [January 11, 2025, 1:37am UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/15 "2025-01-11T01:37:56Z")

</div>

The last example is very good. The secret to .cursorrules format is to write JSON, not markdown. I think because JSON is more like mindmap, it’s hierarchical and contextual. All these cursor directories are low quality, those prompts might work in ChatGPT, but not as a cursorfile. You can play around with examples I built, so far I very happy with the result. [AI-First Organization](https://razbakov.com/blog/2025-01-10-ai-first)

---

<div class="post-metadata">

**Author:** ![tomredman](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/tomredman/32/2287_2.png) [@tomredman](https://forum.cursor.com/u/tomredman)\
**Post date:** [January 22, 2025, 10:26pm UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/16 "2025-01-22T22:26:11Z")

</div>

With minimal prompting, I had Claude 3.5 write its own .cursorrules in Agent mode and it worked really well.

My prompt:

```auto
Do a quick look over the codebase to understand:
- the stack we're using (e.g. tanstack router, tanstack query, convex, react, shadcn, etc.)
- review the conventions and styles used
- then write some instructions for a .cursorrules file based on your observations. cursor rules files are dot files at the root of repository (i've made an empty one) that "customize AI behavior, streamline the development and tailor code generation, suggestions and queries to your framework and language."
- therefore, what you write will be your OWN rules, based on things we've learned building this project.

```

Resulting `.cursorrules`:

 ![cursorrules](https://us1.discourse-cdn.com/cursor1/original/3X/1/8/18601859ccf28c4543f6f9158128da1dc17728e6.jpeg)

> <https://gist.github.com/tomredman/70ad5b7bd53ef5e8b445a36e5fa5b0cc>

---

<div class="post-metadata">

**Author:** ![kimhwanhoon](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/kimhwanhoon/32/22410_2.png) [@kimhwanhoon](https://forum.cursor.com/u/kimhwanhoon)\
**Post date:** [January 26, 2025, 3:44pm UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/17 "2025-01-26T15:44:44Z")

</div>

[cursorrules example](https://github.com/encoredev/encore/blob/main/ts_llm_instructions.txt)

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [June 18, 2026, 10:25am UTC](https://forum.cursor.com/t/good-examples-of-cursorrules-file/4346/18 "2026-06-18T10:25:41Z")

</div>

Closed on June 18, 2026, 10:25am UTC


