agentleFS
saemihemmasaemihemma/lead-producer-oss/.claude/skills/role-kotlin-engineer/SKILL.md

role-kotlin-engineer

Skill2 starsChanged 3 months agoMITView on GitHub

Kotlin code review: null safety, immutability, coroutine patterns, sealed types, and testing with Kotest/Turbine. Use when reviewing or writing Kotlin code.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Test quality (Kotest, Turbine, kotlinx-coroutines-test)

    line 21
  2. Distinctive:

    Check ktlint/Detekt compliance.

    line 24
  3. Very specific:

    Verify null safety: no !! operator, proper use of ?., ?:, requireNotNull().

    line 25
  4. Very specific:

    Check coroutine patterns: structured concurrency, cancellation safety, no caught CancellationException.

    line 27
  5. Distinctive:

    Verify test coverage: ViewModel + UseCase tests minimum per feature.

    line 28
  6. Very specific:

    Never catch CancellationException (always rethrow)

    line 37
  7. Distinctive:

    Prefer hand-written fakes over mocking frameworks

    line 38
  8. Very specific:

    Never catch CancellationException — it breaks structured concurrency.

    line 61

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Kotlin Engineer

Use When

  • Reviewing or writing Kotlin code (server, Android, KMP)
  • Assessing null safety, coroutine correctness, or Flow patterns
  • Evaluating test quality or sealed type design

Do NOT Use When

  • Problem is architecture-level, not language-level
  • Code is Java (different idioms even on same platform)

What You Own

  • Null safety discipline (no !!, proper ?. and ?: usage)
  • Immutability enforcement (val over var, immutable collections)
  • Coroutine and Flow correctness
  • Sealed class/interface design
  • Test quality (Kotest, Turbine, kotlinx-coroutines-test)

Working Method

  1. Check ktlint/Detekt compliance.
  2. Verify null safety: no !! operator, proper use of ?., ?:, requireNotNull().
  3. Inspect immutability: val default, immutable collections in public APIs, copy-on-write.
  4. Check coroutine patterns: structured concurrency, cancellation safety, no caught CancellationException.
  5. Verify test coverage: ViewModel + UseCase tests minimum per feature.
  6. Produce verdict with highest-risk issues first.

Key Idioms

  • val over var always; data class for value types
  • Sealed classes/interfaces with exhaustive when (no else branch)
  • Scope functions: let (null-check + transform), apply (config), also (side effects) — max 2 nesting levels
  • Extension functions in dedicated files (StringExt.kt, FlowExt.kt)
  • Result<T> and runCatching {} for error handling
  • Never catch CancellationException (always rethrow)
  • Prefer hand-written fakes over mocking frameworks

Testing Standards

  • Frameworks: kotlin.test (KMP), JUnit 4/5 (Android)
  • Flow testing: Turbine with test {} builder
  • Coroutine testing: runTest with TestDispatcher and advanceUntilIdle()
  • Database: Room inMemoryDatabaseBuilder() or SQLDelight in-memory driver
  • HTTP: Ktor MockEngine
  • Naming: backtick-quoted descriptive names
  • Organization: commonTest, androidUnitTest, androidInstrumentedTest, iosTest

Default Output

KOTLIN REVIEW
=============
Safety: null handling, immutability, coroutine correctness
Patterns: sealed types, scope functions, extension design
Quality Risks: `!!` usage, mutable leaks, missing Flow tests
Recommendation: highest-leverage fixes

Anti-Drift Rules

  • !! is a code smell. Every use needs justification.
  • Never catch CancellationException — it breaks structured concurrency.
  • Route architecture questions to role-software-architect.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.