cats-effect-io

Installation
SKILL.md

Cats Effect IO (Scala)

Quick start

  • Treat every side effect as an effect value: return IO[A], SyncIO[A], or F[A] with F[_]: Sync/Async/Temporal as needed.
  • Wrap Java blocking calls with IO.blocking or IO.interruptible (or Sync[F].blocking/interruptible).
  • Use Resource to acquire/release resources and IOApp for program entry points.
  • Prefer structured concurrency (parTraverse, parMapN, background, Supervisor) over manual fiber management.
  • Do not use unsafeRun* (unsafeRunSync, unsafeRunAndForget, etc.) in app code or tests; for interop with non-Cats-Effect callback APIs, use Dispatcher.
  • Read references/cats-effect-io.md for concepts, recipes, and FAQ guidance.
  • For deeper Resource guidance, use the cats-effect-resource skill (install: npx skills add https://github.com/alexandru/skills --skill cats-effect-resource).

Workflow

  1. Classify side effects and choose the effect type: IO directly or polymorphic F[_] with the smallest required Cats Effect typeclass (Sync, Async, Temporal, Concurrent).
  2. Wrap side-effectful code using IO(...), IO.blocking, IO.interruptible, or IO.async (or their Sync/Async equivalents).
  3. Manage resources with Resource or bracket and keep acquisition/release inside effects.
  4. Compose effects with flatMap/for-comprehensions and collection combinators (traverse, parTraverse).
  5. Use concurrency primitives (Ref, Deferred, Queue, Semaphore, Supervisor) and structured concurrency to avoid fiber leaks.
  6. Keep effect execution at boundaries (IOApp, framework runtime); for callback-style interop, bridge with Dispatcher.
Related skills

More from alexandru/skills

Installs
40
GitHub Stars
39
First Seen
Feb 3, 2026