What problem does it solve? Setting up HTTP networking in Kotlin Multiplatform projects requires juggling per-platform engines, serialization config, token refresh logic, and testable architecture — and small misconfigurations (like missing encodeDefaults or mixed expectSuccess models) cause hours of debugging. This Skill provides a complete, consistent Ktor client setup that works across Android, iOS, Desktop, and Web. ## Core Features & Use Cases - Per-platform engine wiring: Select OkHttp, Darwin, CIO, or JS engines per source set with version catalog and Gradle dependency snippets. - Bearer auth with automatic refresh: Configure the Ktor Auth plugin with loadTokens, refreshTokens, and markAsRefreshTokenRequest() to handle 401s without infinite loops. - Repository-layer error mapping: Map ClientRequestException, ServerResponseException, and timeouts to domain DataError types, or use the sealed ApiResult<T> + safeRequest pattern for richer error surfaces. - MockEngine testing: Inject HttpClientEngine so tests reuse the production client factory with MockEngine for deterministic network tests. - Use Case: You're building a KMP app targeting Android and iOS and need a shared networking layer with token-based auth, JSON serialization, and unit tests — this Skill gives you the full client factory, service layer, DI setup (Koin or Hilt), and test patterns. ## Quick Start Set up a Ktor HttpClient for my KMP project with bearer token authentication, kotlinx.serialization, and a MockEngine test for the user repository.