
Kotlin Coroutines Flows
This covers the bread and butter of async Kotlin: structured concurrency patterns, Flow operators, StateFlow for UI state, and testing with runTest and Turbine. You get practical examples of parallel decomposition with async/await, combining multiple flows for complex UI state, and one-time events with SharedFlow. The anti-patterns section is honest about common mistakes like GlobalScope leaks and collecting flows in init blocks. Most valuable for Android or KMP developers who've moved past basic launch/async and need patterns for real app state management, like handling debounced search, retries with backoff, or keeping upstream flows alive through configuration changes with WhileSubscribed.
- skills.sh installs
- 5.9K
- GitHub stars
- 300.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add affaan-m/ecc --skill kotlin-coroutines-flows --agent claude-codeInstalls into .claude/skills of the current project.
Files
Kotlin Coroutines & Flows
Patterns for structured concurrency, Flow-based reactive streams, and coroutine testing in Android and Kotlin Multiplatform projects.
When to Activate
- Writing async code with Kotlin coroutines
- Using Flow, StateFlow, or SharedFlow for reactive data
- Handling concurrent operations (parallel loading, debounce, retry)
- Testing coroutines and Flows
- Managing coroutine scopes and cancellation
Structured Concurrency
Scope Hierarchy
Application
└── viewModelScope (ViewModel)
└── coroutineScope { } (structured child)
├── async { } (concurrent task)
└── async { } (concurrent task)
Always use structured concurrency — never GlobalScope:
// BAD
GlobalScope.launch { fetchData() }
// GOOD — scoped to ViewModel lifecycle
viewModelScope.launch { fetchData() }
// GOOD — scoped to composable lifecycle
LaunchedEffect(key) { fetchData() }
Parallel Decomposition
Use coroutineScope + async for parallel work:
Sponsors
Details
- Repository
- github.com/affaan-m/ecc
- Categories
- Testing & QA, Debugging, Mobile Development, Java & JVM
- First seen
- Jul 14, 2026
More from affaan-m/ecc
All 263- React Performance5.9K
- Kotlin Patterns5.9K
- 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