Kotlin Backend Patterns

Use when the user asks about Koin DI, MockK tests, runTest coroutine testing, Kotlin repository and service layers, DTO mapping with extension functions or sealed error hierarchies. Produces Kotlin backend pattern code. Not for Ktor app structure (use kotlin-architecture) or Android (use android).

45 stars 6 forksMobile Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add j4flmao/agent-skills --skill kotlin-backend-patterns
Manual install
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/skills/backend/kotlin/patterns ~/.claude/skills/kotlin-backend-patterns

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Kotlin Backend Patterns

## Purpose
Standardize common Kotlin backend implementation patterns: repository, service, DTO mapping, dependency injection, and testing.

## Agent Protocol

### Trigger
User request includes: `kotlin pattern`, `repository kotlin`, `service layer kotlin`, `koin setup`, `mockk testing`, `kotlin di`, `coroutine pattern`, `kotlin testing`.

### Input Context
- Framework (Ktor, Spring WebFlux, http4k)
- DI framework (Koin, Kodein, Spring)
- Test framework (kotlin.test, MockK)
- Serialization approach (kotlinx.serialization, Jackson)

### Output Artifact
A markdown document containing:
- Repository pattern with coroutines
- Service layer abstraction
- DTO / domain mapping
- DI module wiring
- Unit test examples with MockK
- Integration test patterns

### Response Format
Produce the artifact directly. No preamble, no postamble, no explanations. No filler, no hedging. Compress output.

### Completion Criteria
- Repository abstracted behind interface for testability
- Service layer contains business logic
- DI modules scoped correctly
- Tests cover success, error, and edge cases
- Coroutine dispatchers overridable in tests

### Max Response Length
4096 tokens

## Workflow

### Step 1: Repository Pattern
Read the full skill on GitHub

Details

Skill name
kotlin-backend-patterns
Path
skills/backend/kotlin/patterns/SKILL.md
License
MIT
Repo updated
17 November 2026

FAQ

What does the Kotlin Backend Patterns skill do?

Use when the user asks about Koin DI, MockK tests, runTest coroutine testing, Kotlin repository and service layers, DTO mapping with extension functions or sealed error hierarchies. Produces Kotlin backend pattern code. Not for Ktor app structure (use kotlin-architecture) or Android (use android).

How do I install the Kotlin Backend Patterns skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add j4flmao/agent-skills --skill kotlin-backend-patterns. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Kotlin Backend Patterns popular?

It lives in j4flmao/agent-skills, which has 45 GitHub stars and 6 forks.

Related skills

Agent Observability

45

j4flmao/agent-skills

Use when the user asks about agent observability, tracing agent reasoning, debugging an agent loop, OpenTelemetry GenAI spans for LLM calls, LLM cost tracking per agent, agent audit logs or hallucination/eval monitoring in production. Produces instrumentation config, trace schema, dashboards, alerts and cost attribution. Not for generic service tracing without LLMs (use devops-opentelemetry).

DevOps & Cloud

AI Agent Architectures

45

j4flmao/agent-skills

Use when the user asks to build an AI agent, design an agent that calls tools and keeps memory, write an agent system prompt or pick an agent framework (Claude Agent SDK, OpenAI Agents SDK, LangGraph). Produces an architecture brief covering loop, tools, memory, guardrails and evals, routing depth to child skills. Not for workflow patterns (use ai-agentic-workflows).

AI, LLMs & Agents

AI Agent Core Loop

45

j4flmao/agent-skills

Use when the user asks about the agent loop, ReAct vs plan-and-solve, re-planning, Reflexion, an agent stuck in a loop, max iterations or termination conditions. Produces a loop spec or patch with state, success predicate, caps and no-progress detection. Not for overall agent design (use ai-agent-architectures) or tool schemas (use tool-calling-principles).

AI, LLMs & Agents

Vapor Backend

45

j4flmao/agent-skills

Use when the user asks about Vapor, server-side Swift, Fluent ORM and migrations, Vapor middleware, Vapor WebSocket or Vapor Queues. Produces async/await Vapor 4 services with tests. Not for iOS apps (use ios).

Mobile Development

Kotlin Architecture

45

j4flmao/agent-skills

Use when the user asks about Ktor, Kotlin backend architecture, Ktor plugins and routing, coroutine scopes in a server, StatusPages error handling or http4s/Spring WebFlux with Kotlin. Produces a Kotlin service layout with structured concurrency. Not for repository/DI/MockK recipes (use kotlin-backend-patterns).

Mobile Development

Android Order

33

dvcrn/openclaw-skills-marketplace

Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).

Mobile Development17

Browse the most popular Claude skills, all mobile development skills, or write your own with the skills generator.