Syntic

Skills may execute instructions and code that could affect your environment. Marketplace scans reduce risk but do not guarantee safety. Always review files, run your own security checks, and use at your own risk.

LanguagesFree Safe

Kotlin Specialist

Security Scan Summary

Status: Safe

Source: Syntic Skills registry

Automated security scan completed with no high-risk patterns detected. Manual review is still required.

About This Skill

Use when building Kotlin applications with coroutines, Ktor server framework, Kotlin Multiplatform, and idiomatic language patterns.

Downloadable SKILL.md

Download SKILL.md and place it in your Syntic skills folder. For Syntic Code, install in your local skills directory, review contents, and run in a controlled environment first. Acknowledge the risk notice above to enable the download.

SKILL.md
---
name: Kotlin Specialist
description: Use when building Kotlin applications with coroutines, Ktor server framework, Kotlin Multiplatform, and idiomatic language patterns.
category: Languages
version: 1.0.0
tools: []
---

# Idiomatic Kotlin Development

Write concise, safe, and expressive Kotlin code. Leverage Kotlin's type system, coroutines, and multiplatform capabilities to build applications without sacrificing clarity.

## Core Principles

- Prefer immutability: `val` over `var`, `List` over `MutableList`, `data class` for value types.
- Use null safety aggressively. The `!!` operator is a code smell. Use `?.let`, `?:`, or redesign to eliminate nullability.
- Extension functions are powerful but must be discoverable. Define them in files named after the type they extend.
- Adopt Kotlin idioms: scope functions, destructuring, sealed classes, delegation.

## Coroutines

- Use `suspend` functions for all asynchronous operations. Never block threads with `Thread.sleep` or `runBlocking` in production code.
- Tie `CoroutineScope` to lifecycle: `viewModelScope` (Android), `CoroutineScope(SupervisorJob())` (server).
- Use `async/await` for parallel independent operations. Use sequential `suspend` calls for dependent operations.
- Handle cancellation properly. Check `isActive` in long-running loops. Use `withTimeout` for deadline enforcement.
- Use `Flow` for reactive streams: `flow { emit(value) }`, `stateIn`, `shareIn` for shared state.

## Ktor Server

- Use the Ktor plugin system for modular server configuration: `install(ContentNegotiation)`, `install(Authentication)`.
- Define routes in extension functions on `Route` for clean separation: `fun Route.userRoutes() { ... }`.
- Use `call.receive<T>()` with kotlinx.serialization for type-safe request parsing.
- Implement structured error handling with `StatusPages` plugin and sealed class hierarchies for domain errors.
- Use Koin or Kodein for dependency injection. Ktor does not bundle a DI container.

## Kotlin Multiplatform

- Place shared business logic in `commonMain`. Platform-specific implementations in `androidMain`, `iosMain`, `jvmMain`.
- Use `expect/actual` declarations for platform-specific APIs: file system, networking, crypto.
- Use kotlinx.serialization for cross-platform JSON parsing. Use Ktor Client for cross-platform HTTP.
- Use SQLDelight for cross-platform database access with type-safe SQL queries.
- Keep the shared module dependency-light. Heavy platform SDKs belong in platform source sets.

## Idiomatic Patterns

- Use `sealed class` or `sealed interface` for type-safe state machines and result types.
- Use `data class` for DTOs and value objects. Use `value class` for type-safe wrappers around primitives.
- Use `when` expressions exhaustively with sealed types. The compiler enforces completeness.
- Use scope functions intentionally: `let` for null checks, `apply` for object configuration, `also` for side effects, `run` for transformations.
- Use delegation with `by` for property delegation (`by lazy`, `by Delegates.observable`) and interface delegation.

## Testing

- Use Kotest for BDD-style tests with `StringSpec`, `BehaviorSpec`, or `FunSpec`.
- Use MockK for mocking: `mockk<UserRepository>()`, `coEvery { ... }` for suspend function mocking.
- Use Turbine for testing Kotlin Flows: `flow.test { assertEquals(expected, awaitItem()) }`.
- Use Testcontainers for integration tests with real databases and message brokers.
- Test coroutines with `runTest` from `kotlinx-coroutines-test`. It advances virtual time automatically.

## Verification

- Compile and test all targets: `./gradlew build`.
- Run static analysis: `./gradlew detekt` for code smell detection.
- Run code formatting checks: `./gradlew ktlintCheck`.
- Verify no `!!` operators in production code.

Bundle Download

Includes SKILL.md and bundled support files where provided. Risk acknowledgement is required.

Install Targets

Syntic App

  1. 1. Create a dedicated folder for this skill in your local skills library.
  2. 2. Place SKILL.md into that folder.
  3. 3. Restart Syntic and invoke this skill on matching tasks.

Syntic Code (CLI)

  1. 1. Save SKILL.md in your local Syntic Code skills directory.
  2. 2. Keep related files in the same skill folder.
  3. 3. Run in a safe environment and validate outputs.

Source

https://github.com/rohitg00/awesome-claude-code-toolkit/blob/main/agents/language-experts/kotlin-specialist.md

Open Source Link
Languages

Related Skills