This guide runs a Flow code review on your computer, before you open a pull request. You will:

  • Review your branch with your coding agent
  • Review a range of commits, or ask for more
  • Write the findings as an HTML report

A local review runs the same lenses as a review on GitHub, with the coding agent on your computer. It needs no GitHub App, no workflow and no secrets. It reports every finding, with no maxFindings limit.

Run the command in the folder of your app. It starts a session of your coding agent with the flow-code-review skill.

Terminal
npx @adonisplus/flow review

The review covers each change since your branch left the default branch, with the changes you have not committed and the new files. When it ends, the agent prints the findings and saves them to tmp/code-review.json.

The agent is the one in flow.lock. When flow.lock has more than one, pass --agent with claude, codex, cursor or opencode.

Terminal
npx @adonisplus/flow review --agent=codex

Pass --base to review the changes from a ref up to HEAD. Add --head to end the range at another ref.

Terminal
npx @adonisplus/flow review --base=main --head=feature

Pass --prompt to add your own words to the request, for example to review one folder.

Terminal
npx @adonisplus/flow review --prompt="Review app/controllers"

In a monorepo, run the command in the folder of the app with your package manager. See Monorepos.

After the review, the agent asks if you want the findings as an HTML file. The report shows each finding with its severity, its lenses, the impact, the fix and the lines of code it is about.

The HTML report of a local review, with a critical and a major finding and the lines of code of each

To write the report yourself, run review-report. It reads tmp/code-review.json and writes tmp/code-review.html.

Terminal
npx @adonisplus/flow review-report

Give another findings file as the argument, and another output file with --out.

Terminal
npx @adonisplus/flow review-report tmp/code-review.json --out reports/review.html

GitHub setup

Turn on code reviews for the pull requests of a repository.

Lenses

What each lens checks, and writing your own.