Minitask: Skill for Claude Code

.agents/skills/kotlin-flow-state-event-modeling/SKILL.md

kotlin-flow-state-event-modeling is a skill for Claude Code, Codex from costular/Minitask. It costs 55 tokens per session (2,151 once invoked), scanned A, a copy of kotlin-flow-state-event-modeling, Apache-2.0.

A guide to choosing between Kotlin Flow tools for representing changing data and one-time events. Kotlin Flow is a way for app code to observe values over time; this guide covers StateFlow, SharedFlow, channels, and shared streams.

In plain words
What is it for?
It helps design and review Kotlin APIs for screen state, navigation events, notifications, synchronous value reads, and sharing flows between consumers.
Why use it?
It prevents lost events, stale state, unnecessary background work, and fake placeholder values caused by choosing the wrong data stream.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is costular/Minitask's own configuration. It tells Claude Code and Codex how to work on Minitask 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 Minitask configures →

Reuse

Borrowing it

Nothing to install: this file belongs to costular/Minitask. 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/costular/Minitask/main/.agents/skills/kotlin-flow-state-event-modeling/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/costular/Minitask

Made for: Claude Code, Codex.

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 kotlin-flow-state-event-modeling

README.md
[![agentmods](https://agentmods.dev/badge/skills/costular/minitask/kotlin-flow-state-event-modeling/github.svg)](https://agentmods.dev/skills/costular/minitask/kotlin-flow-state-event-modeling)
Your own site
<a href="https://agentmods.dev/skills/costular/minitask/kotlin-flow-state-event-modeling"><img src="https://agentmods.dev/badge/skills/costular/minitask/kotlin-flow-state-event-modeling/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 kotlin-flow-state-event-modeling

Your own site · 80×15
<a href="https://agentmods.dev/skills/costular/minitask/kotlin-flow-state-event-modeling"><img src="https://agentmods.dev/badge/skills/costular/minitask/kotlin-flow-state-event-modeling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,151 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 95% copy Near-identical to another mod 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.00055 $0.02151
Opus 5 $0.00028 $0.01076
Sonnet 5 $0.00011 $0.00430
Haiku 4.5 $0.00006 $0.00215

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

Security

Grade A, and why

kotlin-flow-state-event-modeling scanned grade A with 0 findings 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 4d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

95% identical to kotlin-flow-state-event-modeling — 4 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.agents/skills/kotlin-flow-state-event-modeling/SKILL.md · 184 lines

How it starts

The opening of the file, as written. The whole thing — 184 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Kotlin Flow: state and event modeling

Core principle

Pick the primitive that matches replay, fan-out, and synchronous-read requirements. StateFlow, SharedFlow, Channel-backed flows, and cold Flow differ in buffering, who sees each emission, and whether .value exists. Wrong choices drop events, leak sharing coroutines, or force fake domain sentinels into state.

When to use this skill

You're writing or reviewing Kotlin code involving:

  • MutableStateFlow<T>(SomeSentinel)NoUser, Empty, Loading, etc. — because the real value is async
  • .stateIn(...) called inside a function rather than assigned to a property
  • SharingStarted.WhileSubscribed(...) on a flow whose .value is read synchronously and must stay fresh
  • MutableSharedFlow for navigation events, snackbars, or other one-shot emissions where loss would be a bug
  • .map { } on a StateFlow when consumers still need synchronous .value
  • MutableStateFlow.value = _state.value.copy(...) or update code that builds expensive objects inside update { ... }

SharedFlow for single-consumer fire-once events

SharedFlow defaults have no replay buffer. If nothing is collecting at the exact instant of emission, the event is gone. For a single UI consumer handling exactly-once events such as navigation or snackbars, a buffered Channel exposed as a Flow often matches the semantics better:

// ❌ BAD
private val _navEvents = MutableSharedFlow<NavigationEvent>()
val navEvents: SharedFlow<NavigationEvent> = _navEvents.asSharedFlow()

// ✅ GOOD
private val _navEvents = Channel<NavigationEvent>(Channel.BUFFERED)
val navEvents: Flow<NavigationEvent> = _navEvents.receiveAsFlow()

Channel.receiveAsFlow() is fan-out, not broadcast: with multiple collectors, each event is delivered to one collector. Channel.BUFFERED is bounded, so sends can suspend and trySend can fail. If multiple observers must all see the same event, use explicit state, durable storage, or a deliberately configured SharedFlow instead.

Read the full file on GitHub · 184 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. 4d ago First seen · 184 lines · 55 tokens per session scan A 7eae78b56046

Subscribe to this mod's changes

kotlin-flow-state-event-modeling is a skill published in the GitHub repository costular/Minitask (12 stars, last pushed 11d ago), licensed Apache-2.0. It adds 55 tokens to every session and 2,151 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 95% identical to kotlin-flow-state-event-modeling, differing in 4 lines, and is treated as a copy.

Related

Other skills, from other repositories

android

Senior-level Android engineering expertise for Jetpack Compose, Material 3, shared element transitions, navigation, performance, security, background work, notifications, adaptive layouts, Coil image loading, WorkManager, FCM, Baseline Profiles, R8 optimization, accessibility, coroutines and Flow, and extraordinary UI…

ayush016/android-lead-agent-skills · 264 tokens

swift-concurrency-expert

Swift concurrency review/fix: compiler errors, Sendable, isolation, remediation.

steipete/agent-scripts · 22 tokens

axiom-analyze-swift-performance

Use when the user mentions Swift performance audit, code optimization, or performance review.

CharlesWiltgen/Axiom · 24 tokens

compose-animations

Use when writing or reviewing Jetpack Compose motion: visibility enter/exit, animating one property toward a target, color or size transitions, multiple properties from one state, switching composable content, or choosing between AnimatedVisibility, animateAsState, rememberTransition, AnimatedContent, and Crossfade.

chrisbanes/skills · 64 tokens

compose-focus-navigation

Use when writing or reviewing Jetpack Compose UI for TV, keyboard, desktop, accessibility focus, D-pad navigation, FocusRequester, focusProperties, key events, or initial focus behavior.

chrisbanes/skills · 41 tokens

kotlin-control-flow

Use when writing or reviewing Kotlin branching and control flow: when expressions, guard conditions, sealed type exhaustiveness, smart casts, nullable branching, early returns, or replacing complex if/else chains.

chrisbanes/skills · 44 tokens