Skip to content

Overview

assay holds Dart and Flutter code to strict, measurable standards. It brings 147 rules, ten of them for security, seven metrics, five cross-file checks, three asset checks and five project-file checks.

The same rules judge your code in the editor, in dart analyze, in CI and at the end of every turn of an AI coding agent. While the gate fails, the agent is told what fails and keeps working. Setting it up takes one development dependency, one line in analysis_options.yaml and one program installed per machine.

  • The analyzer plugin shows violations in the editor and in dart analyze.
  • The command-line program, assay, judges a project or a change, runs the gate in CI and, through the agent plugin, at an agent’s turn end. It also writes reports, metrics, fixes and snapshots of a run, whose trend it shows.
Feature What it does
Rules 147 rules judge Dart and Flutter code, in the editor, in dart analyze and in the command-line program. A blocking violation fails the gate; an advisory one never does.
Fixes 47 rules have a fix, a mechanical source edit that removes one violation. The editor offers it at the violation, and assay fix applies every available one across the project.
Metrics Seven numbers computed for each function, class or file, among them cyclomatic complexity, cognitive complexity and function length. Six have a limit rule, and assay metrics lists every value.
Cross-file checks Five advisory whole-project checks whose result no single file can decide: unused code, unused files, unused localization entries, unnecessary nullable parameters and duplicated code.
Asset checks Three advisory checks of the files a Flutter package declares as assets: unused, oversized, and missing resolution variants.
Project-file checks Five advisory checks of the files an app ships or is built with that are not Dart source: the pubspec and the declared assets, the Android manifest and the Info.plist.
Security Ten rules and the five project-file checks look for security flaws. Each has a security class, so that code scanning lists its results as security alerts.
The gate assay gate judges the whole project, or the changed files of a change, with assay’s rules, the SDK lints and the compiler: pass or fail. The two judgements says how the two differ.
The agent plugins The agent plugin runs the gate at the end of each turn of Claude Code or Codex, on every file the session changed. While the gate fails, the agent is told what fails, and works on.
CI output formats In CI the gate writes GitHub annotations, SARIF for code scanning, a GitLab code quality report and a summary in Markdown. There is a pipeline for GitHub Actions, for GitLab CI and for any other CI.
The baseline Records the violations a project already has, so that the project judgement in CI fails only on new ones while you work off the old ones.
Snapshots and trends A run of assay gate or assay metrics can write a snapshot of what it judged or measured, as counts. assay trend shows how the project moved, in the console or as an HTML page.

Next: Getting started.