lang-kotlin
Skill0 starsChanged 7 days agoMITView on GitHub
Use when writing, reviewing, testing or setting up Kotlin backend code in a loops run (the kotlin language pack) - toolchain, layout, race policy, coverage, idioms and footguns.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- alexderz/agentic-toolboxtheir own version, first seen Oct 17, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- alexderz/agentic-toolbox★ 5same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository35 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/work/platforms/claude.mdCLAUDE.md
- llms.txtllms.txt
- clarifySkill
- consistencySkill
- debuggingSkill
- documentationSkill
- featureSkill
- hexagonalSkill
- initSkill
- jobs-and-state-machinesSkill
- lang-clojureSkill
- lang-cppSkill
- lang-csharpSkill
- lang-elixirSkill
- lang-erlangSkill
- lang-goSkill
- lang-javaSkill
- lang-phpSkill
- lang-pythonSkill
- lang-rubySkill
- lang-rustSkill
- lang-scalaSkill
- lang-swiftSkill
- lang-typescriptSkill
- memorySkill
- parallel-workSkill
- performanceSkill
- qualitySkill
- reportSkill
- review-integrationSkill
- statusSkill
- testingSkill
- workSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 38
If the properties file is missing the gate fails with the exact snippet.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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.
Files
Kotlin backend (JVM, Gradle)
Applies when loops lang detect reports kotlin (src/main/kotlin, or a Gradle build applying the Kotlin plugin). Rules: specs/languages/kotlin/RULES.md (IDs KT-<SEC>-NN). Pack data: specs/languages/kotlin/pack.json (loops lang show kotlin). Layering and SOLID are language-neutral: specs/ARCHITECTURE.md, specs/SOLID.md.
Project rules first
The project's own config wins over this skill: .editorconfig, config/detekt/detekt.yml, the version catalog, framework conventions (Spring or Ktor), existing build-logic/ conventions. When you follow one over a loops rule, record it: loops run override --rule "<loops rule>" --project "<project rule, file:line>" --note "<what you did>" (ROLES.md "Project rules first"). The practices-researcher reads config_files from the pack.
Toolchain the gate runs
loops gate runs these in order; while iterating run a single one. All use the wrapper (./gradlew, never a machine Gradle) and --console=plain; the gate adds --project-cache-dir {run}/.gradle (cache_argv).
| Check | Command | Notes |
| build (required) | ./gradlew assemble | compiles main; warnings are errors by project config (KT-TOOL-04) |
| ktlint (optional) | ./gradlew ktlintCheck | skipped with a hint if the plugin is absent |
| detekt (optional) | ./gradlew detekt | stable plugin io.gitlab.arturbosch.detekt 1.23.8 (KT-TOOL-03) |
| arch (optional) | loops arch | reads each file's package header, not its directory |
| test (required) | ./gradlew test --rerun koverXmlReport | --rerun goes after test, or Gradle reports UP-TO-DATE and skips the tests |
| test-repeat (required) | ./gradlew test --rerun, 2 times | race substitute, see below |
| coverage (required) | loops parses build/reports/kover/report.xml | JaCoCo schema, new-code at least 70% |
| osv (off by default) | osv-scanner scan source -L gradle.lockfile | --vuln |
Narrow scope while working: ./gradlew :module:test --tests 'com.acme.FooTest' (KT-TEST-11). Never run the full gate as an implementer; the lead and QA do (ROLES.md).
Gradle is a shared daemon host: keep GRADLE_USER_HOME shared (it holds downloads), scope only the project cache dir by argv (KT-OPS-05). Never set ORG_GRADLE_PROJECT_* for it; it does nothing.
Race policy (WORKFLOW §6)
The JVM has no race detector, so the pack's mode is none. The gate still requires the substitute and never skips it:
junit-platform.propertiesturns on parallel execution (junit.jupiter.execution.parallel.enabled=true,...mode.default=concurrent) and random method order (junit.jupiter.testmethod.order.default=org.junit.jupiter.api.MethodOrderer$Random, a fully qualified name). Gradle-Ddoes not reach the test JVM, so the file is the only route.testruns once,test-repeattwice more; each run picks a new random seed. A test that fails in any run fails the gate; never add retries.- Tests touching shared state use
@RepeatedTest; concurrent data structures get a Lincheck test (KT-CONC-04); coroutine code usesrunTestvirtual time with injected dispatchers (KT-TEST-09). - If the properties file is missing the gate fails with the exact snippet; see the next section.
Coverage recipe and wave-0 prerequisites (D13)
The architect or kotlin-engineer adds these in wave 0 and logs each as an override if the project already differs:
- Kover
org.jetbrains.kotlinx.kover0.9.11 in the root build;koverXmlReportaggregates modules intobuild/reports/kover/report.xml(KT-TEST-06). src/test/resources/junit-platform.propertieswith the three race keys above;tasks.test { useJUnitPlatform() }.kotlin { compilerOptions { allWarningsAsErrors = true } }andjvmToolchain(21).- Dependency locking with a committed
gradle.lockfile(KT-REPO-06). - Exclude generated code in
kover { reports { filters { excludes { ... } } } }.
How the loops layers map
settings.gradle.kts include(":domain", ":application", ":adapters:http", ":app")
domain/ no dependencies; no framework, java.io/net/sql, Instant.now, UUID.randomUUID
application/ -> domain; ports are small interfaces defined here (consumer-owned)
adapters/*/ -> application; Spring/Ktor/jOOQ/Exposed live only here
app/ composition root: manual wiring or @ConfigurationModule dependencies are the compiler-enforced direction (KT-ARCH-02); loops arch and Konsist cover package-level rules inside a module (KT-ARCH-03/04). Pure domain: inject Clock and an id generator (KT-ARCH-06).
Ten footguns
- Swallowed
CancellationException(catch (e: Exception),runCatchingon suspend code): rethrow it. GlobalScope.launch: own aCoroutineScope(SupervisorJob() + dispatcher)and cancel it on shutdown.- Blocking IO on
Dispatchers.Default:withContext(Dispatchers.IO)or an injected dispatcher. - Platform types (
String!) leaking from Java: declare the Kotlin type;-Xjsr305=strict. !!andlateinitin domain code:?:,requireNotNull, constructor injection.data classas a JPA entity: plain class with thekotlin-jpaand all-open plugins, mapped to a domain type.- Bean Validation annotation on a constructor property without
@field:on an older default target: silently ignored. ./gradlew testis UP-TO-DATE and runs nothing:--rerunaftertest.delayunderrunTeston a hard-codedDispatchers.IOwaits real time: inject the dispatcher.- MDC, transaction or OTel context bound to a thread while coroutines hop:
MDCContext(), coroutine-aware transaction managers.
Load on demand
repo.md: Gradle layout, catalog, locking, wrapper, CI, publishing.architecture.md: modules as layers, visibility, Konsist, DI, purity.idioms.md: errors, null-safety, immutability, sealed types, resources.testing.md: JUnit 5, MockK, Testcontainers,runTest, Kover, flakiness.concurrency.md: coroutines, Flow, cancellation, Lincheck, workers.security.md: injection, deserialization, secrets, supply chain, SAST.data-api.md: persistence, migrations, HTTP, messaging, observability, ops.frameworks.md: Spring Boot, Ktor, footguns, Spring/Ktor conventions.
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
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.

