> For the complete documentation index, see [llms.txt](https://docs.vale.sh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vale.sh/guides/ai-review.md). Agents can also search and read this documentation through its [MCP server](https://docs.vale.sh/~gitbook/mcp).

# AI review

Use Vale beside an AI reviewer, with each one doing the checks it is built for.

An AI reviewer reads a pull request the way an editor does. It comments on a paragraph whose main point is hard to find, an example that no longer matches the text, a sentence a newcomer would read two ways. Vale doesn't do that, and isn't meant to. Vale checks the rules you can write down: the product name spelled one way, the phrase your style guide bans, heading case, a term that belongs in a vocabulary. Most teams want both kinds of check, and they work best when each is given the job it does well.

## [Comparing the two](#comparing-the-two)

|                                            | Vale                                                                   | AI reviewer                                                  |
| ------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------ |
| Same input, same result                    | Yes                                                                    | No                                                           |
| Time to a result                           | Seconds, on every push                                                 | Minutes, sometimes longer                                    |
| Pull requests from forks                   | Doesn't need secrets                                                   | Needs an API key, which forks don't get                      |
| Can fail a check and block a merge         | Yes, on `error`-level alerts                                           | Not reliably: a check that fails at random gets switched off |
| Cost per run                               | None                                                                   | Paid per token                                               |
| Text leaves the machine                    | No                                                                     | Yes, to the model's provider                                 |
| Runs in the editor, as you type            | Yes, through the [language server](https://docs.vale.sh/guides/lsp.md) | Not usually                                                  |
| Judges clarity, tone, and structure        | No                                                                     | Yes                                                          |
| Catches a wrong word that is spelled right | Only with a rule for it                                                | Often                                                        |
| Rewrites a sentence                        | Only the fix a rule defines                                            | Yes                                                          |

The first seven rows are what makes a check something a team can depend on. A check that blocks a merge has to give the same answer every time, or people learn to re-run it until it passes and then switch it off. The last three are what a rule can't do: a rule matches a pattern, and "this paragraph is hard to follow" isn't one.

## [Splitting a style guide](#splitting-a-style-guide)

Go through your style guide one rule at a time, and ask whether a person could check it without reading for meaning.

* **Give it to Vale** if it names exact words or a pattern. "Write *sign in*, not *login*, as a verb." "Don't use *simply* or *just*." "Headings use sentence case." "Spell it *GitHub*." These are [substitution](https://docs.vale.sh/checks/substitution.md), [existence](https://docs.vale.sh/checks/existence.md), and [capitalization](https://docs.vale.sh/checks/capitalization.md) rules, and a [vocabulary](https://docs.vale.sh/keys/vocabularies.md) for your terms.
* **Give it to the reviewer** if it needs a reader. "Lead with what the reader can do." "One idea per paragraph." "Explain why before how." "Examples should run as written."
* **Give both a part** if it has a pattern and an exception. "Avoid passive voice" is a Vale rule at `suggestion` level, which a person or the reviewer can overrule where the passive is the right choice.

The `from-guide` [skill](https://docs.vale.sh/guides/agents.md#skills) does the first pass for you: it turns a written style guide into rules and tests each one against the guide's own examples. It also lists the statements it couldn't check as needing a person. That list is what the reviewer's instructions should cover.

## [Running both](#running-both)

Run Vale on every pull request and let it fail the check on `error`-level alerts. Run the reviewer as an advisory comment, and give it Vale's results so it doesn't spend its review on what Vale has already reported.

### [Vale in CI](#vale-in-ci)

```yaml
name: Docs
on: pull_request

jobs:
  vale:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: vale-cli/vale-action@v3
        with:
          files: docs
          fail_on_error: true
```

This workflow doesn't need secrets. It runs the same way on a pull request from a fork as on one from your own branch. Only `error` sets a non-zero exit code, so decide which rules are `error`: the ones that should stop a merge, such as a product name or a banned term. Leave the rest at `warning` or `suggestion`, where they show up as comments but don't block.

### [Vale's results for the reviewer](#vales-results-for-the-reviewer)

Vale's JSON output is the format to hand a model:

```bash
vale --output=JSON docs/ > vale.json
```

Each alert includes its file, line, rule name, severity, and message. Pass the file to the reviewer with an instruction such as:

```
vale.json lists the style issues Vale has already reported on this pull request.
Don't repeat them. Review what a rule can't check: clarity, structure, accuracy
of examples, and whether the change does what its description says.
```

The reviewer's comments then cover what Vale couldn't, and the two don't argue about the same comma.

### [One source for both](#one-source-for-both)

If the reviewer reads a style guide and Vale reads a configuration, the two drift apart. Keep the configuration as the source, and generate the readable guide from it with the `write-guide` [skill](https://docs.vale.sh/guides/agents.md#skills). Give that guide to the reviewer. When a rule changes, both change with it.

## [Moving a rule from one to the other](#moving-a-rule-from-one-to-the-other)

The split isn't fixed. Move a check when either of the following happens.

* **The reviewer makes the same comment again and again.** If it keeps flagging *e.g.* in running text, or the old product name, the check has a pattern, and a rule makes it instant, free, and the same every time. Write it with the `rule` [skill](https://docs.vale.sh/guides/agents.md#skills) and prove it with `vale test`.
* **A Vale rule keeps flagging text that's fine.** If people switch it off with comments more often than they act on it, the check needs judgment. Lower it to `suggestion`, or take it out and add it to the reviewer's instructions.

## [Using only an AI reviewer](#using-only-an-ai-reviewer)

A reviewer alone may be enough for a small project with internal contributors and no fixed terminology, as long as it never needs to block a merge. Add Vale when a rule has to apply every time, such as for a name, a legal phrase, a term a translation memory depends on, or a check that has to pass before a release.

## [Checking model output](#checking-model-output)

An AI reviewer checks what people write. When a model writes the draft, Vale can check that too. [Agents](https://docs.vale.sh/guides/agents.md) covers styles for a model's own prose, such as Voices, and the hook that lints each file as an assistant writes it.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.vale.sh/guides/ai-review.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
