accessibility
Audits or remediates Flutter widgets against WCAG 2.2 conformance levels A, AA, or AAA across iOS, Android, Web, macOS, Windows,…
Best practices for Dart unit tests, Flutter widget tests, and golden file tests, covering group and test naming, setUp lifecycle and isolation, mocking with package:mocktail, and the shared pumpApp helper. Use when writing, modifying, or reviewing tests, goldens included, that
$ npx -y skills add VeryGoodOpenSource/vgv-ai-flutter-plugin --skill testing --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/testingContext preview
The summary Claude sees to decide when to auto-load this skill.
Best practices for Dart unit tests, Flutter widget tests, and golden file tests, covering group and test naming, setUp lifecycle and isolation, mocking with package:mocktail, and the shared pumpApp helper. Use when writing, modifying, or reviewing tests, goldens included, that
name: testing description: > Best practices for Dart unit tests, Flutter widget tests, and golden file tests, covering group and test naming, setUp lifecycle and isolation, mocking with package:mocktail, and the shared pumpApp helper. Use when writing, modifying, or reviewing tests, goldens included, that use package:test, package:flutter_test, package:mocktail, or package:bloc_test, and when no package is named: adding a golden test, matchesGoldenFile, tagging or updating goldens, writing a unit or widget test, or adding a test helper or mock. A one-line golden or widget test request is in scope, including under "Dart code only"; a widget in a UI package is ui-package's. Use it too when the request asks for what these standards forbid: package:mockito, a raw string test tag instead of TestTag, an inline pumpWidget(MaterialApp(...)), asserting padding, color or font size in a widget test, or state shared between tests. allowed-tools: Read Glob Grep mcp__very-good-cli__test argument-hint: [file-or-directory]
VGV testing conventions for Dart and Flutter. The framework APIs are assumed; what follows is the house style layered on top of them.
Apply these standards to all test work:
| Convention | Rule | | -------------------- | ---------------------------------------------------------------------------------------------- | | **File suffix** | Every test file ends with `_test.dart` | | **Directory** | All tests live under `test/` | | **Mirror structure** | `test/` mirrors `lib/` exactly — `lib/src/models/user.dart` → `test/src/models/user_test.dart` | | **Helpers** | Shared test utilities go in `test/helpers/` (e.g., `pump_app.dart`, `fakes.dart`) |
Structure groups so that concatenated descriptions read as natural sentences. Use the `PascalCase` type itself — not a string — in the top-level group.
class _MockApiClient extends Mock implements ApiClient {}
void main() {
group(UserRepository, () {
late ApiClient apiClient;
late UserRepository subject;
setUp(() {
apiClient = _MockApiClient();
subject = UserRepository(apiClient: apiClient);
});
group('getUser', () {
test('returns $User when API call succeeds', () async {
when(() => apiClient.fetchUser(any()))
.thenAnswer((_) async => User(id: '1', name: 'Dash'));
final result = await subject.getUser('1');
expect(result, equals(User(id: '1', name: 'Dash')));
verify(() => apiClient.fetchUser('1')).called(1);
});
test('throws $UserNotFoundException when API returns 404', () {
when(() => apiClient.fetchUser(any()))
.thenThrow(ApiException(statusCode: 404));
expect(
() => subject.getUser('1'),
throwsA(isA<UserNotFoundException>()),
);
});
});
});
}| Pattern | Example | | ------------------------ | -------------------------------------------------------- | | **Returns a value** | `'returns $User when API call succeeds'` | | **Throws an exception** | `'throws $UserNotFoundException when user is not found'` | | **Calls a dependency** | `
A Claude Code plugin that accelerates Flutter & Dart development with best-practices skills from Very Good Ventures. Developed with 💙 by Very Good Ventures 🦄
Audits or remediates Flutter widgets against WCAG 2.2 conformance levels A, AA, or AAA across iOS, Android, Web, macOS, Windows,…
Best practices for Flutter animations using the built-in animation framework, covering implicit animations, explicit…
Best practices for Bloc state management in Flutter/Dart, covering Cubit versus Bloc, event and state naming, sealed classes with…
Scaffold a new Dart or Flutter project from a Very Good CLI template, covering the flutter_app, dart_package, flutter_package,…
VGV-specific reference for bumping Dart and Flutter SDK constraints across packages, covering pubspec.yaml environment…
Drives a Dart or Flutter package fully green through a verify-fix-rerun loop across four gates: analyze, format, test, coverage.…