Borrowing it
Nothing to install: this file belongs to gsbakshi/nebula-tv. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/gsbakshi/nebula-tv/main/.claude/skills/coroutines-reference/SKILL.mdgit clone --depth 1 https://github.com/gsbakshi/nebula-tvWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/gsbakshi/nebula-tv/coroutines-reference)<a href="https://agentmods.dev/skills/gsbakshi/nebula-tv/coroutines-reference"><img src="https://agentmods.dev/badge/skills/gsbakshi/nebula-tv/coroutines-reference/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/gsbakshi/nebula-tv/coroutines-reference"><img src="https://agentmods.dev/badge/skills/gsbakshi/nebula-tv/coroutines-reference.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00049 | $0.01844 |
| Opus 5 | $0.00024 | $0.00922 |
| Sonnet 5 | $0.00010 | $0.00369 |
| Haiku 4.5 | $0.00005 | $0.00184 |
Grade A, and why
coroutines-reference scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
rssParser.fetch(feedUrl) How it starts
The opening of the file, as written. The whole thing — 210 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Nebula Coroutines Reference
Distilled from official Kotlin docs and battle-tested patterns. All examples are Nebula-context (widget refresh, browser, app grid).
1. stateIn(WhileSubscribed) — The Standard ViewModel Pattern
Always use this when exposing StateFlow from a ViewModel:
class NasaApodViewModel(private val repo: NasaApodRepository) : ViewModel() {
val state: StateFlow<ApodState> = repo.apodFlow() // cold Flow from repo/DataStore
.map { data -> ApodState.Success(data, Instant.now()) }
.catch { e -> emit(ApodState.Error(e.message ?: "Failed")) }
.stateIn(
scope = viewModelScope,
started = SharingStarted.WhileSubscribed(stopTimeoutMillis = 5_000), // 5s grace period
initialValue = ApodState.Loading
)
}
Why WhileSubscribed(5000)?
- Upstream Flow stops collecting 5 seconds after the last subscriber (UI) disappears
- 5-second grace period survives Android screen rotations without restarting the upstream
- Automatically resumes when a new subscriber arrives (launcher comes back to foreground)
- Saves CPU + battery when Nebula launcher is backgrounded
- ❌
SharingStarted.Eagerly— keeps collecting forever, even when backgrounded - ❌
SharingStarted.Lazily— never stops collecting once started
2. CancellationException — NEVER Catch It Silently
This is the most dangerous coroutine mistake. CancellationException extends Exception,
so catch (e: Exception) will eat it — breaking structured concurrency.
// ✅ CORRECT: explicitly rethrow CancellationException
try {
val data = withTimeout(30.seconds) { api.fetchApod(key) }
_state.value = ApodState.Success(data, Instant.now())
} catch (e: TimeoutCancellationException) {
// withTimeout throws TimeoutCancellationException (a CancellationException subclass)
// Safe to catch this specific subtype — it's OUR timeout, not parent cancellation
_state.value = ApodState.Error("Request timed out after 30s")
} catch (e: CancellationException) {
throw e // ← MUST RETHROW. This coroutine's parent is cancelling — let it propagate.
} catch (e: IOException) {
_state.value = ApodState.Error("Network error: ${e.message}")
} catch (e: Exception) {
_state.value = ApodState.Error(e.message ?: "Unknown error")
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 210 lines · 49 tokens per session scan A f6d1f0f77d57
coroutines-reference is a skill published in the GitHub repository gsbakshi/nebula-tv (5 stars, last pushed 6mo ago), licensed MPL-2.0. It adds 49 tokens to every session and 1,844 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
kotlin-specialist
Provides idiomatic Kotlin implementation patterns including coroutine concurrency, Flow stream handling, multiplatform architecture, Compose UI construction, Ktor server setup, and type-safe DSL design. Use when building Kotlin applications requiring coroutines, multiplatform development, or Android with Compose.…
swiftui-dev
Use this skill for SwiftUI development, architecture, structure, performance, and Apple native app profiling. It combines.
axiom-concurrency
Use when writing ANY async code, actors, threads, or seeing ANY concurrency error. Covers Swift 6 concurrency, @MainActor, Sendable, data races, async/await patterns.
developing-genkit-dart
Generates code and provides documentation for the Genkit Dart SDK. Use when the user asks to build AI agents in Dart, use Genkit flows, or integrate LLMs into Dart/Flutter applications.
wax
Swift framework guidance for Wax on-device memory/RAG. Use when writing Swift code with the public Memory facade, experimental PhotoMemory / VideoMemory, BuiltInMultimodalEmbeddings, embedding providers, retrieval modes, or hybrid search. For agent operators using the Wax MCP server tools, use the separate wax-mcp…
mobiai-kmp
Use when working on a Kotlin Multiplatform project — shared code, expect/actual declarations, platform-specific implementations, building and testing.