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 asked to review a PR, MR, branch, or diff, audit changed files, or check code quality.
$ npx -y skills add evanca/flutter-ai-rules --skill code-review --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/code-reviewContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when asked to review a PR, MR, branch, or diff, audit changed files, or check code quality.
name: code-review
description: "Use when asked to review a PR, MR, branch, or diff, audit changed files, or check code quality."
hooks:
PreToolUse:
- matcher: "Bash"
hooks:
- type: command
command: "./scripts/protect-token.sh"
license: MITPerform structured, objective code reviews for Flutter/Dart projects following a repeatable checklist.
Use this skill when:
---
1. Confirm the current branch is a **feature, bugfix, or PR/MR branch** — not the project's primary branch (e.g. `main`, `master`, `develop`). 2. Verify the branch is **up-to-date** with the target branch (no unresolved conflicts). 3. Identify the **target branch** for the merge.
**Checkpoint:** If the branch is behind the target, flag it before proceeding.
1. List all **changed, added, and deleted files**. 2. For each change, look up the **commit title** and review how connected components are implemented. 3. **Analyze the change**: is it clear *why* the change was made? If not, dig into the connected methods and files until it is. When you report, name **which connected files/methods you analyzed and why** — this shows the change was understood, not assumed. 4. **Never assume** a change is correct without investigating the implementation. 5. If a change remains unclear after investigation, **note this explicitly** in the report.
Iterate through each changed file. For every file, verify the following:
| Area | What to verify | |---|---| | **Understand the change** | Why was it made? Review connected methods/files; note which ones you analyzed and why | | **Location** | File is in the correct directory | | **Naming** | File name follows project naming conventions | | **Responsibility** | The file's responsibility is clear; reason for change is understandable | | **Readability** | Variable, function, and class names are descriptive and consistent | | **Logic & correctness** | No logic errors or missing edge cases | | **Code smells** | Scan for the smells in [Code Smells Reference](#code-smells-reference) below | | **Maintainability** | Code is modular; no unnecessary duplication | | **Error handling** | Errors and exceptions are handled appropriately | | **Security** | No input validation gaps; no secrets committed to code | | **Performance** | No obvious inefficiencies (e.g., unnecessary rebuilds, O(n^2) loops on large lists) | | **SOLID principles** | Adherence assessed without forcing unnecessary boilerplate or over-abstraction | | **Flutter/Dart/<your-state-management-package> patterns** | Match against the project's loaded guidelines and conventions | | **Documentation** | Public APIs, complex logic, and new modules are documented | | **Test coverage** | New or changed logic has sufficient tests (see Step 4) | | **Style** | Code matches the project's style guide and linting rules | | **Existing code** | If the new changes look fine, also review surrounding **existing (unchanged) code** for smells and suggest refactors where relevant |
For **generated files** (e.g., `*.g.dart`, `*.freezed.dart`): confirm they are up-to-date and not manually modified.
> **Scope discipline:** Your job is **not** to comment on every change — it's to find errors and concrete improvement areas and comment on those. Don't manufacture comments where the code is fine.
*(Note: The following is just an example using Bloc/Cubit; apply similar principles to Riverpod, Provider, or your chosen state management package.)*
// BAD — rebuilds entire tree on every state change BlocBuilder<MyCubit, MyState>( builder: (context, state) => EntireScreen(state: state), ); // GOOD — scope rebuilds to the widget that actually changes BlocSelector<MyCubit, MyState, String>( selector: (state) => state.title, builder: (context, title) => Text(title), );
For each file, check for common code smells. Use [refactoring.guru/refactoring/smells](https://refactoring.guru/refactoring/smells) for definitions and suggested refactorings.
| Category | Smells | |---|---| | **Bloaters** | Long Method, Large Class, Primitive Obsession, Long Parameter List, Data Clumps | | **Object-Orientation Abusers** | Alternative Classes with Different Interfaces, Refused Bequest, Temporary Field, Switch Statements | | **Change Preventers** | Divergent Change, Parallel Inheritance Hierarchies, Shotgun Surgery | | **Dispensables** | Comments (redundant), Duplicate Code, Data Class, Dead Code, Lazy Class, Speculative Generality | | **Couplers** | Feature Envy, Inappropriate Intimacy, Incomplete Library Class, Message Chains, Middle Man |
1. Verify the change set is **focused and scoped** to its stated purpose — no unrelated changes. 2. Check that the **PR/MR description** accurately reflects the changes.
Verify test coverage **explicitly** — this is easy to skip and easy to fake, so be deliberate:
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 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.
Use when writing Dart code, reviewing for style, refactoring naming, adding doc comments, structuring imports, or enforcing type annotations.