# Pull Request Review Agent

CodeMate is an AI-powered Pull Request review agent that integrates seamlessly into your version control workflow. It automatically analyzes pull requests for correctness, maintainability, security, and performance, then posts clear, structured comments and actionable suggestions directly on your PRs. Designed to help engineering teams ship higher-quality code faster, CodeMate is currently available exclusively as an **Enterprise solution**.

<figure><img src="/files/qtcpGe5LEKDTgV99Ut0h" alt=""><figcaption></figcaption></figure>

***

### Automatic Triggers

When a PR is **opened**, **reopened**, **marked ready for review**, or **synchronized** (new commit pushed), CodeMate automatically runs three commands in sequence:

| Step | Command     | What it does                                                                 |
| ---- | ----------- | ---------------------------------------------------------------------------- |
| 1    | `/describe` | Generates a PR title, type, summary, code walkthrough, and file change table |
| 2    | `/review`   | Reviews the PR for issues, security concerns, and estimates review effort    |
| 3    | `/improve`  | Suggests code improvements inline                                            |

Each of these can be re-triggered manually at any time by posting the corresponding command as a PR comment.

***

### Commands

Post any of the following as a comment on a PR to trigger the corresponding action:

#### `/describe`

Generates a structured PR description including title, type (bug fix / feature / refactor / etc.), a plain-English summary, a file-by-file change walkthrough, and labels. The description is published directly to the PR body (or as a persistent comment if configured that way).

#### `/review`

Performs a full AI review of the PR diff. Outputs:

* Key issues to review
* Estimated effort to review (1–5 scale, also applied as a label)
* Security concerns flag
* General feedback

The review comment is updated in place each time `/review` is re-run, keeping the PR thread clean.

#### `/improve`

Generates concrete, actionable code suggestions for the PR. Each suggestion includes:

* A one-sentence summary
* The existing code
* The improved code (as a GitHub suggestion block, so it can be applied with one click)
* A category label (e.g. "possible issue", "maintainability", "performance")
* An importance score (1–10)

Suggestions are grouped by category and sorted by score. Previous suggestion comments are preserved in a collapsible history section.

#### `/ask <question>`

Answers a free-text question about the PR or the code it touches. Supports image links embedded in the question for visual context.

**Example:** `/ask Why is this function called twice?`

#### `/update_changelog`

Generates or updates `CHANGELOG.md` based on the PR content. Outputs the suggested entry as a PR comment by default; can be configured to commit the file directly to the branch.

#### `/add_docs`

Generates documentation (docstrings, JSDoc, Javadoc, Doxygen, etc.) for functions, methods, and classes changed in the PR. Posted as inline GitHub suggestion blocks.

#### `/generate_labels`

Analyses the PR and suggests appropriate GitHub labels based on its content and any custom label definitions you have configured.

#### `/help`

Posts a summary of all available commands and their descriptions directly on the PR.

***

### Self-Hosted Setup

CodeMate offers a fully self-hosted deployment option, allowing organizations to run the PR Agent entirely within their own infrastructure.

This approach provides greater control over data privacy, security, and compliance, while eliminating dependency on external SaaS services. It enables seamless integration with existing internal tools, custom security policies, and on-premise environments, making it ideal for enterprises with strict regulatory requirements or air-gapped setups.

### Support

Email us at <contact@codemate.ai>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.codemate.ai/pull-request-review-agent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
