fundamentals
3
总安装量
2
周安装量
#55360
全站排名
安装命令
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-android --skill fundamentals
Agent 安装分布
claude-code
2
mcpjam
1
moltbot
1
windsurf
1
zencoder
1
Skill 文档
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 objectlet: Transformrun: Execute with contextwith: Receiver operationsalso: Side effects
Coroutines
viewModelScope.launch {
val data = withContext(Dispatchers.IO) {
fetchData()
}
}
SOLID Principles Summary
- SRP: One responsibility per class
- OCP: Open for extension, closed for modification
- LSP: Substitutable subtypes
- ISP: Specific interfaces
- DIP: Depend on abstractions