Agent skill · software engineering · affaan-m

kotlin-ktor-patterns

Ktor サーバーパターン(ルーティング DSL、プラグイン、認証、Koin DI、kotlinx.serialization、WebSocket、testApplication テストを含む)。

Why this skill is useful

Provides specific Ktor server patterns and integration examples that the AI wouldn't reliably generate on its own.

What it needs

Requires kotlin installed locally. About 6k tokens when loaded. Last updated 2026-08-06. 238,342 stars on the source repository.

What this skill does

Ktor サーバーパターン Kotlin コルーチンで堅牢かつ保守性の高い HTTP サーバーを構築するための包括的な Ktor パターン。 アクティベートするタイミング Ktor HTTP サーバーの構築 Ktor プラグインの設定(Auth、CORS、ContentNegotiation、StatusPages) Ktor を使用した REST API の実装 Koin を使用した依存性注入の設定 testApplication を使用した Ktor インテグレーションテストの作成 Ktor での WebSocket の使用 アプリケーション構造 標準的な Ktor プロジェクトレイアウト アプリケーションエントリーポイント ルーティング DSL 基本ルート 認証ルートを使用したルート整理 コンテントネゴシエーションとシリアライゼーション kotlinx.serialization セットアップ シリアライズ可能なモデル カスタムシリアライザー 認証 JWT 認証 認証ルート StatusPages(エラーハンドリング) CORS 設定 Koin 依存性注入 モジュール定義 ルートでの Koin の使用 テスト用の Koin リクエストバリデーション WebSocket testApplication テスト 基本的なルートテスト 認証ルートのテスト 設定 application.yaml 設定の読み取り クイックリファレンス: Ktor パターン パターン 説明 --------- ------ route("/path") { get { } } DSL を使用したルートグループ化 call.receive<T>() リクエストボディのデシリアライズ call.respond(status, body) ステータス付きレスポンスの送信 call.parameters["id"] パスパラメーターの読み取り call.request.queryParameters["q"] クエリパラメーターの読み取り install(Plugin) { } プラグインのインストールと設定 authenticate("name") { } 認証でルートを保護 by inject<T>() Koin 依存性注入 testApplication { } インテグレーションテスト 覚えておくこと: Ktor は Kotlin コルーチンと DSL を中心に設計されています。ルートをシンプルに保ち、ロジックはサービスに移し、依存性注入には Koin を使用してください。完全なインテグレーションカバレッジのために testApplication でテストしてください。

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills affaan-m/kotlin-ktor-patterns

View the source on GitHub

Browse the @skills marketplace