agentleFS
full-stack-skillsfull-stack-skills/kotlin-skills/skills/kotlin-stable/SKILL.md

kotlin-stable

Skill0 starsChanged 55 days agoApache-2.0View on GitHub

Implement and diagnose stable Kotlin language semantics for JVM projects, including null safety, types, generics, variance, classes, interfaces, sealed hierarchies, delegation, exceptions, and Java interoperability. Use for Kotlin source changes and compiler errors; combine with specialized build, coroutine, testing, review, or migration skills when those domains are present.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    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:

    Use this skill as the language-semantic foundation.

    line 9
  2. Very specific:

    Prefer immutable val, read-only collection interfaces, data classes for value semantics, and sealed types for closed result domains.

    line 21
  3. Distinctive:

    Use extension functions for behavior that is coherent with the receiver.

    line 24
  4. Distinctive:

    Treat platform types from Java as untrusted nullable boundaries.

    line 26
  5. Very specific:

    Use @JvmName, @JvmStatic, @JvmOverloads, wildcards, and checked-exception annotations only when a verified Java ABI requires them.

    line 27
  6. Very specific:

    Avoid clever scope-function chains.

    line 28
  7. Distinctive:

    Add a regression test that observes public behavior.

    line 35
  8. Distinctive:

    Run module compilation, tests, static analysis, then the affected project gate.

    line 36
  9. Very specific:

    Use the repository wrapper (./gradlew) when present.

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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 Stable

Use this skill as the language-semantic foundation. Preserve the project language level and JVM target instead of assuming the newest compiler.

Before changing code

  1. Inspect settings.gradle.kts, build.gradle.kts, version catalogs, gradle.properties, and Java toolchain declarations.
  2. Record Kotlin plugin version, language/API version, JVM target, JDK, enabled compiler plugins, and target platforms.
  3. Compile the smallest affected module before diagnosing source semantics.
  4. Load kotlin-gradle-build for build configuration and kotlin-coroutines for suspend/Flow behavior.

Language rules

  • Model absence with nullable types only where absence is a real domain state. Avoid !! and unchecked casts.
  • Prefer immutable val, read-only collection interfaces, data classes for value semantics, and sealed types for closed result domains.
  • Distinguish read-only collections from immutable implementations; copy at trust boundaries when callers must not mutate state.
  • Apply declaration-site variance deliberately. Do not hide an incorrect type model behind star projections.
  • Use extension functions for behavior that is coherent with the receiver; do not use them as a global utility namespace.
  • Preserve equality, hash, ordering, exception, serialization, and Java-call-site contracts when converting types.
  • Treat platform types from Java as untrusted nullable boundaries. Validate once and expose explicit Kotlin types internally.
  • Use @JvmName, @JvmStatic, @JvmOverloads, wildcards, and checked-exception annotations only when a verified Java ABI requires them.
  • Avoid clever scope-function chains. Choose let, run, apply, also, or with only when receiver/result semantics make the code clearer.

Workflow

  1. Reproduce the compiler or behavioral failure.
  2. Identify whether the defect is type modeling, nullability, variance, overload resolution, ABI, or build configuration.
  3. Make the minimum semantic correction without weakening types.
  4. Add a regression test that observes public behavior.
  5. Run module compilation, tests, static analysis, then the affected project gate.

Quality gate

gradle --no-daemon compileKotlin compileTestKotlin
gradle --no-daemon test
gradle --no-daemon check

Use the repository wrapper (./gradlew) when present. Never silently raise language level, JVM target, or JDK.

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.