flutter-golden-testing

flutter-golden-testing is a skill for Claude Code, Codex from anoopsg/agent_rules. It costs 39 tokens per session (835 once invoked), scanned A, original, MIT.

A workflow for Flutter golden tests, which compare a widget's rendered image with a saved reference image. It uses the Alchemist package and stores reference PNG files near the tests.

In plain words
What is it for?
Use it to create or update visual regression tests for Flutter widgets, including their test files, dependencies, mocks, and golden images.
Why use it?
It provides the setup and test structure needed to catch unintended visual changes in Flutter widgets. It also covers fonts, animations, and network images that can make image comparisons unreliable.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create or update visual regression tests for Flutter widgets, including their test files, dependencies, mocks, and golden images.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/anoopsg/agent_rules/flutter-golden-testing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add anoopsg/agent_rules --skill flutter-golden-testing
Clone the repo
git clone --depth 1 https://github.com/anoopsg/agent_rules

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for flutter-golden-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/anoopsg/agent_rules/flutter-golden-testing/github.svg)](https://agentmods.dev/skills/anoopsg/agent_rules/flutter-golden-testing)
Your own site
<a href="https://agentmods.dev/skills/anoopsg/agent_rules/flutter-golden-testing"><img src="https://agentmods.dev/badge/skills/anoopsg/agent_rules/flutter-golden-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for flutter-golden-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/anoopsg/agent_rules/flutter-golden-testing"><img src="https://agentmods.dev/badge/skills/anoopsg/agent_rules/flutter-golden-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 835 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00039 $0.00835
Opus 5.5 $0.00016 $0.00334
Sonnet 5.5 $0.00008 $0.00167
Haiku 4.5 $0.00004 $0.00084

Measured 22d ago against content hash 63dba71792ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

flutter-golden-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 22d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/exclusive/skills/flutter-golden-testing/SKILL.md · 46 lines

How it starts

The opening of the file, as written. The whole thing — 46 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Flutter Golden Testing Skill

This skill outlines the step-by-step process for implementing and updating golden tests for Flutter widgets.

Step 1: Validation & Setup

Run these steps in the package that owns the widget (usually packages/app_ui/).

  1. Check Dependencies: Ensure alchemist is present in the dev_dependencies of pubspec.yaml. If it is missing, install it:
    flutter pub add --dev alchemist
    
  2. Test Config: Ensure <package>/test/flutter_test_config.dart sets the global AlchemistConfig, including the app theme — see references/alchemist-setup.md. If the file already exists (the app root test/flutter_test_config.dart registers mappers), never replace it: keep its setup first and wrap only testMain.
  3. Directory Structure: Do not create golden folders by hand. Alchemist writes goldens/ci/ and goldens/<platform>/ next to the test file itself.

Step 2: Test Scaffolding

Create the test file named [widget_name]_golden_test.dart, mirroring the widget's path (e.g. under packages/app_ui/test/src/widgets/).

  1. Imports: Import the necessary packages (package:flutter_test/flutter_test.dart and package:alchemist/alchemist.dart).
  2. Fonts: goldenTest loads the app fonts itself; no separate font-loading call (as in golden_toolkit) is needed.

Step 3: Implementation

Implement the test using alchemist APIs instead of the standard testWidgets.

  1. Use goldenTest: Define your test using the goldenTest function.
  2. Theme: goldenTest has no theme: parameter, and wrapping the builder in Theme does not reach Alchemist's MaterialApp. Set the theme through AlchemistConfig(theme: …), built from the app_ui theme classes the same way packages/app_ui/test/helpers.dart does; otherwise context.$.colors throws. For a dark variant, wrap that test in AlchemistConfig.runWithConfig(config: AlchemistConfig.current().copyWith(theme: …), run: …).
  3. Mock Externalities:
    • Disable or replace infinite animations (e.g., CircularProgressIndicator).
    • Mock network image requests (e.g., using mocktail_image_network or network_image_mock).
  4. Matrix Testing: Use GoldenTestGroup and GoldenTestScenario to lay out all possible widget states (e.g., loading, success, error) within a single test execution. Cover light and dark mode at minimum (see Theme), and text scaling with the textScaleFactor: parameter of goldenTest.

Read the full file on GitHub · 46 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 22d ago Changed · +4 lines · +14 tokens per session 63dba71792ba
  2. 3mo ago First seen · 42 lines · 25 tokens per session scan A e8f8241f2a67

Subscribe to this mod's changes

flutter-golden-testing is a skill published in the GitHub repository anoopsg/agent_rules (2 stars, last pushed 23d ago), licensed MIT. It adds 39 tokens to every session and 835 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

flutter-golden-testing compared with skills from other repositories

flutter-golden-testing next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
flutter-golden-testinganoopsg/agent_rulesSkill223d agoMITA39Claude Code, Codex
git-workflowAsyrafHussin/agent-skillsSkill111todayMITA59Claude Code, Codex
laravel-inertia-reactAsyrafHussin/agent-skillsSkill111todayMITA59Claude Code, Codex
laravel-owasp-securityAsyrafHussin/agent-skillsSkill111todayMITA87Claude Code
seo-best-practicesAsyrafHussin/agent-skillsSkill111todayMITA78Claude Code
state-managementAsyrafHussin/agent-skillsSkill111todayMITA47Claude Code, Codex
technical-debtAsyrafHussin/agent-skillsSkill111todayMITA109Claude Code