Agent skill

Squadron Worker

by d-markey in d-markey/squadron

A skill your agent uses when building, writing, or refactoring Squadron workers, worker pools, worker services, or using squadronbuilder annotations (@SquadronService, @SquadronMethod) for…

MITAuto-check passedMobile

Install Squadron Worker

skills CLI
$ npx skills add d-markey/squadron --skill squadron-worker -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install d-markey/squadron squadron-worker --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/d-markey/squadron.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/squadron-worker .claude/skills/squadron-worker && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
squadron-worker
GitHub stars
138
Token cost
~1.6k tokens
SKILL.md length
652 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when building, writing, or refactoring Squadron workers, worker pools, worker services, or using squadronbuilder annotations (@SquadronService, @SquadronMethod) for…

  • Works in 8 steps: Setup & Dependencies → Authoring a Service (@SquadronService) → Required Parts, Imports & Generated… → …
  • Refactoring Squadron workers
  • SKILL.md covers 1. Setup & Dependencies, 2. Authoring a Service…, 3. Required Parts, Imports &… and 4. Code Generation Command, plus 4 more sections
  • Calls dart

What it does

Squadron Worker is an agent skill from d-markey/squadron. Use when building, writing, or refactoring Squadron workers, worker pools, worker services, or using squadronbuilder annotations (@SquadronService, @SquadronMethod) for cross-platform multithreading in Dart and Flutter.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile, covering Cross-platform mobile apps, Async programming and Refactoring. It works with Dart and Flutter. The repository describes itself as: Multithreading and worker thread pool for Dart / Flutter, to offload CPU-bound and heavy I/O tasks to Isolate or Web Worker threads (JS+WASM). The licence is MIT.

When your agent uses it

  • Refactoring Squadron workers
  • Worker services
  • Using squadronbuilder annotations (@SquadronService
  • @SquadronMethod) for cross-platform multithreading in Dart and Flutter

Example prompts

  • “/squadron-worker”

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Setup & Dependencies
  2. Authoring a Service (@SquadronService)
  3. Required Parts, Imports & Generated Artifacts
  4. Code Generation Command
  5. Service Invocation & Interchangeability
  6. Worker Pool Sizing & Concurrency Settings
  7. Worker Lifecycle Management
  8. Arguments & Return Types (Serialization & Base Types)

What it can do on your machine

Read from SKILL.md and the folder at commit 4ab7f15. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dart

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Squadron Worker loads about 1.6k tokens when it runs. Until then it costs about 59 tokens; SKILL.md has 652 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~59
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from d-markey/squadron at commit 4ab7f15, republished under its MIT licence (© d-markey). 652 words, ~1,570 tokens.

Download SKILL.mdSave it as .claude/skills/squadron-worker/SKILL.md (or your agent's skills folder).
name
squadron-worker
description
Use when building, writing, or refactoring Squadron workers, worker pools, worker services, or using squadron_builder annotations (@SquadronService, @SquadronMethod) for cross-platform multithreading in Dart and Flutter.

Squadron & squadron_builder Developer Guide

Squadron is a multi-threading library for Dart and Flutter providing a unified Actor-pattern API for running background tasks across Native platforms (isolates) and the Web (web workers).

1. Setup & Dependencies

To use Squadron and code generation (squadron_builder), configure your pubspec.yaml:

  • Standard dependency: squadron
  • Dev dependency: squadron_builder and build_runner

2. Authoring a Service (@SquadronService)

Create your business service class in a dedicated file (e.g., my_service.dart).

  • Decorate the class with @SquadronService().
  • Decorate worker methods with @SquadronMethod().
  • Worker methods must return Future<...> or FutureOr<...>.
Example Service Implementation (my_service.dart):
dart
import 'dart:async';
import 'package:squadron/squadron.dart';

part 'my_service.worker.g.dart';
import 'my_service.activator.g.dart';

@SquadronService(targetPlatform: TargetPlatform.all)
class MyService {
  @SquadronMethod()
  Future<String?> computeSomething(String? input, int count) async {
    if (input == null) return null;
    return 'Result: $input ($count)';
  }
}

3. Required Parts, Imports & Generated Artifacts

Every service file must declare a part and an import for the generated files:

  1. part 'my_service.worker.g.dart';: included as a part, this file contains multithreading-aware versions of your service (MyServiceWorker and MyServiceWorkerPool) that handle client-side proxying, request dispatching, and worker lifecycle management.
  2. import 'my_service.activator.g.dart';: imported, this file contains the worker's entry point plumbing required to initialize and run the service inside a background thread (Isolate or Web Worker).

4. Code Generation Command

To generate or update the .worker.g.dart and .activator.g.dart files after modifying your annotated services, run build_runner via the Dart CLI:

bash
dart run build_runner build --delete-conflicting-outputs

5. Service Invocation & Interchangeability

When consumers want to use your service, they simply import my_service.dart. Because of the generated .worker.g.dart part file, importing my_service.dart exposes all three implementations:

  1. MyService: The synchronous/local implementation (running on the main thread).
  2. MyServiceWorker: The background worker proxy running tasks in a single background thread (Isolate/Web Worker).
  3. MyServiceWorkerPool: A worker pool distributing tasks across multiple background workers.

Because MyServiceWorker and MyServiceWorkerPool both implement MyService, all three classes can be used interchangeably behind the MyService interface. This allows you to easily switch between running code synchronously on the main thread, asynchronously in a single worker, or scaled across a worker pool without changing consumer calling code.

6. Worker Pool Sizing & Concurrency Settings

When using MyServiceWorkerPool, proper sizing is crucial for performance and resource utilization. You configure concurrency settings via ConcurrencySettings:

Key Pool Sizing Parameters:
  • minWorkers: The minimum number of workers kept alive in the pool.
  • maxWorkers: The maximum number of concurrent workers allowed.
  • maxConcurrency: The maximum number of simultaneous tasks a single worker can handle before the pool spins up an additional worker (up to maxWorkers).
  • idleTimeout: Duration after which idle workers are terminated to free up resources.
Example Pool Instantiation:
dart
final pool = MyServiceWorkerPool(
  // Provide your worker entrypoint function
  activator,
  concurrencySettings: ConcurrencySettings(
    minWorkers: 2,
    maxWorkers: 4,
    maxConcurrency: 2,
    idleTimeout: Duration(seconds: 30),
  ),
);
Show full SKILL.md (267 more words)Show less
Sizing Best Practices:
  • CPU-bound tasks: Set maxWorkers close to the number of available hardware CPU cores (e.g., Platform.numberOfProcessors) to prevent context-switching overhead.
  • I/O-bound tasks: You can set maxWorkers higher than the core count if workers spend most of their time waiting on network or disk I/O.
  • maxConcurrency tuning: Increase maxConcurrency if your worker tasks are lightweight or asynchronous, allowing a single worker isolate/web worker to multiplex multiple requests efficiently without spawning extra threads.

7. Worker Lifecycle Management

  • Startup (start()):
    • worker.start() (and pool initialization) is automatically invoked by Squadron on the very first worker call (lazy initialization).
    • However, you can call worker.start() explicitly upfront during application or feature initialization to avoid latency on the first method invocation.
  • Shutdown (stop()):
    • worker.stop() (or terminating the WorkerPool via pool.stop()) must always be called when the worker is no longer needed.
    • Crucial: Failure to call stop() leaves an active communication stream/port open between the main thread and the worker thread. This background connection prevents the Dart VM event loop from draining, causing the program to never terminate.

8. Arguments & Return Types (Serialization & Base Types)

  • Recommended Types: Stick to base types and collections for arguments and return values:
    • Primitives: int, double, String, bool, and null (along with their nullable variants, e.g., int?, String?).
    • Collections: List<BaseType?>? and Map<BaseType, BaseType?>?.
  • Squadron automatically handles serialization across the main thread and worker thread boundaries for these types and null.
  • Custom Classes: Passing custom objects requires special handling for cross-platform compatibility (native VM isolates have minimal constraints, but the Web platform only supports transferable objects / primitive serialization). For custom objects and serialization details, refer to the marshaling skill.

© d-markey, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/squadron-worker of d-markey/squadron.

Open the folder on GitHubat commit 4ab7f15

Compare with similar skills

Squadron Worker next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Squadron Worker compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Squadron Worker this skilld-markey/squadron138—~1.6kAutomated safety check: PassMIT
Liquid Glass Widgetssdegenaar/liquid_glass_widgets712—~3.8kAutomated safety check: PassMIT
Code Guidelinesgetsentry/sentry-dart873—~2.2kAutomated safety check: PassMIT
Signals Core Advanced Primitivesrodydavis/signals.dart819—~1.7kAutomated safety check: PassApache-2.0
Flutter Handling Concurrencybtwld/superdeck130—~1.8kAutomated safety check: PassBSD-3-Clause
Flutter ConcurrencyHoangNguyen0403/agent-skills-standard571—~680Automated safety check: PassMIT

Similar skills

  • Liquid Glass Widgets

    sdegenaar/liquid_glass_widgets

    Mastery guide and architectural rules for liquidglasswidgets.

    712 GitHub stars~3.8k tokensUpdated today
    MobileAuto-check passed
  • Code Guidelines

    getsentry/sentry-dart

    Official

    Enforce Sentry Dart/Flutter SDK code guidelines for implementation, refactoring, and review.

    873 GitHub stars~2.2k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Signals Core Advanced Primitives

    rodydavis/signals.dart

    Reference for the advanced parts of Dart's signals_core: reactive primitives, async signals, reactive collections and utility types, with a linked page for each.

    819 GitHub stars~1.7k tokensUpdated 24 days ago
    DevelopmentAuto-check passed
  • Executes long-running tasks in background isolates to keep the UI responsive.

    130 GitHub stars~1.8k tokensUpdated 10 days ago
    MobileAuto-check passed
  • Flutter Concurrency

    HoangNguyen0403/agent-skills-standard

    Execute long-running tasks in background isolates to keep the UI responsive.

    571 GitHub stars~680 tokensUpdated yesterday
    MobileAuto-check passed
  • Test Guidelines

    getsentry/sentry-dart

    Official

    Enforce Sentry Dart/Flutter SDK test conventions for naming, structure, and fixtures.

    873 GitHub stars~3.1k tokensUpdated yesterday
    Testing & QAAuto-check passed

More from d-markey/squadron

  • Squadron Cancelation

    d-markey/squadron

    A skill your agent uses when implementing task cancelation, handling CancelationToken, propagating cancelation signals across thread/worker boundaries, and dealing with synchronous vs.

    138 GitHub stars~922 tokensUpdated 16 days ago
    Auto-check passed
  • Squadron Marshaling

    d-markey/squadron

    A skill your agent uses when handling custom classes, object serialization, deserialization, and custom marshalers (SquadronMarshaler, GenericMarshaler, MarshalingContext) for cross-platform worker…

    138 GitHub stars~2.6k tokensUpdated 16 days ago
    Auto-check passed

Works with

Questions about Squadron Worker

What does Squadron Worker do?

A skill your agent uses when building, writing, or refactoring Squadron workers, worker pools, worker services, or using squadronbuilder annotations (@SquadronService, @SquadronMethod) for…. Squadron Worker is an agent skill from d-markey/squadron. Use when building, writing, or refactoring Squadron workers, worker pools, worker services, or using squadronbuilder annotations (@SquadronService, @SquadronMethod) for cross-platform multithreading in Dart and Flutter.

When should I use Squadron Worker?

Squadron Worker fits situations like: refactoring Squadron workers; worker services; using squadronbuilder annotations (@SquadronService; @SquadronMethod) for cross-platform multithreading in Dart and Flutter.

How do I install Squadron Worker in Claude Code?

Run `npx skills add d-markey/squadron --skill squadron-worker -a claude-code`. Or copy the skill folder (skills/squadron-worker in d-markey/squadron) into .claude/skills/squadron-worker in your project. Claude Code loads it when a task matches its description.

How do I install Squadron Worker in Codex?

Run `npx skills add d-markey/squadron --skill squadron-worker -a codex`. Or copy the skill folder (skills/squadron-worker in d-markey/squadron) into .agents/skills/squadron-worker in your project. Codex loads it when a task matches its description.

Can I use Squadron Worker in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add d-markey/squadron --skill squadron-worker -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/squadron-worker, .gemini/skills/squadron-worker, .github/skills/squadron-worker and .opencode/skills/squadron-worker in your project.

What does Squadron Worker need to run?

Going by SKILL.md and its folder, Squadron Worker needs the command-line tools its instructions call (dart).

Does Squadron Worker access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Squadron Worker safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Squadron Worker use?

Squadron Worker is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Squadron Worker use?

About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Squadron Worker?

Skills that share tags, products or a category with Squadron Worker: Liquid Glass Widgets (sdegenaar/liquid_glass_widgets, 712 stars), Code Guidelines (getsentry/sentry-dart, 873 stars), Signals Core Advanced Primitives (rodydavis/signals.dart, 819 stars) and Flutter Handling Concurrency (btwld/superdeck, 130 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Squadron Worker?

d-markey (a GitHub user) maintains it in d-markey/squadron, which has 138 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on September 22, 2026.

Source: d-markey/squadron on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.