All Products
Search
Document Center

AI Coding Assistant Lingma:AI rules

Last Updated:Apr 28, 2025

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.

image

To get best practices for system prompts, visit the Lingma rule library.

Before you start

Make sure you have updated the Lingma IDE plugin to the latest version:

  • JetBrains plugin: v2.1.5 or later.

  • VS Code plugin: v2.1.6 or later.

See Download and install guide for details.

What is a project rule?

Lingma project-specific rules are stored in the .lingma/rules directory and only apply to the current project. By setting these rules, you can help the model understand your coding preferences, like the project's frameworks and code styles.

莫3@1x (8)

Important

Applicable scenarios

These rules apply to all requests in AI Chat and AI Developer, except for the following:

  • Slash commands (such as /debug)

  • Commit messages

Note: Inline code completion does not follow these rules.

How to configure rules

  1. 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:

      1. Click the image icon to open the Lingma plugin.

      2. Click the image icon to go to the Settings page.

      3. Navigate to AI Rules: Project Rules to edit the rule file. 莫3@1x (5)

    • JetBrains:

      1. Click Settings to go to the Settings page.

      2. Navigate to AI Rules > Enable Project Rules to edit the rule file. 0E898DBA-1F49-4F9A-A820-D8170B885736

  2. 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.莫3@1x (6)

Considerations

  1. Each rule file can have up to 10,000 characters. Any extra content will be cut off upon saving or synchronization.

  2. Use simple descriptions in your rule files. Images and links are not allowed.