Skip to main content

Rule

Introduction

Rule is a rule management feature provided by CodeSouler, allowing users to create and manage custom rule files. Through this feature, you can define project-specific coding standards, development guidelines, and best practices, ensuring team members follow unified development standards.

1. Creating Rule Files

Creation Steps Please follow these steps to create a Rule file:

  1. Select the Rules option in the CodeSouler settings page.
  2. Click the "Add new rule" button to create a new rule file.
  3. Assign a meaningful name to the rule file.
  4. Write rule content using Markdown format, supporting standard Markdown syntax such as headings, lists, code blocks, etc.

img

2. Using Rules

Usage Steps Please follow these steps to use Rules:

  1. Enter the +Rules command in the CodeSouler dialog.
  2. The system will display a list of all available rule files in the current project.
  3. Select the rules you want to apply from the list.
  4. The selected rules will be added to the conversation context, and the AI assistant will provide suggestions and guidance based on these rules.

img

3. Advanced Rule Configuration

3.1 Cursor Rule Compatibility

  • CodeSouler Rules are fully compatible with Cursor Rule's .mdc file format
  • You can directly use existing Cursor Rule files without additional conversion

3.2 Always Mode

  • Set alwaysApply to true to enable Always mode
  • In this mode, chat and agent will automatically include global rules as context in every conversation
  • Suitable for core development standards that need to be followed consistently

img

3.3 AgentRequested Mode

  • Set alwaysApply to true
  • Provide detailed descriptions of the rule document's purpose and usage scenarios in the description field
  • Agent will intelligently determine whether to adopt the rules based on the description
  • Suitable for development standards in specific scenarios

img

4. Best Practices

Recommendations To use the Rule feature more effectively, we recommend:

  1. Create separate rule files for different types of rules, such as code style, security standards, performance optimization, etc.

  2. Provide specific examples and explanations in rule descriptions to help team members better understand and implement them.

  3. Regularly update rule content to ensure alignment with the latest development practices.

  4. Use Markdown's code block feature to showcase specific code examples and anti-patterns.

  5. Add clear priority levels and scope of application to rules.

  6. Establish a rule review and update mechanism within the team to ensure rules remain effective and practical.