Custom rules allow you to enforce your organization’s specific best practices across all pull requests. The rules library lets you discover proven rules from other successful teams, apply one rule to multiple repositories, and manage everything from a central dashboard. Rules library with categories and multi-repo management

Rules library

The rules library enables teams to share and adopt best practices efficiently. Instead of creating the same rule for each repository, you can create a rule once and apply it to any number of repositories. Manage all your rules from the rules library

Creating custom rules

To create a new rule, navigate to the Rules library in cubic and click “Add rule”. You can also adopt existing rules from the community library with a single click. Each custom rule includes:
  1. A Name
    A concise title, like “Prevent N+1 Queries” or “Require Sentry Error Handling.”
  2. A Description
    A clear, natural-language instruction the AI will use, such as “Flag code that may cause multiple database calls inside loops.”
    Be as clear and explicit as possible; the more specific you are, the better the results.
  3. Optional Path Filters
    Use Glob patterns to limit where the rule applies (or exclude certain paths). This is especially helpful for monorepos, where different directories often require different rules. For example:
    • Include: backend/** to apply the rule only to files under a backend folder.
    • Exclude: !tests/** to ignore test files and focus on production code.
Add rule
Custom rules can be applied to multiple repositories from a single definition. You can enable different combinations of rules for each repository while managing them all from one central location.

Managing rules across repositories

The multi-repository management capability streamlines how teams handle custom rules at scale:

One rule, many repositories

When you create or edit a rule, you can select which repositories it applies to:
  • Use the repository selector to choose multiple targets
  • Apply the same security check to all 150 microservices with one rule
  • Maintain consistency without duplication

Repository-specific control

While rules are centrally managed, you maintain granular control:
  • Enable or disable rules per repository as needed
  • Different repositories can use different combinations of rules
  • Changes propagate instantly across all selected repositories

Benefits for teams at scale

This approach dramatically simplifies rule management:
  • Before: Creating 150 separate rules for 150 microservices
  • After: One rule applied to all 150 repositories
  • Time saved: Hours of setup reduced to minutes
  • Maintenance: Update once, apply everywhere

Importing rules from Cursor

If your team uses Cursor rules, you can easily import these into cubic by clicking the Sync Cursor Rules button on the AI review page. cubic will analyze your Cursor rule files, suggest suitable custom rules, and let you select which ones you’d like to enable.

Limitations

  • Rule limit: Each repository can have a maximum of 5 enabled custom rules at a time. The rules library allows you to define more rules but only 5 can be active per repository.
  • Single check per PR: cubic currently performs rule checks only once when the pull request is first opened. Subsequent commits won’t trigger additional checks yet.
  • Potential false positives: Occasionally, the AI might incorrectly flag or overlook certain scenarios. Consider AI feedback as helpful guidance rather than definitive judgments.

Tips for effective custom rules

  • Start with the library: Before creating a new rule, check if a similar one already exists in the community library. You can adopt and customize popular rules to fit your needs.
  • Combine related checks: With a limit of 5 active rules per repository, combine multiple related checks into a single rule where it makes sense. The multi-repository feature means you only need to define this once.
  • Leverage path filters in monorepos: When working with monorepos, use Glob patterns to target specific files or folders. The “glob wizard” and “glob testing” tools help ensure your patterns work correctly.
  • Use repository groups: Apply rules to logical groups of repositories (e.g., all frontend repos, all microservices) to maintain consistency across similar projects.
  • Learn from others: Browse popular rules in the library to see what other successful teams are checking for. This can inspire new rules or improvements to your existing ones.
  • Complement existing tools: Custom rules should focus on checks that standard tools like ESLint or Prettier might miss, such as business logic validations or team-specific conventions.

Next steps

  • Rules library: Explore community rules and manage your custom rules across repositories.
  • AI review settings: Configure AI review behavior for your repositories.
  • Introduction: Understand how cubic reviews pull requests by default.