Documentation
Code Review

Code Review

Overview

The Code Review feature in CodeKnack automates the process of reviewing pull requests using AI. It acts as a virtual reviewer that identifies potential bugs, code quality issues, and architectural inconsistencies — allowing teams to accelerate development while maintaining high code standards.
CodeKnack not only highlights problems but also offers detailed suggestions, summaries, and contextual insights to improve code quality and reduce reviewer fatigue.

When Code Review Is Triggered

By default, code reviews are triggered automatically in the following scenarios:

- A new pull request (PR) is opened where the base branch is the repository’s default branch, and Code Review is enabled.
- A PR is updated with new commits.
- A user manually triggers a review command comment (see below).

Review Options

For optimal performance, you can fine-tune when and how reviews are triggered using Automatic Review and Incremental Review options.

1. Review Mode

Define how strict the AI should be when analyzing code:
Relaxed – Focuses only on high-impact issues (e.g., major bugs, critical errors). Ignores minor code style or non-blocking suggestions.
Strict – Provides a thorough review, including:

- Best practices
- Code style
- Minor improvements
- Potential refactors
 Use Strict Mode for production branches or compliance-sensitive projects.

2. High-Level Summary

Enables automatic generation of a concise summary for each pull request. The summary includes:

- Key changes in the PR
- Overall impact or purpose
- A clear summary to speed up team understanding

3. Summary Modes

Customize the detail level of summaries:

- Normal – Balanced detail, ideal for most teams.
- Concise – Brief and to-the-point summaries.
- Explanatory – Detailed explanations with context.

4. Automatic Review

Enable this option to let CodeKnack automatically review PRs whenever they are opened or updated.

- Saves time by eliminating manual review triggers.
- Ensures timely and consistent feedback.

5. Automatic Incremental Review

Optimize for iterative pull requests:

- Only the new changes since the last review are analyzed.
- Useful for fast-moving teams and large PRs with frequent updates.

6. Custom Review Instructions

Customize the review focus using plain language instructions. These are considered during each PR analysis.
such as telling it to ignore specific issue types like retinal display rendering bugs
This allows teams to align reviews with specific project needs or coding standards.

Code Review Commands

CodeKnack supports inline commands in PR comments to give users greater control over when and how reviews are executed.

| Command | Description |

|---------|-------------|

| `@codeknack review` | 
Triggers an immediate full review of the pull request. This is especially useful when automatic reviews are turned off or when the pull request’s base branch is not the default branch. |

| `@codeknack ignore` | 
Prevents CodeKnack from reviewing the pull request. Commonly used when automatic reviews are enabled, but you want to exclude a specific PR. Add this command in the PR description when creating the PR. |
Last Updated on
03 Oct 2025