agentleFS
thiennc-tesoglobalthiennc-tesoglobal/flutter-skills/skills/dart-concurrency/SKILL.md

dart-concurrency

Skill16 starsChanged 3 months agoBSD-3-ClauseView on GitHub

Design and debug Dart asynchronous infrastructure with Future, Stream, isolates, cancellation, and lifecycle-safe ownership. Use for races, stale results, background CPU work, stream leaks, or async error handling; not for routine form-local validation or submission unless its underlying ordering mechanism is the task.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use Future for one result and Stream for a sequence over time.

    line 16
  2. Distinctive:

    Avoid unawaited work unless independence and error handling are intentional.

    line 17
  3. Distinctive:

    Use isolates for measured CPU-bound work or isolation needs, not ordinary network I/O.

    line 21
  4. Distinctive:

    Do not hide async ownership inside global helpers.

    line 25
  5. Distinctive:

    Test success, failure, cancellation/disposal, and out-of-order completion.

    line 29
  6. Distinctive:

    Read isolate communication and worker pools when handling heavy CPU computations, port messaging, or background worker threads.

    line 33
  7. Distinctive:

    Read stream cancellation and debouncing when managing subscription lifecycles, race conditions, debounce/throttle, or latest-wins semantics.

    line 34

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Dart Concurrency

Make ownership, ordering, cancellation, and error propagation explicit.

Diagnose first

Identify the producer, consumer, lifecycle owner, ordering requirement, and desired behavior when work becomes obsolete. Reproduce the race or leak before adding synchronization-like machinery.

Decision rules

  • Use Future for one result and Stream for a sequence over time.
  • Avoid unawaited work unless independence and error handling are intentional.
  • Cancel subscriptions and controllers according to the owning object's lifecycle.
  • Guard UI updates after async gaps with the lifecycle mechanism appropriate to the project.
  • Prevent stale requests from overwriting newer state through cancellation, tokens, sequencing, or latest-wins logic.
  • Use isolates for measured CPU-bound work or isolation needs, not ordinary network I/O.
  • Send transferable values across isolate boundaries and surface failures to the caller.
  • Preserve stack traces when translating errors.

Do not hide async ownership inside global helpers. Keep retry and timeout policy at a boundary that understands idempotency and user intent.

Verification

Test success, failure, cancellation/disposal, and out-of-order completion. Run static analysis; add a focused stress or fake-time test when timing is central to the bug.

References

  • Read isolate communication and worker pools when handling heavy CPU computations, port messaging, or background worker threads.
  • Read stream cancellation and debouncing when managing subscription lifecycles, race conditions, debounce/throttle, or latest-wins semantics.

Sources

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.