Run Goldens Rebaseline logo

Run Goldens Rebaseline

Community
zakariaf
run-goldens-rebaseline

Runs the golden re-baselining ritual — the one sanctioned way committed reference images are overwritten. Enforces the order: land and green the non-golden geometry, contrast and a11y tests FIRST, re-baseline only in the pinned blessing environment that produced the committed images, with loadAppFonts() so nothing renders in Ahem, via `flutter test --update-goldens --tags golden` (never in CI, never to make a red pipeline green), then inspect every changed PNG by eye, delete the orphans left by renamed or removed tests, land the images as their own commit naming why they moved, and prove it by re-running the suite WITHOUT the flag. Manual, side-effecting workflow. Use when a deliberate visual change breaks matchesGoldenFile, when adding or renaming a golden test, or when someone reaches for --update-goldens.

Overview

Publisherzakariaf
RepositoryFlutter-Skills
Skill namerun-goldens-rebaseline
Stars
64
Forks
15
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by zakariaf on GitHub. Read the source before you install it.

Installation

Install the Run Goldens Rebaseline AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/zakariaf/Flutter-Skills/tree/main/skills/run-goldens-rebaseline
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zakariaf/Flutter-Skills.git /tmp/Flutter-Skills
mkdir -p .claude/skills
cp -r /tmp/Flutter-Skills/skills/run-goldens-rebaseline .claude/skills/run-goldens-rebaseline
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Run Goldens Rebaseline in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Run Goldens Rebaseline on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Run Goldens Rebaseline is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Run goldens rebaseline

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.

Non-negotiable rules

  1. A golden failure is a question, not a chore. Before anything is regenerated, answer: did I intend this pixel change? If the answer is not an unambiguous yes for every changed image, the change is a regression and the code is what gets fixed.
  2. Green the real assertions first. Computed geometry, tap-target size, overflow, text-scale, and pure-Dart contrast tests must pass before re-baselining. WHY: a golden cannot assert anything — a blessed screenshot of clipped, unreadable text passes forever. The assertions are the gate; the images are only a diff.
  3. Re-baseline only in the pinned blessing environment. Same OS and same Flutter version that produced the committed images. WHY: font rasterization differs by host, so blessing elsewhere rewrites every image with host noise and permanently breaks the comparison for everyone else.
  4. 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.
  5. Never --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.
  6. Never bless a flaky golden. A golden that changes without a code change is an environment or animation-settling defect — pump to a settled frame, remove the time-dependence, or delete the golden. Re-blessing hides it until the next run.
  7. Inspect every changed image by eye, individually. Not the count, not the diff stat — the images. WHY: this is the entire review; an unrelated screen that moved is exactly what the ritual exists to catch.
  8. Bless the whole affected set in one pass, never a subset. Blessing only the images you expected to change leaves the others failing and invites a second, unreviewed pass.
  9. Delete the orphans. A renamed or removed golden test leaves its PNG behind forever, and nothing fails. Removing stale files is part of the same change.
  10. The images land as their own commit, in the same PR as the change that moved them, with a message naming what changed and why. WHY: binary blobs mixed into a code commit make the code diff unreadable, and a reviewer cannot tell an intended re-baseline from a smuggled one.

The ordered workflow

  1. Confirm the change is intentional and that the non-golden test suite (geometry, overflow, text-scale, contrast, a11y) is green.
  2. Run the failing goldens once, without the flag, and read the failure output. Flutter writes failures/*_testImage.png, *_masterImage.png, and *_isolatedDiff.png next to the goldens — open the diff before deciding anything.
  3. Confirm you are in the blessing environment (pinned OS + flutter --version matching the one that produced the committed baselines).
  4. Re-baseline, scoped to the golden tag:
    bash
    flutter test --update-goldens --tags golden
    # or a single file while iterating:
    flutter test --update-goldens test/golden/notes_screen_golden_test.dart
  5. List what actually changed and open every one:
    bash
    git status --porcelain -- '*.png'
    An image you did not expect is a regression. Stop, revert the images (git checkout -- <paths>), and fix the code.
  6. Remove orphans — golden files no longer referenced by any test:
    bash
    # 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
  7. Delete the failures/ artifacts so they are never committed.
  8. Prove it: re-run the suite WITHOUT the flag.
    bash
    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.
  9. Commit the images alone, e.g. test(goldens): rebaseline notes screen — row height 40→48 (design review FIX-12).

Verification (blocking — must pass before the PR)

  • flutter test --tags golden is green without --update-goldens, run twice in a row to catch a golden that settles differently between runs.
  • Every changed PNG was opened and matches the intended change; nothing unrelated moved.
  • No failures/ directory, no orphan PNGs, and no --update-goldens anywhere in .github/workflows/.
  • The geometry/contrast/a11y assertions — the ones that can actually fail meaningfully — are still green.

Anti-patterns

  • --update-goldens as the reflex response to a red test — deletes the assertion instead of reading it.
  • Blessing on a different machine or Flutter version than the baselines — rewrites every image with host-specific rasterization; everyone else's suite goes red.
  • Blessing without loadAppFonts() — a wall of Ahem boxes, blessed as truth.
  • --update-goldens in a CI workflow — the gate now asserts nothing, permanently.
  • Committing images together with the code change — the reviewer cannot separate the intended re-baseline from an accidental one.
  • Blessing a subset of the failures — the rest fail on the next run and get blessed unreviewed.
  • Leaving orphan PNGs after renaming a test — dead weight nothing will ever fail on.
  • Re-blessing a golden that keeps drifting — that is a flake to fix, not a baseline to update.
  • Committing failures/*_testImage.png — noise, and it silently doubles as a second set of "reference" images nobody trusts.

Definition of done

  • The visual change was intentional and every changed image was inspected by eye.
  • Non-golden geometry, overflow, text-scale, contrast, and a11y tests were green before re-baselining, and still are.
  • Re-baselined in the pinned blessing environment, with loadAppFonts() in effect.
  • The whole affected set was blessed in one pass; nothing unexpected changed.
  • Orphan goldens deleted; failures/ artifacts removed.
  • flutter test --tags golden passes without the flag, twice in a row.
  • Images committed on their own, in the same PR, with a message naming the cause.
  • No --update-goldens anywhere in CI configuration.

Related skills

  • 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.

References

Frequently asked questions

What does the Run Goldens Rebaseline AI skill do?

Runs the golden re-baselining ritual — the one sanctioned way committed reference images are overwritten. Enforces the order: land and green the non-golden geometry, contrast and a11y tests FIRST, re-baseline only in the pinned blessing environment that produced the committed images, with loadAppFonts() so nothing renders in Ahem, via `flutter test --update-goldens --tags golden` (never in CI, never to make a red pipeline green), then inspect every changed PNG by eye, delete the orphans left by renamed or removed tests, land the images as their own commit naming why they moved, and prove it...

Why use Run Goldens Rebaseline on TypingMind?

Because you install it once and use it with any model. Run Goldens Rebaseline is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Run Goldens Rebaseline in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/zakariaf/Flutter-Skills/tree/main/skills/run-goldens-rebaseline. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Run Goldens Rebaseline?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Run Goldens Rebaseline?

As many as you like. As long as a model supports skills, you can use Run Goldens Rebaseline with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Run Goldens Rebaseline AI skill free?

Yes. It is published on GitHub by zakariaf under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇