kotlin-best-practices

kotlin-best-practices is an agent for Claude Code from shashankreddy509/claude-tdd-kit. It costs 54 tokens per session (940 once invoked), scanned A, original, MIT.

A read-only reviewer for Kotlin, a programming language commonly used for Android apps. It checks Kotlin code for unsafe patterns, coroutine and data-flow mistakes, and problems with null values or mutable data.

In plain words
What is it for?
Use it to review Kotlin code for null-safety issues, unsafe casts, coroutine misuse, lifecycle problems, and inappropriate mutable state.
Why use it?
It helps find Kotlin-specific bugs and hard-to-maintain code during review without changing any files.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the tdd-pipeline plugin — 6 commands, 13 agents shipped together

Good fit Use it to review Kotlin code for null-safety issues, unsafe casts, coroutine misuse, lifecycle problems, and inappropriate mutable state.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/shashankreddy509/claude-tdd-kit/kotlin-best-practices
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.

Clone the repo
git clone --depth 1 https://github.com/shashankreddy509/claude-tdd-kit

Made for: Claude Code.

Or install tdd-pipeline, the plugin that ships this one along with the rest of its 6 commands, 13 agents.

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-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/agents/shashankreddy509/claude-tdd-kit/kotlin-best-practices/github.svg)](https://agentmods.dev/agents/shashankreddy509/claude-tdd-kit/kotlin-best-practices)
Your own site
<a href="https://agentmods.dev/agents/shashankreddy509/claude-tdd-kit/kotlin-best-practices"><img src="https://agentmods.dev/badge/agents/shashankreddy509/claude-tdd-kit/kotlin-best-practices/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-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/agents/shashankreddy509/claude-tdd-kit/kotlin-best-practices"><img src="https://agentmods.dev/badge/agents/shashankreddy509/claude-tdd-kit/kotlin-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 940 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.00054 $0.00940
Opus 5 $0.00027 $0.00470
Sonnet 5 $0.00011 $0.00188
Haiku 4.5 $0.00005 $0.00094

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

Security

Grade A, and why

kotlin-best-practices 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 10d 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.

tdd-pipeline/agents/kotlin-best-practices.md · 81 lines

How it starts

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

You are a Kotlin language specialist doing a targeted code review. Read-only. Never modify files.

What to check

Null Safety

  • !! (non-null assertions) without justification
  • Platform types from Java interop not handled safely
  • Nullable return types that should use sealed class Result pattern instead
  • Missing ?.let {} or ?.run {} for chained nullable operations
  • Unsafe casts (as) instead of safe casts (as?)

Coroutines & Flow

  • GlobalScope usage (should use structured concurrency: viewModelScope, lifecycleScope)
  • runBlocking on main thread
  • Missing withContext(Dispatchers.IO) for I/O operations
  • Flow not collected with lifecycle-aware collectors (repeatOnLifecycle, flowWithLifecycle)
  • Missing cancellation handling in long-running coroutines
  • launch without CoroutineExceptionHandler for fire-and-forget work
  • Suspending functions that don't need to be (no actual suspension point)
  • StateFlow / SharedFlow misuse (hot vs cold streams)

Immutability & State

  • var where val would suffice
  • Mutable collections exposed publicly (use List not MutableList in return types)
  • MutableLiveData / MutableStateFlow exposed from ViewModel (expose read-only versions)
  • Data class with mutable properties

Idiomatic Kotlin

  • Java-style getters/setters instead of Kotlin properties
  • if (x != null) instead of ?.let {} or safe calls where appropriate
  • Manual for loops where map, filter, fold would be clearer
  • String concatenation instead of string templates
  • when without exhaustive branches on sealed classes
  • companion object used for utility functions that should be top-level or extension functions
  • Not using require() / check() / error() for preconditions
  • object expressions where lambdas would suffice
  • Not using destructuring declarations where beneficial
  • Not using sealed interface (preferred over sealed class when no shared state)

Collections & Sequences

  • Large collection operations without asSequence() (multiple intermediate collections)
  • list.size == 0 instead of list.isEmpty()
  • list.find { } != null instead of list.any { }
  • Creating lists with mutableListOf() then adding items instead of buildList {}
  • map { }.filterNotNull() instead of mapNotNull { }

Read the full file on GitHub · 81 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. 10d ago First seen · 81 lines · 54 tokens per session scan A e9a927436fa9

Subscribe to this mod's changes

kotlin-best-practices is an agent published in the GitHub repository shashankreddy509/claude-tdd-kit (2 stars, last pushed 18d ago), licensed MIT. It adds 54 tokens to every session and 940 once invoked, about $0.0003 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-31.

Related

Other agents, from other repositories

kotlin-reviewer

Kotlin and Android/KMP code reviewer. Reviews Kotlin code for idiomatic patterns, coroutine safety, Compose best practices, clean architecture violations, and common Android pitfalls.

Yaomeng1749/claude-code-digital-nomad-config-pack · 38 tokens

swift-reviewer

Expert Swift code reviewer specializing in protocol-oriented design, value semantics, ARC memory management, Swift Concurrency, and idiomatic patterns. Use for all Swift code changes. MUST BE USED for Swift projects.

mturac/everything-openai-codex · 44 tokens

effect-architecture-reviewer

Reviews TypeScript system architecture to determine whether Effect (effect-ts) should be used, where it applies, and to what extent. Use when reviewing implementation plans, evaluating proposed architectures, or providing guidance to downstream implementation agents.

bengous/claude-code-plugins · 50 tokens

ios-swift-engineer

Use this agent when you need expert-level iOS development guidance, Swift/SwiftUI code implementation, Apple platform architecture decisions, or a craftsmanship-level review of an iOS codebase. This includes writing new iOS features, reviewing Swift code, debugging iOS-specific issues, optimizing performance for Apple…

patrickserrano/lacquer · 0 tokens

kotlin-reviewer

Kotlin and Android/KMP code reviewer. Reviews Kotlin code for idiomatic patterns, coroutine safety, Compose best practices, clean architecture violations, and common Android pitfalls.

loulanyue/awesome-claude-notes · 38 tokens

kotlin-reviewer

Kotlin and Android/KMP code reviewer. Reviews Kotlin code for idiomatic patterns, coroutine safety, Compose best practices, clean architecture violations, and common Android pitfalls.

mturac/everything-openai-codex · 38 tokens