Auto best practices
Platforms supported: GitHub
- Identifies recurring patterns from accepted suggestions.
- Automatically generates best practices page based on what your team consistently values.
- Applies these learned patterns to future code reviews.
How to enable auto best practices
To enable auto best practices, add the following to your configuration file:Example

Custom best practices
Platforms supported: GitHub, GitLab, Bitbucket
Local best practices file
For basic usage, create abest_practices.md file in your repository’s root directory containing a list of best practices, coding standards, and guidelines specific to your repository. Qodo will use this best_practices.md file as a reference.
In case the PR code violates any of the best practices guidelines, Qodo will create additional suggestions, with a dedicated label: Organization best practices.
Writing effective best practices files
The following guidelines apply to all best practices files:- Write clearly and concisely.
- Include brief code examples when helpful with before/after patterns.
- Focus on project-specific guidelines that will result in relevant suggestions you actually want to get.
-
Keep each file relatively short, under 800 lines, since:
- AI models may not process effectively very long documents.
- Long files tend to contain generic guidelines already known to AI.
- Use pattern-based structure rather than simple bullet points for better clarity.
Example best_practices.md
Error handling
You can create abest_practices.md file in your repository root with content like:
Null checks
You can create abest_practices.md file in your repository root with content like:
Global hierarchical best practices
For organizations managing multiple repositories with different requirements, Qodo supports a hierarchical best practices system using a dedicated global configuration repository. Supported scenarios:- Standalone repositories: Individual repositories can have their own specific best practices tailored to their unique requirements
- Groups of repositories: Repositories can be mapped to shared group-level best practices for consistent standards across similar projects
- Monorepos with subprojects: Large monorepos can have both repository-level and subproject-level best practices, with automatic path-based matching
-
Create a new repository named
pr-agent-settingsin your organization/workspace. -
Build the folder hierarchy in your
pr-agent-settingsrepository. For example:
Note:In this structure,
pr-agent-settings, codebase_standards, global, groups, metadata.yaml, and best_practices.md are hardcoded names that must be used exactly as shown.All other names (such as frontend_repos, backend_repos, repo_a, monorepo-name, service-a, etc.) are examples and should be replaced with your actual repository and service names.Grouping and categorizing best practices
-
Each folder (including the global folder) can contain a single
best_practices.mdfile. -
Organize repository best practices by creating subfolders within the
groupsfolder. Group them by purpose, programming languages, or other categories
- Define the metadata file
metadata.yamlthat maps your repositories to their relevant best practices paths. For example:
- Set the following configuration in your global configuration file:
Best practices priority
When global best practices are enabled, Qodo follows this priority order:- Primary: Global hierarchical best practices from
pr-agent-settingsrepository:
- Fallback: Local repository
best_practices.mdfile:
Edge cases and behavior
-
Missing paths: If specified paths in
metadata.yamldon’t exist in the file system, those paths are skipped - Monorepo subproject matching: For monorepos, Qodo automatically matches PR file paths against subproject paths to apply relevant best practices
- Multiple group inheritance: Repositories can inherit from multiple groups, and all applicable best practices are combined
Best practices suggestions label
Best practice suggestions are labeled asOrganization best practice by default.
To customize this label, modify it in your configuration file:
{organization_name} best practice.

How it works
1. Exploration Phase – Finding Code Issues
Theimprove tool scans PR code changes for potential issues—not minor formatting errors, but real problems like bugs, logic flaws, or anti-patterns. This phase is exploratory by design, helping surface meaningful suggestions beyond predefined categories.
2. Tracking Implemented Suggestions
Qodo automatically tracks accepted AI-generated suggestions. When PR authors apply a suggestion, it’s logged in the.pr_agent_accepted_suggestions Wiki page.
This tracking provides the foundation for learning what works.
3. Learning from Accepted Patterns
Once a month, Qodo analyzes accepted suggestions to generate a custom.pr_agent_auto_best_practices Wiki file. These patterns represent practices that your team implicitly approves through repeated adoption.
4. Applying Best Practices in Reviews
During the next use of theimprove tool:
- The tool checks code changes against these learned patterns.
- If a suggestion matches a learned best practice, it’s clearly labeled with “Learned best practice.”
-
This creates a two-phase analysis:
- Exploratory: Surfaces general issues without restrictions
- Targeted: Checks for violations of established, successful patterns