Flutter Widget Test Generator skill for Claude and Codex
Writes a complete Flutter widget test file for the scenarios you pick, with finders, pump calls and optional golden tests, ready to run.
Install it once and Claude or Codex runs it for you. When your request matches, your AI loads the skill, asks for anything it is missing, and works through the template itself. Prefer to fill it in by hand? See the full prompt template.
Download the skill (.zip) · View SKILL.md
When it is used
Use when a Flutter developer needs a widget test file for a given widget covering renders, taps, error and loading states. Do not use for unit tests for pure Dart logic or end-to-end browser tests. Related topics: flutter, testing, coding.
What it will ask you for
- Widget code or interface (longer free text)
- What the widget does (free text, e.g. "a login button that shows a loading spinner")
- Scenarios to test (choose any: Renders correctly, Tap events trigger callbacks, Displays error states, Loading states)
- Testing package (choose one: flutter_test, patrol, golden_toolkit)
- Include a golden test template (choose one: Yes, No)
How it works
- Read the widget and list its inputs, callbacks and visible states.
- Write the pump setup with MaterialApp and Scaffold and choose finders that do not depend on position.
- Write one test per selected scenario, using pump instead of pumpAndSettle for infinite animations.
- Add the golden test template if requested and list testability problems found in the widget.
What you get
A complete Dart test file with one named test per scenario and a setUp block, followed by notes on hard-to-test code.
What it watches out for
- Calling pumpAndSettle on a looping spinner, which makes the test time out.
- Finding widgets by index, which breaks when layout changes.
- Skipping the MaterialApp wrapper, so theme and navigation lookups fail.
How to install
Claude.ai and the Claude desktop app
- Download the skill .zip.
- Open Settings, then Capabilities, and find Skills.
- Choose Upload skill and select the .zip.
- Ask Claude for help with the task. It loads the skill when your request matches.
Claude Code
- Download the skill .zip.
- Unzip it into ~/.claude/skills/ (or .claude/skills/ inside a project).
- Start a new session. Claude Code loads the skill when your request matches.
Codex
- Download the skill .zip.
- Unzip it into ~/.agents/skills/ (or .agents/skills/ inside a project).
- Codex picks it up on its own. Type $ and the skill name to use it, or just ask for the task.
Cursor
- Download the Cursor rule (.mdc).
- Save it in .cursor/rules/ inside your project.
- Cursor's agent applies the rule when your request matches its description.
AGENTS.md (Codex, Cursor, and other coding agents)
- Copy the AGENTS.md section.
- Paste it into AGENTS.md at the root of your repository, creating the file if needed.
- Coding agents that read AGENTS.md follow it when your request fits.