kotlin-best-practices — Claude Code skill: Kotlin standards
A skill that pins down Kotlin conventions: null safety, Either instead of thrown exceptions, coroutines, and Exposed ORM patterns. Useful while writing or reviewing Kotlin.
npx skills add c0x12c/ai-toolkit --skill kotlin-best-practices -a claude-codeWhat kotlin-best-practices does
The skill spells out how Kotlin should look in a project. !! is out; use ?., ?:, or a null check that lets the compiler smart cast. Managers hand back Either<ClientException, T> rather than throwing, and controllers pull the value out with .throwOrValue(). Enum values are never written as raw strings — call EnumName.VALUE.value.
Database work follows the same tone. Tables extend UUIDTable, not Table, and columns use text() instead of varchar(). Deletes are soft: update the deletedAt timestamp, and every query carries a deletedAt.isNull() filter. Reads hit db.replica, writes go to db.primary. When a change touches more than one table, it belongs in a single transaction block so everything commits or nothing does.
DTOs keep their own conversion: companion object { fun from(entity) } sits inside the Response DTO, and separate mapper files are not created. Each section points to code-patterns.md for the full examples, though that file is not part of the skill — you get the short rules only. The skill runs with Read, Write, Edit, Glob, and Grep.
What it helps with
- write Kotlin without
!!or thrown exceptions - unwrap
Eitherin a controller with.throwOrValue() - soft delete rows instead of removing them
- split reads and writes across
db.replicaanddb.primary - keep entity conversion inside the Response DTO, not a mapper file
Example prompts for the agent
- Write this Kotlin repository following the skill: a
UUIDTable, withdeletedAt.isNull()in every query - Review this manager — it should return
Eitherinstead of throwing - Add an update that writes to two tables in one transaction via
db.primary
How to install kotlin-best-practices
1Skills CLI (Vercel)
npx skills add c0x12c/ai-toolkit --skill kotlin-best-practices -a claude-code2Manually: put the files in place
~/.claude/skills/kotlin-best-practices/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/kotlin-best-practices/
1Skills CLI (Vercel)
npx skills add c0x12c/ai-toolkit --skill kotlin-best-practices -a codex2Manually: put the files in place
.agents/skills/kotlin-best-practices/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add c0x12c/ai-toolkit --skill kotlin-best-practices -a cursor2Manually: put the files in place
.cursor/skills/kotlin-best-practices/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install c0x12c/ai-toolkit kotlin-best-practices2Manually: put the files in place
.github/skills/kotlin-best-practices/SKILL.md1Skills CLI (Vercel)
npx skills add c0x12c/ai-toolkit --skill kotlin-best-practices -a gemini-cli2Platform CLI
gemini skills install https://github.com/c0x12c/ai-toolkit --path toolkit/skills/kotlin-best-practicesManually: put the files in place
.devin/skills/kotlin-best-practices/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add c0x12c/ai-toolkit --skill kotlin-best-practices -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about kotlin-best-practices
How do I install kotlin-best-practices in Claude Code?
Run npx skills add c0x12c/ai-toolkit --skill kotlin-best-practices -a claude-code. The skill lands at ~/.claude/skills/kotlin-best-practices/SKILL.md.
What does kotlin-best-practices do?
It gives the agent Kotlin conventions to follow: no !!, managers returning Either, soft deletes in Exposed ORM, reads and writes split between replica and primary, and conversion kept inside Response DTOs.
Which platforms support the skill?
Besides Claude, there are install paths for Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode.