arrow-resource

Installation
SKILL.md

Arrow Resource (Kotlin)

Quick start

  • Treat every disposable handle as scoped: wrap it in Resource and acquire it only inside resourceScope, resource {}, or Resource.use.
  • Prefer arrow.fx.coroutines.resource.context imports for context-parameter-friendly resource, resourceScope, bind, install, and autoCloseable.
  • Never return a disposable value from resourceScope { ... }, resource { ... }, or resource.use { ... }; that returns a closed handle.
  • Classes must not allocate owned resources in ordinary constructors. Use a companion builder returning Resource<Class> or requiring context(ResourceScope).
  • If suspend Resource cannot be used, use arrow-autoclose/AutoCloseable with the same no-leak discipline.
  • Read references/resource.md before writing examples, reviews, or new APIs.

Workflow

  1. Identify every owned disposable dependency and its release action.
  2. Move acquisition into a Resource recipe or context(ResourceScope) builder.
  3. Compose resources into higher-level resources with .bind() or context-parameter builders.
  4. Keep resource handles private to the scoped object; expose operations, not the raw handle.
  5. Execute at lifecycle boundaries with resourceScope/.use, and keep finalizers idempotent.
Installs
12
GitHub Stars
49
First Seen
Feb 1, 2026
arrow-resource — alexandru/skills