Cursor rules files format aren't clear

Hi everyone!

I’m a newcomer client, and I want to start by saying that Cursor offers a really neat and structured way of working—kudos for that! However, after a few days of exploring, I’m still unsure about the correct format for the Cursor Rules file.

I tried using Cursor Directory - Cursor Rules & MCP Servers to ease the process and generate basic rules from my package.json, but the resulting file seems to already be deprecated.

When I checked the documentation (Cursor – Rules for AI), I found it quite confusing. It’s unclear what these rule files should look like, and there seem to be multiple, sometimes conflicting, suggestions from others on how to implement them.

It would be a huge help if the documentation were clearer and more consistent. A few example files or a step-by-step guide on building valid rule files from scratch would make a world of difference for new users like me.

Thanks for the hard work, and I’m looking forward to seeing this improve!

Control-Shift-P → “New Cursor Rule”

rules files must adhere to the below structure, live in the folder .cursor\rules\ have the file extension .mdc and use nothing other than lowercase and hyphens in their filename.

---
description: the agent will choose rules based on this description here 
globs: list of files and file patterns to trigger these rules to be auto-included to the agent context when matched; e.g. *.cs, src/config/**/*.json, *Test.cpp
---

- list of rules 
- You can @ files here
- You can use markdown but dont have to
1 Like

Thank you for the example, I must be blind because I couldn’t see that snippet in the page that you suggest. Cheers!