kotlin-oo-fundamental

Guide Kotlin object-oriented API design with Java 8 interoperability.

Updated Feb 20, 2026
One-click install
npx skills add https://github.com/KrystianYCSilva/math-theory-lib --skill kotlin-oo-fundamental
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-oo-fundamental
Source: https://github.com/KrystianYCSilva/math-theory-lib/tree/main/.codex/skills/kotlin-oo-fundamental
Command: npx skills add https://github.com/KrystianYCSilva/math-theory-lib --skill kotlin-oo-fundamental

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides pragmatic guidance to design maintainable, testable, and Java 8-interoperable object-oriented APIs in Kotlin, reducing brittle inheritance and visibility issues while preserving performance and clear contracts.

Core Features & Use Cases

  • Practical OO Patterns: Emphasizes composition over inheritance, interface delegation, and clear use of data and sealed classes.
  • Interoperability Guidance: Recommends @Jvm* annotations, overloads, and factory patterns to make Kotlin APIs ergonomic from Java 8.
  • API Hygiene & Evolution: Covers visibility, module boundaries, immutability, and versioning strategies for stable public contracts.
  • Use Case: Designing a domain model for a backend library where invariants, tests, and Java consumers must coexist cleanly.

Quick Start

Use this skill to review a Kotlin API and recommend changes to improve composition, visibility, and Java 8 interoperability.

Frequently Asked Questions about kotlin-oo-fundamental

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a Kotlin object-oriented API for Java 8 interoperability?

Design Kotlin object-oriented APIs for Java 8 interoperability by applying @Jvm* annotations, factory patterns, and overloads. This ensures clear contracts and ergonomic consumption from Java 8, reducing brittle inheritance and visibility issues.

What is the best way to model closed hierarchies and value types in Kotlin?

Model closed hierarchies and value types in Kotlin using sealed and data classes. This approach enforces composition over inheritance, encapsulates mutable state cleanly, and establishes stable public contracts for domain-rich systems.

How do I manage visibility and module boundaries in a Kotlin library?

Manage visibility and module boundaries in a Kotlin library by enforcing strict visibility controls and versioning strategies. This preserves immutability and API hygiene, resulting in maintainable, testable, and evolvable public contracts.

Can I use composition over inheritance for Kotlin backend library design?

Yes, you can use composition over inheritance for Kotlin backend library design through interface delegation. This testing-friendly dependency injection pattern encapsulates mutable state and avoids brittle inheritance hierarchies.

Why does my Kotlin API throw visibility or inheritance errors when consumed by Java?

Kotlin APIs throw visibility or inheritance errors in Java due to default Kotlin behaviors lacking @Jvm* annotations. Apply overloads and factory patterns to ensure Java 8 ergonomics and clear module boundaries.