kp-dispatchers
Installation
SKILL.md
One-line summary
Pick a dispatcher whose thread-pool characteristics match the work — Default for CPU-bound, IO for blocking I/O, Main for UI updates, Unconfined only when you really mean "stay on whatever thread called me".
When to use this skill
- Designing a suspending function whose work has specific concurrency characteristics (CPU-heavy, blocking I/O, UI-bound).
- Code that mixes blocking calls with coroutines and risks starving a thread pool.
- Switching dispatchers mid-computation with
withContext. - Code review wants to verify dispatcher choices are deliberate.
When NOT to use this skill
- The work is a single
suspendcall to anothersuspendfunction — usually no dispatcher choice needed. - The code already runs in a dispatcher-aware framework primitive (
viewModelScopedefaults toMain.immediate).
Core content
Dispatchers.Default — a thread pool sized for CPU cores (typically max(2, #cores)). Use for CPU-bound computation (parsing, transformation, mathematical work). Saturating it is OK — those threads are the right size for the machine.