flutter-async-test-unhandled-future-rejection

flutter-async-test-unhandled-future-rejection is a skill for Claude Code, Codex from divinevideo/divine-mobile. It costs 129 tokens per session (1,473 once invoked), scanned A, original, MPL-2.0.

A Flutter and Dart testing guide for errors from asynchronous tasks, called Futures, that fail without being observed at the right time. It focuses on tests that intentionally trigger errors, such as network or timeout failures.

In plain words
What is it for?
Use it when Flutter tests create failing Futures while checking error handling, call limits, cancellation, or timeout behavior, and need to attach error handling immediately.
Why use it?
It explains why a test can pass locally but fail in continuous integration, where timing may expose an error before a later catch handler runs. This removes confusing or incomplete test failure messages.

Skill for Claude CodeCodex

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

Good fit Use it when Flutter tests create failing Futures while checking error handling, call limits, cancellation, or timeout behavior, and need to attach error handling immediately.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/divinevideo/divine-mobile/flutter-async-test-unhandled-future-rejection
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 divinevideo/divine-mobile --skill flutter-async-test-unhandled-future-rejection
Clone the repo
git clone --depth 1 https://github.com/divinevideo/divine-mobile

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 flutter-async-test-unhandled-future-rejection

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/divinevideo/divine-mobile/flutter-async-test-unhandled-future-rejection"><img src="https://agentmods.dev/badge/skills/divinevideo/divine-mobile/flutter-async-test-unhandled-future-rejection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 129 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,473 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Data Exfiltration · line 202
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
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.00129 $0.01473
Opus 5 $0.00064 $0.00737
Sonnet 5 $0.00026 $0.00295
Haiku 4.5 $0.00013 $0.00147

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

Security

Grade A, and why

flutter-async-test-unhandled-future-rejection 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 10d 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.

.agents/skills/flutter-async-test-unhandled-future-rejection/SKILL.md · 203 lines

How it starts

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

Flutter Async Test Unhandled Future Rejection

Problem

Tests that create Futures which will reject (throw errors) can fail in CI even when:

  • You catch the error with .catchError() at the end
  • You use try/catch around the await
  • The test passes locally

The Flutter/Dart test framework detects "unhandled" Future rejections during test execution, even if you plan to handle them later. This causes flaky tests that pass locally but fail in CI due to timing differences.

Context / Trigger Conditions

Symptoms:

  • Test passes locally with flutter test but fails in CI
  • Error message is truncated or cryptic (e.g., "ROR]" instead of "[ERROR]")
  • Test name appears in error output but no clear assertion failure
  • Test involves creating Futures to URLs/resources that don't exist
  • Using patterns like:
    final future = someAsyncOperation(); // This will throw
    // ... do assertions ...
    await future.catchError((_) {}); // Too late - already flagged as unhandled
    

Common scenarios:

  • Testing that a method can only be called once (state guards)
  • Testing timeout/cancellation behavior
  • Testing error handling paths
  • Any test that intentionally triggers errors in async code

Solution

Don't create Futures that will reject - test the state machine directly

Instead of:

test('start throws if already started', () async {
  final session = SomeSession(url: 'wss://fake.url');

  // BAD: This Future will reject when connection fails
  final startFuture = session.start();

  // Even this won't help - rejection already detected
  await Future.delayed(Duration.zero);

  expect(() => session.start(), throwsA(isA<StateError>()));

  // Too late to catch - test already failed
  await startFuture.catchError((_) {});
});

Do this:

test('start throws if already started', () {
  // GOOD: Completely synchronous, no network calls
  final session = SomeSession(url: 'wss://example.com');

  // Use a synchronous state transition to exit the "startable" state
  session.cancel(); // Transitions state without network call

  // Now test that start() throws when not in initial state
  expect(
    () => session.start(),
    throwsA(isA<StateError>()),
  );

  session.dispose();
});

Read the full file on GitHub · 203 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. 10d ago First seen · 203 lines · 129 tokens per session scan A 04b93a613c7a

Subscribe to this mod's changes

flutter-async-test-unhandled-future-rejection is a skill published in the GitHub repository divinevideo/divine-mobile (265 stars, last pushed yesterday), licensed MPL-2.0. It adds 129 tokens to every session and 1,473 once invoked, about $0.0006 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-30.

Related

Other skills, from other repositories

temporal-python-testing

Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.

wshobson/agents · 45 tokens

migrate-xunit-to-xunit-v3

Migrate .NET test projects from xUnit.net v2 to xunit.v3 and fix v3 breaks. Use for package/CPM conversion, OutputType=Exe, preserving the VSTest or MTP runner (including projects currently using YTest.MTP.XUnit2), incompatible TFMs, async void tests, string-to-Type attributes, custom Fact/Theory/BeforeAfterTest…

dotnet/skills · 149 tokens

golang-testing

Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI…

samber/cc-skills-golang · 115 tokens

setup

Wire Ginkgo into a Go package — install the ginkgo CLI and Ginkgo+Gomega, ginkgo bootstrap to generate the suitetest.go (TestXxx/RegisterFailHandler(Fail)/RunSpecs), the package xxxtest convention, dot-import alternatives (aliased import, dsl/ subpackages, --nodot), ginkgo generate, and testing.T interop via…

onsi/ginkgo · 118 tokens

assertions

Write correct synchronous Gomega assertions — Expect/Ω notation, the To/NotTo/ToNot/Should/ShouldNot equivalences, the multi-return error idiom, Succeed vs HaveOccurred, the .Error() chaining form, annotating assertions (format-string and func()string), tuning failure output via the format subpackage…

onsi/gomega · 145 tokens

adk-setup

Sets up a local ADK Python development environment in a git clone of the open-source adk-python repository: a uv virtual environment, all dependency extras, pre-commit hooks, and a first unit-test run. Runs only when explicitly requested, never on its own. Use when asked to set up, bootstrap, or repair a development…

google/adk-python · 146 tokens