Logo: Run Goldens Rebaseline

Run Goldens Rebaseline

Communautéit
zakariaf
run-goldens-rebaseline

Féiert de Ritual fir d'Nei-Baseline vun de Golden-Referenzbiller aus — deen eenzege geneemegte Wee, fir committ Referenzbiller ze iwwerschreiwen. Setzt déi genee Reiefolleg duerch: d'Geometrie an d'Kontrast- an a11y-Tester, déi net vu Golden-Dateie ofhänken, ALS ÉISCHT integréieren an op gréng bréngen; d'Baseline nëmmen an der festgeluechter Blessing-Ëmgéigend nei erstellen, an där déi committ Biller entstane sinn, mat loadAppFonts(), fir ze verhënneren, datt eppes an Ahem gerendert gëtt, iwwer `flutter test --update-goldens --tags golden` (ni am CI a ni, fir e roude Pipeline-Laf gréng ze maachen); duerno all geännert PNG mat den Ae kontrolléieren, verwaist Biller vun ëmbenannten oder geläschten Tester ewechhuelen, d'Biller als eegene Commit integréieren an uginn, firwat se geännert goufen, a Beweis liwweren, andeems d'Suite OUNI de Flag nach eng Kéier leeft. Manuelle Workflow mat Niewewierkungen. Benotzt dëst, wann eng bewosst visuell Ännerung matchesGoldenFile scheitere léisst, wann Dir e Golden-Test bäisetzt oder ëmbenennt oder wann een no --update-goldens gräift.

Add to TypingMind

Iwwersiicht

Editeurzakariaf
RepositoryFlutter-Skills
Skill-Nummrun-goldens-rebaseline
Stären
64
Forks
15
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    zakariaf huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Run Goldens Rebaseline an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/zakariaf/Flutter-Skills/tree/main/skills/run-goldens-rebaseline
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Run Goldens Rebaseline an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Run Goldens Rebaseline automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Run Goldens Rebaseline net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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

Heefeg gestallte Froen

Wat mécht de KI-Skill Run Goldens Rebaseline?

Féiert de Ritual fir d'Nei-Baseline vun de Golden-Referenzbiller aus — deen eenzege geneemegte Wee, fir committ Referenzbiller ze iwwerschreiwen. Setzt déi genee Reiefolleg duerch: d'Geometrie an d'Kontrast- an a11y-Tester, déi net vu Golden-Dateie ofhänken, ALS ÉISCHT integréieren an op gréng bréngen; d'Baseline nëmmen an der festgeluechter Blessing-Ëmgéigend nei erstellen, an där déi committ Biller entstane sinn, mat loadAppFonts(), fir ze verhënneren, datt eppes an Ahem gerendert gëtt, iwwer `flutter test --update-goldens --tags golden` (ni am CI a ni, fir e roude Pipeline-Laf gréng ze m...

Firwat Run Goldens Rebaseline op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Run Goldens Rebaseline besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Run Goldens Rebaseline an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/zakariaf/Flutter-Skills/tree/main/skills/run-goldens-rebaseline an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Run Goldens Rebaseline benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Run Goldens Rebaseline benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Run Goldens Rebaseline domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Run Goldens Rebaseline gratis?

Jo. zakariaf huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇