# Configuration

This guide covers `.flow/review.yml`, the settings of a Flow code review. You will learn:

- What each setting does, and its default
- How to accept a finding

## Overview

`npx @adonisplus/flow install` writes `.flow/review.yml` with the built-in lenses. Commit it. Once it exists, the installer leaves it as it is, so your changes stay.

`agent`, `env`, `emojis`, `triggers` and `workflow` apply only to reviews on GitHub. Flow reads them from your default branch, so a pull request cannot change how it is reviewed. A local review uses the other settings, and reports every finding, with no `maxFindings` limit.

```yaml [.flow/review.yml]
agent: claude
maxFindings: 10
ignore: ['database/seeders/**']
env: ['DATABASE_URL']
triggers:
  drafts: false
lenses:
  - ref: .flow/lenses/review-access-control.md
    globs: ['app/**']
  - ref: .flow/lenses/review-code-placement.md
    globs: ['app/**']
    severity: nit
```

## Settings

::::field-group

:::field{name="lenses" type="list"}
The lenses that run. Each has a `ref`, the path of its file, `globs`, the files it reads, and an optional `severity` that gives all its findings that severity: `critical`, `major`, `minor` or `nit`. Without `globs`, a lens reads every changed file. See [Lenses](/docs/flow/reviews/lenses).
:::

:::field{name="maxFindings" type="number"}
The most findings one review reports, the most severe first. Defaults to `10`.
:::

:::field{name="maxParallel" type="number"}
The most lenses that run at the same time. Defaults to `4`.
:::

:::field{name="batchSize" type="number"}
The most files one sub-agent of a lens reviews. A lens with more files splits them into batches. Defaults to `20`.
:::

:::field{name="ignore" type="list of globs"}
Files that no lens reviews, such as generated code or seeders.
:::

:::field{name="accepted" type="list"}
Findings your team accepts. See [Accepting a finding](#accepting-a-finding).
:::

:::field{name="agent" type="claude | codex"}
The agent that reviews, when the repository has credentials for both. See [Supported agents](/docs/flow/reviews/setup#supported-agents).
:::

:::field{name="env" type="list of names"}
The variables of the workflow job that the review's shell can see, such as `DATABASE_URL` for a test run. The model credential and `GITHUB_TOKEN` are never passed.
:::

:::field{name="emojis" type="map"}
The emoji of each severity in the review's comments. Defaults to 🔴 critical, 🟠 major, 🟡 minor and 🔵 nit.
:::

:::field{name="triggers.drafts" type="boolean"}
Whether draft pull requests are reviewed. Defaults to `false`.
:::

:::field{name="triggers.forks" type="members | all"}
Whose pull requests from forks are reviewed. `members` reviews only those of people with write access to the repository. Defaults to `members`.
:::

:::field{name="workflow" type="string"}
The workflow file the Flow App starts. Defaults to `flow-review.yml`.
:::

::::

## Accepting a finding

When your team decides a finding is fine, accept it so the review stops reporting it.

For the whole repository, add it to `accepted`, with the lens, the finding in a few words, and the reason.

```yaml [.flow/review.yml]
accepted:
  - lens: review-query-cost
    finding: Reports loads every order of the month
    reason: The report runs once a night on a replica
```

For one place in the code, add a `flow-allow` comment right above the line or block. Name the doc or skill whose rule the code breaks, and why it must. A reason that only says someone asked for it is not enough.

```ts [app/controllers/webhooks_controller.ts]
// flow-allow flow-cruddy-controllers: Stripe calls this exact path, so it cannot be a resource route
router.post('/stripe/webhook', [controllers.Webhooks, 'handle'])
```

## Next steps

::card-group
:::card{title="Lenses" to="/docs/flow/reviews/lenses"}
What each lens checks, and writing your own.
:::

:::card{title="GitHub setup" to="/docs/flow/reviews/setup"}
Turn on the Flow review for a repository.
:::
::
