thalarch-kotlin-jpalisted
Install: claude install-skill LUC4N3X/antigravity-thalarch
# Thalarch Kotlin JPA
Kotlin and ORM semantics interact in ways that generic Java/JPA advice can miss. Treat entity
identity, proxying, nullability, generated IDs, lazy associations, equality and serialization as
one contract.
If the current host exposes the official Kotlin/JetBrains
`kotlin-backend-jpa-entity-mapping` skill and the task matches it, prefer loading that skill for
platform-specific guidance. This Thalarch skill remains the scope/evidence/verification envelope.
## 1. Prove the persistence stack
Before editing, confirm from build files and imports:
- Kotlin version and compiler plugins;
- JPA package (`javax.persistence` vs `jakarta.persistence`);
- ORM/framework and version (Hibernate/Spring Data/etc.);
- no-arg/all-open/JPA plugins or equivalent proxy support;
- database/migration stack;
- serialization/API mapping conventions;
- project entity equality/ID conventions.
Do not impose a new entity style if the repository already has a deliberate, working convention.
## 2. Entity identity is the primary invariant
For every entity define explicitly:
- what identifies a persisted instance;
- what identifies an unsaved instance;
- whether equality is ID-based, business-key-based, or intentionally reference-based;
- whether hash code stays safe when persistence state changes;
- how proxies/subclasses interact with equality;
- whether lazy state can be touched by `equals`, `hashCode`, `toString`, logging or serialization.
Do not use Kotlin `data class` for a