New cursor rules files do not trigger when asked non strictly coding tasks

I’m trying to use cursor rules to “suggest” what git command to use to extract some info, but i can’t make the agent pick the rule unless i mention it specifically with @

This it my rule:


# Get the last release branch name

### Alternative prompts

- Get the last release version number
- What's the next release number
- What's the current release number

## Command to use

On any OS:

\```sh
git for-each-ref --sort=-committerdate refs/remotes/origin/release/* --format='%(refname:short)' --count=1
\```

## Notes

- If the user asks for the next version/release number add the counter to the digits but also specify what is the current release number.

  Example of result
 \ ```
  Current release: origin/release/11.0.1
  Next Patch release: origin/release/11.0.2
  Next Feature release: origin/release/11.1.0
  Next Major release: origin/release/12.1.0
 \ ```
  

Is this a Project Rule or in your .cursorrules?

If it’s a project rule, what is your description + glob? Are you sure it’s being seen by the composer?

I kept playing with it a bit, it seems Cursor is very picky about the rule description that you place on top.

The previous description was: “A list of suggested git commands to perform common tasks”

and my prompt was: “What is the next patch release?” or “What is the current release number”?

After a couple of attempts i changed the description to: “Get release version number with git”

After both prompts above started to work without mentioning the file.

Perhaps cursor should use the content of the rules to decide if it should be used or not?

In this case I would have loved to have a single rule file with multiple git commands kind of ready to use, but seems that i have to be very specific in the description field.

I’d recommend making your description even richer. Something that:

  • Summarises what the file does
  • Includes common questions that would warrant its usage

Try this:

Provides a Git command that retrieves the latest release branch name from a remote repository by sorting branches under “origin/release/*” by the committer date. It answers questions like “What is the current release number?”, “Get the last release version number”, and “What’s the next release number?” by displaying the most recent release branch. Additionally, when the next version is requested, it indicates both the current release number and suggests the next patch, feature, or major release.

mmh interesting

Perhaps that field should be multiline :slight_smile:

I will definitely try it out and try a similar approach even in other rules and let you know!

Top support btw thanks!

1 Like

Agreed. And no problem :grin:

Hello, a little update on rules. First i must say i’m very happy with the direction of Cursor, the rules files are a nice addition and this demonstrate that the Cursor team is always a step forward the competition.

Recently i’ve been working a lot on rules in the attempt of making cursor fetch the rules that are best for the current task, i had some quite good results, even with simpler description but there’s a catch.

i’ve been using the .cursorrules file to tell cursor to be very mindful of the project rules, this way the likelyhood it fetches them increased a lot.

I managed to make Cursor fetch multiple rules at a time and even to make it fetch rules in the mid of a conversation when the user changes topic or task without the user explicitly asking for it.

Making Cursor fetch rules in the mid of the conversation is quite difficult though, and i’m also aware the the .cursorrules file is considered deprecated however for this specific use-case it seems a necessary requirement to have a project wide rule that is always fetched regardless of the task.

here’s the content of .cursorrules i ended up with:

⚠️ FETCH RULES OR YOUR RESPONSE WILL BE WRONG ⚠️

MANDATORY: CALL fetch_rules FIRST

- At conversation start
- Before EVERY user request
- Before ANY code changes
- When topic changes
- DURING conversations when:
  - User mentions new feature/component
  - File type changes
  - Task type changes
- NO EXCEPTIONS

CHECK ALL MATCHING RULES:

- General guidelines (ALWAYS)
- Feature rules
- File type rules (.ts, .css, etc)

RULES OVERRIDE YOUR KNOWLEDGE.
PROCEED ONLY AFTER APPLYING ALL RULES.

REMEMBER: EVEN MID-CONVERSATION, FETCH RULES AGAIN!

This was for the most part generated by claude based on the content i put there earlier and it seems to kind of work, is not perfect of course but i can’t expect perfections from LLMs.

It would be really cool if you can keep this use case in consideration when moving forward with the rules feature.

In a nutshell:

  • make cursor very willing to fetch the rules
  • make cursor very willing to fetch more than 1 rule at a time
  • make cursor fetch new rules when the task changes or it becomes more complex and starts to involve multiple part of the system.

Here’s my list of rules and descriptions.

airule-api-module-guidelines
Guidelines for generating type-safe API modules that integrate with our query client and error handling system using manual API schemas. Used for creating/modifying API modules.

airule-css-guidelines
Guidelines for writing good CSS, including naming conventions and best practices. Used for any CSS/SCSS related tasks.

airule-general-code-guidelines
Must be used for ALL code-related tasks. Covers file extensions, function declarations, and protected folders.

airule-git-get-release-version
Provides Git commands for retrieving latest release branch names and determining version numbers.

airule-icon-guidelines
Comprehensive guide for icon usage, covering different types (monochrome, colored, animated) and implementation patterns.

airule-manual-schema-generation
Guidelines for generating and modifying manual schema files, including structure and best practices.

airule-package-manager-guidelines
Specifies Yarn as package manager and provides commands for dependency management and scripts.

airule-react-component-guidelines
Comprehensive guide for React component creation/modification, covering structure, naming, and best practices.

airule-run-dev-server-pointing-prod
Instructions for running dev server with production API, including special URL access.
1 Like

Hey jake another updated since now we are on 0.46.

It seems that the .cursorrules file is still necessary to “force” cursor to pick the rules from the .cursor/rules folder. Even if I set as alwaysApply a rule, it’s not always picked.

Here’s a video https://youtu.be/9h-GO4Ap04I

1 Like

Thanks for your feedback raythurnvoid.

This is something that’s being actively worked on, and should be resolved in the next release :slight_smile:

There is already version 0.47.3 in Cursor Changelog.
Is this issue resolved in 0.47.3?