Agent skill

Widget Golden and A11y Testing Skill for Flutter

The widget golden and a11y testing skill has an AI coding agent pin device sizes, run text scale overflow matrices, check contrast on color values and keep goldens to glyph shaping.

Install
npx skills add zakariaf/Flutter-Skills
View on GitHub

Stars, license and last push from GitHub. Install count as reported by the open skills directory.

What is the widget golden and a11y testing skill?

The widget golden and a11y testing skill is a SKILL.md in zakariaf/Flutter-Skills. It makes an AI coding agent pin the device in Flutter widget tests, assert layout and accessibility by computed geometry, check contrast on color values in pure Dart, and use goldens only for glyph shaping and mirroring.

The widget golden and a11y testing skill is a SKILL.md in zakariaf/Flutter-Skills. It has an AI coding agent assert layout and accessibility in Flutter widget tests by computed geometry, with goldens as a narrow safety net for glyph shaping and mirroring.

One pumpApp harness pins the device size and layers MediaQuery above MaterialApp, so each test runs at a chosen phone size with a chosen text scale, bold text and accessible navigation setting.

The overflow and fit matrix

The matrix runs one testWidgets per device, text scale and bold tuple, because overflow is reported once per RenderObject. Scales are 1.0, 1.3, 1.5, 2.0 and 3.0, and a getSize or getRect assertion checks that each label fits inside its computed cell.

Accessibility and goldens

Contrast is asserted in pure Dart on color values with WCAG and APCA, and tap targets are measured with an explicit getSize loop. The skill states that Flutter ships four machine checkable guidelines and that Switch Access cannot be tested automatically.

Goldens run in two lanes, an Ahem lane for geometry and mirroring and one pinned OS real font lane for glyph shaping, and both call loadAppFonts. RTL goldens pump under Directionality, and CI blocks --update-goldens.

Who the widget golden and a11y testing skill is for

Best for

  • Writing test/support/harness.dart and a pumpApp helper for Flutter widget tests.
  • Chasing an overflowed by N pixels failure across device sizes and text scales.
  • Writing a11y_test.dart with isSemantics, simulatedAccessibilityTraversal or meetsGuideline.

Not for

  • It asserts layout by computed geometry in widget tests rather than writing layout code, so for building Flutter layouts that adapt to window size the flutter-build-responsive-layout skill fits.
  • Its answer to an overflow is a test net that never suppresses and a rule to fix the layout, so for mapping Flutter layout errors such as overflow and unbounded constraints to their fixes the flutter-fix-layout-issues skill fits.
  • It asserts on the Flutter widget tree inside widget tests, so for scanning a live URL with axe-core, pa11y and Lighthouse the a11y-ally skill fits.
  • SKILL.md says Flutter's four built-in guidelines cover a small minority of real accessibility, so for a WCAG 2.2 quick reference with POUR checks and a screen reader checklist the accessibility-testing skill fits.