kotlin-patterns
by affaan-mkotlin-patterns helps you write and review idiomatic Kotlin using null safety, immutability, sealed hierarchies, coroutines, extension functions, and DSL builders. Use this kotlin-patterns skill for Kotlin-native code generation, refactoring, and Gradle Kotlin DSL decisions with less guesswork.
This skill scores 78/100, which means it is a solid listing candidate for directory users who want Kotlin-specific guidance. The repository shows enough real workflow content, examples, and constraints to help an agent trigger and apply it with less guesswork than a generic prompt, though it is lighter on adoption aids like install instructions and supporting assets.
- Covers multiple concrete Kotlin workflows: new code, code review, refactoring, module/library design, and Gradle Kotlin DSL configuration.
- Provides operational examples and code fences for core patterns such as null safety, sealed classes, coroutines/Flow, extension functions, and DSL builders.
- Strong structural signal quality: valid frontmatter, substantial body length, many headings, and no placeholder markers.
- No install command, scripts, references, or support files, so users must rely on the SKILL.md content alone to adopt it.
- The skill is broad and pattern-oriented rather than task-specific, so agents may still need context to choose the right Kotlin pattern in ambiguous cases.
Overview of kotlin-patterns skill
What kotlin-patterns is for
The kotlin-patterns skill helps you write and review Kotlin code using idiomatic patterns instead of generic AI-generated advice. It is best for developers who want cleaner application code, safer null handling, better coroutine usage, and more maintainable module or DSL design.
When it fits best
Use the kotlin-patterns skill when you are starting new Kotlin code, refactoring existing code, reviewing style and architecture, or shaping Gradle Kotlin DSL builds. It is especially useful when the task needs Kotlin-native decisions rather than language-agnostic suggestions.
What makes it useful
The main value is pattern selection: null safety, immutability, sealed hierarchies, structured concurrency, extension functions, and type-safe DSL builders. That makes the kotlin-patterns skill more practical than a plain prompt because it anchors suggestions in Kotlin conventions the model can apply consistently.
How to Use kotlin-patterns skill
Install and activate it
For kotlin-patterns install, add the skill to your Claude Code setup with:
npx skills add affaan-m/everything-claude-code --skill kotlin-patterns
After install, treat it as a Kotlin-focused working context, not a static reference. The kotlin-patterns usage flow works best when you ask for a concrete Kotlin task, then let the skill shape the code style and design choices.
Give it the right task shape
The skill performs better when your prompt includes the goal, current code, and constraints. A weak prompt is: “Improve this Kotlin code.” A stronger prompt is: “Refactor this suspend function to use structured concurrency, preserve error handling, avoid nullable return values, and keep the public API unchanged.”
For kotlin-patterns for Code Generation, specify whether you want application code, library code, a DSL, or build logic. Also name the expected Kotlin version, coroutine usage, and whether you prefer data classes, sealed classes, or extension functions.
Read the right files first
Start with SKILL.md, then inspect any linked context in the repository tree if present. In this repo, the skill is concentrated in one file, so the fastest path is to read SKILL.md and the examples together. The most useful sections are the “When to Use,” “How It Works,” and example blocks because they show the decision rules the skill is built around.
Workflow that improves output
Use the skill in two steps: first ask for a plan or pattern choice, then ask for the implementation. This works well when the problem is ambiguous, such as choosing between a sealed result type and exceptions, or deciding whether a DSL builder is appropriate. If you already know the target pattern, state it explicitly so the output stays focused.
kotlin-patterns skill FAQ
Is kotlin-patterns only for code generation?
No. The kotlin-patterns skill is also useful for review and refactoring. It helps identify where Kotlin idioms can replace verbose or unsafe code, not just generate new code from scratch.
How is it different from a normal prompt?
A normal prompt may return generic best practices. The kotlin-patterns skill is centered on Kotlin-specific conventions, so it is better at suggesting null-safe APIs, sealed types, coroutine structure, and DSL-friendly designs that match the language.
Is it good for beginners?
Yes, if you want guided Kotlin patterns rather than abstract theory. It is most helpful when you have a concrete task and want the code to stay idiomatic while still being easy to read.
When should I not use it?
Do not use it when the task is mostly language-agnostic, or when you need product-specific business rules more than Kotlin design guidance. If the code is not Kotlin, another skill will be a better fit.
How to Improve kotlin-patterns skill
Provide the constraints that matter
The best kotlin-patterns results come from constraints that affect design: Kotlin version, coroutine scope, API stability, module boundaries, nullability expectations, and whether the code should be library-grade or app-only. These details reduce guesswork and make the generated pattern choices more reliable.
Ask for one pattern decision at a time
If you want higher-quality output, narrow the request to one decision first: “Should this be a sealed class or enum?” or “Should this API return Result<T> or throw?” That helps the skill produce a sharper kotlin-patterns guide response instead of a broad rewrite with mixed priorities.
Watch for common failure modes
The main risk is overusing “idiomatic” patterns where simplicity is better. Another common issue is introducing coroutine or DSL abstractions without enough need. If the first output feels heavy, ask for a smaller, more explicit version with fewer abstractions and clearer tradeoffs.
Iterate with examples from your codebase
If you want the skill to match your project, paste one real file and one target example of the style you want. Then ask for a before/after refactor plus the reasoning behind the pattern choice. That usually produces better adoption than asking for a generic Kotlin template.
