All skills
paulrberg avatar

/effect-ts

@5a97bbf
by Paul Bergpaulrberg/agent-skills94 stars
7

Use for nontrivial Effect 3 work including services/layers, typed errors, Schema/JSONSchema, Config, runtime/concurrency, @effect/vitest, @effect/ai, @effect/sql, Effect Atom, or @prb/effect-next.

Use this Skill: https://skilld.dev/gh/paulrberg/agent-skills/effect-ts

This session only. Nothing lands on disk.

referencestesting.md

≈441 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Testing Effect 3 with Vitest

Use @effect/vitest for Effect programs. Keep assertions inside the returned Effect and run only the tests covering the changed behavior.

Choose the Test Runtime

  • it.effect provides Effect's test environment, including TestClock.
  • it.live uses live runtime services.
  • it.scoped combines the test environment with a Scope.
  • it.scopedLive combines live services with a Scope.
  • layer(...) shares one Layer across a test block; use nested it.layer(...) when a subgroup needs another Layer.

Use regular it for pure synchronous tests. Do not call Effect.runPromise, runSync, or another runtime launcher inside an Effect test; that escapes the test runtime and can silently replace test services.

Advance Virtual Time Deliberately

Under it.effect, time does not advance until the test calls TestClock.adjust or TestClock.setTime. Fork the effect that sleeps, retries, polls, or repeats, then advance enough time for the whole schedule and join the fiber. Use it.live only when wall-clock behavior is genuinely under test.

Production Effect code should read time through Clock or DateTime, not Date.now, so tests can control it.

Prove Fiber Startup Before Opening Gates

Forking schedules a fiber; it does not prove that the fiber reached the intended coordination point. For overlap, deduplication, or sharing tests, have the worker complete a started Deferred immediately before awaiting a separate gate. Await started before opening the gate.

Bound and Release

Bound infinite streams and polling loops. Join or interrupt every fiber. Use scoped tests when code allocates scoped resources, and let Layer/test scopes own finalizers instead of launching detached runtimes.

Source: SKILL.md on GitHub

No alerts7d5 checks · Risk SAFE
  • Gen Agent Trust Hub7d

    The skill provides comprehensive guidelines and best practices for developing with the Effect 3 library ecosystem. It focuses on correct usage of functional programming patterns, error handling, configuration management, and testing, while promoting security-aware practices like secret redaction and runtime schema validation.

  • Socket7d

    No alerts

  • Snyk7d

    Risk: LOW · No issues

  • Runlayer6mo

    7 files scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 5a97bbf. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 months ago
Other metadata
compatibility
Requires a project using current stable Effect 3 packages; verify exact APIs against the target's installed package source.

README badge

README badge for paulrberg/agent-skills/effect-ts