Learn how to configure Lingma AI rules. This feature lets you define your own rule prompts to help models generate code or answers that are more accurate, personalized, and project-specific.
To get best practices for system prompts, visit the Lingma rule library. |
Before you start
Make sure you have updated Lingma to the latest version. See Install Lingma for details.
JetBrains plugin: v2.1.5 or later.
VS Code plugin: v2.1.6 or later.
Visual Studio plugin: v0.4.4 or later.
Lingma IDE
What is a project rule?
Lingma project-specific rules are stored in the .lingma/rules
directory and only apply to the current project. These rules help models understand the project's framework and your coding preferences.
Applicable scenarios
These rules apply to all requests in Ask, Edit, and Agent modes, except for the following:
Slash commands (such as
/debug
)Commit messages
Note: Inline code completion does not follow these rules.
Limits
Currently, only one rule file is supported. The file can have up to 10,000 characters. Any extra content will be cut off upon saving or synchronization.
Use simple descriptions in your rule files. Images and links are not allowed.
How to configure rules
Open the configuration file and click Edit to open the file editing page.
If the file does not exist, it will be created automatically.
If it does exist, you can edit it.
VS Code:
Click the
icon to open the Lingma plugin.
Click the
icon to go to the Settings page.
Navigate to AI Rules: Project Rules to edit the rule file.
JetBrains:
Click Settings to go to the Settings page.
Navigate to AI Rules > Enable Project Rules to edit the rule file.
Rule files for your project are synced with your local code and apply only to that project. If you want the rules to apply only to your personal project, add the rule file to the
.gitignore
file.