widget-golden-and-a11y-testing

widget-golden-and-a11y-testing is a skill for Claude Code from zakariaf/Flutter-Skills. It costs 223 tokens per session (3,900 once invoked), scanned A, original, MIT.

A testing guide for Flutter widgets, screen layouts, visual snapshots called goldens, and accessibility checks. It uses fixed device sizes and text settings, and checks the actual widget geometry rather than relying only on screenshots.

In plain words
What is it for?
Use it to build or review Flutter widget tests, geometry checks, accessibility tests, golden tests, and test-hygiene checks.
Why use it?
It helps reveal layout overflow and accessibility problems across device sizes, text scales, bold text, and right-to-left layouts. It also prevents visual snapshots from hiding structural layout failures.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the flutter plugin — 40 skills shipped together

Good fit Use it to build or review Flutter widget tests, geometry checks, accessibility tests, golden tests, and test-hygiene checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zakariaf/flutter-skills/widget-golden-and-a11y-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 zakariaf/Flutter-Skills --skill widget-golden-and-a11y-testing
Clone the repo
git clone --depth 1 https://github.com/zakariaf/Flutter-Skills

Made for: Claude Code.

Or install flutter, the plugin that ships this one along with the rest of its 40 skills.

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 widget-golden-and-a11y-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/zakariaf/flutter-skills/widget-golden-and-a11y-testing/github.svg)](https://agentmods.dev/skills/zakariaf/flutter-skills/widget-golden-and-a11y-testing)
Your own site
<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/widget-golden-and-a11y-testing"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/widget-golden-and-a11y-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 widget-golden-and-a11y-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/widget-golden-and-a11y-testing"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/widget-golden-and-a11y-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 223 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,900 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.00223 $0.03900
Opus 5 $0.00112 $0.01950
Sonnet 5 $0.00045 $0.00780
Haiku 4.5 $0.00022 $0.00390

Measured 11d ago against content hash ee8df72098ca, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

widget-golden-and-a11y-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 11d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/check-test-hygiene.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/widget-golden-and-a11y-testing/SKILL.md · 286 lines

How it starts

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

Widget, golden and accessibility testing

One harness pins the surface; layout and accessibility are asserted by computed geometry on the real widget tree, not by blessed pixels. Goldens are a narrow, honest safety net for glyph shaping and mirroring — never the layout gate. This skill covers the widget tier; for the pure-core / Drift / Notifier tiers see testing-strategy.

Read the reference for the task at hand:

  • references/harness-and-mediaquery.md — pumpApp, Device presets, the four load-bearing lines, driving MediaQuery flags, finder policy.
  • references/overflow-and-textscale.md — the two overflow classes, the three traps, the matrix, the fit assertion, and the four wrong fixes.
  • references/a11y-guidelines-and-limits.md — the four built-in guidelines and their defects, the semantics/traversal gate, pure-Dart contrast, and what automation genuinely cannot cover.
  • references/golden-two-lanes.md — the golden-refusal argument, the Ahem-vs-real-font lanes, RTL goldens, and blocking accidental blessing.

Run scripts/check-test-hygiene.sh before a PR.

Non-negotiable rules

  1. Pin the device on every layout/geometry test. The default widget surface is 800x600 logical — wider than any phone. Unpinned, content is ~2x too wide, everything fits, the suite is green, and the shipped phone is broken. useDevice(...) first, pumpApp(...) second.
  2. physicalSize is in PHYSICAL pixels — always multiply by DPR. view.physicalSize = Size(320, 640) at the default DPR 3.0 is a 107x213 logical surface, not a phone. Set devicePixelRatio and physicalSize = logical * dpr, then addTearDown(view.reset) — a leaked size poisons every later test in the file.
  3. Layer MediaQuery ABOVE MaterialApp, built from .copyWith. MaterialApp inserts no MediaQuery of its own; the one from pumpWidget's View is nearest. A bare MediaQueryData() zeroes the view-derived size the device just pinned — the test then measures a 0x0 screen and passes.
  4. pump(), never pumpAndSettle() as an animation wait. pumpAndSettle carries a 10-minute timeout and truncates its stack trace, and hangs forever on an infinite splash/shimmer/spinner. Use pump() for state changes and pump(duration) / fakeAsync for timer-driven async — pump() does not advance the fake clock.
  5. Never suppress overflow. A RenderFlex overflow already fails a widget test (it routes through FlutterError.reportError and the binding rethrows at test end). Never call takeException() to swallow it, never assign FlutterError.onError, never copy ignoreOverflowErrors, and never takeException() in a global tearDown — each disarms the whole net.
  6. One testWidgets per (device, scale, bold) tuple — never a loop inside a test. Overflow is reported once per RenderObject (the flag resets only on reassemble()), so looping scales inside one test silently under-reports every scale after the first. Loop around the testWidgets call.
  7. Assert the fit, not just absence of overflow. A clipped Text reports nothing — RenderParagraph has no overflow indicator. takeException(), isNull is necessary but not sufficient; add a getSize/getRect assertion that the label fits inside its computed cell.
  8. Prefer computed geometry over goldens for layout. Assert cells in a row share a top and cells in a column share a left (moreOrLessEquals, epsilon: 0.5); assert tap targets with a getSize loop. These fail with a sentence a human can act on. Goldens cannot assert anything — a blessed screen of clipped, unreadable text passes forever.
  9. Assert contrast on colour VALUES in pure Dart, never on pixels. meetsGuideline(textContrastGuideline) screenshots and histograms the layer — white text on #FAFAFA passes (an open Flutter defect). A pure-Dart WCAG + APCA test on the theme's colours cannot false-pass. For a state pair distinguished only by chroma (selected vs surface at equal luminance), assert wcag(theme.selected, theme.surface) directly — a grayscale-mode user perceives exactly that luminance gap, so no separate grayscale channel is needed.
  10. await expectLater(...) for meetsGuideline — it returns an AsyncMatcher. A plain expect() looks right and asserts nothing. Keep the four built-in guidelines only as advisory tripwires; the geometry and pure-Dart contrast tests are the gate.
  11. Two golden lanes, both loadAppFonts(); block accidental --update-goldens. Ahem squares are byte-stable cross-OS and prove geometry/mirroring but not glyph shaping; one narrow real-font lane on a pinned OS proves script joining and numeral glyphs. Tag every golden @Tags(['golden']) and generate blessed files in one pinned environment only.
  12. Never clamp TextScaler. withClampedTextScaling, textScaleFactor, and FittedBox defeat the matrix while contrast and tap-target stay green, and override the user's own OS setting. Fix the layout, not the text.

Read the full file on GitHub · 286 lines

Files

What ships with it

8 files 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. 11d ago First seen · 286 lines · 223 tokens per session scan A ee8df72098ca

Subscribe to this mod's changes

widget-golden-and-a11y-testing is a skill published in the GitHub repository zakariaf/Flutter-Skills (2 stars, last pushed 13d ago), licensed MIT. It adds 223 tokens to every session and 3,900 once invoked, about $0.0011 per session on Opus 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

Other skills, from other repositories

e2e-testing

Guide for running end-to-end tests of the Qwen Code CLI, including headless mode, MCP server testing, and API traffic inspection. Use this skill whenever you need to verify CLI behavior with real model calls, reproduce user-reported bugs end-to-end, test MCP tool integrations, or inspect raw API request/response…

QwenLM/qwen-code · 94 tokens

terminal-capture

Automates terminal UI screenshot testing for CLI commands. Applies when reviewing PRs that affect CLI output, testing slash commands (/about, /context, /auth, /export), generating visual documentation, or when 'terminal screenshot', 'CLI test', 'visual test', or 'terminal-capture' is mentioned.

QwenLM/qwen-code · 66 tokens

agent-reproduce-align

Use after a Codex or Claude Code feature has been implemented in Qwen Code to run the selected reference agent and Qwen Code under the same scenario, capture HTTP and terminal traces, compare request bodies, tool/function schemas, outputs, and iterate until the reproduced behavior is close enough.

QwenLM/qwen-code · 62 tokens

cw-gates

Use before claiming any Codewhale change is done, green, or ready to land: the focused-to-broad verification ladder, the budget checks CI enforces, and the rules for what counts as a passing test.

Hmbown/Codewhale · 48 tokens

codew-release-qa-sweep

Use before claiming Codewhale release work is done: run the full gate sweep and list the manual QA targets.

Hmbown/CodeWhale · 31 tokens

verify

Exercise the real app/API/CLI and collect observable evidence; tests alone do not count as end-to-end verification.

Hmbown/CodeWhale · 25 tokens