What problem does it solve?
Deciding where state and behavior belong in a concurrent Kotlin codebase is error-prone: misplaced fields cause torn reads, latching monitor defects, and dangling references. This Skill provides a decision framework for assigning every object a role and placing state correctly before writing or reviewing code.
Core Features & Use Cases
- Role Classification: Categorizes every object as an Active Object, Passive Object, or Monitor Object using mechanical tests based on
select, coroutineScope, and stored CoroutineScope usage.
- Value Boundary Design: Applies Clojure's identity/state model and aggregate design to decide when two fields are one value, requiring a single atomic swap behind a sealed hierarchy.
- Defect Recognition: Identifies monitor defects such as latching conditions (e.g., the
Watchers failure mode) and transient state that must not be published mid-flight.
- Use Case: When reviewing a diff that adds a
Map<Id, State> beside the objects it identifies, use this Skill to determine whether the state belongs in a new object, an existing value, or a transient accumulator.
Quick Start
Ask the AI to apply the xtdb-object-boundaries skill to decide which object should own a new field you are adding to a Kotlin class.