Use the backing-property pattern: `private val _state = MutableStateFlow(initial)` and `val state = _state.asStateFlow()`. The public surface is read-only and mutation stays in the ViewModel; avoid a public `var` and minimize public visibility.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Kotlin Best Practices?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-kotlin-best-practices-2a3c1ed7)
Use the backing-property pattern: `private val _state = MutableStateFlow(initial)` and `val state = _state.asStateFlow()`. The public surface is read-only and mutation stays in the ViewModel; avoid a public `var` and minimize public visibility.