kotlin-conventions

kotlin-conventions is a skill for Claude Code, Codex from tmj-90/gaffer. It costs 115 tokens per session (2,011 once invoked), scanned A, original, Apache-2.0.

A set of conventions for writing Kotlin code in Android apps, web services, and shared modules. Kotlin is a programming language with built-in support for handling missing values and asynchronous work.

In plain words
What is it for?
It helps choose Kotlin types and data structures, use coroutines and Flow, model fixed states, and keep detekt and ktlint checks clean.
Why use it?
It helps code match the project's style and avoids unsafe missing-value shortcuts, accidental shared changes, and poorly managed background tasks.

Skill for Claude CodeCodex

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

Good fit It helps choose Kotlin types and data structures, use coroutines and Flow, model fixed states, and keep detekt and ktlint checks clean.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tmj-90/gaffer/kotlin-conventions
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.

Any agent
npx skills add tmj-90/gaffer --skill kotlin-conventions
Clone the repo
git clone --depth 1 https://github.com/tmj-90/gaffer

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 kotlin-conventions

README.md
[![agentmods](https://agentmods.dev/badge/skills/tmj-90/gaffer/kotlin-conventions/github.svg)](https://agentmods.dev/skills/tmj-90/gaffer/kotlin-conventions)
Your own site
<a href="https://agentmods.dev/skills/tmj-90/gaffer/kotlin-conventions"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/kotlin-conventions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kotlin-conventions

Your own site · 80×15
<a href="https://agentmods.dev/skills/tmj-90/gaffer/kotlin-conventions"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/kotlin-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 115 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,011 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00115 $0.02011
Opus 5.5 $0.00046 $0.00804
Sonnet 5.5 $0.00023 $0.00402
Haiku 4.5 $0.00012 $0.00201

Measured 16d ago against content hash c97e9229bd3f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

kotlin-conventions 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 16d ago.

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.

runner/skills/kotlin-conventions/SKILL.md · 121 lines

How it starts

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

Write idiomatic Kotlin

Kotlin's value is safety made concise: nullability in the type, immutability by default, structured concurrency that cannot leak. For the builder and the reviewer of a Kotlin diff; the module's config and existing code win over it.

Procedure

  1. Discover the module's conventions first. Call search_lore for Kotlin conventions. Read build.gradle.kts, gradle/libs.versions.toml (Kotlin, coroutines, AGP versions), jvmToolchain, whether explicitApi() is on, .editorconfig (ktlint reads ktlint_code_style and rule toggles there), detekt.yml and its baseline, and Android lint.xml. Identify Android vs server vs multiplatform, the DI framework (Hilt/Koin/Spring), how dispatchers are injected, and the state pattern (MVVM/MVI with StateFlow, or a service layer). Copy a sibling class and its test.
  2. Pin the exact commands from CI (the run-tests and run-lint skills). Use the defaults below only when the repo defines none; never add to a detekt baseline to pass.
  3. Write the change with the idioms below, then walk the concurrency section for every coroutine, flow, shared value and resource you touched.
  4. Test each acceptance criterion's own behaviour. One test per AC that fails without your change, plus its error path, using runTest with the test dispatcher and Turbine for flows. If the AC involves shared state or persistence, add a test that launches N concurrent coroutines on a multi-threaded dispatcher (Dispatchers.Default) and asserts the invariant.
  5. Verify, then stop. Done when: ktlint and detekt are clean at the repo's config, the compiler reports no new warnings where allWarningsAsErrors is set, tests are green, and every AC has a test. Record the output with the record-evidence skill; the runner submits the work.

Commands

  • All checks: ./gradlew check (runs tests plus wired-in linters).
  • Style: ./gradlew ktlintCheck (ktlint Gradle plugin) or ktlint "src/**/*.kt"; ./gradlew detekt.
  • Tests: ./gradlew test; one class: ./gradlew test --tests 'pkg.ClassTest'.
  • Android: ./gradlew lint testDebugUnitTest (or the repo's variant).
  • Dependencies: a new or bumped entry in libs.versions.toml or the build file is a blocker (the dependency-upgrade skill).

Read the full file on GitHub · 121 lines

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. 16d ago Changed · +47 lines · +10 tokens per session c97e9229bd3f
  2. 19d ago First seen · 74 lines · 105 tokens per session scan A c4488aab8abe

Subscribe to this mod's changes

kotlin-conventions is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 17d ago), licensed Apache-2.0. It adds 115 tokens to every session and 2,011 once invoked, about $0.0005 per session on Opus 5.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-09-28.

Related

Other skills, from other repositories

sota-jvm

State-of-the-art JVM engineering rules for Java and Kotlin that Claude applies when writing or auditing JVM code. Java LTS releases (virtual threads final since 21; structured concurrency still preview), modern Kotlin. Covers modern idioms (records, sealed types, pattern matching, Kotlin null-safety/coroutines)…

martinholovsky/SOTA-skills · 254 tokens

sota-swift

State-of-the-art Swift engineering rules (Swift 6 language mode) that Claude applies when writing or auditing Swift on ANY target — server-side services (Vapor, Hummingbird, SwiftNIO), CLIs, libraries, packages and apps. Covers optionals and error handling, value types and API design, Swift 6 data-race safety…

martinholovsky/SOTA-skills · 240 tokens

maven-gradle-guide

Maven and Gradle build tool patterns including pom.xml structure, build.gradle.kts configuration, multi-module projects, dependency management, plugins, and BOMs. Use when the user is setting up Java/Kotlin build configurations, managing dependencies, creating multi-module projects, or troubleshooting build issues.…

VersoXBT/claude-initial-setup · 88 tokens

kotlin-testing

Kotlin testing patterns with Kotest, MockK, coroutine testing, property-based testing, and Kover coverage. Follows TDD methodology with idiomatic Kotlin practices.

affaan-m/ECC · 38 tokens

android-development

Android development guidelines for Kotlin with clean architecture, MVI pattern, Material Design, and best practices for building robust mobile applications.

Mindrally/skills · 27 tokens

kotlin-patterns

Kotlin: coroutines, Flow, sealed/data classes, null safety, Ktor, Compose, KMP. Triggers: Kotlin, coroutine, Flow, suspend, Ktor, Jetpack Compose, KMP, kotlinx.

softspark/ai-toolkit · 51 tokens