
Kotlin Patterns
This is a comprehensive reference for writing idiomatic Kotlin that goes beyond basic syntax. It covers the patterns that make Kotlin code actually feel like Kotlin: null safety with Elvis operators instead of force-unwrapping, sealed classes for exhaustive when expressions, structured concurrency with coroutineScope and async/await, and type-safe DSL builders. The examples are practical, showing things like modeling API errors with sealed interfaces and using value classes for zero-overhead type safety. Use this when you want your Kotlin to look like it was written by someone who understands the language's strengths, not just Java with different keywords.
- skills.sh installs
- 5.9K
- GitHub stars
- 300.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add affaan-m/ecc --skill kotlin-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
Kotlin Development Patterns
Idiomatic Kotlin patterns and best practices for building robust, efficient, and maintainable applications.
When to Use
- Writing new Kotlin code
- Reviewing Kotlin code
- Refactoring existing Kotlin code
- Designing Kotlin modules or libraries
- Configuring Gradle Kotlin DSL builds
How It Works
This skill enforces idiomatic Kotlin conventions across seven key areas: null safety using the type system and safe-call operators, immutability via val and copy() on data classes, sealed classes and interfaces for exhaustive type hierarchies, structured concurrency with coroutines and Flow, extension functions for adding behaviour without inheritance, type-safe DSL builders using @DslMarker and lambda receivers, and Gradle Kotlin DSL for build configuration.
Examples
Null safety with Elvis operator:
fun getUserEmail(userId: String): String {
val user = userRepository.findById(userId)
return user?.email ?: "unknown@example.com"
}
Sponsors
Details
- Repository
- github.com/affaan-m/ecc
- Categories
- Mobile Development, Java & JVM
- First seen
- Jul 14, 2026
More from affaan-m/ecc
All 263- Architecture Decision Records5.9K
- Deployment Patterns5.8K
- React Testing5.8K
- Pytorch Patterns5.8K
- Hexagonal Architecture5.8K
- Flutter Dart Code Review5.8K
- Frontend A11y5.8K
- Error Handling5.8K
- Ui Demo5.8K
- Agentic Engineering5.8K
- Vite Patterns5.8K
- Bun Runtime5.8K
- Agent Architecture Audit5.8K
- Nodejs Keccak2565.8K
- Security Scan5.8K
- Cpp Testing5.8K
- Django Tdd5.8K
- Dashboard Builder5.7K
- Redis Patterns5.7K
- Eval Harness5.7K
- Manim Video5.7K
- Content Engine5.7K
- Springboot Tdd5.7K
- Motion Patterns5.7K