nebula-tv: Skill for Claude Code

.claude/skills/coroutines-reference/SKILL.md

coroutines-reference is a skill for Claude Code from gsbakshi/nebula-tv. It costs 49 tokens per session (1,844 once invoked), scanned A, original, MPL-2.0.

A Kotlin coding reference for Nebula's coroutine and Flow patterns, including ViewModel state, time limits, cancellation, and debugging.

In plain words
What is it for?
Use it when writing ViewModels, StateFlows, widget refreshes, parallel updates, or coroutine code that needs reliable debugging.
Why use it?
It helps avoid inconsistent asynchronous code and common lifecycle, cancellation, and resource-use mistakes in the Nebula launcher.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

This is gsbakshi/nebula-tv's own configuration. It tells Claude Code how to work on nebula-tv itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything nebula-tv configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/gsbakshi/nebula-tv/main/.claude/skills/coroutines-reference/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/gsbakshi/nebula-tv

Made for: Claude Code.

Wrote 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.

agentmods badge for coroutines-reference

README.md
[![agentmods](https://agentmods.dev/badge/skills/gsbakshi/nebula-tv/coroutines-reference/github.svg)](https://agentmods.dev/skills/gsbakshi/nebula-tv/coroutines-reference)
Your own site
<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.

agentmods 80×15 button for coroutines-reference

Your own site · 80×15
<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>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,844 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 9d ago against content hash f6d1f0f77d57, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

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)
.claude/skills/coroutines-reference/SKILL.md · 210 lines

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")
}

Read the full file on GitHub · 210 lines

Changes

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.

  1. 9d ago First seen · 210 lines · 49 tokens per session scan A f6d1f0f77d57

Subscribe to this mod's changes

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.

Related

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.…

Jeffallan/claude-skills · 86 tokens

swiftui-dev

Use this skill for SwiftUI development, architecture, structure, performance, and Apple native app profiling. It combines.

Orkas-AI/Orkas · 3 tokens

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.

CharlesWiltgen/Axiom · 43 tokens

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.

google/skills · 48 tokens

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…

christopherkarani/Wax · 68 tokens

mobiai-kmp

Use when working on a Kotlin Multiplatform project — shared code, expect/actual declarations, platform-specific implementations, building and testing.

ArisGuimera/MobiAI-Core · 32 tokens