flutter-strict-analysis
Skill1 starsChanged 26 days agoBSD-3-ClauseView on GitHub
Sets up a strict Flutter analysis policy with a --fatal-infos CI gate, not just dart analyze. Use when setting up a new Flutter repo, when flutter_lints feels too loose or CI analyze is noisy. Also use when a PR should not compile with missing returns.
In this repository52 other files it gives its agents.
- academic-research-assistantSkill
- answer-sheetSkill
- app-graphicsSkill
- app-landing-pageSkill
- app-screenshotsSkill
- break-uiSkill
- consumer-app-from-behaviorSkill
- cross-language-safetySkill
- dart-tool-scriptsSkill
- decision-sweepSkill
- engineering-diarySkill
- figma-review-loopSkill
- flutter-app-size-auditSkill
- flutter-async-at-the-edgeSkill
- flutter-async-cubit-safetySkill
- flutter-bloc-clean-architectureSkill
- flutter-clean-architecture-tddSkill
- flutter-cubit-smart-cachingSkill
- flutter-error-logging-conventionsSkill
- flutter-observability-instrumentationSkill
- flutter-paywall-and-review-timingSkill
- flutter-precommit-cleanupSkill
- flutter-router-decisionSkill
- flutter-runtime-safetySkill
- flutter-shorebird-otaSkill
- flutter-stream-architectureSkill
- flutter-web-first-paintSkill
- forced-pivot-15-daySkill
- gplay-consoleSkill
- ios-distribution-feature-flagsSkill
- launch-readinessSkill
- launch-watchSkill
- locale-expert-reviewSkill
- market-pulseSkill
- mobile-ui-referenceSkill
- moscow-prioritizationSkill
- orchestrate-agentic-engineeringSkill
- parallel-agent-inboxSkill
- paywall-conversion-flowSkill
- paywall-transparencySkill
- proactive-crash-repair-loopSkill
- promise-auditSkill
- pr-preview-shippingSkill
- ship-first-dollar-appSkill
- slim-ios-simulator-fleetSkill
- spec-sql-harnessSkill
- store-launch-mastermindSkill
- sync-contextSkill
- task-blitzSkill
- techdebtSkill
- vendor-decisionSkill
- web-interface-reviewSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Do not ship production apps on default flutter_lints.
- Very specific: line 24
Do not depend on all_lint_rules_community, which was last published in November 2024 (0.0.43) and misses newer rules.
- Very specific: line 26
Never add pedantic or effective_dart (deprecated).
- Very specific: line 60
After enabling: dart fix --apply then dart analyze.
- Very specific: line 62
When a rule fights you, disable it with a comment.
- Distinctive: line 72
Keep the width only there so CI and editors agree.
- Distinctive: line 76
When the same review comment appears twice on agent-written code, turn it into a lint rule instead of a line in AGENTS.md.
- Very specific: line 85
Write the check as a script that greps import and export lines.
- Very specific: line 91
Test the directory first and exit non-zero when it is absent, match lines that start with import or export, and restrict the search to …
- Distinctive: line 101
Keep the set small and name each rule after the mistake it stops.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flutter strict analysis
Do not ship production apps on default flutter_lints.
As of Dart 3.13, the linter has 244 non-deprecated, non-removed rules (233 stable, 11 experimental).
flutter_lints 6.0.0 (with lints 6.1.0) enables 102 of them (~42%).
The Flutter framework repo enables 177 (~72%), and very_good_analysis 11.0.0 enables 214 (~88%).
Recount when these packages or the SDK update.
This is policy, not "run dart analyze".
Pick one policy
- Package:
very_good_analysis(strictest maintained set) orlint(slightly less strict,strict/casual/packageflavors). - Manual (once you care): include all rules, disable a short documented list.
Copy the list from https://dart.dev/tools/linter-rules/all into
all_lint_rules.yamland refresh it on SDK upgrades. Do not depend onall_lint_rules_community, which was last published in November 2024 (0.0.43) and misses newer rules.
Never add pedantic or effective_dart (deprecated).
Manual skeleton
include: all_lint_rules.yaml # copied from dart.dev/tools/linter-rules/all
analyzer:
exclude:
["**/*.g.dart", "**/*.freezed.dart", "**/*.mocks.dart", "lib/generated/**"]
language:
strict-casts: true
strict-inference: true
strict-raw-types: true
errors:
included_file_warning: ignore
missing_required_param: error
missing_return: error
record_literal_one_positional_no_trailing_comma: error
parameter_assignments: warning
todo: ignore
formatter:
page_width: 120
trailing_commas: preserve # Dart >= 3.8
linter:
rules:
prefer_double_quotes: false
sort_constructors_first: false
# every disable gets a why-commentThe all-rules list contains conflicting pairs such as prefer_single_quotes and prefer_double_quotes.
Without included_file_warning: ignore, the analyzer reports that conflict as a warning on the include, and dart analyze fails on warnings by default.
Disable one rule of each conflicting pair in linter: rules:.
After enabling: dart fix --apply then dart analyze.
When a rule fights you, disable it with a comment. Do not // ignore: across the repo.
CI
- run: dart format --output=none --set-exit-if-changed .
- run: dart analyze --fatal-infosdart format reads formatter: page_width from analysis_options.yaml (default 80).
Keep the width only there so CI and editors agree.
Repo rules for repeated agent mistakes
- When the same review comment appears twice on agent-written code, turn it into a lint rule instead of a line in
AGENTS.md. A rule fails the agent's own check run, and a prose rule only asks (a recommendation inferred from the T3 Code and qmd rule sets, untested here). - One engineer who ships about 1,000 agent PRs a month ranks enforcement from strongest to weakest as codebase conventions, then static checks that fail CI (lint, compiler, import-boundary checks), then rules, a review bot and skills, which agents "can still forget" (single report, a 2026-10 talk).
They call a human enforcing an invariant in PR review a code smell, and ask whether the check can be a lint rule, a CI failure or a design that removes the problem.
Their concrete examples are an import check that fails when one layer's directory imports another's and a ban on code comments, because agents write comments about past instructions.
This skill does not adopt the comment ban, because every suppression here needs a reason comment.
For a layered Flutter app, a CI check that fails on a forbidden package import is the same idea, and
ffca-auditowns the layer rules (inference, not checked against that skill's text). Itsvalidate_layers.dartscript reads only pubspec dependencies between workspace packages (read 2026-10-29). - In a single-package app with
lib/features/<feature>/presentationanddatafolders, a pubspec-based layer check has nothing to read. Write the check as a script that grepsimportandexportlines. One developer's version grepslib/features/*/presentationforimport .*/data/, prints the hits, prints "presentation/ must not import data/" and exits 1 (single report, from a post image). That nine-line version has three flaws, each reproduced on 2026-10-29 with the systemgrep. With|| trueafter the grep and no directory test, a missing or renamed folder gives exit 0, so the check passes while checking nothing. It does not matchexportlines. It does not match animportwhose path is on the next line. Test the directory first and exit non-zero when it is absent, match lines that start withimportorexport, and restrict the search to--include='*.dart'. - The same developer's published checker (MIT,
Ethiel97/flutter-clean-riverpod-skills,skills/flutter-feature-scaffold/scripts/check_boundaries.sh) does these three things and checks five rules. Its smoke test injects one violation per rule and asserts each is reported. It also asserts that a legitimate cross-feature domain import is not flagged. Copy the idea, and treat any use of the repo's files as remote code that goes through the code-gate rule. - Dart supports project rules through analyzer plugins since Dart 3.10, with the
analysis_server_pluginpackage. A plugin registers its rules inlib/main.dart, and a lint rule a plugin defines stays off untilanalysis_options.yamllists it underplugins: <name>: diagnostics:. The page does not cover the oldercustom_lintpackage, so check which one a repo already uses before adding the other. Adding either package is a new dependency and goes through the code-gate rule. - Require a reason on every suppression, as T3 Code's
require-suppression-reasonrule does, so the "disable it with a comment" policy above is checked by a tool. - Keep the set small and name each rule after the mistake it stops.
- Make the failure output state the rule and the fix, for example "presentation/ must not import data/, go through the repository interface in domain/". The agent reads CI output in the same loop as its test results, so the message is the one instruction it is sure to see. The author of one post calls this their most effective prompt, which is one author's opinion with no measurement.
Sources
- https://rydmike.com/blog_flutter_linting
- https://dart.dev/tools/linter-rules/all
- https://dart.dev/tools/analysis
- https://dart.dev/tools/dart-format
- https://dart.dev/tools/dart-analyze
- https://pub.dev/packages/lint
- https://pub.dev/packages/very_good_analysis
- https://dart.dev/tools/linter-rules
- https://dart.dev/tools/diagnostics/included_file_warning
- https://github.com/dart-lang/sdk/issues/55975
- https://pub.dev/packages/flutter_lints
- https://pub.dev/packages/lints
- https://pub.dev/packages/all_lint_rules_community
- https://github.com/flutter/flutter/blob/master/analysis_options_common.yaml
- https://github.com/VeryGoodOpenSource/very_good_analysis
- https://github.com/VeryGoodOpenSource/very_good_templates/blob/main/very_good_core/__brick__/analysis_options.yaml
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

