understanding-stability-inference
Installation
SKILL.md
Understanding Stability Inference — read the compiler's mind
Stability is decided by a 12-phase algorithm baked into the Compose compiler. This skill teaches Claude how the algorithm walks a type so it can explain why a report says what it says, and predict classifications before the report is even generated. Pair this with ../diagnosing-compose-stability/SKILL.md (which generates the report) and ../stabilizing-compose-types/SKILL.md (which fixes obvious unstable types). Reach for this skill when the simpler skills produce a verdict that surprises the developer.
When to use this skill
- The developer asks "why is
Fooclassified asruntime stableand notstable?" - A report shows
runtimeorunknownfor a class that "looks fine". - Generics involved:
Box<T>,Wrapper<A, B>,Pair<String, Int>,ImmutableList<User>. - The class lives in another module and ships as a
.class/.kotlin_metadataartifact. - The developer asks about the
$stable: Intfield,@StabilityInferred, or cross-module classification. - A self-referential type (
class Node(val children: List<Node>)) is unstable for non-obvious reasons. - A Java type, an interface, or an abstract base appears in a parameter list and surprises the developer.
When NOT to use this skill
- The fix is mechanical (
var→val,List→ImmutableList,Flowparameter removal). Use../stabilizing-compose-types/SKILL.md. - No report exists yet. Run
../diagnosing-compose-stability/SKILL.mdfirst. - The developer wants CI enforcement of stability. Use
../enforcing-stability-in-ci/SKILL.md.