Individual skill
kotlin-control-flow
Use when writing or reviewing Kotlin branching and control flow: when expressions, guard conditions, sealed type exhaustiveness, smart casts, nullable branching, early returns, or replacing complex if/else chains.
skills/kotlin-control-flow/SKILL.md
Source commit 72628aea92c9081df0ba96600f24af3f07f4a87a
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- Yes
- Repository scan complete
- No
- Skill scan complete
- Yes
- Observed behavior
- Instructions only
- Last checked
- Nov 10, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 1,146
- Repository last updated
- Nov 5, 2026
- License
- Apache-2.0
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- android Repository topic
- compose-multiplatform Repository topic
- coroutines Repository topic
- jetpack-compose Repository topic
- kotlin Repository topic
- kotlin-multiplatform Repository topic
- skills Repository topic
- writing Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
SKILL.mdcore · 4,380 bytes
Read excerpt
# Kotlin control flow
## Core principle
Make the classified value obvious, keep branch-local predicates on their
branch, and let the compiler prove closed-domain coverage.
## Procedure
1. Name the value being classified. If every branch tests it, use
`when (subject)`; otherwise keep a subjectless `when` or `if` chain.
2. Choose the branch shape:
| Code shape | Prefer |