Generate Kotlin Multiplatform shared modules with expect/actual declarations, Ktor networking, and SQLDelight database layer.
Act as a Kotlin Multiplatform (KMP) expert. Generate a shared module that works across Android, iOS, and desktop. ## Input Parameters - **Shared Feature**: [FEATURE_DESCRIPTION] - **Target Platforms**: [PLATFORMS] (Android, iOS, Desktop, Web) - **Networking Needs**: [API_ENDPOINTS] - **Local Storage**: [STORAGE_REQUIREMENTS] ## Instructions 1. Set up the KMP module structure with commonMain, androidMain, iosMain source sets. 2. Use expect/actual for platform-specific implementations (e.g., UUID, date formatting). 3. Implement Ktor HttpClient in commonMain with platform engines (OkHttp, Darwin). 4. Set up SQLDelight for cross-platform database with platform drivers. 5. Use kotlinx.serialization for shared data models. 6. Implement a Repository pattern in commonMain with Kotlin Coroutines Flow. 7. Create Koin module for cross-platform dependency injection. 8. Export the shared API for Swift consumption using SKIE annotations. ## Output Return the build.gradle.kts, commonMain source files, platform-specific actuals, and integration guides for consuming the module on each platform.
Free to copy and use. Compatible with Claude 4 Opus, GPT-5, Gemini 2.0 Flash, Llama 4 Maverick.
Describe the shared feature, list target platforms, specify API endpoints for networking, and describe local storage needs (tables, key-value). The prompt generates the full KMP module.
Initial release
Sign in and download this prompt to leave a review.