AI Assistant Help

Configure project rules

Project-specific rules help AI Assistant better understand your code, preferred tools, and coding conventions. By defining these rules, you can improve the relevance of AI responses and ensure that suggestions align with your project setup.

By default, project rules are automatically added to each chat session, so AI Assistant adheres to the provided guidelines. You can customize this behavior – for example, apply rules only to specific files, invoke them manually, or let the model decide when to use them.

To configure project rules:

  1. Go to Settings | Tools | AI Assistant | Rules.

    Project rules
  2. Click New Project Rules File and provide a name for the file.

  3. Switch to the created rule file and select the Rule type. The following types are available:

    Project rules types
    • Always – applied automatically to all chat sessions. As a result, AI Assistant will always take the specified guidelines into consideration when providing responses.

    • Manually – applied only when explicitly invoked in the chat using @rule: or #rule:, or added via the Add attachment action.

    • By model decision – applied when the model considers the rule relevant. You must also provide an Instruction so AI Assistant can understand when the rule should be applied. For example, you can instruct AI Assistant to apply the rule only when you work with Java files.

    • By file patterns – applied when a file referenced in the chat matches the specified file pattern (for example, *.kt or src/**). The pattern must be provided in the Patterns field.

    • Off – the rule is inactive and not applied.

  4. Add the guidelines to the Markdown file. Here is an example of what the file with guidelines may look like:

    # General Code Review Guidelines ## Naming - Use clear, descriptive names for variables, functions, and classes - Avoid single-letter names except for loop indices - Follow consistent naming conventions throughout the project ## Style - Keep line length reasonable (e.g., 100–120 characters) - Use consistent indentation and spacing - Include comments for complex logic or important decisions ## Structure - Keep functions short and focused on a single responsibility - Avoid deep nesting and long parameter lists - Group related code logically ## Best Practices - Avoid duplicate code - Prefer composition over inheritance - Handle errors and edge cases gracefully ## Documentation - Write doc comments for public functions and modules - Keep documentation up to date with code changes ## Tools - Follow project-specific tooling or linters - Use version control best practices (e.g., atomic commits, meaningful messages)

Once configured, AI Assistant will use the rules (if applicable) when providing responses. To check whether the rules were applied, expand the list of attachments at the beginning of the AI Assistant's response:

Project rules attached to the AI Assistant's response
14 July 2025
Morty Proxy This is a proxified and sanitized view of the page, visit original site.