kotlin-ktor-patterns

kotlin-ktor-patterns is a skill for Claude Code, Codex from hashgraph-online/awesome-codex-plugins. It costs 34 tokens per session (4,027 once invoked), scanned A, original, Apache-2.0.

A collection of Ktor patterns for building HTTP servers in Kotlin. Ktor is a Kotlin server framework for routes, web requests, authentication, WebSockets, and related application features.

In plain words
What is it for?
Use it to build REST APIs, configure authentication, CORS, error handling, and JSON responses, add dependency injection with Koin, support WebSockets, or write integration tests.
Why use it?
It gives a consistent structure for server configuration and common request-handling tasks. It also covers testing server applications with Ktor's test tools.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build REST APIs, configure authentication, CORS, error handling, and JSON responses, add dependency injection with Koin, support WebSockets, or write integration tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hashgraph-online/awesome-codex-plugins/kotlin-ktor-patterns
About the project

Awesome Codex Plugins is a curated catalogue and marketplace of installable plugins, skills, and related resources for OpenAI Codex and ChatGPT. It helps people find, create, validate, and submit extensions for Codex workflows across its app, command-line interface, and IDE extensions. The catalogue add-ons are the plugins, skills, agents, and hooks listed or supported by this project.

hashgraph-online/awesome-codex-plugins · 1,373 stars · on GitHub · hol.org

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add hashgraph-online/awesome-codex-plugins --skill kotlin-ktor-patterns
Clone the repo
git clone --depth 1 https://github.com/hashgraph-online/awesome-codex-plugins

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kotlin-ktor-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/hashgraph-online/awesome-codex-plugins/kotlin-ktor-patterns/github.svg)](https://agentmods.dev/skills/hashgraph-online/awesome-codex-plugins/kotlin-ktor-patterns)
Your own site
<a href="https://agentmods.dev/skills/hashgraph-online/awesome-codex-plugins/kotlin-ktor-patterns"><img src="https://agentmods.dev/badge/skills/hashgraph-online/awesome-codex-plugins/kotlin-ktor-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kotlin-ktor-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/hashgraph-online/awesome-codex-plugins/kotlin-ktor-patterns"><img src="https://agentmods.dev/badge/skills/hashgraph-online/awesome-codex-plugins/kotlin-ktor-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,027 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00034 $0.04027
Opus 5.5 $0.00014 $0.01611
Sonnet 5.5 $0.00007 $0.00805
Haiku 4.5 $0.00003 $0.00403

Measured 1mo ago against content hash 71982b984b91, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

kotlin-ktor-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

5 near-identical copies found in the catalogue:

plugins/Colin4k1024/tsp/skills/kotlin-ktor-patterns/SKILL.md · 690 lines

How it starts

The opening of the file, as written. The whole thing — 690 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Ktor Server Patterns

Comprehensive Ktor patterns for building robust, maintainable HTTP servers with Kotlin coroutines.

When to Activate

  • Building Ktor HTTP servers
  • Configuring Ktor plugins (Auth, CORS, ContentNegotiation, StatusPages)
  • Implementing REST APIs with Ktor
  • Setting up dependency injection with Koin
  • Writing Ktor integration tests with testApplication
  • Working with WebSockets in Ktor

Application Structure

Standard Ktor Project Layout

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
│   └── di/
│       └── AppModule.kt         # Koin modules
src/test/kotlin/
├── com/example/
│   ├── routes/
│   │   └── UserRoutesTest.kt
│   └── services/
│       └── UserServiceTest.kt

Application Entry Point

// Application.kt
fun main() {
    embeddedServer(Netty, port = 8080, module = Application::module).start(wait = true)
}

fun Application.module() {
    configureSerialization()
    configureAuthentication()
    configureStatusPages()
    configureCORS()
    configureDI()
    configureRouting()
}

Routing DSL

Basic Routes

// plugins/Routing.kt
fun Application.configureRouting() {
    routing {
        userRoutes()
        authRoutes()
        healthRoutes()
    }
}

// routes/UserRoutes.kt
fun Route.userRoutes() {
    val userService by inject<UserService>()

    route("/users") {
        get {
            val users = userService.getAll()
            call.respond(users)
        }

        get("/{id}") {
            val id = call.parameters["id"]
                ?: return@get call.respond(HttpStatusCode.BadRequest, "Missing id")
            val user = userService.getById(id)
                ?: return@get call.respond(HttpStatusCode.NotFound)
            call.respond(user)
        }

        post {
            val request = call.receive<CreateUserRequest>()
            val user = userService.create(request)
            call.respond(HttpStatusCode.Created, user)
        }

        put("/{id}") {
            val id = call.parameters["id"]
                ?: return@put call.respond(HttpStatusCode.BadRequest, "Missing id")
            val request = call.receive<UpdateUserRequest>()
            val user = userService.update(id, request)
                ?: return@put call.respond(HttpStatusCode.NotFound)
            call.respond(user)
        }

        delete("/{id}") {
            val id = call.parameters["id"]
                ?: return@delete call.respond(HttpStatusCode.BadRequest, "Missing id")
            val deleted = userService.delete(id)
            if (deleted) call.respond(HttpStatusCode.NoContent)
            else call.respond(HttpStatusCode.NotFound)
        }
    }
}

Read the full file on GitHub · 690 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 690 lines · 34 tokens per session scan A 71982b984b91

Subscribe to this mod's changes

kotlin-ktor-patterns is a skill published in the GitHub repository hashgraph-online/awesome-codex-plugins (1,373 stars, last pushed today), licensed Apache-2.0. It adds 34 tokens to every session and 4,027 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

Other skills, from other repositories

create-spring-boot-kotlin-project

Skill "create-spring-boot-kotlin-project" from boshi-xixixi/TraeSkill, covering create spring boot kotlin project prompt, check java version, download spring boot project template, unzip the downloaded file and remove the downloaded zip file.

boshi-xixixi/TraeSkill · 15 tokens

kotlin-springboot

Get best practices for developing applications with Spring Boot and Kotlin.

boshi-xixixi/TraeSkill · 18 tokens

swift-codable

Implement Swift Codable models for JSON and property-list encoding and decoding with JSONDecoder, JSONEncoder, CodingKeys, and custom init(from:) or encode(to:). Use when parsing API responses, remapping keys, flattening nested JSON, handling date or data decoding strategies, decoding heterogeneous arrays, or…

dpearson2699/swift-ios-skills · 76 tokens

go-gin-generator

Generate production-ready Go projects using the Gin framework with modern best practices, multiple templates, database integration, authentication, and comprehensive features for building scalable web applications and microservices.

kuku0922/awesome-ai-coding-enhance · 39 tokens

kotlin-ktor-patterns

Ktor server patterns including routing DSL, plugins, authentication, Koin DI, kotlinx.serialization, WebSockets, and testApplication testing. Use when building a Ktor server — routing, plugins, auth, DI, serialization, or tests.

userInner/SKILLS · 55 tokens

retrofit-kotlin

Expert guidance on configuring Retrofit + OkHttp + kotlinx.serialization for Kotlin Android — interceptors, auth refresh, retries, error mapping, and test doubles. Use this for any networking setup.

almasumdev/awesome-kotlin-android-agent-skills · 42 tokens