Auto Indexing of Version Number after Code Changes

Hello Folks,

I’ve been trying to configure Cursor to automatically increment the version number after any code update.

Right now, it works if I manually type:

“When done editing, index the Version Number.”

But I don’t want to have to type this every single time.

I’m developing a WordPress plugin, and I want Cursor to automatically increment the patch version number every time I make a code change.

Example:

  • Version format: Major.Minor.PatchX.X.{last+1}
  • If the current version is 1.0.5 , after a code update, it should automatically become 1.0.6 .

I tried adding this rule in the Project Settings > Rules, assuming it would handle this automatically, but NOPE! It doesn’t seem to work.

Here’s what I added to the cursor/rules file:

WordPress Plugin Version Number
- After making any code changes, always index to the next WordPress plugin version number.
- Follow these rules when indexing the version number:
  1. Use the following format: X.X.X (Major.Minor.Patch)
  2. After making any code changes, always increment the Patch Number.
  3. Use this format: (X.X.{last+1})
- Always follow these rules whenever code changes occur.
- Every time a code change is completed, ensure the version number is incremented.

Question:

How can I make this happen automatically without needing to prompt Cursor manually every time?

Any ideas or workarounds would be greatly appreciated!

Thanks,
Mike

Unfortunatly, there’s no built-in way to automatically increment version numbers in Cursor. While you can use the AI to help with version updates through manual prompts, automatic version incrementing isn’t a feature we have right now

For WordPress plugin development, you might want to look into using external tools like npm version or custom git hooks to handle this automatically. That way you won’t need to rely on manual prompts in Cursor

You can check out more about how Cursor handles project rules in our docs here: Rules for AI - but keep in mind these are mainly for customizing AI behavior rather than handling version numbers