~cytrogen/vbhelper

ref: e9d2cce8024f3fd3bacb258c183c31f59d3f4b40 vbhelper/.claude/rules/kotlin.md -rw-r--r-- 665 bytes
e9d2cce8 — Cytrogen Add UnifiedPush notification system with Ktor server a month ago

#Kotlin Conventions

#Coroutines & Concurrency

  • Use suspend functions for all database and I/O operations
  • Use Flow (not LiveData) for observable data streams from repositories
  • Collect Flows using lifecycleScope or repeatOnLifecycle in UI layer
  • Never use GlobalScope or runBlocking in production code
  • Use withContext(Dispatchers.IO) for blocking I/O inside suspend functions

#General

  • Prefer data class for DTOs and domain models
  • Use sealed classes/interfaces for representing finite state sets
  • Prefer extension functions over utility classes
  • Null safety: avoid !! — use ?.let, ?:, or require non-null at boundaries