Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature suggestion: implement Cursor Rules support, or equivalent #3303

Open
mikehearn opened this issue Feb 19, 2025 · 0 comments
Open

Feature suggestion: implement Cursor Rules support, or equivalent #3303

mikehearn opened this issue Feb 19, 2025 · 0 comments

Comments

@mikehearn
Copy link

The Cursor IDE is basically VSCode + something like Aider. It has a concept called Rules:

https://docs.cursor.com/context/rules-for-ai

These are basically pattern match rules on "events" like the model creating a file, a file being added to the context, etc. They allow prompts to be automatically customized by context.

There's an interesting blog post here by someone who argues for the construction of "stdlibs" of rules that help power up the model:

https://ghuntley.com/stdlib/

Example rules include:

  • Don't create Bazel build files.
  • Framework or language specific style rules.
  • Code style rules for specific folders.

The Cursor format is a bit odd - it appears to be YAML embedded inside Markdown with header context. Presumably it's done this way so rules can be created using a GUI. I don't personally use Cursor so don't care about compatibility. Other people who work in teams might care more. It strikes me that the format doesn't seem to be terribly intuitive, nor documented, so Aider could perhaps invent a better format.

A simple git-like approach would be to have an .aider directory that can contain hook scripts. When an event occurs like a response being received from a model, hook scripts would be invoked as a sub-process which speak a simple file/stdout based protocol, perhaps with some other commands existing in the environment. For instance, a script added to .aider/hooks/on-edit.d/do-the-thing could:

  • Fix common errors made by a model.
  • Automatically extend the context based on file type or location.
  • Recursively invoke a model on the first output of the model (perhaps by calling back into Aider using a command supplied in an environment variable?)
  • Generate a suggestion or automatic submission of the next command.

And so on. On Windows Aider could notice the .ps1 extension to send the script to PowerShell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant