kotlin-fundamentals

pluginagentmarketplace's avatarfrom pluginagentmarketplace

Master Kotlin syntax, OOP principles, SOLID practices, functional programming, and data structures. Use when writing Kotlin code or designing class hierarchies.

⭐0stars🔀0forks📁View on GitHub🕐Updated Nov 19, 2025

When & Why to Use This Skill

This Claude skill provides comprehensive expertise in Kotlin programming, ranging from core syntax and null safety to advanced architectural patterns. It empowers users to generate clean, idiomatic, and efficient Kotlin code by leveraging Object-Oriented Programming (OOP) principles, SOLID practices, and functional programming constructs. Designed for both Android and JVM environments, it ensures high-quality software development through robust data structures and modern concurrency models like Coroutines.

Use Cases

  • Case 1: Generating idiomatic Kotlin code for Android applications, utilizing null safety, extension functions, and scope functions to reduce boilerplate.
  • Case 2: Refactoring legacy codebases to adhere to SOLID principles and OOP best practices, improving long-term maintainability and scalability.
  • Case 3: Designing complex class hierarchies and implementing efficient data structures for high-performance backend services.
  • Case 4: Implementing asynchronous programming logic using Kotlin Coroutines to manage background tasks and improve UI responsiveness.
  • Case 5: Applying functional programming patterns such as higher-order functions and collection transformations to create concise and readable logic.
namefundamentals
descriptionMaster Kotlin syntax, OOP principles, SOLID practices, functional programming, and data structures.
version"2.0.0"
sasmp_version"1.3.0"
bonded_agent01-android-fundamentals
bond_typePRIMARY_BOND
atomictrue
single_responsibilityKotlin & OOP fundamentals
typestring
enum[kotlin, oop, solid, functional, collections]
requiredfalse
max_attempts2
backoffexponential
on_failurereturn_basic_example
levelinfo
include[query, response_time, errors]

Kotlin Fundamentals Skill

Quick Start

// Variables
val immutable = "constant"
var mutable = "variable"

// Functions
fun greet(name: String): String = "Hello, $name"

// Classes
data class User(val id: Int, val name: String)

// Null safety
val user: User? = null
user?.name // safe call
user?.name ?: "Unknown" // elvis operator

Key Concepts

Null Safety

  • ? for nullable types
  • !! for non-null assertion (avoid)
  • ?: elvis operator for defaults
  • ?.let { } for null-safe blocks

Extension Functions

fun String.isValidEmail(): Boolean = contains("@")
val valid = "user@example.com".isValidEmail()

Scope Functions

  • apply: Configure object
  • let: Transform
  • run: Execute with context
  • with: Receiver operations
  • also: Side effects

Coroutines

viewModelScope.launch {
    val data = withContext(Dispatchers.IO) {
        fetchData()
    }
}

SOLID Principles Summary

  1. SRP: One responsibility per class
  2. OCP: Open for extension, closed for modification
  3. LSP: Substitutable subtypes
  4. ISP: Specific interfaces
  5. DIP: Depend on abstractions

Learning Resources