Install
$ agentstack add skill-lugassawan-swe-workbench-language-kotlin ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Kotlin
Null safety
?makes nullability explicit in the type —String?vsString.- Safe-call
?.returns null instead of throwing. Elvis?:provides a default. - Never use
!!in production code — it is a promise you will never break that can't be verified.
val length = name?.trim()?.length ?: 0
user?.email?.let { send(it) } // null-guard + scoping
Data classes and sealed interfaces
data classfor value containers: auto-generatesequals,hashCode,toString,copy, and destructuring.sealed interfacecloses a hierarchy and enables exhaustivewhenwithout anelsebranch.
sealed interface Result
data class Success(val value: T) : Result
data class Failure(val error: Throwable) : Result
fun handle(r: Result) = when (r) {
is Success -> show(r.value)
is Failure -> log(r.error)
}
Coroutines — structured concurrency
suspendfunctions must be called from a coroutine or anothersuspendfunction.- Use
coroutineScope { }for fan-out — child coroutines are cancelled if one fails. withContext(Dispatchers.IO)for blocking IO; never block insideDispatchers.Default.
suspend fun fetchDashboard(id: String): Dashboard = coroutineScope {
val user = async { fetchUser(id) }
val orders = async { fetchOrders(id) }
Dashboard(user.await(), orders.await())
}
launchis fire-and-forget;asyncreturns aDeferred.- Prefer
coroutineScopeoverGlobalScope— global coroutines outlive their logical parent.
Result and error handling
runCatching { }wraps a block inResultwithout try/catch noise.- Chain with
map,recover,onSuccess,onFailure. - Exceptions for genuinely exceptional paths;
Resultfor recoverable failures.
val result = runCatching { parse(input) }
.map { it.validate() }
.recover { _ -> ParsedValue.empty() } // recover: failure → success fallback
.onFailure { e -> log.warn("parse failed", e) }
Scope functions — pick the right one
| Function | Receiver as | Returns | Use when | |---|---|---|---| | let | it | lambda result | null-guard, transform, introduce local name | | apply | this | receiver | builder / configure-and-return | | run | this | lambda result | scope + transform | | also | it | receiver | side-effect (logging) without changing the chain | | with | this | lambda result | operations on a non-nullable object without extension |
Do not nest scope functions more than one level — it destroys readability.
Extension functions
- Additive utilities on existing types. Place in the package that uses them, not in a companion.
- Do not shadow members — extension functions lose to member functions at call sites.
fun String.toSlug() = lowercase().replace(Regex("[^a-z0-9]+"), "-").trim('-')
Flow — async sequences
Flowis cold (lazy); it does not run until collected.StateFlowfor observable mutable state;SharedFlowfor events.map,filter,flatMapLatest,debounce— use operators over manual loops.
val prices: Flow = priceRepo.watch(symbol)
.filter { it > BigDecimal.ZERO }
.distinctUntilChanged()
Tooling
- Imports/Format:
./gradlew ktlintFormat/ktlint -F(standalone binary) - Lint:
detekt/./gradlew detekt - Test:
./gradlew test(see Testing below)
Testing
- JUnit 5 or Kotest for test structure; MockK for Kotlin-friendly mocking.
runTest { }fromkotlinx-coroutines-testfor coroutine tests — no manual dispatchers.
@Test
fun `fetch returns cached value`() = runTest {
val repo = FakeRepo(listOf(user))
assertThat(repo.find(user.id)).isEqualTo(user)
}
Avoid
!!— if you know it is non-null, prove it with arequireNotNullor type the field as non-nullable.- Translating Java idioms (
if (x != null)→ use?.and?:). - Nesting scope functions more than one level deep.
lateinit varoutside dependency injection — preferby lazyor constructor injection.GlobalScope— ties coroutines to the process lifetime instead of a logical scope.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: lugassawan
- Source: lugassawan/swe-workbench
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.