Rules not automatically picked up

Not sure what you mean by that? Are you talking about the context glob?

Here’s my main ruleset I’d like included on every request. I tried leaving the glob empty and using *:

1 Like

Thank you for the screenshot.

Per documentation you have to describe the case when the rule should be used by ai by writing that into the description field, and if you want it to work only on certain files then add the extensions in glob

Semantic Descriptions: Each rule can include a description of when it should be applied
File Pattern Matching: Use glob patterns to specify which files/folders the rule applies to

Just made a thread about my confusion over Project Rules. Cursor team really should’ve thought about this before implementing it. The docs are of zero help.

The mistake in docu is that they use the word ‘can’ where it should say 'must. thats all.

Yea completely unclear in the docs. Does the semantic description go in the title of the rule, or just as the first line of the rule or something?

There is a field description. Thats the word used in docu as well, write when this file should be used in the field description of the rule file.

I put at the very top of the project rule to respond with a specific emoji first, and it did not do it. o3-mini model, agent-mode. The description states it must retrieve it for ALL files in the project.

Not sure if a mention to use it on ALL files is the right description for the LLM that processes the descriptions :slight_smile:

Then what description would you suggest for a rule that we want to always have loaded into context?

I guess “Always load this rule when doing code changes”? depends really what you mean when you say to apply to all files (why, what is being done on the files,…)

The issue is i cant evaluate the rules processing externally.
Cursor made .cursorrules file which is a always include. but it seems they are going to deprecate it. My guess is because people use it the same way as they used pinned context files with too much content which made it hard for the AI to choose the matching part.

Alternatively for ‘always’ you should put it in the cursor settings into the “Rules for AI” part. (not project rule files)

For now my solution is making the description “Always use this rule” for my main rule. This seems to be working properly.

1 Like

This kind of rule is pretty useless, as cursor most probably have these or use a model (like codex and claude-sonnet) that has general stuff like this.

Your rules must be task-specific, self-contained, and not ambiguous or very generic.

Start by noting what cursor is doing bad, or missing and add a specific rule for that.

In my case, cursor was writing Python without docstring. so I made a specific rule for that.

The most important rule is that, LLMs don’t have infinite memory, and are bad at keeping large context, so avoid overloading and creating a rule of multiple pages, it will just make your result worse.

@cursor
Please clarify if the rule is always applied when editing a file that matches the glob pattern.

If not, how about showing the rule that the cursor is applying in the chat or composer panel?

The reason why engineers tend to prefer cursor instead of replit or bolt is because of its accuracy of its behavior.

Yea, but I prefer:

1 — Rule get picked up automatically (like stated in the doc)
2 — Show me what rule been used in every chat/compose conversation.

2 Likes

I am also not having my rules picked up automatically.

Also, check out this response when I manually included the rule file. Seems like something might be off with your prompt template. Seems like you have instructed it not to acknowledge the file explicitly which means the “Start each response with :sunglasses:” strategy won’t work. We would need some other strategy to indicate that it is being picked up.

I’d like to +1 that automatic context of cursor rules does not work for me based on

Semantic Descriptions: Each rule can include a description of when it should be applied
File Pattern Matching: Use glob patterns to specify which files/folders the rule applies to

I tried pretty much everything suggested in this thread

  • Make sure the rules are committed / resync
  • Close / reopen project
  • Attempt matching of different rules (all created in the settings page)
    • Very direct match on description
    • Match on glob
    • Match on rules without glob

Pulling in via @Cursor Rules works fine

When you only supply a glob pattern (no description) for project rules, Composer doesn’t explicitly tell you that it’s used the rule (since it’s supposed to be automatic).

You can see it adds “:sunglasses:” so it’s following the rule.

If you’re having trouble with project rules not being automatically applied:

  • try removing the description
  • make sure your file matching pattern is correct
  • make sure you add a file that matches one of your glob patterns to your file context

Same here. If I need to explicitly reference this rule. Why cursor has this glob match input

So much time, so many users with the problem, and nobody officially speaks out. To this day the rules are still a problem.

2 Likes

I was able to get the rules to be picked up by deleting the project index and rebuilding.
When I started a new chat in agent mode I asked “Has any context been provided to you regarding code styling rules?” and it was able to reply with the rules I defined for code styling, whereas before it wasn’t able to find any rules.