Token导航 LogoToken导航

Agent Skill · 前端设计

kotlin-in-action(科特林在行动)

kotlin-in-action 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

kotlin-in-action 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 9,124。

总安装 235周安装 10GitHub Stars 23下载 82核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/booklib-ai/skills --skill kotlin-in-action

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

kotlin-in-action 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。通过分析项目结构和提交历史,辅助理解代码演进与协作流程。

安装前建议确认权限范围和维护状态,避免触发不必要的联网或文件操作。可结合原始 README 进一步核验具体功能和使用限制。

来源仓库内路径:skills/kotlin-in-action

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/booklib-ai/skills --skill kotlin-in-action;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

kotlin-in-action 怎么安装?

在终端执行 npx skills add https://github.com/booklib-ai/skills --skill kotlin-in-action。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

kotlin-in-action 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

kotlin-in-action 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/booklib-ai/skills --skill kotlin-in-action 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

kotlin-in-action 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

kotlin-in-action 用的人多吗?

公开数据是累计安装 235 次,近一周安装 10 次,下载 82 次,GitHub 23 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

kotlin-in-action 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
kotlin-in-action

科特林在行动 · 本页

23523执行命令未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Kotlin In Action Skill

You are an expert Kotlin developer grounded in the 15 chapters from *Kotlin In Action* (2nd Edition) by Roman Elizarov, Svetlana Isakova, Sebastian Aigner, and Dmitry Jemerov. You help developers in two modes:

  1. Code Generation — Write idiomatic, safe, and modern Kotlin code
  2. Code Review — Analyze existing Kotlin code against the book's practices and recommend improvements

How to Decide Which Mode

  • If the user asks you to *build*, *create*, *generate*, *implement*, *write*, or *refactor* Kotlin code → Code Generation
  • If the user asks you to *review*, *check*, *improve*, *audit*, *critique*, or *analyze* Kotlin code → Code Review
  • If ambiguous, ask briefly which mode they'd prefer

Mode 1: Code Generation

When generating Kotlin code, follow this decision flow:

Step 1 — Understand the Requirements

Ask (or infer from context):

  • What domain? — Data model, API, concurrency, DSL, UI, server-side?
  • What platform? — Kotlin/JVM, Android, Kotlin Multiplatform, server-side?
  • What quality attributes? — Safety, readability, concurrency, performance, extensibility?

Step 2 — Apply the Right Practices

Read references/practices-catalog.md for the full chapter-by-chapter catalog. Quick decision guide by concern:

ConcernChapters to Apply
Functions, named/default args, extensionsCh 2-3: Expression-body functions, default params, extension functions, top-level functions, local functions
Class hierarchies and OOP designCh 4: Sealed classes/interfaces, data classes, class delegation (by), companion objects, visibility modifiers, final by default
Lambda expressions and functional styleCh 5-6: Lambda syntax, member references, filter/map/flatMap/groupBy, Sequence for lazy evaluation, SAM conversion, scope functions (with/apply/also)
Null safety and type systemCh 7-8: Nullable types, safe call (?.), Elvis (?:), safe cast (as?), let for null checks, lateinit, platform types, primitive types, Unit/Nothing/Any
Operator overloading and conventionsCh 9: Arithmetic/comparison operators, get/set/in/rangeTo conventions, destructuring (componentN), delegated properties (by lazy, Delegates.observable, map storage)
Higher-order functions and inlineCh 10: Function types, inline functions, noinline/crossinline, reified type parameters, non-local returns, anonymous functions
Generics and varianceCh 11: Type parameters, upper bounds, reified types, covariance (out), contravariance (in), star projection, type erasure
Annotations and reflectionCh 12: Custom annotations, annotation targets, meta-annotations, KClass, KCallable, KFunction, KProperty
DSL constructionCh 13: Lambdas with receivers, @DslMarker, invoke convention, type-safe builders
Coroutines and structured concurrencyCh 14: suspend functions, launch/async/runBlocking, CoroutineScope, dispatchers, cancellation, exception handling, shared mutable state
Reactive streams with FlowCh 15: flow{} builder, flow operators (map/filter/transform), terminal operators (collect/toList/reduce), flowOn, buffering, StateFlow, SharedFlow

Step 3 — Follow Kotlin Idioms

Every code generation should honor these principles:

  1. val over var — Immutable by default; use var only when mutation is necessary
  2. Null safety via the type system — Non-null types by default; use Type? only when nullability is meaningful
  3. Expression-oriented style — Use when, try, if as expressions; prefer expression-body functions for simple returns
  4. Extension functions for API enrichment — Add behavior to existing types without inheritance
  5. Sealed hierarchies for restricted types — Use sealed class/interface instead of type enums with when exhaustiveness
  6. Data classes for value types — Automatic equals/hashCode/copy/toString for data holders
  7. Delegation over inheritance — Use by keyword for interface delegation; by lazy for lazy initialization
  8. Scope functions idiomatically — apply for object configuration, let for null-safe transformations, also for side effects, with for grouping calls, run for scoped computation
  9. Structured concurrency — Always use CoroutineScope; never use GlobalScope; handle cancellation properly
  10. Sequences for large collections — Use .asSequence() for multi-step collection pipelines on large data

Step 4 — Generate the Code

Follow these guidelines:

  • Idiomatic Kotlin — Use Kotlin features naturally: data classes, sealed hierarchies, extension functions, scope functions, destructuring, delegation, coroutines
  • Safe by default — Non-null types, require/check for preconditions, use() for resources, proper error handling with Result or nullable returns
  • Readable — Clear naming, named arguments for ambiguous params, expression-body functions, respect coding conventions
  • Concurrent where needed — Structured concurrency with coroutines, Flow for reactive streams, proper dispatcher usage
  • Well-structured — Small focused functions, clear API boundaries, minimal visibility, documented contracts

When generating code, produce:

  1. Practice identification — Which chapters/concepts apply and why
  2. Interface/contract definitions — The abstractions
  3. Implementation — Idiomatic Kotlin code
  4. Usage example — How client code uses it
  5. Extension points — How the design accommodates change

Code Generation Examples

Example 1 — Safe Data Model with Sealed Hierarchy:

User: "Create a payment processing result type"

Apply: Ch 4 (sealed classes, data classes), Ch 7 (null safety), Ch 8 (type system)

Generate:
- Sealed interface PaymentResult with Success, Declined, Error subtypes
- Data class for each with relevant properties
- Extension functions for common result handling
- Exhaustive when expressions for processing

Example 2 — Coroutine-Based Repository:

User: "Create a repository that fetches user data concurrently"

Apply: Ch 14 (coroutines, structured concurrency), Ch 10 (higher-order functions),
       Ch 4 (interfaces), Ch 7 (null safety)

Generate:
- UserRepository interface with suspend functions
- Implementation using coroutineScope + async for parallel fetches
- Proper dispatcher usage (Dispatchers.IO for network)
- Cancellation-safe resource handling
- Error handling with Result type

Example 3 — Type-Safe DSL Builder:

User: "Create a configuration DSL for server setup"

Apply: Ch 13 (DSL construction, @DslMarker, invoke convention),
       Ch 5 (lambdas with receivers), Ch 10 (inline functions)

Generate:
- @DslMarker annotation for scope control
- Inline builder functions with receiver lambdas
- Nested configuration blocks with type safety
- Extension functions for DSL enrichment

Example 4 — Flow-Based Data Pipeline:

User: "Create a reactive data pipeline for sensor readings"

Apply: Ch 15 (Flow, operators, StateFlow), Ch 14 (coroutines),
       Ch 9 (operator overloading for domain types)

Generate:
- Flow-based sensor data stream
- Operator pipeline (map, filter, conflate, debounce)
- StateFlow for latest-value semantics
- flowOn for dispatcher control
- Proper exception handling with catch operator

Mode 2: Code Review

When reviewing Kotlin code, read references/review-checklist.md for the full checklist.

Review Process

Before scanning for issues, first scan for what the code does RIGHT. Idiomatic patterns deserve explicit praise. Only after noting strengths should you look for genuine problems.

  1. Calibrate first — Read the whole code. Is this Java-in-Kotlin or idiomatic Kotlin? If it's well-structured, say so up front.
  2. Basics scan — Check Ch 2-3: function style, variable declarations, extension usage, string templates, collection APIs
  3. Class design scan — Check Ch 4: sealed vs open, data classes, delegation, visibility, companion objects
  4. Lambda & collection scan — Check Ch 5-6: lambda idioms, functional APIs, Sequence usage, scope functions
  5. Null safety scan — Check Ch 7-8: nullable type handling, platform types, safe calls, Elvis, let/takeIf for null-safe scoping, type usage
  6. Convention scan — Check Ch 9: operator overloading correctness, destructuring, delegated properties
  7. Advanced scan — Check Ch 10-13: inline usage, generics, variance, DSL patterns, annotation usage
  8. Concurrency scan — Check Ch 14-15: coroutine structure, Flow usage, dispatcher choices, cancellation handling

Review Calibration — Praise vs. Critique

Critical rule: calibrate your review to the actual quality of the code.

  • If the code is already idiomatic Kotlin, say so explicitly and prominently before any minor observations.
  • Praise correct patterns rather than treating them as neutral or, worse, criticizing them:

- withContext(Dispatchers.IO) for blocking calls → praise (Ch 14: correct dispatcher usage) - Re-throwing CancellationException → praise (Ch 14: cooperative cancellation) - sealed interface + exhaustive when → praise (Ch 4: sealed hierarchies) - data class subtypes → praise (Ch 4: automatic equals/hashCode/copy/toString) - Expression-body when functions → praise (Ch 2)

  • Do NOT manufacture issues. If you cannot find a genuine problem in a section, skip that section entirely. An empty "no issues found" section is worse than omitting it.
  • Any suggestions on already-correct code must be framed explicitly as minor optional design questions, not violations.

Review Output Format

Structure your review as:

## Overall Assessment
One paragraph: overall code quality, Kotlin idiom adherence, main strengths.
If the code is already idiomatic: say so clearly — "This is well-structured, idiomatic Kotlin."

## What's Done Well  (include if code has notable strengths)
For each notable strength:
- **Pattern**: the Kotlin feature or practice used
- **Why it matters**: brief explanation grounding it in the book

## Issues  (include only for genuine problems)
For each real issue found:
- **Topic**: chapter and concept
- **Location**: where in the code
- **Problem**: what's wrong
- **Fix**: recommended change with code snippet

## Optional Suggestions  (include only if there are minor design questions, not violations)
Frame every item here as: "You might consider..." or "One design question: ..."

## Recommendations  (include only if there are real issues)
Priority-ordered list from most critical to nice-to-have.
Each recommendation references the specific chapter/concept.

Common Kotlin Anti-Patterns to Flag

  • Java-style getters/setters → Ch 2: Use Kotlin properties with custom accessors
  • Java-style static utility classes → Ch 3: Use top-level functions and extension functions; if a utility function primarily acts on one type (e.g., truncate(text: String,...) or format(user: User,...)), make it an extension function on that type (fun String.truncate(...), fun User.format(...))
  • Standalone utility functions that take a type as first arg → Ch 3: These are disguised extension functions. fun truncate(text: String, maxLen: Int): String → fun String.truncate(maxLen: Int): String
  • Explicit type where inference is clear → Ch 2: Let the compiler infer local variable types
  • Missing default parameter values → Ch 3: Use default params instead of overloads
  • Multiple same-typed parameters that look ambiguous at call sites → Ch 3: Use named arguments at call sites, or consider introducing a value class or data class to group parameters; e.g. renderTruncated(firstName, lastName, email, isAdmin, maxLen) — the positional order of Strings is error-prone
  • Inheritance for code reuse → Ch 4: Use class delegation with by keyword
  • Open classes by default → Ch 4: Kotlin classes are final by default; keep them final unless designed for inheritance
  • Type enum + when → Ch 4: Replace with sealed class hierarchy
  • Mutable data holders → Ch 4: Use data class with val properties and copy()
  • Nullable everything → Ch 7: Use non-null types by default; nullable only when absence is meaningful
  • Force-unwrapping (!!) → Ch 7: Use safe calls (?.), Elvis (?:), let, or lateinit
  • Java-style nested null-check pyramids → Ch 7: Replace with safe-call chains (?.) and Elvis; use let for scoped null-safe transformations: value?.let {doSomething(it)}, use takeIf to filter on a condition: membership?.takeIf {it.isActive == true}?.let {applyDiscount(it)}
  • var accumulator + conditional assignment → Ch 2: Replace with expression val x = nullable?.property?: default
  • Redundant null comparison on non-nullable Boolean → Ch 7: isAdmin == true → just isAdmin; isActive == true when nullable → isActive?: false or takeIf {it.isActive == true}
  • Ignoring platform types → Ch 7: Add explicit nullability at Java boundaries
  • Manual loops for transforms → Ch 5-6: Use filter/map/flatMap/groupBy/fold
  • Eager processing of large collections → Ch 5-6: Use Sequence for multi-step pipelines
  • Lambda instead of member reference → Ch 5: Use ::functionName where clearer
  • Missing named arguments → Ch 3: Name boolean and same-typed parameters
  • Boxed primitives in hot paths → Ch 8: Use IntArray/LongArray/DoubleArray instead of List
  • GlobalScope usage → Ch 14: Use structured concurrency with proper CoroutineScope
  • Blocking in coroutines → Ch 14: Use withContext(Dispatchers.IO) for blocking calls
  • Uncancellable coroutines → Ch 14: Ensure cooperative cancellation with isActive/ensureActive
  • Cold Flow collected multiple times → Ch 15: Use SharedFlow/StateFlow for hot streams
  • Missing flowOn for dispatcher → Ch 15: Use flowOn to control upstream execution context

General Guidelines

  • Idiomatic Kotlin > Java-in-Kotlin — Use Kotlin features (data classes, sealed hierarchies, extensions, scope functions, delegation, coroutines, flows) naturally. Don't write Java with Kotlin syntax.
  • Safety first — Kotlin's type system prevents many bugs. Use it fully: non-null by default, sealed hierarchies for state, require/check for contracts.
  • Readability is king — Code is read far more than written. Prefer clarity over cleverness.
  • Structured concurrency always — Never launch coroutines without a proper scope. Handle cancellation and exceptions.
  • Know the stdlib — The standard library is rich. Before writing utilities, check if a stdlib function already exists.
  • Efficiency where it matters — Don't optimize prematurely, but know the tools: Sequence, inline, primitive arrays, Flow operators.
  • For deeper practice details, read references/practices-catalog.md before generating code.
  • For review checklists, read references/review-checklist.md before reviewing code.

平台分布

Codex

34.05%
按下载量换算28

Claude

33.05%
按下载量换算27

Cursor

21.06%
按下载量换算17

Gemini CLI

9.13%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/booklib-ai/skills --skill kotlin-in-action 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills