I. Background note
1.1 The need for .cursorules
exist Cursor Rules for AI helps you set some basic rules for the code generated by AI, such as style, naming style, etc. This way, both in code completion and command execution, AI can better meet the needs of your project. In this way, AI can better meet the needs of your project, both in code completion and command execution.
But there are some problems in that it's not a good idea to write Rules for AI completely to death if you're doing different projects, especially if you're switching frequently between writing scripts, making websites, making apps, all these different projects.
At this point you can use .cursorrules, which can be thought of as a more advanced mode of customizing the system prompt words for the project.
If your project requires more detailed rules, then you can create a .cursorrules file in the project root directory. This way, Cursor will automatically load the customization instructions in it and generate effects tailored to this project.
Using .cursorrules has the following three benefits:
1, multi-project differentiation management: different projects have different coding specifications and library requirements , .cursorrules can make each project's Cursor performance are in line with your expectations .
2. Reduce manual adjustment: set the naming rules, dependency libraries, Cursor will automatically apply these specifications, no need to modify frequently.
3, unified style: whether it is variable naming or comment format , AI will follow the specific requirements of the project to make the code more coherent.
With the .cursorrules file, Cursor reads the system prompt that serves as its system prompt and enforces these rules whenever it talks to you in this project.
1.2 Difficulties in the management of .cursorrules
However, I often encounter difficulties when I use it, especially in the case of many types of projects I do, I am often too lazy to manage the .cursorrules file, and it is not so convenient to find and use it. So I would like to have a better way to import .cursorrules files for a project easily.
Thus, this Cursor (VScode) plugin was born.
Second, Cursor Rules - Peanut Plugin
This is a Cursor (VScode) plugin that helps you quickly configure the rules of the Cursor AI programming assistant. With this plugin, you can easily add preconfigured Cursor Rules rule files to your project. Since Cursor itself is shell VScode, so Cursor plugin and VScode plugin you can understand is a concept.
2.1 Functional characteristics
Provides a wide variety of preset Cursor rules rule configurations, including:
- General: ground rules applicable to all projects
- Chrome Plugin: Browser Extension Development
- WeChat small program: small program development rules
- App Development - iOS: iOS App Development
- App Development - Android: Android Development
- HTML: HTML/CSS/JavaScript
- React: React Development Rules
- Vue: Vue.js Development Rules
- python: Python Development Rules
- local development
- Web Development
- mobile development
- Small program development
- Browser plug-ins
- General rules
2.2 Installation methods
The plugin is now available, you can also install it by searching for "Peanuts: Chinese Cursor Rules" in Cursor's plugin marketplace.
2.3 Methods of use
Mode 1: Command Panel
- Open your project folder in VSCode
- Use the shortcut Ctrl+Shift+P (Windows) or Cmd+Shift+P (Mac) to open the command panel
- Type "Peanut" or "Add Cursor Rule File".
- Select the type of rule you want to add from the list
- Confirmation of adding rules
Way 2: Right-click menu
- In VSCode's Explorer
- Right-click on any folder
- Select "Peanuts: Add Cursor Rule File".
- Select the rule type and confirm
If the .cursorrules file already exists in the target location, the plugin provides the following options:
- Override: Replacement of existing rules with new ones
- Consolidation: merging new rules with existing ones
- Cancellation: leave existing rules unchanged