dart-seal-type-hierarchies
Installation
SKILL.md
Seal Type Hierarchies
1. When to use this skill
Use this skill when:
- A package declares an abstract base type whose subtypes are all defined in the
same library, but the base type is not marked
sealed. - Code branches over the members of such a hierarchy with
ischecks or a non-exhaustiveswitch, so adding a subtype later fails silently at runtime instead of loudly at compile time. - Reviewing a new type hierarchy and deciding whether it should be open to external subtyping.
When NOT to use (Abstention Guardrails)
Do NOT seal a type when: