Install
$ agentstack add skill-pledgeandgrow-pledge-skills-kotlin ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Kotlin Expert (v2.4.0)
Official Documentation: https://kotlinlang.org/docs/home.html
Quick Reference
| Topic | File | |-------|------| | Variables, basic types, strings, control flow, ranges, when | basics-syntax.md | | Functions, named args, defaults, lambdas, function types, inline | functions-lambdas.md | | Classes, constructors, properties, inheritance, interfaces, data/sealed/enum classes, objects | classes-objects.md | | List, Set, Map, sequences, collection operations, functional API | collections.md | | Nullable types, safe calls, Elvis, smart casts, not-null assertion | null-safety.md | | Suspending functions, launch, async, Flow, StateFlow, channels, dispatchers | coroutines.md | | Variance, reified type parameters, star projections, type bounds | generics.md | | DSLs, type-safe builders, scope functions, extension functions, delegation | dsl-builders.md | | Kotlin Multiplatform (KMP), expect/actual, platform-specific code, sharing logic | multiplatform.md | | @Serializable, JSON, ProtoBuf, polymorphism, custom serializers | serialization.md | | Java interop, migration guides, Kotlin/Java differences, JSpecify | java-interop.md | | JUnit 5, assertions, parameterized tests, coroutine testing, mocking | testing.md | | Gradle, Kotlin Gradle Plugin, Maven, compiler options, KSP | build-tools.md | | Idiomatic Kotlin patterns, coding conventions, best practices | idioms-best-practices.md | | Kotlin 2.4.0 features, language changes, stdlib additions, migration | whats-new.md | | Reflection, KClass, callable references, property/constructor references | reflection.md | | Exceptions, try-catch-finally, precondition functions, Nothing type, custom exceptions | exceptions.md | | Annotations, use-site targets, @Target, @Retention, @Repeatable, Java annotations | annotations.md | | Type checks (is/!is), smart casts, as/as?, structural vs referential equality, floating-point | type-casts-equality.md |
Core Philosophy
Kotlin is a modern, concise, multiplatform programming language that is fully interoperable with Java. Key principles:
- Conciseness — reduce boilerplate with data classes, type inference, smart casts
- Safety — null safety at compile time, no NPEs by default, immutable by default (
val) - Interoperability — seamless Java interop, usable on JVM, JS, Native, Wasm
- Tooling — first-class IDE support (IntelliJ IDEA), excellent compiler diagnostics
- Multiplatform — share business logic across iOS, Android, web, backend, desktop
- Coroutines — structured concurrency with lightweight threads (suspending functions)
- DSL-friendly — extension functions, infix, lambda receivers enable type-safe DSLs
Hello World
fun main() {
println("Hello, World!")
}
// With command-line args
fun main(args: Array) {
println("Args: ${args.joinToString()}")
}
Variables
val readOnly = "immutable" // val — read-only, assigned once
var mutable = "changeable" // var — mutable, can be reassigned
// Type inference — type is automatically detected
val count = 42 // Int
val pi = 3.14 // Double
val name = "Kotlin" // String
// Explicit type
val score: Int = 100
val temp: Float = 24.5f
Basic Types Quick Reference
| Category | Types | Example | |----------|-------|---------| | Integers | Byte, Short, Int, Long | val year: Int = 2025 | | Unsigned | UByte, UShort, UInt, ULong | val score: UInt = 100u | | Float | Float, Double | val price: Double = 19.99 | | Boolean | Boolean | val ok: Boolean = true | | Character | Char | val sep: Char = ',' | | String | String | val msg: String = "Hi" | | Array | Array | val arr = arrayOf(1, 2, 3) |
Operators
| Operator | Description | |----------|-------------| | + - * / % | Arithmetic | | += -= *= /= %= | Augmented assignment | | ++ -- | Increment / decrement | | && \|\| ! | Boolean AND, OR, NOT | | == != === !== | Equality (structural), identity (referential) | | ` = | Comparison | | .. .. b) a else b
// when — replaces switch val desc = when (x) { 0 -> "zero" 1, 2, 3 -> "small" in 4..10 -> "medium" else -> "large" }
// for loop with range for (i in 1..5) print(i) // 12345 for (i in 1.. String = { s -> s.uppercase() } // or with implicit 'it' val upper2: (String) -> String = { it.uppercase() }
// Trailing lambda list.filter { it > 0 }
## Classes Quick Reference
```kotlin
// Basic class with primary constructor
class Person(val name: String, var age: Int)
// Data class — auto-generates equals, hashCode, toString, copy, componentN
data class User(val id: Long, val name: String, val email: String)
// Enum class
enum class Color { RED, GREEN, BLUE }
// Sealed class — restricted hierarchy
sealed class Result {
data class Success(val data: String) : Result()
data class Error(val message: String) : Result()
}
// Object declaration — singleton
object Database {
fun connect() { /* ... */ }
}
// Companion object — static-like members
class Factory {
companion object {
fun create() = Factory()
}
}
Coroutines Quick Reference
import kotlinx.coroutines.*
// Launch a coroutine
suspend fun fetchData(): String {
delay(1000)
return "Data"
}
// runBlocking — bridge blocking to suspend
fun main() = runBlocking {
val result = fetchData()
println(result)
}
// launch — fire and forget
GlobalScope.launch {
repeat(5) { i ->
delay(500)
println("Tick $i")
}
}
// async — returns a value
val deferred = CoroutineScope(Dispatchers.IO).async {
fetchData()
}
val data = deferred.await()
Installation & Setup
# Install via SDKMAN! (Linux/macOS)
sdk install kotlin
# Install via Homebrew (macOS)
brew install kotlin
# Windows: download from https://kotlinlang.org/docs/command-line.html
# Or use winget:
winget install JetBrains.Kotlin
# Verify
kotlinc -version
Build & Run
# Compile and run a script
kotlinc main.kt -include-runtime -d main.jar
java -jar main.jar
# Kotlin script (.kts)
kotlinc -script script.kts
# With Gradle (Kotlin DSL)
gradle build
gradle run
# With Maven
mvn compile
mvn exec:java -Dexec.mainClass="MainKt"
Project Creation
# Gradle project (Kotlin DSL)
gradle init --type kotlin-application
# Maven project
mvn archetype:generate -DarchetypeArtifactId=kotlin-archetype-jvm
# IntelliJ IDEA: New Project > Kotlin
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: pledgeandgrow
- Source: pledgeandgrow/pledge-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.