Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问clear审计提醒

moai-lang-kotlin摩艾朗科特林

Agent Skill

moai-lang-kotlin 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

196

周安装

8

GitHub Stars

61

下载量

63
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:moai-lang-kotlin(摩艾朗科特林)
来源仓库:https://github.com/modu-ai/cc-plugins
仓库路径:skills/moai-lang-kotlin
安装命令:
npx skills add https://github.com/modu-ai/cc-plugins --skill moai-lang-kotlin
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/modu-ai/cc-plugins --skill moai-lang-kotlin

简介

moai-lang-kotlin 用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词快速定位候选结果。
  • 通过 npx skills add 命令从 cc-plugins 仓库安装并使用。
  • 安装前建议确认权限范围和维护状态,注意是否会触发联网或命令执行。
  • 具体用法可结合来源仓库 README 进一步核验实际功能边界。

SKILL.md

Quick Reference (30 seconds)

Kotlin 2.0+ Expert - K2 compiler, coroutines, Ktor, Compose Multiplatform with Context7 integration.

Auto-Triggers: Kotlin files (.kt, .kts), Gradle Kotlin DSL (build.gradle.kts, settings.gradle.kts)

Core Capabilities:

  • Kotlin 2.0: K2 compiler, coroutines, Flow, sealed classes, value classes
  • Ktor 3.0: Async HTTP server/client, WebSocket, JWT authentication
  • Exposed 0.55: Kotlin SQL framework with coroutines support
  • Spring Boot (Kotlin): Kotlin-idiomatic Spring with WebFlux
  • Compose Multiplatform: Desktop, iOS, Web, Android UI
  • Testing: JUnit 5, MockK, Kotest, Turbine for Flow testing

Implementation Guide (5 minutes)

Kotlin 2.0 Features

Coroutines and Flow: Use coroutineScope with async for parallel operations. Create deferred values with async, then call await on each to get results. Combine results into data classes. For reactive streams, create flow blocks with emit calls inside while loops. Use delay for intervals and flowOn to specify dispatcher.

Sealed Classes and Value Classes: Define sealed interface with generic type parameter. Create data class implementations for success and data object for stateless cases like Loading. Use @JvmInline annotation with value class wrapping a primitive. Add init blocks with require for validation.

Ktor 3.0 Server

Application Setup: Call embeddedServer with Netty, port, and host parameters. Inside the lambda, call configuration functions for Koin, security, routing, and content negotiation. Call start with wait equals true.

For Koin configuration, install Koin plugin and define modules with single declarations for singletons. For security, install Authentication plugin and configure JWT with realm, verifier, and validate callback. For content negotiation, install ContentNegotiation with json configuration.

Routing with Authentication: Define routing function on Application. Inside routing block, use route for path prefixes. Create unauthenticated endpoints with post and call.receive for request body. Use authenticate block with verifier name for protected routes. Inside route blocks, define get endpoints with call.parameters for path/query params. Use call.respond with status code and response body.

Exposed SQL Framework

Table and Entity: Define object extending LongIdTable with table name. Declare columns with varchar, enumerationByName, and timestamp functions. Use uniqueIndex() and defaultExpression for defaults.

Create entity class extending LongEntity with companion object extending LongEntityClass. Declare properties with by syntax using table column references. Create toModel function to map entity to domain model.

Repository with Coroutines: Create repository implementation taking Database parameter. Implement suspend functions wrapping Exposed operations in dbQuery helper. Use findById for single entity lookup. Use Entity.new for inserts. Define private dbQuery function using newSuspendedTransaction with IO dispatcher.

Spring Boot with Kotlin

WebFlux Controller: Annotate class with @RestController and @RequestMapping. Create suspend functions for endpoints with @GetMapping and @PostMapping. Return Flow for collections using map to convert entities. Return ResponseEntity with status codes. Use @Valid for request validation.


Advanced Patterns

Compose Multiplatform

Shared UI Component: Create @Composable function taking ViewModel and callback parameters. Collect uiState as state with collectAsState. Use when expression on sealed state to show different composables for Loading, Success, and Error.

For list items, create Card composables with Modifier.fillMaxWidth and clickable. Use Row with padding, AsyncImage for avatars with CircleShape clip, and Column for text content with MaterialTheme.typography.

Testing with MockK

Create test class with mockk for dependencies. Initialize service with mock in declaration. Use @Test with runTest for coroutine tests. Use coEvery with coAnswers for async mocking with delay. Use assertThat for assertions. For Flow testing, use toList to collect emissions and assert on size and content.

Gradle Build Configuration

Use plugins block with kotlin("jvm") and kotlin("plugin.serialization") with version strings. Add id for ktor.plugin. Configure kotlin block with jvmToolchain. In dependencies block, add ktor server modules, kotlinx coroutines, exposed modules, and postgresql driver. Add test dependencies for mockk, coroutines-test, and turbine.


Context7 Integration

Library mappings for latest documentation:

  • /ktorio/ktor - Ktor 3.0 server/client documentation
  • /jetbrains/exposed - Exposed SQL framework
  • /JetBrains/kotlin - Kotlin 2.0 language reference
  • /Kotlin/kotlinx.coroutines - Coroutines library
  • /jetbrains/compose-multiplatform - Compose Multiplatform
  • /arrow-kt/arrow - Arrow functional programming

Usage: Call mcp__context7__get_library_docs with context7CompatibleLibraryID, topic string for specific areas, and tokens parameter for response size.


When to Use Kotlin

Use Kotlin When:

  • Developing Android applications (official language)
  • Building modern server applications with Ktor
  • Preferring concise, expressive syntax
  • Building reactive services with coroutines and Flow
  • Creating multiplatform applications (iOS, Desktop, Web)
  • Full Java interoperability required

Consider Alternatives When:

  • Legacy Java codebase requiring minimal changes
  • Big data pipelines (prefer Scala with Spark)

Works Well With

  • moai-lang-java - Java interoperability and Spring Boot patterns
  • moai-domain-backend - REST API, GraphQL, microservices architecture
  • moai-domain-database - JPA, Exposed, R2DBC patterns
  • moai-quality-testing - JUnit 5, MockK, TestContainers integration
  • moai-infra-docker - JVM container optimization

Troubleshooting

K2 Compiler: Add kotlin.experimental.tryK2=true to gradle.properties. Clear.gradle directory for full rebuild.

Coroutines: Avoid runBlocking in suspend contexts. Use Dispatchers.IO for blocking operations.

Ktor: Ensure ContentNegotiation is installed. Check JWT verifier configuration. Verify routing hierarchy.

Exposed: Ensure all DB operations run within transaction context. Be aware of lazy entity loading outside transactions.


Advanced Documentation

For comprehensive reference materials:

  • reference.md - Complete ecosystem, Context7 mappings, testing patterns, performance
  • examples.md - Production-ready code examples, Ktor, Compose, Android patterns

Last Updated: 2026-01-11 Status: Production Ready (v1.1.0)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

30.51%
按下载量换算19

windsurf

22.93%
按下载量换算14

trae

19.56%
按下载量换算12

OpenCode

12.21%
按下载量换算8

Codex

7.73%
按下载量换算5

Antigravity

3.67%
按下载量换算2

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills