/flutter:run-goldens-rebaselinefrom Flutter Skills
Executes the sanctioned golden re-baselining ritual for Flutter widget tests. Enforces the correct order: green non-golden tests first, rebaseline only in the pinned blessing environment with loadAppFonts(), via `flutter test --update-goldens --tags golden`, visually inspect every changed PNG, delete orphans, and re-run without the flag to verify.
Ships in Flutter Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Blessing a golden overwrites the only record of what the UI used to look like. It is the one operation in the test suite that destroys an assertion instead of running it, so it is a manual, low-freedom, human-run workflow: execute the steps in order, do not improvise, and never run it to make a failure go away.
The two-lane golden strategy, the harness, and why goldens are the weakest visual
assertion belong to widget-golden-and-a11y-testing. This skill is only the ritual for
changing the baselines.
loadAppFonts() must have run. Without it the real-font lane renders every glyph
as an Ahem box and you bless a wall of rectangles that will "pass" forever.--update-goldens in CI, and never to fix a red pipeline. A gate that
rewrites the thing it checks asserts nothing (ci-pipeline-and-gates). Blessing is a
local, human-reviewed act.failures/*_testImage.png, *_masterImage.png, and *_isolatedDiff.png
next to the goldens — open the diff before deciding anything.flutter --version
matching the one that produced the committed baselines).flutter test --update-goldens --tags golden
# or a single file while iterating:
flutter test --update-goldens test/golden/notes_screen_golden_test.dart
git status --porcelain -- '*.png'
An image you did not expect is a regression. Stop, revert the images
(git checkout -- <paths>), and fix the code.# Every committed golden whose filename appears in no test source.
for f in $(git ls-files 'test/**/goldens/*.png'); do
grep -rq "$(basename "$f")" test --include='*.dart' || echo "orphan: $f"
done
failures/ artifacts so they are never committed.flutter test --tags golden
Anything still failing means the baseline you just wrote does not reproduce — an
unsettled animation, a time-dependent value, or a font that was not loaded.test(goldens): rebaseline notes screen — row height 40→48 (design review FIX-12).flutter test --tags golden is green without --update-goldens, run twice in a
row to catch a golden that settles differently between runs.failures/ directory, no orphan PNGs, and no --update-goldens anywhere in
.github/workflows/.--update-goldens as the reflex response to a red test — deletes the assertion
instead of reading it.loadAppFonts() — a wall of Ahem boxes, blessed as truth.--update-goldens in a CI workflow — the gate now asserts nothing, permanently.failures/*_testImage.png — noise, and it silently doubles as a second
set of "reference" images nobody trusts.loadAppFonts() in effect.failures/ artifacts removed.flutter test --tags golden passes without the flag, twice in a row.--update-goldens anywhere in CI configuration.widget-golden-and-a11y-testing — the two golden lanes, the pumpApp harness,
loadAppFonts(), and why goldens are the weakest assertion in the suite.ci-pipeline-and-gates — gates verify and never bless; the pinned-runner rule.design-review-workflow — the review pass that legitimately produces intentional
visual changes.design-system-structure — where a token change that moved every golden originated.testing-strategy — the assertions that should be carrying the weight instead.matchesGoldenFile: https://api.flutter.dev/flutter/flutter_test/matchesGoldenFile.htmlflutter test options (--update-goldens, --tags): https://docs.flutter.dev/reference/flutter-cliGoldenFileComparator / LocalFileComparator: https://api.flutter.dev/flutter/flutter_test/GoldenFileComparator-class.htmlgolden_toolkit / alchemist — loadAppFonts(): https://pub.dev/packages/alchemistWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub zakariaf/flutter-skills --plugin flutter40 skills in this plugin
/accessibility-as-codeEnforces accessibility as a correctness property authored into each widget — Semantics(button/label) or ExcludeSemantics on every node, a11y state read from MediaQuery not app state, never MediaQuery.withClampedTextScaling / textScaleFactor / FittedBox / TextOverflow.ellipsis to fit a label, non-color redundant channels (icon+label+shape+text) for every state, contrast against composited backgrounds (4.5:1 body / 3:1 large), 44px single-tap targets, OrdinalSortKey traversal, and honoring boldText / reduce-motion. Use when adding a GestureDetector/InkWell or any tap target, adding an Icon or Image, reaching for withClampedTextScaling/FittedBox/ellipsis/textScaleFactor to make text fit, encoding state via color, sizing type, ordering focus traversal, or reviewing any View for screen-reader/switch/low-vision support./adaptive-layoutEnforces adapting layout by available CONSTRAINTS/size, never device or platform checks — LayoutBuilder + MediaQuery.sizeOf/paddingOf/viewInsetsOf (not .of) for narrow rebuilds, Material 3 window size classes (compact <600, medium 600-840, expanded 840-1200, large >1200) as the breakpoint vocabulary, navigation affordance chosen by width (NavigationBar → NavigationRail → NavigationDrawer), list-detail single-pane-vs-two-pane, readable max-width via ConstrainedBox, Flexible/Expanded/FractionallySizedBox over fixed widths, SafeArea + display cutouts + keyboard insets, never lock orientation, foldable/hinge awareness via MediaQuery.displayFeatures, and golden-matrix verification across sizes. Use when building responsive or adaptive UI, tablet/desktop/foldable support, master-detail or two-pane screens, a NavigationRail-vs-BottomNav shell, breakpoints, LayoutBuilder, MediaQuery sizing, SafeArea/cutouts, or fixing overflow at large widths./ads-and-iap-monetizationEnforces opt-in, rewarded-first monetization over the service seam — a rewarded view grants exactly one benefit and only on a genuine reward outcome (a sealed Rewarded/Dismissed/NoFill), earn loops capped per day against an injected Clock, the earn control preloaded and hidden unless an ad is loaded so a fresh account never dead-ends on "no ads available" (a Guideline 2.1 risk), interstitials only at a natural break under a count-and-elapsed cap owned by the service so callers stay dumb, no banner on the primary work surface, one non-consumable unlock plus Restore re-checked each launch and committed through the single write path before the UI reacts, one derived isEntitled provider as the only gate, and the entitlement restored BEFORE the ad SDK initializes so a paying user never starts it, resolves consent, or sees a tracking prompt. Use when adding ads, wiring a rewarded earn loop, placing an interstitial, building a paywall, gating an entitlement, or setting up ad units./app-startup-and-bootstrapEnforces a fixed main() cold-launch order — crash-log sink + FlutterError.onError + PlatformDispatcher.onError installed BEFORE any code that can throw, settings/theme read before runApp so the first frame paints correct, real infra constructed in a composition-root bootstrap() and injected via ProviderScope overrideWithValue over throwing placeholder providers, non-blocking warm-up deferred to addPostFrameCallback, exactly two error handlers with NO runZonedGuarded, ProviderException unwrapped before logging, and a WidgetsBindingObserver that flushes durable state on background/resume. Use when editing lib/main.dart, main_<flavor>.dart, bootstrap.dart or app.dart, reordering anything in main(), adding a splash/onboarding/permission gate, restoring theme before first paint, wiring a DB or service into ProviderScope, handling app-lifecycle background/resume flushes, or chasing cold-start latency, ANRs, or first-frame jank./async-safetyEnforces no-silent-failure async discipline in Flutter/Dart — the arrow-callback Future-drop hole no lint catches (`onTap: () => vm.save(x)`), void-returning event handlers, a mounted/ref.mounted guard after EVERY await before touching BuildContext, capturing Navigator/ScaffoldMessenger before the gap, honest `unawaited()` that always ends in catchError, no empty/bare catches, `rethrow` over `throw e`, and disposing every StreamSubscription/StreamController/Timer/sink. Use when writing or reviewing async/await, wiring onTap/onPressed/onSubmitted or any VoidCallback, touching BuildContext after an await, writing initState/dispose/addPostFrameCallback, adding a Timer or Future.delayed, writing a try/catch, or seeing use_build_context_synchronously, cancel_subscriptions, close_sinks, unawaited_futures, or discarded_futures./ci-pipeline-and-gatesEnforces a lean GitHub Actions Flutter CI where every gate maps to one named release-blocking contract — pinned runner + subosito/flutter-action@v2 toolchain, dart format --set-exit-if-changed, flutter analyze --fatal-infos, build_runner and drift schema freshness (git diff --exit-code), flutter test --test-randomize-ordering-seed random, static import/banned-string greps that catch what runtime can't, coverage-as-report-never-a-gate with the upward-lie fixed, verify-never-bless goldens (no --update-goldens in CI), and an honest statement of what CI cannot prove (audio, real fonts, on-device behaviour). Use when editing .github/workflows/*.yml, adding or removing a job or step, wiring a codegen/schema/format/analyze/coverage gate, writing a grep-based policy test or gate script under test/policy or tool/, pinning action versions, or claiming CI proves something it can't.Other plugins' skills for the same job