---
name: "ktor-asynchronous-kotlin-framework"
description: "Build lightweight, non-blocking asynchronous web servers and HTTP clients in Kotlin."
metadata:
  author: "JetBrains"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "write ktor server routing"
  - "contentnegotiation json ktor"
  - "ktor http client coroutines"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Ktor Asynchronous Kotlin Web Framework & Coroutines

Develops applications with JetBrains Ktor: configuring embeddedServer, routing DSL (get, post), ContentNegotiation with kotlinx.serialization, CallLogging, Authentication plugins, and Ktor HTTP client.

## When to Invoke
Invoke this skill whenever you need to:
- write ktor server routing
- contentnegotiation json ktor
- ktor http client coroutines

## Execution SOP & Rules
1. Start server: embeddedServer(Netty, port = 8080) { configureRouting(); configureSerialization() }.start(wait = true).
2. Install serialization: install(ContentNegotiation) { json() }.
3. Define routes: routing { get('/users/{id}') { val id = call.parameters['id']; call.respond(user) } }.
4. Handle client requests asynchronously: val response: HttpResponse = client.get('https://...').

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
