Install any skill in seconds. Free to start, no credit card required.
Get Started Free →loulanyue/kotlin-ktor-patterns
Ktor server patterns including routing DSL, plugins, authentication, Koin DI, kotlinx.serialization, WebSockets, and testApplication testing.
Passed 21 of 22 test cases with the skill, and 19 of 22 without it.
2 fixed19 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
I'm building a Kotlin backend with Ktor and want to set up centralized exception handling across all endpoints. Could you write a Ktor configuration function using StatusPages that catches common runtime errors (like invalid request payloads, bad arguments, missing entities, and auth failures) and maps them to a consistent JSON error wrapper? Please show both the error configuration code and the standard API response data model.
| Checked | Without skill | With skill |
|---|---|---|
| Defines an ApiResponse data model containing success, data, and error fields. | Missed | Passed |
| Configures StatusPages exception handlers using ApiResponse.error for response wrapping. | Missed | Passed |
The instructions your model reads when the skill loads.
Comprehensive Ktor patterns for building robust, maintainable HTTP servers with Kotlin coroutines.
src/main/kotlin/
├── com/example/
│ ├── Application.kt # Entry point, module configuration
│ ├── plugins/
│ │ ├── Routing.kt # Route definitions
│ │ ├── Serialization.kt # Content negotiation setup
│ │ ├── Authentication.kt # Auth configuration
│ │ ├── StatusPages.kt # Error handling
│ │ └── CORS.kt # CORS configuration
│ ├── routes/
│ │ ├── UserRoutes.kt # /users endpoints
│ │ ├── AuthRoutes.kt # /auth endpoints
│ │ └── HealthRoutes.kt # /health endpoints
│ ├── models/
│ │ ├── User.kt # Domain models
│ │ └── ApiResponse.kt # Response envelopes
│ ├── services/
│ │ ├── UserService.kt # Business logic
│ │ └── AuthService.kt # Auth logic
│ ├── repositories/
│ │ ├── UserRepository.kt # Data access interface
│ │ └── ExposedUserRepository.kt
test cases passed, vs 19 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.