Codebase intelligence & anti-AI-slop · Dart & Flutter

Find what dart analyze misses.

loam.dev is a CLI for Dart & Flutter projects you build with AI coding agents. It finds the structural drift, AI slop and accessibility gaps that dart analyze doesn’t report — and in CI, it fails only on new Findings.

dart pub global activate loam

Then run loam scan in your project. Early preview · 20 live rules · free · MIT · no account.

Homebrew on Apple Silicon Macs & Linux: brew install silvio-l/loam/loam

~/shopcart — loam scan
$ loam scanshopcart · source: lib, bin lib/services/cart_service.dart  1     warning  circular-dependencies        cart_service.dart ⇄ checkout_service.dartlib/services/order_notifier.dart  9     warning  code-duplicates        2 occurrences of duplicated block (59 tokens)lib/services/pricing_engine.dart  5     warning  complexity-hotspots        PricingEngine.discountFor: cyclomatic=27, cognitive=39 3 findings (warning: 3)
Real output of loam scan on the demo project behind the demo report (opens in a new tab), shortened.

The problem

Valid Dart isn’t the same as clean code.

When an AI agent builds the feature, there is more to check than whether it works: a helper copied under a new name, an empty catch that swallows the error, a public class nothing uses, an icon button without an accessible name.

All of that is valid Dart, so dart analyze lets it pass — it checks your code largely file by file, not the project as a whole. Left unchecked, it piles up until the codebase gets hard to change.

lib/checkout/checkout_page.dart
String formatPrice(int cents) =>    '${(cents / 100).toStringAsFixed(2)} €'; String priceLabel(int cents) =>    '${(cents / 100).toStringAsFixed(2)} €'; Future<void> submit(Order order) async {  try {    await api.send(order);  } catch (e) {    // TODO: handle error  }} class CheckoutAnalyticsHelper {  void track(String event) {}} IconButton(  icon: const Icon(Icons.delete),  onPressed: onRemove,),
  1. 1a helper copied under a new name code-duplicates
  2. 2an empty catch that swallows the error slop-empty-catch
  3. 3a public class nothing uses unused-public-exports
  4. 4an icon button without an accessible name a11y-icon-button-label

What loam.dev finds

Three kinds of problems, one scan.

AI slop

Empty or comment-only catch blocks, // ignore: without a reason, comments that repeat the code or narrate it step by step, placeholders like // ... rest of code, functions that only throw UnimplementedError, tests that assert nothing (expect(true, isTrue)), setState after an await without a mounted check, and secrets hardcoded in strings — without ever printing the value.

How it works

Scan everything once. Then block only what’s new.

  1. Audit what’s there.

    loam scan runs every rule over the whole project and lists all Findings. Fix what matters now.

    $ loam scan  warning  circular-dependencies  warning  code-duplicates  warning  complexity-hotspots3 findings (warning: 3)
  2. Record what you accept.

    loam baseline --write records the Findings you accept in baseline.json. Commit it.

    $ loam baseline --writeloam baseline: wrote 3 findings to baseline.json$ git add baseline.json
  3. Block what’s new in CI.

    loam gate in CI fails only on new Findings from blocking rules. Your existing code doesn’t turn the build red, and the score can only improve.

    $ loam gate# exit 0 · nothing new# …the agent adds an empty catch…$ loam gatelib/models/order.dart  18:5  warning  slop-empty-catch# exit 1 · one new Finding

Starting from scratch? loam gate --absolute ignores the baseline and allows no blocking Findings at all. While you code, loam watch repeats the audit on every save and shows what is new or resolved.

How loam.dev analyses your project

Proof

Check the results yourself.

  • The live demo report.

    The demo report (opens in a new tab) is the exact html output of loam.dev, generated from a deliberately messy demo project. Filter it, select Findings, copy the fix-prompt.

  • loam.dev checks itself.

    On every push, loam.dev runs its own gate on its own code — all rules, absolute mode, zero Findings allowed.

  • Open source, MIT.

    Every rule is readable on GitHub. No account, no licence key, no subscription.

  • Early preview.

    Version 0.1.16 is an early preview: 20 rules are live, and the one planned rule is labelled as planned.

FAQ

Questions before you install

Does it replace dart analyze?

No, it adds to it. Keep running dart analyze for types and lints. loam.dev looks at the whole project at once — references, imports, copies across files — and doesn’t set out to repeat what the analyzer already reports.

Can I add it to an existing codebase without a red CI?

No. The ratchet is the default: freeze today’s Findings in a baseline, and only new ones fail. Clean up the backlog when it suits you.

How noisy is it?

By default only the core profile can fail the gate: seven rules built for near-zero false positives. Heuristic and threshold rules show up as hints until you opt in with --profile strict. Code from generators such as freezed, json_serializable, Drift and Riverpod is recognised automatically, and // loam-ignore: <rule> – <reason> silences a single Finding — the reason is mandatory.

Does my code leave my machine?

No. The analysis runs locally and offline, your code is never uploaded, and you need no account. Apart from that, loam.dev checks pub.dev for updates once a day — off in CI and easy to switch off anywhere.

Does it use AI to judge my code?

Not today. All 20 live rules are deterministic: the same code and ruleset version always give the same Findings. A planned, optional LLM rule will run on your own API key, with every verdict cached, so the gate stays reproducible.

How does it work with my AI agent?

--format agent gives your agent a short, capped list; json and sarif feed tools and CI. In the HTML report you pick Findings and copy a ready-made fix-prompt. After a run, loam.dev suggests one preventive instruction per problem class for your agent’s standing rules (for example CLAUDE.md) — it never edits them itself.

What does it cost, and where does it run?

Nothing — it’s MIT-licensed. It runs on macOS, Linux and Windows: install it with Dart pub on any of them, or with Homebrew on Apple Silicon Macs and Linux.

Get started

Run your first scan.

dart pub global activate loam
loam scan # in your project

On Apple Silicon Macs and Linux, Homebrew works too, with no PATH setup:

brew install silvio-l/loam/loam

If your shell can’t find loam after a pub install, add ~/.pub-cache/bin to your PATH.

Read the Developer Guide for every command, the CI setup and configuration.