What problem does it solve?
This Skill solves the challenge of designing maintainable Ktor server applications by providing a cohesive set of practical patterns for routing, plugins, DI, serialization, auth, error handling, WebSockets, and integration testing.
Core Features & Use Cases
- Routing DSL & Route Organization: Define grouped REST endpoints (including authenticated sub-routes) using Ktor’s routing DSL for clean structure.
- Ktor Plugins Setup: Configure ContentNegotiation with kotlinx.serialization, JWT authentication, StatusPages-based error handling, and CORS for production-friendly defaults.
- Koin Dependency Injection: Wire repositories and services via Koin modules and use inject() directly inside routes, including test-friendly module swapping.
- WebSockets Support: Add WebSocket endpoints with connection management and broadcast-style message handling.
- testApplication Integration Testing: Validate endpoints (including protected routes) using Ktor’s testApplication with deterministic client setup.
Quick Start
Ask the assistant to generate a complete Ktor module layout for an HTTP API using routing DSL, JWT auth, StatusPages, CORS, Koin DI, kotlinx.serialization, plus a small testApplication-based integration test suite.