Writes Patrol end-to-end tests for Flutter apps: action ordering, Patrol API usage, assertion rules, native dialog handling, and test-key conventions. Use when adding or editing integration tests, assigning widget keys, or debugging failing Patrol tests.
Ships in flutter-patrol. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
If the project's Patrol tests use LeanCode's Modules/System/ApiClients architecture (e.g. a patrol_test/modules/ directory and a testApp wrapper), also follow patrol-test-architecture, which builds on this skill and wins where the two differ.
When working with Patrol tests:
patrol-run({ "testFile": "patrol_test/your_test.dart" }) to run tests and wait for completionpatrol-screenshot({ "platform": "android" }) or patrol-screenshot({ "platform": "ios" }) to capture screenshots for debugging test failurespatrol-quit({}) to quit the session gracefullypatrol-status({}) to check current status and recent outputpatrol-native-tree({}) to fetch the current native UI tree hierarchy for writing native interactions and interactions with apps other than the app under test.$(), .scrollTo(), .tap(), .enterText(), .waitUntilVisible(), etc.) should import 'package:patrol/patrol.dart';$.platform methods before implementing test actionspatrol test for all tests. Never use flutter test command$.pump, waitUntilVisible or waitUntilExists and other wait methods after or before tap, scrollTo and enterText. Patrol handles it automatically. Do this only at the end of the test$.pumpAndSettle fails. Pass settlePolicy: SettlePolicy.noSettle to the actions on that screen instead of adding waitswaitUntilVisible as assertion at the end of the testexpect() for assertions only when waitUntilVisible is not enough$.platform.mobile.grantPermissionWhenInUse over $.platform.mobile.tap$.platform.mobile.isPermissionDialogVisible() before handling itAssign a key ONLY to widgets involved in testing
ONLY add the key parameter to existing widgets
NEVER change widget signatures
NEVER refactor existing code structure
NEVER hardcode keys in the app, you must use keys from the keys file that is shared between app and tests
NEVER create new widgets in the app
NEVER create a key that is not assigned to a widget
Always make sure that each key value is unique
ALWAYS sort keys alphabetically
Add keys as first parameter to the widget constructor
If widget is not unique (for example generated from a list) use a parameterized key
Use individual keys when:
Use parameterized keys when:
What SKILL.md sets; muted values are Claude Code's defaults
/flutter-patrol:patrol-write-testfrom flutter-patrol
flutter-patrol@leancode-ai-plugins is listed by leancodepl/ai-plugins — review the source before installing
npx claudepluginhub leancodepl/ai-plugins --plugin flutter-patrol4 skills in this plugin
/patrol-migrate-from-maestroMigrate a Flutter app's Maestro UI flows (`.yaml`) to Patrol end-to-end tests — inventory the flows, translate each command to Patrol, replace text and relative selectors with widget keys, move JS scripts and hooks to Dart, and prove every migrated test green before the next one. Use when a project has a `maestro/` (or `.maestro/`) directory and the user wants those flows in Patrol./patrol-setupSet up Patrol end-to-end (E2E) testing in a Flutter project for the first time — configure the pubspec `patrol` block, wire native Android, and get a first minimal test passing on an Android emulator. Covers Android only (iOS and other platforms follow the same install doc). Use when adding Patrol to a project that does not have it yet./patrol-test-architectureAdd-on to patrol-write-test for Patrol test suites built on LeanCode's recommended architecture — Modules, System, and ApiClients — with per-feature keys.dart files. Use together with patrol-write-test when the project's Patrol tests already follow this architecture (e.g. a `patrol_test/modules/` directory and a `testApp` wrapper), or when the user asks to introduce it or to organize test code into modules.Other plugins' skills for the same job