Rulesets is available only on the PRO plan.

MATTER.md

Similar to Cursor Rules, you can define rules in a MATTER.md file in the root of your repository. This file will be automatically detected and applied by MatterAI during code reviews. MATTER.md file must contain:
  • # CODE_REVIEW_RULES section: Define rules for code reviews

Best practices

  • Good rules are focused, actionable, and scoped.
  • Keep rules under 500 lines
  • Split large rules into multiple, composable rules
  • Provide concrete examples or referenced files
  • Avoid vague guidance. Write rules like clear internal docs
You can find more detailed examples in the Git repository here: https://github.com/GravityCloudAI/matter-rules-examples

Example

MATTER.md
# CODE_REVIEW_RULES

## 1. Code Format & Style
   - Use camelCase for variables and functions
   - Use PascalCase for constructors and classes
   - Use const for immutable values, let for variables
   - Prefer arrow functions for callbacks and short functions

## 2. Modern JavaScript Patterns
   - Use destructuring for object/array extraction
   - Prefer template literals over string concatenation
   - Use optional chaining (?.) for safe property access
   - Use nullish coalescing (??) for default values

## 3. Async Operations
   - Prefer async/await over .then() chains
   - Always handle promise rejections with try/catch
   - Use Promise.all() for parallel async operations
   - Avoid mixing async/await with .then()

## 4. Error Handling
   - Validate function parameters at entry
   - Use meaningful error messages
   - Handle edge cases (null, undefined, empty arrays)
   - Log errors with sufficient context

## 5. Performance & Memory
   - Avoid creating functions inside render loops
   - Use array methods (map, filter, reduce) appropriately
   - Clean up event listeners and timers
   - Minimize DOM manipulation in loops

Cursor Rules and Claude.md

If you have exisitng Cursor Rules or Claude.md files in your repositories, MatterAI can automatically detect and apply these rules during code reviews. This ensures that your established coding standards and practices are consistently enforced without any additional configuration. Check Configurations to enable this feature.

Language Rules

Language Rules allow you to define how MatterAI should review code written in specific programming languages. These rules help ensure that your team follows consistent coding standards, patterns, and best practices specific to each language in your tech stack. With Language Rules, you can:
  • Define language-specific standards: Create custom rules for Python, JavaScript, Java, Go, and other languages your team uses
  • Enforce coding conventions: Specify naming conventions, formatting preferences, and structural patterns
  • Prioritize review focus: Tell MatterAI which aspects of the code deserve more attention during reviews
  • Customize feedback style: Configure how detailed or concise the AI’s feedback should be for each language
  • Implement team-specific practices: Align reviews with your team’s unique development methodologies
Language Rules

Security Rules

Security Rules enable you to define how MatterAI should evaluate code for potential security vulnerabilities and compliance issues. These rules help your team maintain robust security standards across your codebase. With Security Rules, you can:
  • Target specific vulnerabilities: Configure the AI to focus on particular security concerns relevant to your applications
  • Implement compliance checks: Ensure code adheres to industry standards like OWASP, GDPR, HIPAA, etc.
  • Set severity thresholds: Define what level of security issues should trigger alerts
  • Customize security contexts: Create different security rule profiles for different parts of your application
  • Integrate with security workflows: Align AI reviews with your existing security practices and tools
Security Rules

Repository Rules

Repository Rules allow you to configure how MatterAI interacts with specific repositories in your organization. These rules help you tailor the review process to the unique requirements of each project. With Repository Rules, you can:
  • Set repository-specific priorities: Define what aspects of code should be emphasized in reviews for each repo
  • Configure branch policies: Create different review standards for different branches
  • Customize PR workflows: Define how MatterAI should participate in your pull request process
  • Set exclusion patterns: Specify files or directories that should be excluded from AI review
Repository Rules

Benefits of Custom Rulesets

  • Consistency: Ensure all code reviews follow the same standards across your organization
  • Efficiency: Automate enforcement of your team’s specific coding standards
  • Adaptability: Easily update rules as your team’s practices evolve
  • Knowledge sharing: Codify your team’s expertise and best practices