Generating and Managing Rules

This page explains how to generate and manage rules in the Qodo portal, including rule lifecycle operations such as editing, disabling, and deletion.

Admins can create, edit, enable, approve, and delete rules. Members can generate rules in the portal; however, these rules appear in the Suggestions tab and require admin approval before becoming active. Members can also view active rules, suggested rules, and review rule outcomes during code reviews.

Anatomy of a rule

A rule consists of the following fields:

Field
Description
Details

Rule name

Short, descriptive title summarizing the rule’s intent.

Shown in the Rules table and in code review findings.

Rule content

Enforcement description used during reviews.

Explains what to check and what behavior is expected.

Examples

Compliant and non-compliant code examples.

Displayed to developers when violations occur.

Category

Type of issue the rule addresses.

Security, Correctness, Quality, Reliability, Performance, Testability, Compliance, Accessibility, Observability, Architecture.

Severity

Priority level of a violation.

Error (action required), Warning (recommended), Recommendation (informational).

Scope

Where the rule is enforced.

Can be left empty to apply organization-wide, or limited to specific Git organizations, repositories, and optional path patterns.

Rule scope

Scope defines where the rule is enforced.

By default, a rule applies organization-wide. You can narrow the scope to limit enforcement:

  • Organization — leave the scope empty to apply the rule to all repositories across all Git organizations.

  • Git organization — applies the rule to selected Git organizations.

  • Repository — applies only to selected repositories.

  • Path patterns — applies to specific directories or files within a repository. Path patterns are optional and can only be added after selecting a repository, and are especially useful for monorepos where different projects or services live under the same repository.

Generate a rule

Use this flow to describe a rule in natural language and let Qodo agent generate a structured draft.

Step 1: Start rule generation

  1. From Rules, click Generate.

  2. Enter a short description of the rule’s intent.

  3. Click Generate rule.

Example prompts:

  • “Disallow console.log in production builds”

  • “Avoid SQL string concatenation with user input”

Step 2: Review the generated rule draft

Qodo generates a complete rule draft that can be edited before activation.

Before activation, Qodo checks for:

  • Conflicts

  • Duplicates

  • Overlapping scope

You can review related rules or revise the draft.

Step 4: Accept and activate

  1. Click Accept & activate to enable enforcement.

The rule is added to the Rules table and enforced automatically according to its defined scope (repositories and optional path patterns).

Manage existing rules

Management actions for existing rules are available from the actions menu (⋮) in the Rules table. These actions are optional and can be performed at any time by admins or team admins.

Editing a rule - Editing an existing rule.

Enabling or disabling a rule - Disabling pauses enforcement while retaining history.

Deleting a rule - Deletion is permanent and irreversible.

Best practices for maintenance

  • Edit instead of duplicating

  • Disable before deleting

  • Keep scopes narrow

  • Periodically review low-signal rules

Last updated