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.
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 testsAbout 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
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.
| Field | 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. 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 risk | Review first | Review first | Review first | Review first |
| Notes | Safety · Privacy ✓ | Safety · Privacy ✓ | Safety · Privacy ✓ | Safety · Privacy · |
| Category | rules | rules | rules | rules |
| Source | source-backed | source-backed | source-backed | source-backed |
| Author | jaso0n0818 | jaso0n0818 | jaso0n0818 | JSONbored |
| Added | 2026-06-16 | 2026-06-13 | 2026-06-14 | 2025-09-16 |
| Platforms | Claude Code | Claude Code | Claude Code | Claude Code |
| Source repo | — | — | — | — |
| Safety notes | — missing | — missing | — missing | — missing |
| 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. | ✓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 | ||||
| Claim | Unclaimed | Unclaimed | Unclaimed | Unclaimed |
Signals
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.