From ai-toolkit
Enforces Kotlin best practices including null safety, Either error handling, coroutines, Exposed ORM patterns, transactions, and DTO conversions. Use when writing, reviewing, or learning Kotlin code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ai-toolkit:kotlin-best-practicesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
`!!` is banned. Use `?.`, `?:`, or null check for smart cast.
!! is banned. Use ?., ?:, or null check for smart cast.
See code-patterns.md for all null safety examples.
Managers return Either<ClientException, T> -- never throw. Controllers unwrap with .throwOrValue().
See code-patterns.md for manager + controller examples.
Never hardcode strings when an enum exists. Use EnumName.VALUE.value everywhere.
See code-patterns.md for enum definition and usage patterns.
Extend UUIDTable, use text() not varchar(). Always filter deletedAt.isNull(). Soft delete via timestamp update, never hard delete.
See code-patterns.md for table, query, and soft delete examples.
Reads use db.replica, writes use db.primary. Multi-table writes go in one transaction block -- all succeed or all rollback.
See code-patterns.md for transaction examples.
Put companion object { fun from(entity) } inside Response DTOs. Never create separate mapper files.
See code-patterns.md for the full pattern.
!! -- always use ?., ?:, or null check@Suppress -- fix the root causeEither.left() insteadVARCHAR in SQL -- use TEXTTable base class -- use UUIDTablenpx claudepluginhub c0x12c/ai-toolkit --plugin ai-toolkitProvides idiomatic Kotlin patterns and best practices for null safety, coroutines, sealed classes, extension functions, and type-safe DSL builders.
Covers idiomatic Kotlin patterns including null safety, immutability, sealed classes, structured concurrency with coroutines, extension functions, and type-safe DSL builders to write robust and maintainable code.
Provides idiomatic Kotlin patterns for coroutines, Flow, KMP, Compose UI, Ktor servers, and DSL design. Invoke for sealed classes, suspend functions, or Android Kotlin development.