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.

referencesnext-js.md

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

Effect 3 and Next.js

Use this reference only for projects using @prb/effect-next. Inspect the installed package README and declarations before relying on an API because the package is experimental.

Choose the Boundary Helper

  • Route handlers: build a named handler with Next.make(name, layer) from @prb/effect-next/handlers, then expose methods with Route.build.
  • Server actions: provide the application Layer at the action boundary, then use runServerAction or runServerActionOrThrow from @prb/effect-next/action according to the caller's error contract.
  • Request data: call the Effects exported as Headers(), Cookies(), and DraftMode(); they are not service tags.
  • Navigation: yield the package navigation helpers so redirects, rewrites, and not-found behavior remain in the Effect control flow.

Pick the Cache by Lifetime

  • reactCache(effectFn) from @prb/effect-next/react-cache deduplicates work within one React request. It rejects Effects requiring Scope; move resource acquisition into a Layer. The root export's reactCache(effect, runtime) is a different Promise-returning helper.
  • cachedEffect and cachedEffectWithKey implement cross-request cache-aside behavior with an explicit store, TTL, optional stale-while-revalidate window, Schema, and failure policy.
  • Cache-control helpers build browser/CDN headers. Set visibility explicitly and keep browser, generic CDN, and Vercel CDN policies distinct.

Reading Headers or Cookies opts the route into dynamic rendering. Keep those reads out of layouts or components that must remain static or CDN-cacheable.

Middleware and Telemetry

Compose middleware through the route builder and package middleware tags/layers; do not hand-roll a parallel handler pipeline. Use the telemetry adapter Layer only when an application supplies the backend. Bound sampling and redact high-cardinality or sensitive values on high-volume routes.

Use the package testing kit for its documented Exit and runtime helpers, but preserve the host project's Vitest and @effect/vitest conventions.

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