Guide · Agent skill
How to use the Kotlin Development Patterns agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The kotlin-patterns skill is a set of written Kotlin conventions and code examples that an AI agent reads before it writes or reviews Kotlin code. It covers null safety, immutable data, sealed classes, structured coroutines, extension functions and type-safe Gradle Kotlin DSL builds. This guide shows you how to install it, how to ask for it in plain language, and what to check before you rely on its output.
Quick start
- 1Download the ZIP. Get the kotlin-patterns skill ZIP from this page.
- 2Unzip into a skills folder. Extract it into ~/.claude/skills/ for all projects, or into a project's .claude/skills/ folder for one project.
- 3Or upload in the Claude apps. In the Claude apps, open Settings, go to Capabilities, then Skills, and upload the skill.
- 4Ask a Kotlin question. Describe the Kotlin task in plain language, such as writing a function or reviewing a class.
- 5Review the output. Check null handling, mutability and coroutine scope against your project's own rules before merging.
What the skill makes the agent do
Once the skill is loaded, the agent follows the Kotlin conventions in the skill when it writes new code, reviews existing code, refactors it, designs modules or libraries, or configures Gradle Kotlin DSL builds. The skill names seven areas: null safety using the type system and safe-call operators, immutability through val and copy() on data classes, sealed classes and interfaces for exhaustive type hierarchies, structured concurrency with coroutines and Flow, extension functions, type-safe DSL builders using @DslMarker and lambda receivers, and Gradle Kotlin DSL.
The skill is guidance, not a tool. It does not run anything on its own; it shapes how the agent writes code and what it points out in review.
- Prefers non-nullable types and the Elvis operator over force-unwrapping with !!
- Prefers val, immutable collections and copy() over mutable state
- Suggests sealed classes for result types so a when expression can be exhaustive
- Uses coroutineScope with async and await for structured concurrency
Install the skill with a ZIP or the Claude apps
Download the ZIP file for the skill from this page. The skill package contains one file, SKILL.md. Unzip it so the skill folder ends up in one of these locations: ~/.claude/skills/ to make it available across your projects, or .claude/skills/ inside a specific project to make it available only there.
If you use the Claude apps instead, open Settings, go to Capabilities, then Skills, and upload the skill there.
- Personal install: unzip into ~/.claude/skills/
- Project install: unzip into the project's .claude/skills/ folder
- Claude apps: Settings → Capabilities → Skills, then upload
Trigger the skill with natural requests
You do not need a special command. Describe the Kotlin task in plain language and mention what you want. The skill's own description covers idiomatic patterns, coroutines, null safety and DSL builders, so requests that touch those topics are the most likely to use it.
The skill also applies when you ask for a review or a refactor of existing Kotlin code, and when you ask for Gradle Kotlin DSL build configuration.
- "Write a Kotlin function that looks up a user's email and handles the case where the user is missing."
- "Review this Kotlin service for null-safety problems and mutable state."
- "Refactor this result handling into a sealed class with an exhaustive when."
- "Load a user and their posts in parallel using structured coroutines."
- "Set up build.gradle.kts for this module using the Gradle Kotlin DSL."
Examples of what the agent produces
The skill includes three example patterns the agent draws on. A null-safe lookup uses a safe call and the Elvis operator to return a fallback instead of !!. A sealed Result class models Success, Failure and Loading so callers must handle every case. A coroutine example uses coroutineScope with two async calls and await() to fetch a user and their posts together.
These are starting points. Ask the agent to adapt them to your own types, names and error handling.
fun getUserEmail(userId: String): String {
val user = userRepository.findById(userId)
return user?.email ?: "unknown@example.com"
}Check what the skill does not cover
The skill focuses on style and patterns. It does not contain project-specific rules, your team's architecture decisions or tests for your code. Review generated code the same way you would review a colleague's pull request, especially concurrency and error-handling paths.
The skill applies only to Kotlin. For other languages it will not help, and it may push its own preferences over your local conventions if they conflict.
- Does not know your house style; state local rules explicitly in your request
- Only relevant to Kotlin code
- Changes to build files should be reviewed before running them
Safety notes: scripts and network
According to the skill's listing, it runs no scripts and uses no network connection. It requires nothing beyond the skill file itself. Its only file is SKILL.md, which is a set of written guidelines and code examples.
Because the skill itself does no work, any commands the agent runs while writing or testing your Kotlin code are governed by your own environment and permissions, not by this skill.
- Runs scripts: no
- Uses network: no
- Requires: nothing listed
- Files: SKILL.md
What people use it for
- Writing a new Kotlin service that handles missing values without !!
- Reviewing an Android Kotlin pull request for mutable state and unsafe coroutine use
- Refactoring a result type into a sealed class with exhaustive when expressions
- Configuring a Gradle Kotlin DSL build file for a new module
Frequently asked questions
How do I install the kotlin-patterns skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps, you can instead upload it under Settings, Capabilities, Skills.
Does the kotlin-patterns skill require anything else to run?
The listing says it requires nothing and runs no scripts. It is a single SKILL.md file of guidelines and examples, and it does not use the network.
Is the kotlin-patterns skill free?
The skill is listed under the MIT licence. Check the licence file in the source repository for the exact terms before you redistribute it.
Can the skill review Kotlin code, or only write it?
It guides the agent in both writing and reviewing Kotlin, as well as refactoring and configuring Gradle Kotlin DSL builds. Its review focus is on null safety, immutability, sealed types and coroutine structure.
Will the skill work with Java or other languages?
No. The guidance applies only to Kotlin code and will not help with other languages.
What if the agent ignores my team's coding rules?
The skill can push its own preferences over local rules when they conflict. State your project's conventions explicitly in your request, and check the output against them before merging.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you write new Kotlin or Android code, review or refactor Kotlin codebases, or maintain Gradle Kotlin DSL builds and want an AI assistant to follow modern, consistent conventions. Pick something else if you do not write Kotlin, or if your project has a strict house style that conflicts with these conventions and you cannot restate it clearly in each request.
Download the skill