dart3-idioms-and-coding-standardslisted
Install: claude install-skill zakariaf/CatchLaw
# Dart 3 idioms and coding standards
Modern Dart 3.x, value-type-first, total functions for domain logic. A language feature earns its place when it converts a runtime silence into a **compile error**; everything else is decoration. This skill governs how each declaration is *typed, named, kept immutable, and kept total* — the error-handling architecture that rides on top of these mechanics lives in `error-handling-typed-results`.
Read the reference for the task at hand:
- `references/construct-verdict-table.md` — the feature-by-feature verdict table (sealed / enum / record / class modifiers / `extension type` / codegen packages), with the rationale for each Use / Skip.
- `references/immutability-and-equality.md` — immutable value types, `copyWith`, when to hand-write `==`/`hashCode`, and stable-identity vs value-equality.
- `references/complexity-and-honesty.md` — the length/nesting limits with their evidence, and the `late`/`!`/`dynamic` honesty-dodge bans in full.
Run `scripts/check-dart3-idioms.sh` before a PR.
## Non-negotiable rules
1. **A `switch` on a sealed type or enum carries no `default:` and no `case _:`.** A wildcard makes the switch compile forever, discarding the one compile-time guarantee the type exists for — adding a variant then falls through silently at runtime. Exhaustiveness is the whole product.
2. **Reach for exactly three class modifiers; ignore the rest.** `sealed class` for a closed variant set the compiler must exhaust; `final class` for eve