Skip to main content
rulesSource-backedReview first Safety · Privacy

Kotlin Expert - CLAUDE.md Rules for Claude Code

Transform Claude into a Kotlin specialist with deep knowledge of coroutines, null safety, data classes, sealed types, and JVM/Android API design patterns.

by jaso0n0818·added 2026-06-16·
HarnessClaude Code
Review first review before installing

Open the source and read safety notes before installing.

Privacy notes

  • Rules reference API keys, database credentials, and signing secrets; store them in environment variables, Android Keystore, or a secrets manager, never in committed source files.

Schema details

Install type
copy
Reading time
4 min
Difficulty score
85
Troubleshooting
Yes
Breaking changes
No
Full copyable content
You are an expert Kotlin developer with deep knowledge of coroutines, null
safety, expressive type modeling, and idiomatic JVM and Android API design.

## Core Philosophy

- Prefer expressive types (data classes, sealed hierarchies, value classes)
  over stringly-typed APIs
- Use nullable types and safe calls deliberately; avoid `!!` except in tests
  or provably invariant contexts
- Keep domain logic pure and side-effect free; isolate I/O at boundaries
- Favor `suspend` functions and structured concurrency over raw threads

## Null Safety & Modeling

```kotlin
data class OrderId(val value: String)

sealed interface OrderStatus {
    data object Pending : OrderStatus
    data class Paid(val at: Instant) : OrderStatus
    data class Shipped(val tracking: String) : OrderStatus
}
```

- Model invalid states as unrepresentable with sealed types when possible
- Use `require`/`check` for programmer errors; use `Result` or typed errors
  for expected failures at API boundaries
- Prefer `map`/`flatMap` on `Result` over nested try/catch chains

## Coroutines & Concurrency

- Scope work with `coroutineScope` or `supervisorScope`; never leak GlobalScope
  in application code
- Use `Dispatchers.IO` for blocking I/O and `Dispatchers.Default` for CPU work
- Collect `Flow` with lifecycle-aware scopes on Android; handle backpressure
  with `buffer`, `conflate`, or explicit channel sizing
- Cancel child jobs when parent scope ends; use `withTimeout` for bounded waits

## API & Module Design

- Expose small, intention-revealing interfaces; keep implementation details internal
- Use extension functions for syntax sugar, not to hide large behavior
- Prefer constructor injection and explicit dependencies over service locators
- Write `internal` by default; widen visibility only when required

## Testing

- Use `runTest` for coroutine tests; advance virtual time for delays
- Fake repositories at boundaries; assert state and emitted `Flow` values
- Keep Android framework calls behind interfaces for JVM unit tests

About this resource

Usage

Add this rule set to your project's CLAUDE.md to configure Claude as a Kotlin expert. It covers null safety, coroutines, Flow, data classes, sealed hierarchies, and idiomatic API design — grounded in the official Kotlin documentation.

Sources

Source citations

Add this badge to your README

Show that Kotlin Expert - CLAUDE.md Rules for Claude Code is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/rules/kotlin-expert.svg)](https://heyclau.de/entry/rules/kotlin-expert)

How it compares

Kotlin Expert - CLAUDE.md Rules for Claude Code side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.

FieldKotlin Expert - CLAUDE.md Rules for Claude Code

Transform Claude into a Kotlin specialist with deep knowledge of coroutines, null safety, data classes, sealed types, and JVM/Android API design patterns.

Open dossier
.NET and C# Expert - CLAUDE.md Rules for Claude Code

A CLAUDE.md rule set that turns Claude into a senior .NET reviewer aligned with current Microsoft guidance across ASP.NET Core, Entity Framework Core, asynchronous programming, typed options, and automated testing.

Open dossier
Django Expert - CLAUDE.md Rules for Claude Code

Transform Claude into a Django specialist with deep knowledge of models, views, DRF serializers, migrations, middleware, and production deployment patterns.

Open dossier
Go Golang Expert - CLAUDE.md Rules for Claude Code

Transform Claude into a Go language expert with deep knowledge of concurrency, performance optimization, and idiomatic Go

Open dossier
Trust
Install riskReview firstReview firstReview firstReview first
Notes Safety · Privacy Safety · Privacy Safety · Privacy Safety · Privacy ·
Categoryrulesrulesrulesrules
Sourcesource-backedsource-backedsource-backedsource-backed
Authorjaso0n0818jaso0n0818jaso0n0818JSONbored
Added2026-06-162026-06-132026-06-142025-09-16
Platforms
Claude Code
Claude Code
Claude Code
Claude Code
Source repo
Safety notes— missing— missing— missing— missing
Privacy notesRules reference API keys, database credentials, and signing secrets; store them in environment variables, Android Keystore, or a secrets manager, never in committed source files.Rules reference dotnet user-secrets and Azure Key Vault for credential storage; secrets must never be committed to source control or hard-coded in application settings files.Rules reference SECRET_KEY, database credentials, and API tokens; store them in environment variables, never in settings.py committed to git.— missing
Prerequisites— none listed— none listed— none listed— none listed
Install
Config
Citations
ClaimUnclaimedUnclaimedUnclaimedUnclaimed

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.