Getting started
Setting assay up takes one development dependency, one line in analysis_options.yaml and one program installed per machine. Steps 1 to 3 do each by hand; assay init, in step 4, writes the line of step 2 for you.
1. Add assay_lints
Section titled “1. Add assay_lints”dart pub add dev:assay_lints# in a project that uses Flutterflutter pub add dev:assay_lintsassay_lints holds the three presets and nothing else: no code and no dependencies, so it can never make your pub get fail over a conflict. It needs Dart 3.11 or later.
2. Include a preset
Section titled “2. Include a preset”At the top of the project’s analysis_options.yaml:
include: package:assay_lints/recommended.yamlThat one line is all you write. The preset names the analyzer plugin, the package assay, at exactly the version of assay_lints. The analysis server fetches the plugin the first time it starts for the project, apart from your dependencies, and violations show in the editor and in dart analyze. That first start compiles the plugin, once per project directory.
The three presets are core, recommended and strict. Moving to another is a change of one word.
3. Install the command-line program, once per machine
Section titled “3. Install the command-line program, once per machine”dart pub global activate assay_cliThis installs the command assay. Run it from the package root, the directory that holds pubspec.yaml and analysis_options.yaml:
assay checkIt reads the preset from the project’s own assay_lints, so fetch the dependencies first (dart pub get or flutter pub get). Until you do, every command stops with The file package:assay_lints/recommended.yaml cannot be read., and the Next: row of its verdict says to fetch the packages.
Where assay is not found
Section titled “Where assay is not found”dart pub global activate puts the command in the pub cache’s bin directory: ~/.pub-cache/bin on macOS and Linux, %LOCALAPPDATA%\Pub\Cache\bin on Windows, or bin under PUB_CACHE where that variable is set. If that directory is not on your PATH, run the program as:
dart pub global run assay_cli:assay <command>Or put the directory on the PATH, then open a new terminal:
- macOS (zsh is the default shell): add
export PATH="$PATH:$HOME/.pub-cache/bin"to~/.zshrc. - Linux: add the same line to
~/.bashrc, or to the start-up file of your shell. - Windows: add
%LOCALAPPDATA%\Pub\Cache\binto your user’sPathunder Settings → System → About → Advanced system settings → Environment Variables.
The agent plugin runs with the agent’s PATH, which can differ from your terminal’s, and also looks in the pub cache’s bin directory. If assay is anywhere else, set its command in the setting assay_command (Claude Code) or the environment variable ASSAY_COMMAND (Codex); see The gate and agent setup.
4. Let assay init include the preset
Section titled “4. Let assay init include the preset”assay init does step 2 for you:
assay init # adopt recommended, or keep the preset adoptedassay init --preset strict # adopt strict insteadWithout --preset, init keeps the preset the options file already includes (a project on strict stays on strict), and adopts recommended where it includes none. With --preset, it adopts that preset and says which one it replaced, so pass it only when you mean to change the preset.
In a project that has no analysis_options.yaml:
╭──────────────────────────────────────────────────────────────────────────────╮│ assay init │╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Files ───────────────────────────────────────────────────────────── 1 file ─╮│ analysis_options.yaml created ││ + Its `include:` names `package:assay_lints/recommended.yaml`: the project ││ adopts the preset recommended. │╰──────────────────────────────────────────────────────────────────────────────╯
╭──────────────────────────────────────────────────────────────────────────────╮│ ✓ 1 file changed. │╰──────────────────────────────────────────────────────────────────────────────╯To judge an AI agent's changes at the end of each turn, install the agent pluginof assay: it is separate from this program.init edits an existing options file in place and keeps everything else in it. It never writes a plugins: entry or an agent hook, and a second run changes nothing. It ends by saying that the agent plugin, which holds Claude Code or Codex to the gate, is installed in the agent (The gate and agent setup). Its options, output and exit codes are on assay init.
What a project never does
Section titled “What a project never does”- Add
assayorassay_clito its pubspec. The plugin comes through the preset, and the program is installed per machine. A project that depends onassaybrings back the dependency conflict this layout avoids; that is not supported. - Run
dart run assay_cli:assay. The program is installed by global activation only. - Write a
plugins.assayentry, in its own options file or one it includes. It would replace the preset’s entry and drop its rule map, so assay reports it as a configuration error. Tune everything under theassay:key (Configuration). - Include a file of assay by path. Adopt a preset by its
package:assay_lints/…address only.
Which name goes where
Section titled “Which name goes where”assay is three packages, and you write each name in its own places.
| Name | Where you write it |
|---|---|
assay_lints |
The development dependency in pubspec.yaml, and the include: address: include: package:assay_lints/recommended.yaml. |
assay |
The assay: key of analysis_options.yaml; the command, assay check; the prefix of a suppression, // ignore: assay/avoid_dynamic. It is also the name of the analyzer plugin, in the plugins.assay entry that the preset carries and a project never writes. |
assay_cli |
Only to install the program, dart pub global activate assay_cli, and in the fallback form dart pub global run assay_cli:assay <command>. |
The prefix of a suppression is assay/, the plugin’s name, never assay_lints/. A suppression can also name an assay rule by its name alone; see Suppressions.
Supported SDKs and platforms
Section titled “Supported SDKs and platforms”| Dart | 3.11 and later, within the analyzer’s major version 14: the plugin and the program accept analyzer from 14.3.0 to below 15.0.0. assay’s own CI runs on Dart 3.11 and on the newest stable Dart. |
| Flutter | Any release whose Dart is 3.11 or later. |
| macOS and Linux | Supported. |
| Windows | Not supported in this version: a known defect stops every command at start, to be fixed before the release. The agent plugin has a launcher for Windows PowerShell, and its POSIX launcher runs where Claude Code runs hooks with Git Bash. |
- Presets, to choose one.
- Configuration, to tune a rule.
- The gate and agent setup, to hold an agent to the gate.
- Adopting assay in an existing project, for a project that already has violations.
- In the editor, for what the plugin shows as you write.
- CI integrations, to run the gate in CI.