/flutter-code-quality:codebase-conventionsfrom flutter-code-quality
Searches Flutter projects for existing components, styles, and naming conventions before adding UI code. Prevents duplicate widgets by searching by role and suffix.
Ships in flutter-code-quality. 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.
The most common defect in agent-written Flutter is not a bug. It is a second
PrimaryButton — correct, tested, and redundant, because the project already had one
called AppButton and nothing looked for it.
Nothing in review catches this. The diff is all additions, every line is defensible, and the duplication only surfaces months later when a brand change has to be applied twice.
Read the conventions file first.
.agents/flutter-conventions.mdrecords where this project keeps its shared widgets, typography, colours, and assets, and what its naming rules are. If it is absent, check.claude/flutter-conventions.md. The user generates it with theflutter-adaptskill —$flutter-adaptin Codex; in Claude Code/flutter-code-quality:flutter-adaptas a plugin or/flutter-adaptwhen vendored. It only runs when the user invokes it, so suggest it rather than trying to run it.If it does not exist, do the discovery below inline before writing code. Do not skip it because there is no file — the file is a cache of an answer you would otherwise have to work out, not a precondition.
It records locations and rules, never an inventory of components. A list of every widget in the project is out of date within a week and then actively misleads. Search live; use the file to know where to search.
Search first, and search by role, not by the name you have in mind. Searching for
PrimaryButton, finding nothing, and building one is the failure — the project calls it
AppButton, and one grep for the wrong string is what convinced you otherwise.
For a component that renders X, search in this order:
grep -rn "class .*Button" lib/ — every button in the project, whatever
the prefix. Same for Card, Field, Tile, Sheet, Dialog, Chip, Avatar.Balance and Card
separately, not BalanceCard.widgets/ directory.Then read what you found before deciding. A widget that does 80% of what you need is usually a parameter away from doing 100%, and adding the parameter is a smaller change than adding a file.
Report what you found and what you decided. "Found AppButton, it has no loading
state, adding an isLoading parameter" is a reviewable decision. Silently creating
LoadingButton is not.
FilterChip is not a Tag because they
happen to be capsule-shaped.Do not create a new component because the existing one is in an inconvenient directory, because its API is slightly awkward, or because it is easier to write a fresh one than to read an existing one. Those are the three reasons duplication actually happens.
Under tokens: none, inline TextStyle is allowed and no token layer is required.
Otherwise text styles come from the project's typography source. Avoid TextStyle(...) inline
in a widget — an inline style is invisible in review and is how a screen ends up two
points off from every other screen.
Where the source is depends on the profile's tokens setting: context.tokens.text.*,
Theme.of(context).textTheme.*, or the project's own constants class. The conventions
file names the exact entry point.
If the design calls for a style the project does not have, add it to the typography source and use it from there. Do not inline it "just this once" — the token that does not exist yet is the whole reason the next person inlines one too.
Applying a single modifier to an existing style is fine and is not an inline style:
style: context.tokens.text.bodyMedium.copyWith(color: context.tokens.color.danger)
Reaching for copyWith on three properties at once means the style itself is missing.
Never invent an asset path. A path that does not resolve throws at runtime, in the
widget, on the device — flutter analyze says nothing, tests that do not render that
screen say nothing, and it reaches a reviewer looking like working code.
Before referencing an asset:
flutter: assets: in pubspec.yaml. A file
that exists but is undeclared fails the same way at runtime.If a required brand asset is missing, report it and continue independent work. Use a clearly labelled placeholder only if the user authorized one; never invent a path or claim visual fidelity for a substituted asset.
Use the project's existing loader. A project on flutter_svg uses SvgPicture.asset for
SVGs; introducing a second image library for one icon is a dependency added by accident.
These are not correctness rules. They are the difference between a change that reads as part of the codebase and one that reads as pasted in.
wallet_page.dart in a project of
_page.dart files, not WalletScreen.dart.*Page and none are *Screen,
the thirteenth is a Page. Count before choosing.StatelessWidget,
ConsumerWidget, HookWidget. Introducing flutter_hooks into a project that does not
use it is a stack decision disguised as a widget.package: and relative imports, and its use of
barrel files. This one is worth checking rather than guessing; projects are consistent
about it and the analyzer often enforces it.Everything dart format and analysis_options.yaml already enforce is not your concern —
run the formatter and let the analyzer speak.
core/widgets/ on its first use. Wait for the third — two
usages that later diverge are cheaper to split than to un-merge.TextStyle inside a copyWith chain, on the grounds that it is technically
going through the theme. It is not.assets/images/logo.png because that is where a logo would obviously be.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub draz26648/flutter_craft_skills --plugin flutter-code-quality8 skills in this plugin
/a11y-and-rtlImplement or review Flutter semantics, keyboard access, text scaling, localization, and RTL behavior for affected user-facing controls./architecturePlace or refactor Flutter feature code using the project’s existing architecture and dependency boundaries. Use for structural changes, not every new file./flutter-adaptInspect a Flutter project and create or regenerate its agent profile and conventions when explicitly requested. Preserve existing user decisions./performanceDiagnose Flutter jank, expensive rebuilds, image memory, or long-list performance. Use for relevant list/image changes or measured performance issues./responsive-adaptiveImplement or debug Flutter layout across available widths, keyboard insets, orientations, and text scaling. Use for layout changes or overflow./review-gateAudit Flutter changes before a commit or PR, after substantial implementation, or on request. Report formatting, analysis, tests, and scoped convention findings.Other plugins' skills for the same job