mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-08 14:50:40 +08:00
docs: add auto best practices documentation and configuration
This commit is contained in:
64
docs/docs/core-abilities/auto_best_practices.md
Normal file
64
docs/docs/core-abilities/auto_best_practices.md
Normal file
@ -0,0 +1,64 @@
|
||||
# Auto Best Practices 💎
|
||||
`Supported Git Platforms: GitHub`
|
||||
|
||||
## Overview
|
||||
|
||||
### Finding Code Problems - Exploration Phase
|
||||
|
||||
The Qodo Merge `improve` tool identifies potential issues, problems and bugs in Pull Request (PR) code changes.
|
||||
Rather than focusing on generic concepts like code style, the tool intelligently analyzes code to detect meaningful problems.
|
||||
|
||||
The analysis is intentionally broad to allow discovery of diverse issues - from subtle bugs to architectural concerns.
|
||||
This open-ended exploration enables the tool to surface any relevant issues without being constrained to predefined categories.
|
||||
|
||||
### Tracking Implemented Suggestions
|
||||
|
||||
Qodo Merge features a novel [tracking system](https://qodo-merge-docs.qodo.ai/tools/improve/#suggestion-tracking) that automatically detects when PR authors implement AI-generated code suggestions.
|
||||
All accepted suggestions are documented in a repository-specific wiki page called [`.pr_agent_accepted_suggestions`](https://github.com/qodo-ai/pr-agent/wiki/.pr_agent_accepted_suggestions).
|
||||
|
||||
### Learning and Applying Auto Best Practices
|
||||
|
||||
Monthly, Qodo Merge analyzes the collection of accepted suggestions to generate repository-specific best practices, stored in [`.pr_agent_auto_best_practices`](https://github.com/qodo-ai/pr-agent/wiki/.pr_agent_auto_best_practices) wiki file.
|
||||
These best practices reflect recurring patterns in accepted code improvements.
|
||||
|
||||
The `improve` tool will incorporate these best practices as an additional analysis layer, checking PR code changes against known patterns of previously accepted improvements.
|
||||
This creates a two-phase analysis:
|
||||
|
||||
1. Open exploration for general code issues
|
||||
2. Targeted checking against established best practices - exploiting the knowledge gained from past suggestions
|
||||
|
||||
By keeping these phases decoupled, the tool remains free to discover new or unseen issues and problems, while also learning from past experiences.
|
||||
|
||||
When presenting the suggestions generated by the `improve` tool, Qodo Merge will add a dedicated label for each suggestion generated from the auto best practices - 'Learned Best Practice':
|
||||
|
||||
{width=512}
|
||||
|
||||
|
||||
## Auto Best Practices vs Custom Best Practices
|
||||
|
||||
Teams and companies can also manually define their own [custom best practices](https://qodo-merge-docs.qodo.ai/tools/improve/#best-practices) in Qodo Merge to evaluate PR code changes.
|
||||
|
||||
When custom best practices exist, Qodo Merge will still generate an 'auto best practices' wiki file, though it won't use it in the `improve` tool analysis.
|
||||
However, this auto-generated file can still serve two valuable purposes:
|
||||
|
||||
1. It can help enhance your custom best practices with additional insights derived from suggestions your team found valuable enough to implement
|
||||
2. It demonstrates effective patterns for writing AI-friendly best practices
|
||||
|
||||
We recommend regularly reviewing the auto best practices file to refine your custom rules, even when using custom best practices.
|
||||
|
||||
## Relevant configurations
|
||||
|
||||
```toml
|
||||
[auto_best_practices]
|
||||
# Disable all auto best practices usage or generation
|
||||
enable_auto_best_practices = true
|
||||
|
||||
# Disable usage of auto best practices file in the 'improve' tool
|
||||
utilize_auto_best_practices = true
|
||||
|
||||
# Extra instructions to the auto best practices generation prompt
|
||||
extra_instructions = ""
|
||||
|
||||
# Max number of patterns to be detected
|
||||
max_patterns = 5
|
||||
```
|
@ -2,6 +2,7 @@
|
||||
Qodo Merge utilizes a variety of core abilities to provide a comprehensive and efficient code review experience. These abilities include:
|
||||
|
||||
- [Fetching ticket context](https://qodo-merge-docs.qodo.ai/core-abilities/fetching_ticket_context/)
|
||||
- [Auto best practices](https://qodo-merge-docs.qodo.ai/core-abilities/auto_best_practices/)
|
||||
- [Local and global metadata](https://qodo-merge-docs.qodo.ai/core-abilities/metadata/)
|
||||
- [Dynamic context](https://qodo-merge-docs.qodo.ai/core-abilities/dynamic_context/)
|
||||
- [Self-reflection](https://qodo-merge-docs.qodo.ai/core-abilities/self_reflection/)
|
||||
|
Reference in New Issue
Block a user