Skip to main content 홈 크리에이터 ajbcoding claude-skill-eval moai-lang-kotlin
moai-lang-kotlin Kotlin 2.0 Multiplatform Enterprise Development with KMP, Coroutines, Compose Multiplatform, and Context7 MCP integration. Advanced patterns for mobile, backend, and cross-platform development.
설치로 이동 Skills Marketplace 커뮤니티가 만든 AI 스킬을 발견하고 탐색하세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/AJBcoding/claude-skill-eval --skill moai-lang-kotlin명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Zip 다운로드 다운로드 중... 이 저장소의 다른 Skills Enterprise database architecture specialist with PostgreSQL 17, MySQL 8.4 LTS,
MongoDB 8.0, Redis 7.4 expertise. Master connection pooling, query optimization,
caching strategies, and database DevOps automation. Build scalable, resilient
database systems with comprehensive monitoring and disaster recovery.
Enterprise Frontend Development with AI-powered modern architecture, Context7 integration, and intelligent component orchestration for scalable user interfaces
Enterprise-grade security expertise with production-ready patterns for OWASP Top 10 2021, zero-trust architecture, threat modeling (STRIDE, PASTA), secure SDLC, DevSecOps automation, cloud security, cryptography, identity & access management, and compliance frameworks (SOC 2, ISO 27001, GDPR, CCPA).
name moai-lang-kotlin version 4.0.0 created 2025-10-22T00:00:00.000Z updated 2025-11-13T00:00:00.000Z status stable description Kotlin 2.0 Multiplatform Enterprise Development with KMP, Coroutines, Compose Multiplatform, and Context7 MCP integration. Advanced patterns for mobile, backend, and cross-platform development. keywords ["kotlin","kmp","coroutines","compose","android","multiplatform","enterprise","context7"] allowed-tools ["Read","Bash","mcp__context7__resolve-library-id","mcp__context7__get-library-docs"]
Lang Kotlin Skill - Enterprise v4.0.0
Skill Overview
Kotlin 2.0 Multiplatform enterprise development with advanced async patterns, KMP architecture, and Compose Multiplatform UI. This skill provides patterns for mobile, backend, and cross-platform development with full Context7 MCP integration for real-time documentation access.
Core Capabilities
✅ Kotlin 2.0 Multiplatform (KMP) enterprise architecture
✅ Advanced coroutines and structured concurrency patterns
✅ Compose Multiplatform UI development (Android, iOS, Web)
✅ Enterprise testing strategies with Kotest and MockK
✅ Context7 MCP integration for latest documentation
✅ Performance optimization and memory management
✅ Modern architecture patterns (MVI, Clean Architecture)
✅ Security best practices for production systems
Quick Reference
When to Use This Skill
Automatic activation :
Kotlin/KMP development discussions
Multiplatform project architecture and design
Mobile development with shared business logic
Async programming and coroutine patterns
Compose Multiplatform UI development
Manual invocation :
Design multiplatform architecture
Implement advanced async patterns
Optimize performance and memory usage
Review enterprise Kotlin code
Technology Stack (2025-11-13)
Component Version Purpose Status Kotlin 2.0.20 Core language Current Coroutines 1.8.0 Async programming Current Compose Multiplatform 1.6.10 UI framework Current Serialization 1.7.1 JSON/data serialization Current Ktor 2.3.12 HTTP client/server Current Android Gradle Plugin 8.5.0 Android build Current
Core Language Features
1. Null Safety & Type System Kotlin's null safety is a game-changer for enterprise development:
val name: String? = "John"
val length = name?.length ?: 0
@JvmInline
value class UserId (val value: String)
sealed class Result <T > {
data class Success <T >(val data : T) : Result<T>()
data class Error (val exception: Throwable) : Result<Nothing >()
}
Eliminates NullPointerException at compile time
Zero runtime overhead with inline classes
Type-safe domain models
2. Coroutines - Structured Concurrency Enterprise async patterns with built-in safety:
coroutineScope {
val result1 = async { fetchData("API1" ) }
val result2 = async { fetchData("API2" ) }
awaitAll(result1, result2)
}
withContext(Dispatchers.IO) {
val data = blockingIoCall()
}
supervisorScope {
launch { riskyOperation1() }
launch { riskyOperation2() }
}
Automatic cancellation and resource cleanup
Prevents memory leaks and zombie coroutines
Context-aware execution
3. Extension Functions & DSLs Powerful language extension without inheritance:
fun html (block: HtmlBuilder .() -> Unit ) : String {
val builder = HtmlBuilder()
builder.block()
return builder.build()
}
val page = html {
h1("Welcome" )
p("This is a paragraph" )
}
Multiplatform Architecture
Project Structure kmp-enterprise-app/
├── shared/
│ ├── src/
│ │ ├── commonMain/kotlin/
│ │ │ ├── domain/ # Business logic
│ │ │ ├── data/ # Data layer
│ │ │ └── presentation/ # State management
│ │ ├── androidMain/kotlin/
│ │ ├── iosMain/kotlin/
│ │ └── commonTest/kotlin/
├── androidApp/
├── iosApp/
└── webApp/
expect/actual Pattern
expect class PlatformDatabase {
suspend fun saveData (data : String ) : Result<Unit >
}
actual class PlatformDatabase {
actual suspend fun saveData (data : String ) = try {
room.insert(data )
Result.success(Unit )
} catch (e: Exception) {
Result.failure(e)
}
}
actual class PlatformDatabase {
actual suspend fun saveData (data : String ) = try {
coreData.save(data )
Result.success(Unit )
} catch (e: Exception) {
Result.failure(e)
}
}
Share business logic in commonMain
Isolate platform specifics in platform modules
Compile-time platform selection
Advanced Async Patterns
Flow - Reactive Streams
fun getUsersFlow () : Flow<User> = flow {
while (true ) {
val users = repository.fetchUsers()
emit(users)
delay(5000 )
}
}
getUsersFlow()
.map { it.copy(name = it.name.uppercase()) }
.filter { it.isActive }
.distinctUntilChanged()
.collect { updateUI(it) }
StateFlow - Mutable State class CounterViewModel {
private val _count = MutableStateFlow(0 )
val count: StateFlow<Int > = _count.asStateFlow()
fun increment () { _count.value++ }
fun decrement () { _count.value-- }
}
viewModel.count.collect { count ->
updateUI("Count: $count " )
}
Compose Multiplatform UI
Basic Components @Composable
fun UserListScreen (users: List <User >) {
Column(modifier = Modifier.fillMaxSize()) {
Text("Users" , style = MaterialTheme.typography.headlineLarge)
LazyColumn {
items(users) { user ->
UserCard(user)
}
}
}
}
@Composable
fun UserCard (user: User ) {
Card(modifier = Modifier.fillMaxWidth().padding(8. dp)) {
Column(modifier = Modifier.padding(16. dp)) {
Text(user.name, style = MaterialTheme.typography.titleMedium)
Text(user.email, color = Color.Gray)
}
}
}
Declarative UI
Reusable components
State management integration
Enterprise Patterns
Dependency Injection with Koin val appModule = module {
single { HttpClient() }
single { UserRepository(get ()) }
viewModel { UserListViewModel(get ()) }
}
val userService: UserService = get ()
Error Handling
suspend fun fetchData () : Result<String> = try {
Result.success(apiCall())
} catch (e: Exception) {
Result.failure(e)
}
fetchData()
.onSuccess { data -> updateUI(data ) }
.onFailure { error -> showError(error) }
Testing @Test
fun testAsync () = runTest {
val result = someAsyncFunction()
assertEquals("expected" , result)
}
@Test
fun testWithMock () {
val repo = mockk<Repository>()
coEvery { repo.fetch("1" ) } returns "data"
coVerify { repo.fetch("1" ) }
}
Context7 MCP Integration This skill integrates with Context7 for real-time access to official documentation:
Available Resources
Kotlin Language : /kotlin/kotlin
Coroutines : /kotlin/kotlinx.coroutines
KMP : /kotlin/kotlin.multiplatform
Compose : /jetbrains/compose-multiplatform
Ktor : /ktor/ktor
Serialization : /kotlin/kotlinx.serialization
Usage Example
val docs = mcp__context7__get-library-docs(
context7CompatibleLibraryID = "/kotlin/kotlinx.coroutines"
)
Performance Optimization
Memory Efficiency
Use Sequence for lazy evaluation :
(1. .1_000_000 ).asSequence()
.filter { it % 2 == 0 }
.map { it * 2 }
.toList()
Inline classes for zero-overhead :
@JvmInline
value class UserId (val value: String)
Primitive arrays instead of boxed :
val intArray = IntArray(1000 )
Execution Speed
Tail recursion :
tailrec fun factorial (n: Int , acc: Int = 1 ) : Int =
if (n <= 1 ) acc else factorial(n - 1 , n * acc)
Coroutine pooling (automatic with structured concurrency)
Best Practices
1. Always Use Structured Concurrency
coroutineScope {
val result = async { fetchData() }
}
GlobalScope.launch { fetchData() }
2. Null Safety Over Exceptions
val user = repository.findUser(id)
?.let { updateUI(it) }
?: showNotFound()
val user = repository.findUser(id)!!
3. Resource Management
File("data.txt" ).bufferedReader().use { reader ->
reader.readLines()
}
try {
} finally {
resource.close()
}
Security Considerations
Input Validation data class SecureUserInput (val email: String) {
init {
require(email.contains("@" )) { "Invalid email" }
require(email.length <= 254 ) { "Email too long" }
}
}
Secure Storage expect class SecureStorage {
suspend fun store (key: String , value: String )
suspend fun retrieve (key: String ) : String?
}
Network Security
val client = HttpClient {
install(Auth) {
bearer {
loadTokens { getBearerTokens() }
}
}
}
Testing Strategy Category Target Tools Unit Tests 80% Kotest, MockK, runTest Integration Tests 15% Kotest, testcontainers UI Tests 5% Compose Test
Works Well With
moai-foundation-trust (TRUST 5 quality gates)
moai-foundation-security (Enterprise security)
moai-foundation-testing (Testing strategies)
moai-cc-mcp-integration (MCP integration)
moai-essentials-debug (Debugging)
For Complete Information
Changelog
v4.0.0 (2025-11-13): Refactored to Progressive Disclosure with comprehensive examples.md and reference.md
v3.0.0 (2025-03-15): Added KMP and multiplatform patterns
v2.0.0 (2025-01-10): Basic Kotlin patterns and best practices
v1.0.0 (2024-12-01): Initial release