{"slug":"kotlin-patterns","title":"kotlin-patterns","summary":"Idiomatic Kotlin patterns, best practices, and conventions for building robust, efficient, and maintainable Kotlin applications with coroutines, null safety, and DSL builders. Use when writing or reviewing Kotlin code and idiomatic structure or null safety is in question.","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-12-02T16:53:42.063311Z","repo":{"url":"https://github.com/beginwithu/agent-skills","stars":11,"forks":2,"license":"MIT","updatedAt":"2026-12-02T16:37:11Z"},"bodyHtml":"<hr>\n<h2>name: kotlin-patterns\ndescription: Idiomatic Kotlin patterns, best practices, and conventions for building robust, efficient, and maintainable Kotlin applications with coroutines, null safety, and DSL builders. Use when writing or reviewing Kotlin code and idiomatic structure or null safety is in question.\nmetadata:\norigin: ECC</h2>\n<h1>Kotlin Development Patterns</h1>\n<p>Idiomatic Kotlin patterns and best practices for building robust, efficient, and maintainable applications.</p>\n<h2>When to Use</h2>\n<ul>\n<li>Writing new Kotlin code</li>\n<li>Reviewing Kotlin code</li>\n<li>Refactoring existing Kotlin code</li>\n<li>Designing Kotlin modules or libraries</li>\n<li>Configuring Gradle Kotlin DSL builds</li>\n</ul>\n<h2>How It Works</h2>\n<p>This skill enforces idiomatic Kotlin conventions across seven key areas: null safety using the type system and safe-call operators, immutability via <code>val</code> and <code>copy()</code> on data classes, sealed classes and interfaces for exhaustive type hierarchies, structured concurrency with coroutines and <code>Flow</code>, extension functions for adding behaviour without inheritance, type-safe DSL builders using <code>@DslMarker</code> and lambda receivers, and Gradle Kotlin DSL for build configuration.</p>\n<h2>Examples</h2>\n<p><strong>Null safety with Elvis operator:</strong></p>\n<pre><code>fun getUserEmail(userId: String): String {\n    val user = userRepository.findById(userId)\n    return user?.email ?: \"unknown@example.com\"\n}\n</code></pre>\n<p><strong>Sealed class for exhaustive results:</strong></p>\n<pre><code>sealed class Result&lt;out T&gt; {\n    data class Success&lt;T&gt;(val data: T) : Result&lt;T&gt;()\n    data class Failure(val error: AppError) : Result&lt;Nothing&gt;()\n    data object Loading : Result&lt;Nothing&gt;()\n}\n</code></pre>\n<p><strong>Structured concurrency with async/await:</strong></p>\n<pre><code>suspend fun fetchUserWithPosts(userId: String): UserProfile =\n    coroutineScope {\n        val user = async { userService.getUser(userId) }\n        val posts = async { postService.getUserPosts(userId) }\n        UserProfile(user = user.await(), posts = posts.await())\n    }\n</code></pre>\n<h2>Core Principles</h2>\n<h3>1. Null Safety</h3>\n<p>Kotlin's type system distinguishes nullable and non-nullable types. Leverage it fully.</p>\n<pre><code>// Good: Use non-nullable types by default\nfun getUser(id: String): User {\n    return userRepository.findById(id)\n        ?: throw UserNotFoundException(\"User $id not found\")\n}\n\n// Good: Safe calls and Elvis operator\nfun getUserEmail(userId: String): String {\n    val user = userRepository.findById(userId)\n    return user?.email ?: \"unknown@example.com\"\n}\n\n// Bad: Force-unwrapping nullable types\nfun getUserEmail(userId: String): String {\n    val user = userRepository.findById(userId)\n    return user!!.email // Throws NPE if null\n}\n</code></pre>\n<h3>2. Immutability by Default</h3>\n<p>Prefer <code>val</code> over <code>var</code>, immutable collections over mutable ones.</p>\n<pre><code>// Good: Immutable data\ndata class User(\n    val id: String,\n    val name: String,\n    val email: String,\n)\n\n// Good: Transform with copy()\nfun updateEmail(user: User, newEmail: String): User =\n    user.copy(email = newEmail)\n\n// Good: Immutable collections\nval users: List&lt;User&gt; = listOf(user1, user2)\nval filtered = users.filter { it.email.isNotBlank() }\n\n// Bad: Mutable state\nvar currentUser: User? = null // Avoid mutable global state\nval mutableUsers = mutableListOf&lt;User&gt;() // Avoid unless truly needed\n</code></pre>\n<h3>3. Expression Bodies and Single-Expression Functions</h3>\n<p>Use expression bodies for concise, readable functions.</p>\n<pre><code>// Good: Expression body\nfun isAdult(age: Int): Boolean = age &gt;= 18\n\nfun formatFullName(first: String, last: String): String =\n    \"$first $last\".trim()\n\nfun User.displayName(): String =\n    name.ifBlank { email.substringBefore('@') }\n\n// Good: When as expression\nfun statusMessage(code: Int): String = when (code) {\n    200 -&gt; \"OK\"\n    404 -&gt; \"Not Found\"\n    500 -&gt; \"Internal Server Error\"\n    else -&gt; \"Unknown status: $code\"\n}\n\n// Bad: Unnecessary block body\nfun isAdult(age: Int): Boolean {\n    return age &gt;= 18\n}\n</code></pre>\n<h3>4. Data Classes for Value Objects</h3>\n<p>Use data classes for types that primarily hold data.</p>\n<pre><code>// Good: Data class with copy, equals, hashCode, toString\ndata class CreateUserRequest(\n    val name: String,\n    val email: String,\n    val role: Role = Role.USER,\n)\n\n// Good: Value class for type safety (zero overhead at runtime)\n@JvmInline\nvalue class UserId(val value: String) {\n    init {\n        require(value.isNotBlank()) { \"UserId cannot be blank\" }\n    }\n}\n\n@JvmInline\nvalue class Email(val value: String) {\n    init {\n        require('@' in value) { \"Invalid email: $value\" }\n    }\n}\n\nfun getUser(id: UserId): User = userRepository.findById(id)\n</code></pre>\n<h2>Sealed Classes and Interfaces</h2>\n<h3>Modeling Restricted Hierarchies</h3>\n<pre><code>// Good: Sealed class for exhaustive when\nsealed class Result&lt;out T&gt; {\n    data class Success&lt;T&gt;(val data: T) : Result&lt;T&gt;()\n    data class Failure(val error: AppError) : Result&lt;Nothing&gt;()\n    data object Loading : Result&lt;Nothing&gt;()\n}\n\nfun &lt;T&gt; Result&lt;T&gt;.getOrNull(): T? = when (this) {\n    is Result.Success -&gt; data\n    is Result.Failure -&gt; null\n    is Result.Loading -&gt; null\n}\n\nfun &lt;T&gt; Result&lt;T&gt;.getOrThrow(): T = when (this) {\n    is Result.Success -&gt; data\n    is Result.Failure -&gt; throw error.toException()\n    is Result.Loading -&gt; throw IllegalStateException(\"Still loading\")\n}\n</code></pre>\n<h3>Sealed Interfaces for API Responses</h3>\n<pre><code>sealed interface ApiError {\n    val message: String\n\n    data class NotFound(override val message: String) : ApiError\n    data class Unauthorized(override val message: String) : ApiError\n    data class Validation(\n        override val message: String,\n        val field: String,\n    ) : ApiError\n    data class Internal(\n        override val message: String,\n        val cause: Throwable? = null,\n    ) : ApiError\n}\n\nfun ApiError.toStatusCode(): Int = when (this) {\n    is ApiError.NotFound -&gt; 404\n    is ApiError.Unauthorized -&gt; 401\n    is ApiError.Validation -&gt; 422\n    is ApiError.Internal -&gt; 500\n}\n</code></pre>\n<h2>Scope Functions</h2>\n<h3>When to Use Each</h3>\n<pre><code>// let: Transform nullable or scoped result\nval length: Int? = name?.let { it.trim().length }\n\n// apply: Configure an object (returns the object)\nval user = User().apply {\n    name = \"Alice\"\n    email = \"alice@example.com\"\n}\n\n// also: Side effects (returns the object)\nval user = createUser(request).also { logger.info(\"Created user: ${it.id}\") }\n\n// run: Execute a block with receiver (returns result)\nval result = connection.run {\n    prepareStatement(sql)\n    executeQuery()\n}\n\n// with: Non-extension form of run\nval csv = with(StringBuilder()) {\n    appendLine(\"name,email\")\n    users.forEach { appendLine(\"${it.name},${it.email}\") }\n    toString()\n}\n</code></pre>\n<h3>Anti-Patterns</h3>\n<pre><code>// Bad: Nesting scope functions\nuser?.let { u -&gt;\n    u.address?.let { addr -&gt;\n        addr.city?.let { city -&gt;\n            println(city) // Hard to read\n        }\n    }\n}\n\n// Good: Chain safe calls instead\nval city = user?.address?.city\ncity?.let { println(it) }\n</code></pre>\n<h2>Extension Functions</h2>\n<h3>Adding Functionality Without Inheritance</h3>\n<pre><code>// Good: Domain-specific extensions\nfun String.toSlug(): String =\n    lowercase()\n        .replace(Regex(\"[^a-z0-9\\\\s-]\"), \"\")\n        .replace(Regex(\"\\\\s+\"), \"-\")\n        .trim('-')\n\nfun Instant.toLocalDate(zone: ZoneId = ZoneId.systemDefault()): LocalDate =\n    atZone(zone).toLocalDate()\n\n// Good: Collection extensions\nfun &lt;T&gt; List&lt;T&gt;.second(): T = this[1]\n\nfun &lt;T&gt; List&lt;T&gt;.secondOrNull(): T? = getOrNull(1)\n\n// Good: Scoped extensions (not polluting global namespace)\nclass UserService {\n    private fun User.isActive(): Boolean =\n        status == Status.ACTIVE &amp;&amp; lastLogin.isAfter(Instant.now().minus(30, ChronoUnit.DAYS))\n\n    fun getActiveUsers(): List&lt;User&gt; = userRepository.findAll().filter { it.isActive() }\n}\n</code></pre>\n<h2>Coroutines</h2>\n<h3>Structured Concurrency</h3>\n<pre><code>// Good: Structured concurrency with coroutineScope\nsuspend fun fetchUserWithPosts(userId: String): UserProfile =\n    coroutineScope {\n        val userDeferred = async { userService.getUser(userId) }\n        val postsDeferred = async { postService.getUserPosts(userId) }\n\n        UserProfile(\n            user = userDeferred.await(),\n            posts = postsDeferred.await(),\n        )\n    }\n\n// Good: supervisorScope when children can fail independently\nsuspend fun fetchDashboard(userId: String): Dashboard =\n    supervisorScope {\n        val user = async { userService.getUser(userId) }\n        val notifications = async { notificationService.getRecent(userId) }\n        val recommendations = async { recommendationService.getFor(userId) }\n\n        Dashboard(\n            user = user.await(),\n            notifications = try {\n                notifications.await()\n            } catch (e: CancellationException) {\n                throw e\n            } catch (e: Exception) {\n                emptyList()\n            },\n            recommendations = try {\n                recommendations.await()\n            } catch (e: CancellationException) {\n                throw e\n            } catch (e: Exception) {\n                emptyList()\n            },\n        )\n    }\n</code></pre>\n<h3>Flow for Reactive Streams</h3>\n<pre><code>// Good: Cold flow with proper error handling\nfun observeUsers(): Flow&lt;List&lt;User&gt;&gt; = flow {\n    while (currentCoroutineContext().isActive) {\n        val users = userRepository.findAll()\n        emit(users)\n        delay(5.seconds)\n    }\n}.catch { e -&gt;\n    logger.error(\"Error observing users\", e)\n    emit(emptyList())\n}\n\n// Good: Flow operators\nfun searchUsers(query: Flow&lt;String&gt;): Flow&lt;List&lt;User&gt;&gt; =\n    query\n        .debounce(300.milliseconds)\n        .distinctUntilChanged()\n        .filter { it.length &gt;= 2 }\n        .mapLatest { q -&gt; userRepository.search(q) }\n        .catch { emit(emptyList()) }\n</code></pre>\n<h3>Cancellation and Cleanup</h3>\n<pre><code>// Good: Respect cancellation\nsuspend fun processItems(items: List&lt;Item&gt;) {\n    items.forEach { item -&gt;\n        ensureActive() // Check cancellation before expensive work\n        processItem(item)\n    }\n}\n\n// Good: Cleanup with try/finally\nsuspend fun acquireAndProcess() {\n    val resource = acquireResource()\n    try {\n        resource.process()\n    } finally {\n        withContext(NonCancellable) {\n            resource.release() // Always release, even on cancellation\n        }\n    }\n}\n</code></pre>\n<h2>Delegation</h2>\n<h3>Property Delegation</h3>\n<pre><code>// Lazy initialization\nval expensiveData: List&lt;User&gt; by lazy {\n    userRepository.findAll()\n}\n\n// Observable property\nvar name: String by Delegates.observable(\"initial\") { _, old, new -&gt;\n    logger.info(\"Name changed from '$old' to '$new'\")\n}\n\n// Map-backed properties\nclass Config(private val map: Map&lt;String, Any?&gt;) {\n    val host: String by map\n    val port: Int by map\n    val debug: Boolean by map\n}\n\nval config = Config(mapOf(\"host\" to \"localhost\", \"port\" to 8080, \"debug\" to true))\n</code></pre>\n<h3>Interface Delegation</h3>\n<pre><code>// Good: Delegate interface implementation\nclass LoggingUserRepository(\n    private val delegate: UserRepository,\n    private val logger: Logger,\n) : UserRepository by delegate {\n    // Only override what you need to add logging to\n    override suspend fun findById(id: String): User? {\n        logger.info(\"Finding user by id: $id\")\n        return delegate.findById(id).also {\n            logger.info(\"Found user: ${it?.name ?: \"null\"}\")\n        }\n    }\n}\n</code></pre>\n<h2>DSL Builders</h2>\n<h3>Type-Safe Builders</h3>\n<pre><code>// Good: DSL with @DslMarker\n@DslMarker\nannotation class HtmlDsl\n\n@HtmlDsl\nclass HTML {\n    private val children = mutableListOf&lt;Element&gt;()\n\n    fun head(init: Head.() -&gt; Unit) {\n        children += Head().apply(init)\n    }\n\n    fun body(init: Body.() -&gt; Unit) {\n        children += Body().apply(init)\n    }\n\n    override fun toString(): String = children.joinToString(\"\\n\")\n}\n\nfun html(init: HTML.() -&gt; Unit): HTML = HTML().apply(init)\n\n// Usage\nval page = html {\n    head { title(\"My Page\") }\n    body {\n        h1(\"Welcome\")\n        p(\"Hello, World!\")\n    }\n}\n</code></pre>\n<h3>Configuration DSL</h3>\n<pre><code>data class ServerConfig(\n    val host: String = \"0.0.0.0\",\n    val port: Int = 8080,\n    val ssl: SslConfig? = null,\n    val database: DatabaseConfig? = null,\n)\n\ndata class SslConfig(val certPath: String, val keyPath: String)\ndata class DatabaseConfig(val url: String, val maxPoolSize: Int = 10)\n\nclass ServerConfigBuilder {\n    var host: String = \"0.0.0.0\"\n    var port: Int = 8080\n    private var ssl: SslConfig? = null\n    private var database: DatabaseConfig? = null\n\n    fun ssl(certPath: String, keyPath: String) {\n        ssl = SslConfig(certPath, keyPath)\n    }\n\n    fun database(url: String, maxPoolSize: Int = 10) {\n        database = DatabaseConfig(url, maxPoolSize)\n    }\n\n    fun build(): ServerConfig = ServerConfig(host, port, ssl, database)\n}\n\nfun serverConfig(init: ServerConfigBuilder.() -&gt; Unit): ServerConfig =\n    ServerConfigBuilder().apply(init).build()\n\n// Usage\nval config = serverConfig {\n    host = \"0.0.0.0\"\n    port = 443\n    ssl(\"/certs/cert.pem\", \"/certs/key.pem\")\n    database(\"jdbc:postgresql://localhost:5432/mydb\", maxPoolSize = 20)\n}\n</code></pre>\n<h2>Sequences for Lazy Evaluation</h2>\n<pre><code>// Good: Use sequences for large collections with multiple operations\nval result = users.asSequence()\n    .filter { it.isActive }\n    .map { it.email }\n    .filter { it.endsWith(\"@company.com\") }\n    .take(10)\n    .toList()\n\n// Good: Generate infinite sequences\nval fibonacci: Sequence&lt;Long&gt; = sequence {\n    var a = 0L\n    var b = 1L\n    while (true) {\n        yield(a)\n        val next = a + b\n        a = b\n        b = next\n    }\n}\n\nval first20 = fibonacci.take(20).toList()\n</code></pre>\n<h2>Gradle Kotlin DSL</h2>\n<h3>build.gradle.kts Configuration</h3>\n<pre><code>// Check for latest versions: https://kotlinlang.org/docs/releases.html\nplugins {\n    kotlin(\"jvm\") version \"2.3.10\"\n    kotlin(\"plugin.serialization\") version \"2.3.10\"\n    id(\"io.ktor.plugin\") version \"3.4.0\"\n    id(\"org.jetbrains.kotlinx.kover\") version \"0.9.7\"\n    id(\"io.gitlab.arturbosch.detekt\") version \"1.23.8\"\n}\n\ngroup = \"com.example\"\nversion = \"1.0.0\"\n\nkotlin {\n    jvmToolchain(21)\n}\n\ndependencies {\n    // Ktor\n    implementation(\"io.ktor:ktor-server-core:3.4.0\")\n    implementation(\"io.ktor:ktor-server-netty:3.4.0\")\n    implementation(\"io.ktor:ktor-server-content-negotiation:3.4.0\")\n    implementation(\"io.ktor:ktor-serialization-kotlinx-json:3.4.0\")\n\n    // Exposed\n    implementation(\"org.jetbrains.exposed:exposed-core:1.0.0\")\n    implementation(\"org.jetbrains.exposed:exposed-dao:1.0.0\")\n    implementation(\"org.jetbrains.exposed:exposed-jdbc:1.0.0\")\n    implementation(\"org.jetbrains.exposed:exposed-kotlin-datetime:1.0.0\")\n\n    // Koin\n    implementation(\"io.insert-koin:koin-ktor:4.2.0\")\n\n    // Coroutines\n    implementation(\"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2\")\n\n    // Testing\n    testImplementation(\"io.kotest:kotest-runner-junit5:6.1.4\")\n    testImplementation(\"io.kotest:kotest-assertions-core:6.1.4\")\n    testImplementation(\"io.kotest:kotest-property:6.1.4\")\n    testImplementation(\"io.mockk:mockk:1.14.9\")\n    testImplementation(\"io.ktor:ktor-server-test-host:3.4.0\")\n    testImplementation(\"org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2\")\n}\n\ntasks.withType&lt;Test&gt; {\n    useJUnitPlatform()\n}\n\ndetekt {\n    config.setFrom(files(\"config/detekt/detekt.yml\"))\n    buildUponDefaultConfig = true\n}\n</code></pre>\n<h2>Error Handling Patterns</h2>\n<h3>Result Type for Domain Operations</h3>\n<pre><code>// Good: Use Kotlin's Result or a custom sealed class\nsuspend fun createUser(request: CreateUserRequest): Result&lt;User&gt; = runCatching {\n    require(request.name.isNotBlank()) { \"Name cannot be blank\" }\n    require('@' in request.email) { \"Invalid email format\" }\n\n    val user = User(\n        id = UserId(UUID.randomUUID().toString()),\n        name = request.name,\n        email = Email(request.email),\n    )\n    userRepository.save(user)\n    user\n}\n\n// Good: Chain results\nval displayName = createUser(request)\n    .map { it.name }\n    .getOrElse { \"Unknown\" }\n</code></pre>\n<h3>require, check, error</h3>\n<pre><code>// Good: Preconditions with clear messages\nfun withdraw(account: Account, amount: Money): Account {\n    require(amount.value &gt; 0) { \"Amount must be positive: $amount\" }\n    check(account.balance &gt;= amount) { \"Insufficient balance: ${account.balance} &lt; $amount\" }\n\n    return account.copy(balance = account.balance - amount)\n}\n</code></pre>\n<h2>Collection Operations</h2>\n<h3>Idiomatic Collection Processing</h3>\n<pre><code>// Good: Chained operations\nval activeAdminEmails: List&lt;String&gt; = users\n    .filter { it.role == Role.ADMIN &amp;&amp; it.isActive }\n    .sortedBy { it.name }\n    .map { it.email }\n\n// Good: Grouping and aggregation\nval usersByRole: Map&lt;Role, List&lt;User&gt;&gt; = users.groupBy { it.role }\n\nval oldestByRole: Map&lt;Role, User?&gt; = users.groupBy { it.role }\n    .mapValues { (_, users) -&gt; users.minByOrNull { it.createdAt } }\n\n// Good: Associate for map creation\nval usersById: Map&lt;UserId, User&gt; = users.associateBy { it.id }\n\n// Good: Partition for splitting\nval (active, inactive) = users.partition { it.isActive }\n</code></pre>\n<h2>Quick Reference: Kotlin Idioms</h2>\n<table>\n<thead>\n<tr>\n<th>Idiom</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>val</code> over <code>var</code></td>\n<td>Prefer immutable variables</td>\n</tr>\n<tr>\n<td><code>data class</code></td>\n<td>For value objects with equals/hashCode/copy</td>\n</tr>\n<tr>\n<td><code>sealed class/interface</code></td>\n<td>For restricted type hierarchies</td>\n</tr>\n<tr>\n<td><code>value class</code></td>\n<td>For type-safe wrappers with zero overhead</td>\n</tr>\n<tr>\n<td>Expression <code>when</code></td>\n<td>Exhaustive pattern matching</td>\n</tr>\n<tr>\n<td>Safe call <code>?.</code></td>\n<td>Null-safe member access</td>\n</tr>\n<tr>\n<td>Elvis <code>?:</code></td>\n<td>Default value for nullables</td>\n</tr>\n<tr>\n<td><code>let</code>/<code>apply</code>/<code>also</code>/<code>run</code>/<code>with</code></td>\n<td>Scope functions for clean code</td>\n</tr>\n<tr>\n<td>Extension functions</td>\n<td>Add behavior without inheritance</td>\n</tr>\n<tr>\n<td><code>copy()</code></td>\n<td>Immutable updates on data classes</td>\n</tr>\n<tr>\n<td><code>require</code>/<code>check</code></td>\n<td>Precondition assertions</td>\n</tr>\n<tr>\n<td>Coroutine <code>async</code>/<code>await</code></td>\n<td>Structured concurrent execution</td>\n</tr>\n<tr>\n<td><code>Flow</code></td>\n<td>Cold reactive streams</td>\n</tr>\n<tr>\n<td><code>sequence</code></td>\n<td>Lazy evaluation</td>\n</tr>\n<tr>\n<td>Delegation <code>by</code></td>\n<td>Reuse implementation without inheritance</td>\n</tr>\n</tbody>\n</table>\n<h2>Anti-Patterns to Avoid</h2>\n<pre><code>// Bad: Force-unwrapping nullable types\nval name = user!!.name\n\n// Bad: Platform type leakage from Java\nfun getLength(s: String) = s.length // Safe\nfun getLength(s: String?) = s?.length ?: 0 // Handle nulls from Java\n\n// Bad: Mutable data classes\ndata class MutableUser(var name: String, var email: String)\n\n// Bad: Using exceptions for control flow\ntry {\n    val user = findUser(id)\n} catch (e: NotFoundException) {\n    // Don't use exceptions for expected cases\n}\n\n// Good: Use nullable return or Result\nval user: User? = findUserOrNull(id)\n\n// Bad: Ignoring coroutine scope\nGlobalScope.launch { /* Avoid GlobalScope */ }\n\n// Good: Use structured concurrency\ncoroutineScope {\n    launch { /* Properly scoped */ }\n}\n\n// Bad: Deeply nested scope functions\nuser?.let { u -&gt;\n    u.address?.let { a -&gt;\n        a.city?.let { c -&gt; process(c) }\n    }\n}\n\n// Good: Direct null-safe chain\nuser?.address?.city?.let { process(it) }\n</code></pre>\n<p><strong>Remember</strong>: Kotlin code should be concise but readable. Leverage the type system for safety, prefer immutability, and use coroutines for concurrency. When in doubt, let the compiler help you.</p>\n","files":[{"path":"LICENSE","sizeBytes":1071,"isText":false},{"path":"SKILL.md","sizeBytes":18951,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-12-02T16:57:27.806829Z","sha256":"A3063B5794E45DCC3BB3D2D0BFFC2B763834CB3FB5D8E70865C854F243603095","sizeBytes":7272},"review":null,"source":{"repositoryUrl":"https://github.com/beginwithu/agent-skills","path":"skills/kotlin-patterns","license":"MIT","commit":"a960304c52212f2e845067047f5cefc0c594d787","subtreeSha":"A9407887EBACE33FE2DDD13351A69D7D5A736635323D56C529ED2B71EB29CFFC","lastSyncedAt":"2026-12-02T16:52:59.20206Z"},"reviewedAt":"2026-12-02T17:04:54.649493Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/beginwithu/agent-skills/tree/main/skills/kotlin-patterns"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install beginwithu-agent-skills@llmmart"},{"target":"git","command":"git clone https://github.com/beginwithu/agent-skills.git"}]}