async-safety

async-safety is a skill for Claude Code from zakariaf/Flutter-Skills. It costs 189 tokens per session (3,686 once invoked), scanned A, original, MIT.

A set of Dart and Flutter rules for handling asynchronous work without dropping errors, using disposed screens, or leaking subscriptions and timers.

In plain words
What is it for?
Use it when writing async callbacks, using await with BuildContext, or managing subscriptions, timers, and streams in Flutter.
Why use it?
It addresses failures that ordinary lint checks can miss, such as an event callback silently ignoring a Future or continuing after a widget is gone.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the flutter plugin — 40 skills shipped together

Good fit Use it when writing async callbacks, using await with BuildContext, or managing subscriptions, timers, and streams in Flutter.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zakariaf/flutter-skills/async-safety
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zakariaf/Flutter-Skills --skill async-safety
Clone the repo
git clone --depth 1 https://github.com/zakariaf/Flutter-Skills

Made for: Claude Code.

Or install flutter, the plugin that ships this one along with the rest of its 40 skills.

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 async-safety

README.md
[![agentmods](https://agentmods.dev/badge/skills/zakariaf/flutter-skills/async-safety/github.svg)](https://agentmods.dev/skills/zakariaf/flutter-skills/async-safety)
Your own site
<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/async-safety"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/async-safety/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 async-safety

Your own site · 80×15
<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/async-safety"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/async-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 189 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,686 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 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.00189 $0.03686
Opus 5 $0.00095 $0.01843
Sonnet 5 $0.00038 $0.00737
Haiku 4.5 $0.00019 $0.00369

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

Security

Grade A, and why

async-safety 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 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.

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.

skills/async-safety/SKILL.md · 250 lines

How it starts

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

Async safety: no failure may be silent

Async bugs are silence. A dropped Future swallows its error; a dead BuildContext throws into a void; a leaked subscription fires into a disposed widget. An app with no telemetry has exactly two feedback loops — the analyzer and the test suite — and the analyzer has one hole big enough to drive the product through. Close it structurally, not with discipline. This skill applies whenever you write async/await, wire a callback, or hold a subscription, timer, or sink.

Non-negotiable rules

  1. A callback must never touch a Future. Every onTap/onPressed/onSubmitted/VoidCallback handler returns void. onTap: () => vm.save(x) where save is async is caught by NO lint (see below) — the fix is shape, not vigilance.
  2. A mounted / ref.mounted guard goes after EVERY await, immediately before the next BuildContext use — never once at the top, never before the await where it proves nothing. Or capture the object you need before the gap.
  3. Multiple awaits ⇒ the guard sits after the LAST one. A guard only certifies the interval since the most recent suspension point.
  4. unawaited(x) is legal only if x provably cannot fail silently — it ends in a .catchError(...) or is total. Bare unawaited(f) routes errors to PlatformDispatcher.onError, detached from the UI. That is silence with a permission slip.
  5. Every StreamSubscription, StreamController, Timer, and sink is released in dispose() / ref.onDispose. Prefer not owning it: a provider gives teardown for free.
  6. Every timer/stream callback that calls setState guards mounted first. A Timer holds a strong reference to its closure and fires happily after the widget is gone.
  7. No empty catch, no bare catch, no swallow. Every catch has an on clause (except the crash logger's own write), logs with its stack, and surfaces the failure. Use rethrow, never throw e — the latter resets the stack trace.
  8. Never assert a platform/plugin return value. Asserts are stripped in release: green in every test, absent on the device — the perfect silent-failure bug.
  9. Nothing unbounded runs before runApp. No migration, no plugin warm-up. Show a usable first frame, then warm up in addPostFrameCallback, unawaited.
  10. No runZonedGuarded. Two error handlers suffice — app-startup-and-bootstrap owns installing them, their pre-runApp ordering, the PlatformDispatcher.onError return true rule, and never letting a handler throw. Don't restate that machinery here.

Read the full file on GitHub · 250 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 · 250 lines · 0 tokens per session scan A 019e75754449

Subscribe to this mod's changes

async-safety is a skill published in the GitHub repository zakariaf/Flutter-Skills (2 stars, last pushed 11d ago), licensed MIT. It adds 189 tokens to every session and 3,686 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. 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

rust-check

Run cargo check on the current Rust project to find compile errors.

Hmbown/CodeWhale · 15 tokens

pi-loop-forensics

Diagnose pi-go agent loops and degenerate turns — "agent loop aborted", runaway thinking with no tool calls, repeated phrases. Discriminates genuine model repetition collapse from a race, a tool-parse failure, or a too-low guard, and A/B replays a seed session across providers.

dimetron/pi-go · 65 tokens

nightly-session-watch

Nightly sweep of the last 24h of pi-go sessions — anomalous runs, loop aborts, tool error rates, token waste, real prompt-token spend, and whether the observation and palace pipelines are still recording. Triages each finding to the specialist skill that diagnoses it. Use for an unattended daily health check, or on…

dimetron/pi-go · 78 tokens

native-runtime-debug

Diagnose native C/C++ crashes, hangs/deadlocks, bad runtime state, and crash dumps with qwen-dap-mcp and DAP. Use for crashes, minidumps/core dumps, processes that stop making progress, lock/wait triage, unexpected variable changes, differential good-versus-bad runtime comparison, bounded value/write tracing…

SLP-DEV1/qwen-dap-mcp · 95 tokens

debug-go

Systematic 5-step debugging flow for Go 1.22+ services. Load when a test fails, a goroutine leaks, a downstream provider hangs, errors lose context, or production logs are unhelpful. Forces layer isolation (handler vs service vs repo vs provider) and runs the 5 most common Go antipattern greps before any code change …

yerdaulet-damir/vibe-coding-rules · 91 tokens

python-debugpy

Debug Python with pdb, breakpoint(), post-mortem inspection, and debugpy remote attach.

subhansh-dev/agent-maxxing · 23 tokens