accessibility
Use when working on accessibility, a11y, WCAG, ARIA, screen readers, keyboard nav, focus order, contrast, alt text, captions, reduced motion, or target sizes;…
Use when writing E2E/integration tests, testing native interactions like permissions or system dialogs, capturing UI regressions, or validating cross-platform behavior (Patrol 4.x).
$ npx -y skills add evanca/flutter-ai-rules --skill patrol-e2e-testing --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/patrol-e2e-testingContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when writing E2E/integration tests, testing native interactions like permissions or system dialogs, capturing UI regressions, or validating cross-platform behavior (Patrol 4.x).
name: patrol-e2e-testing description: "Use when writing E2E/integration tests, testing native interactions like permissions or system dialogs, capturing UI regressions, or validating cross-platform behavior (Patrol 4.x)." license: MIT
Design, implement, and run end-to-end (E2E) tests using Patrol 4.x in Flutter projects.
Use this skill when:
Follow the official Patrol documentation for installation and project initialization: [https://patrol.leancode.co/documentation#setup](https://patrol.leancode.co/documentation#setup)
Key Patrol conventions:
Follow these steps when implementing or updating Patrol tests.
Break the feature into:
Rules:
Basic Patrol structure:
import 'package:flutter_test/flutter_test.dart';
import 'package:patrol/patrol.dart';
void main() {
patrolTest(
'user can log in successfully',
($) async {
await $.pumpWidgetAndSettle(const MyApp());
const email = String.fromEnvironment('E2E_EMAIL');
const password = String.fromEnvironment('E2E_PASSWORD');
await $(#emailField).enterText(email);
await $(#passwordField).enterText(password);
await $(#loginButton).tap();
await $.waitUntilVisible($(#homeScreenTitle));
expect($(#homeScreenTitle).text, equals('Welcome'));
},
);
}Key concepts:
For OS-level permission dialogs:
patrolTest('grants camera permission', ($) async {
await $.pumpWidgetAndSettle(const MyApp());
await $(#openCameraButton).tap();
if (await $.native.isPermissionDialogVisible()) {
await $.native.grantPermission();
}
await $.waitUntilVisible($(#cameraPreview));
});Use native automation only when required by the feature.
**Finding widgets:**
$('some text') // by text
$(TextField) // by type
$(Icons.arrow_back) // by icon**Tapping:**
// Tap a widget containing a specific text label
await $(Container).$('click').tap();
// Tap a container that contains an ElevatedButton
await $(Container).containing(ElevatedButton).tap();
// Tap only the enabled ElevatedButton
await $(ElevatedButton)
.which<ElevatedButton>(
(b) => b.enabled,
)
.tap();**Entering text:**
// Enter text into the second TextField on screen
await $(TextField).at(1).enterText('your input');**Scrolling:**
await $(widget_you_want_to_scroll_to).scrollTo();
**Native interactions:**
// Grant permission while app is in use await $.native.grantPermissionWhenInUse(); // Open notification shade and tap a notification by text await $.native.openNotifications(); await $.native.tapOnNotificationBySelector( Selector(textContains: 'text'), );
Run all tests:
patrol test
Run a specific file with live reload (development mode):
patrol develop -t integration_test/my_test.dart
Run a specific file:
patrol test --target patrol_test/login_test.dart
Run on web:
patrol test --device chrome
Headless web (CI):
patrol test --device chrome --web-headless true
Filter by tags:
patrol test --tags android
Flaky tests undermine confidence. Apply these patterns:
// AVOID — arbitrary delay await Future.delayed(Duration(seconds: 3)); // PREFER — explicit wait condition await $.waitUntilVisible($(#targetWidget)); // For animations, pump until settled await $.pumpAndSettle();
When applied, this skill produces:
1. Patrol test(s) covering the specified feature. 2. Any required widget `Key` additions to production code. 3. Exact `patrol test` command(s) to execute locally. 4. Notes explaining stabilization or timing decisions.
**Checkpoint:** Run `patrol test --target <file>` locally to confirm the test passes before committing.
A valid Patrol test must be:
36 Flutter and Dart skills your coding agent loads by itself, sourced only from official documentation. A skill is a folder with a SKILL.md file.
Use when working on accessibility, a11y, WCAG, ARIA, screen readers, keyboard nav, focus order, contrast, alt text, captions, reduced motion, or target sizes;…
Use when creating a feature, designing folder structure, adding repositories/services/view models, wiring dependency injection, or deciding which layer owns…
Use when creating a Cubit or Bloc, modeling state with sealed classes or status enums, wiring BlocBuilder/BlocListener/BlocProvider, writing bloc tests, or…
Use when asked to review a PR, MR, branch, or diff, audit changed files, or check code quality.
Use when writing switch statements, refactoring if-else chains, creating data classes, choosing records vs classes, destructuring values, or modernizing…
Use when building AI agents in Dart, implementing Genkit flows or tools, integrating LLMs into Dart or Flutter applications, or using Genkit Dart plugins.