skills/cats-effect-io/SKILL.md
Helps agents write and review Scala Cats Effect IO code. Use for suspending side effects and non-determinism in IO or F[_], choosing Sync/Async/Temporal/Concurrent/Clock/Random, handling blocking I/O, testing with TestControl, and composing resources, fibers, races, and structured concurrency safely.
npx skillsauth add alexandru/skills cats-effect-ioInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
IO[A], SyncIO[A], or F[A] with the smallest needed Cats Effect capability.Instant.now(), random/UUID generation, environment reads, and mutable allocation such as new Array[...] belong inside IO(...), Sync[F].delay, Clock, Random, or an effectful factory.IO/F/Resource factories and pass the resulting reference or service around. Do not hide effects in constructors, top-level vals, or default arguments.IO.interruptible by default (or Sync[F].interruptible); use blocking for acquisition, finalizers, and operations that must not be interrupted.Resource to acquire/release resources and IOApp for program entry points.parTraverse, parMapN, background, Supervisor) over manual fiber management.unsafeRun* (unsafeRunSync, unsafeRunAndForget, etc.) in app code or tests; for interop with non-Cats-Effect callback APIs, use Dispatcher.references/cats-effect-io.md for concepts, recipes, FAQ guidance, and verified samples.Resource guidance, use the cats-effect-resource skill (install: npx skills add https://github.com/alexandru/skills --skill cats-effect-resource).IO or polymorphic F[_] with the smallest capability (Clock, Random, Sync, Async, Temporal, Concurrent, etc.).IO(...), IO.interruptible, IO.blocking, IO.async, or the corresponding typeclass operation.create/resource factories returning F[A] or Resource[F, A].flatMap/for-comprehensions and collection combinators (traverse, parTraverse).Ref, Deferred, Queue, Semaphore, Supervisor) and structured concurrency to avoid fiber leaks.IOApp, framework runtime); for callback-style interop, bridge with Dispatcher.IO, SyncIO, and to F[_]: Sync/Async)IO (or F[_] with Cats Effect typeclasses/capabilities).Instant.now(), System.currentTimeMillis(), Random.nextInt(), UUID.randomUUID().Array, mutable.Map, Java collections, AtomicReference, caches).IO.interruptible/Sync[F].interruptible for blocking use-phase operations. This gives cancellation a chance to interrupt the underlying thread and is the right default for network/socket-style blocking APIs.interruptible; some APIs still ignore interruption, so add a resource-specific cancellation protocol when cancellation responsiveness matters and testing shows interruption is not enough.IO.blocking/Sync[F].blocking for acquisition, cleanup, and disposal (Closeable#close, AutoCloseable#close), where attempted interruption can leave lifecycle state ambiguous.IO/SyncIO or F[_]: Sync/Async); the guidance here applies equally to concrete IO and polymorphic F[_].scripts/verify-examples.scala script.unsafeRun* is forbidden in production and test code, including import cats.effect.unsafe.implicits.global.Dispatcher.IO[Assertion]/F[Assertion]) instead of manually running effects.IO.sleep/Thread.sleep in unit tests unless using virtual time with TestControl.references/cats-effect-io.md for documentation summary and patterns.references/cats-effect-io.md; the representative check is scripts/verify-examples.scala.cats-effect-resource skill for Resource-specific workflows and patterns (install: npx skills add https://github.com/alexandru/skills --skill cats-effect-resource).development
Scala auto-derivation with Kindlings for Circe and PureConfig. Use when replacing circe-generic/circe-generic-extras or PureConfig generic derivation with Kindlings while keeping normal Circe JSON APIs and PureConfig loading/writing APIs.
development
Simplifies code for clarity without changing behavior. Use when code is working but overly complex, deeply nested, duplicated, or unclear.
development
Helps agents design and review Kotlin library APIs for Java consumers. Use when building Kotlin code intended for Java callers, shaping JVM signatures with @JvmName, @JvmOverloads, @JvmStatic, @JvmField, @Throws, @JvmRecord, nullability, records, and backward/binary compatibility rules.
tools
JSpecify nullness annotations for Java APIs and tooling. Use when adopting or migrating JSpecify annotations, designing null-safe Java signatures, fixing generic bounds and type-use placement, or interpreting Kotlin interop, annotation-processor, and tool-conformance behavior.