/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.
$ npx -y skills add chrisbanes/skills --skill kotlin-api-design --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/kotlin-api-design
Context preview
The summary Claude sees to decide when to auto-load this skill.
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.
SKILL.md
kotlin-api-design.SKILL.mdname: kotlin-api-design
description: 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.
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. 2. Choose function ownership before adding an extension, factory, helper, or service layer. 3. Represent a single-field domain concept with the smallest type that preserves its semantic and interop contract. 4. Keep shared code semantic; put native SDK and platform details behind an interface or a narrowly justified expect/actual boundary. 5. Read the focused reference for every material API decision below. 6. 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 and guard-condition shape | [Kotlin control flow](../kotlin-control-flow/SKILL.md) |
RED/GREEN agent scenarios
1. RED adds an extension on `String` to hide repository behavior. GREEN gives the behavior a domain owner or service with a meaningful dependency boundary. 2. Novel case: shared UI needs a platform permission service. GREEN preserves a semantic shared contract and places platform SDK calls at the native leaf. 3. Counterexample: an internal helper has one obvious owning class. GREEN keeps it a member instead of extracting a factory or value type for ceremony.
Read more
name: kotlin-api-design description: 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.
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. 2. Choose function ownership before adding an extension, factory, helper, or service layer. 3. Represent a single-field domain concept with the smallest type that preserves its semantic and interop contract. 4. Keep shared code semantic; put native SDK and platform details behind an interface or a narrowly justified expect/actual boundary. 5. Read the focused reference for every material API decision below. 6. 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 and guard-condition shape | [Kotlin control flow](../kotlin-control-flow/SKILL.md) |
RED/GREEN agent scenarios
1. RED adds an extension on `String` to hide repository behavior. GREEN gives the behavior a domain owner or service with a meaningful dependency boundary. 2. Novel case: shared UI needs a platform permission service. GREEN preserves a semantic shared contract and places platform SDK calls at the native leaf. 3. Counterexample: an internal helper has one obvious owning class. GREEN keeps it a member instead of extracting a factory or value type for ceremony.
A set of skills for Kotlin, Jetpack Compose, and Android development.
Repo: chrisbanes/skills
Other skills on chrisbanes-skills.
- /compose-animations
Use when writing or reviewing Jetpack Compose motion: visibility enter/exit, animating one property toward a target, color or size transitions, multiple properties from one state, switching composable content, or choosing between AnimatedVisibility, animate*AsState,
Open skill - /compose-component-design
Use when designing or reviewing reusable Jetpack Compose component APIs with modifier parameters, root layout placement, caller-provided variable content, primitive content parameters, optional content, or boolean shape flags.
Open skill - /compose-focus-navigation
Use when writing or reviewing Jetpack Compose UI for TV, keyboard, desktop, accessibility focus, D-pad navigation, FocusRequester, focusProperties, key events, or initial focus behavior.
Open skill - /compose-performance
Use when investigating Jetpack Compose recomposition cost, compiler stability reports, skippability, unstable parameters, frame-rate State reads, cross-phase snapshot back-writing, or @ReadOnlyComposable contracts.
Open skill - /compose-state-and-effects
Use when writing or reviewing Jetpack Compose state ownership, remember state, state hoisting, screen state holders, LaunchedEffect, DisposableEffect, SideEffect, Flow collection, navigation, snackbar, analytics, or focus requests.
Open skill - /compose-ui-testing-patterns
Use when writing or reviewing Jetpack Compose UI tests, screenshot tests, previews, semantics assertions, fake image loading, keyboard input, focus assertions, interaction state (hover/pressed/focused), or tests for plain state-driven UI composables.
Open skill

