effective-kotlin

effective-kotlin is a skill for Claude Code, Codex from booklib-ai/booklib. It costs 212 tokens per session (3,775 once invoked), scanned A, original, MIT.

A Kotlin coding and review guide based on 52 best-practice recommendations from Effective Kotlin, a book about writing safer, clearer, reusable Kotlin code.

In plain words
What is it for?
Use it when generating, refactoring, or reviewing Kotlin code for safety, readability, reuse, and appropriate abstraction.
Why use it?
It gives developers a consistent way to improve Kotlin code, covering issues such as mutability, null values, naming, abstraction, tests, and error handling.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/booklib-ai/booklib/effective-kotlin
Any agent
npx skills add booklib-ai/booklib --skill effective-kotlin
Clone the repo
git clone --depth 1 https://github.com/booklib-ai/booklib

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for effective-kotlin

README.md
[![agentmods](https://agentmods.dev/badge/skills/booklib-ai/booklib/effective-kotlin.svg)](https://agentmods.dev/skills/booklib-ai/booklib/effective-kotlin)
Your own site
<a href="https://agentmods.dev/skills/booklib-ai/booklib/effective-kotlin"><img src="https://agentmods.dev/badge/skills/booklib-ai/booklib/effective-kotlin.svg" alt="Measured on agentmods" height="20"></a>
Per session 212 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,775 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00212 $0.03775
Opus 5 $0.00106 $0.01887
Sonnet 5 $0.00042 $0.00755
Haiku 4.5 $0.00021 $0.00378

Measured 6d ago against content hash f64c0fc207fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

effective-kotlin scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/example.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/effective-kotlin/SKILL.md · 272 lines

How it starts

The opening of the file, as written. The whole thing — 272 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Effective Kotlin Skill

You are an expert Kotlin developer grounded in the 52 best-practice items from Effective Kotlin (2nd Edition) by Marcin Moskała. You help developers in two modes:

  1. Code Generation — Write idiomatic, safe, readable, and efficient Kotlin code
  2. Code Review — Analyze existing Kotlin code against the 52 items and recommend improvements

How to Decide Which Mode

  • If the user asks you to build, create, generate, implement, write, or refactor Kotlin code → Code Generation
  • If the user asks you to review, check, improve, audit, critique, or analyze Kotlin code → Code Review
  • If ambiguous, ask briefly which mode they'd prefer

Mode 1: Code Generation

When generating Kotlin code, follow this decision flow:

Step 1 — Understand the Requirements

Ask (or infer from context):

  • What domain? — Data model, API, UI, concurrency, DSL?
  • What constraints? — Kotlin/JVM, Kotlin Multiplatform, Android, server-side?
  • What quality attributes? — Safety, readability, performance, extensibility?

Step 2 — Apply the Right Practices

Read references/practices-catalog.md for the full 52-item catalog. Quick decision guide by concern:

Concern Items to Apply
Preventing null / type errors Items 3-8: Eliminate platform types, don't expose inferred types, prefer null/Failure, handle nulls properly
Limiting mutability and scope Items 1-2: Limit mutability (val, immutable collections, data class copy), minimize variable scope
Error handling and validation Items 5-7: Use require/check/assert, prefer standard errors, prefer null or Failure result type
Resource management Item 9: Close resources with use()
Readable and maintainable code Items 11-18: Design for readability, meaningful operators, explicit types when unclear, named arguments, coding conventions
Avoiding duplication Items 19-22: DRY, use stdlib algorithms, property delegation, generics for common algorithms
API and abstraction design Items 26-32: Single abstraction level, protect against changes, API stability, wrap external APIs, minimize visibility, document contracts
Object creation Items 33-35: Factory functions, primary constructor with named optional args, DSL for complex creation
Class and type design Items 36-44: Composition over inheritance, data modifier, function types, sealed hierarchies, equals/hashCode/compareTo contracts, extensions
Performance Items 45-52: Avoid unnecessary object creation, inline functions, inline value classes, eliminate obsolete references, Sequence, limit operations, primitive arrays, mutable collections
Testing Item 10: Write unit tests

Read the full file on GitHub · 272 lines

Files

What ships with it

10 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 272 lines · 212 tokens per session scan A f64c0fc207fb

Subscribe to this mod's changes

effective-kotlin is a skill published in the GitHub repository booklib-ai/booklib (38 stars, last pushed 4mo ago), licensed MIT. It adds 212 tokens to every session and 3,775 once invoked, about $0.0011 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

kotlin-docs

Comprehensive Kotlin 2.4.0 reference covering all language features: variables, basic types, strings, control flow, functions, lambdas, classes, objects, inheritance, interfaces, data classes, sealed classes, generics, collections, sequences, null safety, coroutines (suspend, launch, async, Flow, StateFlow, channels)…

pledgeandgrow/pledge-skills · 183 tokens

compose-multiplatform

Use when building one shared Compose UI in Kotlin across Android, iOS, and desktop — commonMain @Composables, expect/actual, source-set placement, native interop, multiplatform ViewModel/navigation/Koin. NOT a single-platform native build (that is kotlin-android / swift-ios), and NOT Dart/Flutter cross-platform UI…

ericrisco/rsc-harness · 80 tokens

kotlin-android

Use when building or fixing a native Android app in Kotlin and Jetpack Compose on the UDF layered architecture — ViewModel/StateFlow, Hilt, Room, Retrofit, coroutines, type-safe Navigation, and the Gradle/AGP surface. NOT shared Android and iOS UI from one Kotlin codebase (that is compose-multiplatform).

ericrisco/rsc-harness · 78 tokens

kotlin-expert

Expert-level Kotlin development, Android, coroutines, and multiplatform. Use when the user mentions Android, coroutines, multiplatform, or JVM, or when the task involves Kotlin Fundamentals, Android Development, Kotlin Multiplatform, or Kotlin Style.

personamanagmentlayer/pcl · 55 tokens

new-list-screen

Generate a new UI/VM module pairing with a scrolling list screen — blurred top bar, pull-to-refresh, shimmer loading, and Loading/Empty/Failure/Success states. Uses ListSchedulesScreen as the reference template.

jonapoul/aktual · 48 tokens

apply-upstream-migration

Apply a new upstream Actual migration to Aktual — update MigrateDatabase.kt, SQLDelight .sq files, Adapters, model types, and the migration test. Triggered when last-known-migration.txt is updated.

jonapoul/aktual · 50 tokens