concurrent-collections-and-synchronizerslisted
Install: claude install-skill robsonkades/agent-skills
# Concurrent Collections and Synchronizers
## Purpose
Once "use a concurrent collection", "use a queue" or "use a limit" is the decision, this is the
next one: **which member of the family, with which parameter, and what breaks when it is wrong.**
These failures are rarely exceptions — a consumer that idles with work queued, a limit of 8 that
admits 12, a latch nobody counts down, a heap dump full of queue nodes. The _rule_ that a
thread-safe collection does not make a sequence atomic belongs to java-thread-safety-contracts;
the mechanism it implies is here. Baseline **Java 25**; vendor support status and
version-sensitive claims must be checked separately.
Before applying that authoring baseline, inspect the target compiler release/toolchain,
deployed JDK/vendor/build and existing dependencies. Do not upgrade or enable preview merely
to apply this skill. `StructuredTaskScope` is preview in Java 25; route to
structured-concurrency for its version-specific API and compiler/runtime flags, and use
existing stable coordination APIs when preview is not authorized.
## Workflow
1. **Inspect the invariant and caller lifecycle first.** Reuse code, tests and the supplied context:
what must be atomic, who owns accepted work/resources, and what ends a wait? Ask only for missing
answers that change the choice. Retain an adequate existing lock or unshared collection.
If overload can occur, name the admission policy: state
the capacity or explain why an intrinsically unboun