divine-mobile: Skill for Claude Code

.agents/skills/flutter-dispose-timer-test-failure/SKILL.md

flutter-dispose-timer-test-failure is a skill for Claude Code, Codex from divinevideo/divine-mobile. It costs 86 tokens per session (838 once invoked), scanned A, original, MPL-2.0.

A Flutter widget-testing guide for cleanup code that schedules delayed work while a widget is being removed. Widget tests check that no timers or other delayed tasks remain after the widget tree is disposed.

In plain words
What is it for?
Use it when dispose() contains Future, Future.delayed, Timer, or Riverpod updates, and move suitable synchronous cleanup to deactivate().
Why use it?
It fixes failures reporting that a timer is still pending after disposal, including failures that appear only when tests run together. The problem is asynchronous cleanup started too late in the widget lifecycle.

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

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

Reuse

Borrowing it

Nothing to install: this file belongs to divinevideo/divine-mobile. 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/divinevideo/divine-mobile/main/.agents/skills/flutter-dispose-timer-test-failure/SKILL.md
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-dispose-timer-test-failure

README.md
[![agentmods](https://agentmods.dev/badge/skills/divinevideo/divine-mobile/flutter-dispose-timer-test-failure.svg)](https://agentmods.dev/skills/divinevideo/divine-mobile/flutter-dispose-timer-test-failure)
Your own site
<a href="https://agentmods.dev/skills/divinevideo/divine-mobile/flutter-dispose-timer-test-failure"><img src="https://agentmods.dev/badge/skills/divinevideo/divine-mobile/flutter-dispose-timer-test-failure.svg" alt="Measured on agentmods" height="20"></a>
Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 838 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 113
    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.00086 $0.00838
Opus 5 $0.00043 $0.00419
Sonnet 5 $0.00017 $0.00168
Haiku 4.5 $0.00009 $0.00084

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

Security

Grade A, and why

flutter-dispose-timer-test-failure 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 8d 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-dispose-timer-test-failure/SKILL.md · 115 lines

How it starts

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

Flutter Dispose Timer Test Failure

Problem

Flutter widget tests fail with the error "A Timer is still pending even after the widget tree was disposed" when dispose() contains Future-based cleanup code.

Context / Trigger Conditions

  • Test error: A Timer is still pending even after the widget tree was disposed
  • Widget's dispose() method contains:
    • Future(() => ...)
    • Future.delayed(...)
    • Timer(...) or Timer.periodic(...)
    • Riverpod ref.read(provider.notifier).someMethod() wrapped in Future
  • Tests pass individually but fail when run together
  • Error appears at end of test, not during widget interaction

Solution

Step 1: Identify the problematic code

Look for patterns like this in your widget:

// BAD: Creates pending timer that test framework detects
@override
void dispose() {
  final notifier = _overlayNotifier;
  if (notifier != null) {
    Future(() => notifier.setSettingsOpen(false));  // <- Problem!
  }
  super.dispose();
}

Step 2: Move cleanup to deactivate()

Use deactivate() instead of dispose() and remove the Future wrapper:

// GOOD: Runs synchronously before widget is removed
@override
void deactivate() {
  _overlayNotifier?.setSettingsOpen(false);  // Direct call, no Future
  super.deactivate();
}

Step 3: Understand the lifecycle difference

  • deactivate(): Called when widget is removed from tree, but State might be reinserted
  • dispose(): Called when State will never build again, permanent cleanup

For most notification/provider cleanup, deactivate() is appropriate.

Verification

  1. Run the specific test that was failing
  2. Run the full test suite
  3. Verify no "Timer is still pending" errors

Example

Before (causes test failure):

class _SettingsScreenState extends ConsumerState<SettingsScreen> {
  OverlayNotifier? _overlayNotifier;

  @override
  void dispose() {
    final notifier = _overlayNotifier;
    if (notifier != null) {
      // This Future creates a pending timer!
      Future(() => notifier.setSettingsOpen(false));
    }
    super.dispose();
  }
}

Read the full file on GitHub · 115 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. 8d ago First seen · 115 lines · 86 tokens per session scan A 218d3dc2144d

Subscribe to this mod's changes

flutter-dispose-timer-test-failure is a skill published in the GitHub repository divinevideo/divine-mobile (265 stars, last pushed today), licensed MPL-2.0. It adds 86 tokens to every session and 838 once invoked, about $0.0004 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

systematic-debugging

4-phase root cause debugging: understand bugs before fixing.

NousResearch/hermes-agent · 16 tokens

langsmith-observability

LLM observability platform for tracing, evaluation, and monitoring. Use when debugging LLM applications, evaluating model outputs against datasets, monitoring production systems, or building systematic testing pipelines for AI applications.

davila7/claude-code-templates · 45 tokens

experimental-code-coverage-local-debugger

Runs code coverage locally via Universal Test Runner (UTR) or helper scripts, mimicking LUCI trybots. Activate when CQ tryjobs fail or underreport coverage, to test local GN/recipe repairs before uploading, or to debug hermetic crashes.

chromium/chromium · 59 tokens

adversarial-reviewer

Adversarial code review that assumes bugs exist and hunts for them. Use when asked to review code, find bugs, audit for correctness, stress-test a PR, or when someone says "tear this apart" or "what's wrong with this". Give no benefit of the doubt — every line is guilty until proven innocent.

emdash-cms/emdash · 71 tokens

cli-e2e

Write, modify, or debug Docker-based Composio CLI end-to-end tests under ts/e2e-tests/cli, including binary invocation, fixture isolation, output assertions, and package manifests. Use for CLI E2E test suites only; use cli-command for CLI source implementation.

ComposioHQ/composio · 62 tokens

ios-simulator

Verify and debug native, React Native, Expo, or Flutter apps on an iOS Simulator with agent-device. Use when an agent needs to launch an app, inspect its live UI, tap, type, scroll, validate a code change, collect failure evidence, or reproduce a workflow on an iPhone or iPad Simulator.

callstack/agent-device · 69 tokens