What this thread does
Do first: Run dart analyze --fatal-infos after enabling the diagnostics you intend to enforce; check the SDK lower bound before requesting newer syntax.
Short answer
The mechanisms cover different jobs: dart-sdk-skills supplies version lookup guidance; Dart’s analyzer reports enabled diagnostics; a Claude Code Stop hook can enforce a command before the turn ends. A Dart fix is available only for diagnostics with an associated automated fix.
What to do
| Mechanism | Concrete setup or action |
|---|---|
| Version guidance | The repository’s dart-sdk-changelog skill includes version-matrix.md for feature minimums |
| Language compatibility | Read the lower SDK constraint in pubspec.yaml; the Dart evolution guide requires a lower bound no earlier than the feature’s release |
| Lints and fixes | Enable chosen lints in analysis_options.yaml; preview with dart fix --dry-run, then apply with dart fix --apply |
| Analysis gate | dart analyze normally fails on errors and warnings, not infos; --fatal-infos includes infos and --no-fatal-warnings makes warnings nonfatal |
| Claude Code turn-end enforcement | Configure a command-type Stop hook in .claude/settings.json; a failed check must return exit code 2 to block, with diagnostic output on stderr |
Two documented feature minimums relevant to stale syntax:
| Feature | Dart release | Release date |
|---|---|---|
| Dot shorthands | 3.10 | 12 November 2025 |
| Primary constructors | 3.13 | 12 August 2026 |
Use the skill’s feature lookup to guide generation and the enabled analyzer diagnostics to check the resulting code. Use the hook when that analyzer check must run at turn end.
Limits and open questions
Not every diagnostic has a fix, and enabling lints determines which optional analysis issues appear. Claude Code overrides the next block after eight consecutive blocked stops without a tool call; CLAUDE_CODE_STOP_HOOK_BLOCK_CAP raises that cap. The cited sources do not establish that a skill, lint set or hook alone detects every outdated coding pattern.
Not for: Android Gradle minSdk configuration.
Sources
- dart-sdk-skills repository
- Dart language evolution
- Dart fix documentation
- Dart analyze documentation
- Claude Code Stop-hook guidance
Checked
2026-11-17: read dart-sdk-skills repository, Dart language evolution, Dart fix documentation, Dart analyze documentation, Claude Code Stop-hook guidance; no command was run.
Started from a post by @RandalSchwartz, packaged by the editor. Original post