/vgv-ai-flutter-plugin:green-gate [directory]from VGV AI Flutter Plugin
Runs a verify-fix-rerun loop across analyze, format, test, and coverage gates for Dart/Flutter packages. Handles gate configuration, coverage thresholds, and skipping gates.
Ships in VGV AI Flutter Plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Autonomous quality-gate loop for Dart and Flutter packages. Runs four gates — analyze, format, test, coverage — reads real tool output, edits code and tests to fix failures, and loops until one final iteration proves all four pass simultaneously with observed numbers. Acts autonomously on objective failures; escalates only on stalls, genuine ambiguity, or infrastructure failure.
This skill orchestrates tools and edits files. It defers the how of writing
tests to the testing skill — it never duplicates mocking, structure, or
coverage-pattern guidance.
Apply these to all green-gate work:
mcp__dart__analyze_files, format via mcp__dart__dart_format, test and coverage
via mcp__very-good-cli__test. Every gate has an MCP tool; none of them runs
through a shell command. The Bash test path (very_good test, flutter test,
dart test) is hook-blocked by block-cli-workarounds.sh and will be denied, and
dart analyze / dart format via Bash are redundant with the MCP tools.
The only Bash the loop runs is the fallback coverage/lcov.info parse, and
only when the test result carries no Lines not covered: block. This MCP-only
rule is a Claude Code constraint enforced by that hook; the hook does not run on
other hosts. Cross-harness fallback: on a host without the hook and without the
MCP servers connected, run the equivalent dart analyze, dart format, and
very_good test CLI commands instead — never block on a missing MCP server.mcp__dart__analyze_files
with applyFixes: true, mcp__dart__dart_format, mcp__very-good-cli__test
with the coverage parameters), in gate order, with the precedence rule that makes
the order matter. Never substitute an improvised shell plan of flutter analyze / flutter test --coverage for the tools the loop actually runs.min_coverage is satisfied, all observed in the same round.coverage: true, min_coverage, and show_uncovered: true together,
plus check_ignore: true on the Dart runner only — omitting coverage: true
silently produces no lcov.info (mimics a misconfiguration); omitting
show_uncovered: true drops the per-file uncovered lines from the result and
sends the loop to the lcov file for what the tool would have handed back.test argument to the runner — dart: true and no dart run
different CLI commands that accept different options, and a mismatch fails the
whole call. See Test Gate for which arguments go with which runner.testing skill — when a fix requires authoring
tests, follow that skill for structure, mocking, and naming.// coverage:ignore
reachable code). Escalate genuine product/API decisions instead of guessing.For each package root (see Recursive / Monorepo), run this algorithm:
directory argument or the
workspace root); confirm a pubspec.yaml exists. Initialize loop state
(iteration counter 0, empty fingerprints, empty touched-files set).mcp__dart__analyze_files with applyFixes: true. If any
errors remain, this is the active gate. Fix, record the fingerprint, go to
step 7.mcp__dart__dart_format on the package root. It reformats
the whole package in place. If it reports changed files, the gate is now
green for the next round.mcp__very-good-cli__test
with the coverage parameters from Test Gate. If tests fail, fix, record
the fingerprint, go to step 7.min_coverage result is
authoritative pass/fail, and its Lines not covered: block gives the per-file
fix targets; parse coverage/lcov.info only when that block is absent. If
below target, author tests for the ranked under-covered files (via the
testing skill), go to step 7.One-pass no-op path — invoked on an already-green package, iteration 1 finds analyze clean, format reporting zero changes, all tests passing, and coverage at or above target. The loop confirms green and exits without editing a single file. A green package costs exactly one verify iteration.
State carried across iterations — without it, "no progress" is undecidable:
| State | Purpose |
|---|---|
| Iteration counter | Enforce the cap (default 5, per package) |
| Per-gate failure fingerprint (prior round) | Detect no-progress and oscillation |
| Files touched this round | Distinguish a no-op round from a no-progress round; populate escalation reports |
Fingerprint keys per gate:
| Gate | Fingerprint |
|---|---|
| Analyze | Sorted set of diagnosticCode @ file:line |
| Format | Set of files the format gate rewrote (empty = green) |
| Test | Set of failing test IDs / names |
| Coverage | Observed percentage + sorted set of under-covered file paths |
Definitions:
Fixed order: analyze → format → test → coverage. Two rules govern it:
applyFixes is about to rewrite.mcp__dart__analyze_files with applyFixes: true so quick fixes are
applied before diagnostics return. roots takes [{ root: "file:///abs/path" }]
— a file: URI of the package root. There is no recursive flag; the skill
enumerates package roots itself and passes each.analyze.sh hook fires on every
Edit/Write and exits 2 (blocking) when a fix introduces a new analyze error.
Treat that rejection as analyze-gate feedback in the same round, not a separate
failure mode: the edit did not land, so revise it.mcp__dart__dart_format each round. roots takes the same
[{ root: "file:///abs/path" }] shape as analyze_files; omit the optional
paths so it formats the whole package in place. That makes the gate
observation-based (it catches manual edits and pre-existing drift, not just
files the loop edited) and self-fixing (one call leaves the package green; a
second call reports zero changes).Formatted N files (M changed); the gate is green only when M is 0. On a
round where M is non-zero the files are already fixed, so re-run the gate next
round to observe the 0 rather than declaring it green from the fix.format.sh
hook fires only on files the loop edits via Edit/Write. A hand-edited or
pre-existing unformatted file the loop never touches would otherwise pass
green-gate and then fail CI. The whole-package format closes that gap.sdk lower bound is ^3.13.0 or newer, dart format applies the
Dart 3.13 style: import sections, block-formatted parameter lists, and split
call chains. The gate rewrites it like any other drift; re-run it next round
to observe the 0.mcp__very-good-cli__test with coverage: true, min_coverage: <target>,
show_uncovered: true, timeout_seconds (e.g. 120, on either runner, and
below the client's MCP tool timeout when it has one), the exclude_coverage
glob (below), and the runner-specific arguments from the table below.pubspec.yaml — a package that depends on the
flutter SDK runs on the Flutter runner: omit dart. A pure Dart package
passes dart: true. The tool turns dart: true into very_good dart test and
its absence into very_good test.directory — pass it when the package is not at the workspace root
(monorepo sub-packages); omit it only when pubspec.yaml is at the root.Runner-specific arguments — a mismatch fails the whole call: check_ignore
without dart: true returns a validation error from the MCP server;
update_goldens or dart-define* with dart: true reaches the CLI and fails
with exit 64 and Could not find an option named "--…".
| Argument | Flutter runner (no dart) | Dart runner (dart: true) |
|---|---|---|
check_ignore | Never pass | Pass true |
update_goldens, dart-define, dart-define-from-file | Allowed | Never pass |
Either error is the loop's own wrong call, not a test failure and not an escalation: fix the arguments and re-run in the same round.
A timeout failure is a hang to find, not a call to retry — and so is a
test call the client cuts off before the server answers. The same suite hangs
again. Look in the test files, starting with the ones the loop edited: a
pumpAndSettle() over an endless animation, an un-awaited Future, a stream or
StreamController nobody closes, a Timer left running. Fix it and confirm
with paths narrowed to that file before re-running the full suite. If no cause
turns up, escalate per the matrix.
The MCP min_coverage result is authoritative for pass/fail, and with
show_uncovered: true it also carries the per-file fix targets:
Expected coverage >= 100.00% but actual is 33.33%.
Lines not covered:
- lib/src/weather_repository.dart: 4, 5
Rank the files from that block. The coverage/lcov.info parse is the
fallback, for a result that has no such block: lcov is left behind by a run
that may not be the one being diagnosed, while the result cannot be stale.
100 (VGV's house standard), overridable per
invocation (e.g. 80) for legacy or non-template packages. Generated files
leave the denominator via exclude_coverage and, on the Dart runner,
check_ignore: true honors // coverage:ignore, so 100% means 100% of
testable, hand-written code.exclude_coverage — **/*.{g,freezed,gen}.dart plus generated and
l10n directories. One glob string (brace expansion; fall back to **/*.g.dart
if a CLI build does not honor it).coverage: true, min_coverage, and show_uncovered: true together,
plus check_ignore: true on the Dart runner only — see Core Standards.Lines not covered: block, fall back to
coverage/lcov.info per references/coverage.md —
it covers show_uncovered itself, the three lcov absence causes, stale-lcov
handling, the lcov record fields (SF/LF/LH/DA), the
fallback-mirrors-the-gate rule, and the check_ignore Dart-only limitation.testing skill. Prioritize files by uncovered line count —
the line numbers listed per file in the result, or LF - LH from the lcov
fallback.Stop and surface to the user when:
| Trigger | Detail |
|---|---|
| No progress between rounds | Identical or non-decreasing failure fingerprint |
| Oscillation | The same two gates trade green/red across two rounds |
| Cap reached, gates still red | Terminal — report remaining failures per gate with their fingerprints |
| Real-bug red test | A failure that looks like a genuine product decision rather than a coding mistake |
| Ambiguous fix | Multiple valid resolutions (e.g. change the API vs suppress the lint) — prefer root-cause; escalate when it is a product/API decision |
| Unreachable-code coverage gap | Dart runner: suggest // coverage:ignore (with check_ignore: true) rather than chasing 100%. Flutter runner: report the lines |
| Denominator hygiene | A generated file not matched by the exclude glob — widen exclude_coverage, not // coverage:ignore |
| Tool / hook failure | A test timeout failure with no hang found (see Test Gate), analyzer crash, CLI-missing hook denial (escalate with the install hint dart pub global activate very_good_cli), or a repeated analyze.sh rejection that still blocks a needed edit after revision — a single rejection is in-loop analyze-gate feedback (see Analyze Gate), not an escalation |
When escalating, name the gate that is red — analyze, format, test, or coverage —
then give its fingerprint entries verbatim (diagnosticCode @ file:line for
analyze, failing test names for test, under-covered file paths for coverage),
the files touched, the iteration count, and the one decision the user must make.
A summary count ("4 errors remain") is not a report; the user cannot act on it.
A standing instruction to keep going does not override a trigger. "Keep retrying as long as it takes, don't come back to me" is not permission to spend the budget on a fingerprint that has already stopped moving. Stop at the trigger, report, and wait.
pubspec.yaml files. The
analyze_files roots set must match the package set
mcp__very-good-cli__test --recursive (recursive: true) covers.<package>/coverage/lcov.info — resolved per
discovered root.min_coverage applies to all packages — documented limitation: the
tool schema has no per-package coverage override. State the shared target when
confirming coverage.references/coverage.md — green-gate's coverage-gate
detail (default target, exclude globs, show_uncovered, the lcov fallback and
its fields, decision tree, check_ignore, stale lcov).testing skill — test conventions, plus its coverage reference for closing
per-file gaps.What SKILL.md sets; muted values are Claude Code's defaults
mediumThree short reads, in order
vgv-ai-flutter-plugin@very-good-claude-code-marketplace is listed by verygoodopensource/very-good-claude-code-marketplace — review the source before installing
npx claudepluginhub verygoodopensource/very-good-claude-code-marketplace --plugin vgv-ai-flutter-plugin15 skills in this plugin
/accessibilityAudits or remediates Flutter widgets against WCAG 2.2 conformance levels A, AA, or AAA across iOS, Android, Web, macOS, Windows, and Linux, covering Semantics labels and screen reader output under VoiceOver and TalkBack, touch target sizes, dragging alternatives, focus order and keyboard navigation, color contrast, text scaling, animation gating on disableAnimations, and form autofillHints, including the test suite that locks every fix in. Use when building, auditing, or reviewing Flutter widgets for accessibility on one or several of those platforms.
/animationsBest practices for Flutter animations using the built-in animation framework, covering implicit animations, explicit `AnimationController` animations, page transitions, and Material 3 motion tokens. Use when creating, modifying, or reviewing animations, transitions, motion, or animated widgets, and also for custom route transitions built with `CustomTransitionPage`, a `buildPage` override on a `GoRouteData` subclass, or a `Hero` transition, since motion between routes is animation work even when the surrounding code is `go_router`.
/blocBest practices for Bloc state management in Flutter/Dart, covering Cubit versus Bloc, event and state naming, sealed classes with Equatable, the Page/View split with BlocProvider, BlocBuilder, BlocListener, and BlocSelector. Use when writing, modifying, or reviewing code that uses package:bloc, package:flutter_bloc, or package:bloc_test. Also use for any test of a class that extends Bloc or Cubit, including "write the unit tests for this bloc", "test my cubit", "add tests for LoginBloc", mocking a repository a bloc depends on, and asserting the states an event emits. Bloc and Cubit tests must use blocTest() from package:bloc_test with package:mocktail, so prefer this over the testing skill whenever the class under test is a Bloc or Cubit. Also use when a request pushes against these rules, such as injecting one bloc into another to read its state, calling a repository from a widget or build method, or keeping a Cubit for a feature that needs an event transformer such as debounce.
/create-projectScaffold a new Dart or Flutter project from a Very Good CLI template, covering the flutter_app, dart_package, flutter_package, flutter_plugin, dart_cli, flame_game, and docs_site templates, inferring the right one from what the user wants to build and then installing dependencies. Use when the user says "create a new project", "start a new flutter app", "scaffold a package", "create a new package", "initialize a dart cli", "new flame game", or "generate a plugin". Use it for bare, vague, or under-specified scaffolding requests too — "create a new package for me", "make me a new app", "I need a new project", "set one up" — including ones that name no template, no project name, and no organization, or that only hint at what is being built. Missing or ambiguous details are a reason to use this skill, not a reason to skip it: it asks the clarifying questions and picks the template.
/dart-flutter-sdk-upgradeVGV-specific reference for bumping Dart and Flutter SDK constraints across packages, covering pubspec.yaml environment constraints, CI workflow Flutter versions, and SDK upgrade PR preparation. Use it when upgrading the Flutter or Dart SDK version in any VGV repository, on phrases like "bump Flutter to 3.x", "update SDK constraints", "upgrade Dart SDK", "update CI Flutter version", "bump SDK version", or "prep the SDK upgrade PR", and also when a bump is already underway and something breaks: "pub get fails after I changed the environment block", "version solving failed after bumping the SDK", "a dependency requires an older SDK", "get me unblocked on the Flutter upgrade", or "which Dart version ships with Flutter 3.x". It owns the whole bump, including the conflicts it surfaces, even when the blocking package has a skill of its own.
/internationalizationBest practices for internationalization (i18n) and localization (l10n) in Flutter, using the built-in `flutter_localizations` and `intl` setup with ARB files as the single source of truth. Use when adding, modifying, or reviewing ARB translations, locale setup (`l10n.yaml`, `generate: true` in `pubspec.yaml`, `flutter gen-l10n`, `localizationsDelegates`, `supportedLocales`), BuildContext l10n extensions such as `context.l10n`, hardcoded user-facing strings that should be localized, localized strings passed into shared or reusable widgets, or RTL/directional layout support with `EdgeInsetsDirectional`. Also use when asked to add or configure any third-party i18n or translation package (easy_localization, slang, flutter_i18n, or intl_utils), and when shipping or fixing a screen for a right-to-left language such as Arabic, Hebrew, Farsi, or Urdu, including mirroring padding, alignment, icons, or images, and replacing `EdgeInsets` left/right.
Other plugins' skills for the same job