chrisbanes/skills

kotlin-api-design

Use when designing or reviewing Kotlin function ownership, member or extension functions, factories, single-field domain types, value classes, data classes, Kotlin Multiplatform expect/actual declarations, or platform service boundaries.

Trending #9679 First seen Aug 6, 2026

Installation

$ npx skills add chrisbanes/skills --skill kotlin-api-design

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from chrisbanes/skills · top by installs.

npx skills add chrisbanes/skills

Browse all from chrisbanes/skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 1.0K
License LICENSE
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,117 B
  • docs SUMMARY.md 2,063 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 394 installs

SKILL.md

Kotlin API design

Core principle

Place behavior, types, and platform seams where their meaning is clearest to callers; use the smallest public abstraction that preserves domain language and platform independence.

Procedure

  1. Name the domain concept, its owning type or module, and the callers that

need to depend on it.

  1. Choose function ownership before adding an extension, factory, helper, or

service layer.

  1. When reviewing a public mapping over a sealed result, name every

caller-visible outcome. Flag a catch-all else that hides a subtype and recommend explicit subtype branches so the contract stays exhaustive and preserves smart casts.

  1. Represent a single-field domain concept with the smallest type that preserves

its semantic and interop contract.

  1. Keep shared code semantic; put native SDK and platform details behind an

interface or a narrowly justified expect/actual boundary.

  1. Read the focused reference for the selected decision below.
  2. Finish when the public surface states domain intent, platform details remain

at leaves, and callers do not depend on convenience abstractions with no clear owner.

Topic router

Signal Read
Member vs top-level, extension, factory, service, or receiver choice [Function ownership](references/functions.md)
Primitive obsession, one-field domain type, @JvmInline value class, data class, interop, or Compose stability [Value classes](references/value-classes.md)
Source sets, platform services, native SDKs, files, sensors, permissions, Compose Multiplatform interop, or expect/actual [Multiplatform boundaries](references/multiplatform-boundaries.md)
Branching, guard-condition shape, sealed-result mapping, or a catch-all else [Kotlin control flow](../kotlin-control-flow/SKILL.md)