effect-ts — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited effect-ts (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Expert guidance for functional programming with the Effect library, covering error handling, dependency injection, composability, testing, and runtime-boundary patterns.
Use this skill for nontrivial Effect work. Do not route through this skill just because a file imports from effect; use it when the change depends on Effect semantics such as services, layers, typed errors, Schema, Config, runtime/concurrency, streams, or Effect-aware tests.
For small code edits:
./references/critical-rules.md before writing or changing Effect code.Check the Effect source at ~/.effect only when the task needs upstream API details, changelog verification, or a complex type/runtime question that local project patterns do not answer.
If ~/.effect is required but missing, stop and inform the user. Clone it before proceeding:
git clone https://github.com/Effect-TS/effect.git ~/.effectLast checked against ~/.effect HEAD 05d72eab7 from 2026-06-05:
[email protected]@effect/[email protected]@effect/[email protected]@effect/[email protected]@effect/[email protected]@effect/[email protected]@effect/[email protected]Your local ~/.effect checkout need not match these exact versions. Drift is expected and fine as long as the major versions match. For effect that means the 3.x line. For the 0.x @effect/* packages, semver treats the leading non-zero segment as the break boundary, so match the minor too (e.g. @effect/[email protected]). Patch differences, and minor differences on stable packages, won't invalidate this skill's guidance; only a break-boundary bump warrants caution.
Local ~/.effect drift is usually fine for routine project work. If git -C ~/.effect log -1 --oneline is newer and the task depends on upstream behavior, inspect the touched package changelogs and commits before relying on this skill. Capture public API or guidance changes in a reference file.
Effect-TS has many ways to accomplish the same task. For moderate to high complexity tasks, research enough to choose the least surprising pattern that fits the current codebase. Prefer parallel local reads/searches. Use subagents only when the environment explicitly supports them and the task has separable research tracks.
exist in the codebase, follow them for consistency. If no patterns exist, skip this step.
package source under ~/.effect/packages/<package>/src/. For core Effect, use ~/.effect/packages/effect/src/.
~/.effect/packages/*/before inferring from old examples.
HIGH Priority (Always Research):
MEDIUM Priority (Research if Complex):
Open references selectively:
| Task shape | Read |
|---|---|
| Writing/changing Effect code | ./references/critical-rules.md |
Services, Layers, Effect.Service, Context.Tag, Effect.fn | ./references/services-layers.md |
| Config, env vars, secrets, custom providers | ./references/config.md |
| Schema decoding, JSON Schema, AI parameter shapes | ./references/schema-jsonschema.md |
@effect/vitest, TestClock, sleeps/retries, fibers in tests | ./references/testing.md |
Resources, scheduling, refs, concurrency, SubscriptionRef | ./references/runtime.md |
| Streams, backpressure, bounded consumption | ./references/streams.md |
Pattern matching, tagged unions, Data.taggedEnum | ./references/pattern-matching.md |
@effect/ai tools/providers/OpenAI integration | ./references/ai.md |
@effect/sql, SqlSchema, repository row decoding | ./references/sql.md |
@effect/platform, @effect/rpc, deployment runtimes | ./references/platform-rpc.md |
@prb/effect-next / Next.js App Router | ./references/next-js.md |
@effect-atom/* React state | ./references/effect-atom.md |
| Array/Record reducers, filters, predicates, sorting | ./references/collection-operations.md |
| Tiny utility functions, deprecations | ./references/quick-utils.md |
| Upstream drift or recent package behavior | ./references/recent-upstream.md |
When working in a project that uses Effect, check for existing patterns before implementing new code:
'effect' to understand existing usageIf no Effect patterns exist in the codebase, proceed using canonical patterns from the Effect source and examples. Do not block on missing codebase patterns.
Apply these core principles when writing Effect code:
Schema.TaggedError for domain/API errors that cross serialization or HTTP boundariesData.TaggedError for internal, non-encoded errors when Schema integration is unnecessaryEffect.fail, Effect.catchTag, Effect.catchAll for error control flow./references/critical-rules.md for forbidden patternsContext.TagLayer.merge, Layer.provideEffect.provide to inject dependenciesEffect.succeed, Effect.fail, Effect.tryPromise, Effect.tryEffect.flatMap, Effect.map, Effect.tapSchema.Class for domain and API models that need construction, validation, encoding, or equalityEffect.gen for readable sequential codeEffect.fn() for automatic telemetry and better stack tracesdesign.
platform APIs.
@effect/platform services such as FileSystem and Path are environment requirements. Keep them inside existingservice/runtime boundaries unless widening a function's environment is a deliberate design improvement.
config services.
Read ./references/critical-rules.md before writing or changing nontrivial Effect code. Key guidelines:
return yield* pattern for errors (makes termination explicit)Quick links to patterns that frequently cause issues:
unsafeMake is not a function → runtime.mdSchema.Record(String, Never) emits no extra properties →Tool.EmptyParams or omit parameters → ai.mdLayer.fresh only when needed →When providing solutions, explain the Effect-TS concepts being used and why they're appropriate for the specific use case. If encountering patterns not covered in the documentation, suggest improvements while maintaining consistency with existing codebase patterns (when they exist).
Effect.succeed(value) // Wrap success value
Effect.fail(error) // Create failed effect
Effect.tryPromise(fn) // Wrap promise-returning function
Effect.try(fn) // Wrap synchronous throwing function
Effect.sync(fn) // Wrap synchronous non-throwing functionEffect.flatMap(effect, fn) // Chain effects
Effect.map(effect, fn) // Transform success value
Effect.tap(effect, fn) // Side effect without changing value
Effect.all([...effects]) // Run effects (concurrency configurable)
Effect.forEach(items, fn) // Map over items with effects
// Collect ALL errors (not just first)
Effect.all([e1, e2, e3], { mode: "validate" }) // Returns all failures
// Partial success handling
Effect.partition([e1, e2, e3]) // Returns [failures, successes]// Domain/API errors that cross boundaries: prefer Schema.TaggedError
class UserNotFoundError extends Schema.TaggedError<UserNotFoundError>()(
"UserNotFoundError",
{
userId: Schema.String
}
) {
get message() {
return `User not found: ${this.userId}`
}
}
// Internal-only errors may use Data.TaggedError
class CacheMissError extends Data.TaggedError("CacheMissError")<{
userId: string
}> {}
// Direct yield of errors (no Effect.fail wrapper needed)
Effect.gen(function* () {
if (!user) {
return yield* new UserNotFoundError({ userId })
}
})
Effect.catchTag(effect, tag, fn) // Handle specific error tag
Effect.catchAll(effect, fn) // Handle all errors
Effect.result(effect) // Convert to Exit value
Effect.orElse(effect, alt) // Fallback effectCategorize errors for appropriate handling:
| Category | Examples | Handling |
|---|---|---|
| Expected Rejections | User cancel, deny | Graceful exit, no retry |
| Domain Errors | Validation, business rules | Show to user, don't retry |
| Defects | Bugs, assertions | Log + alert, investigate |
| Interruptions | Fiber cancel, timeout | Cleanup, may retry |
| Unknown/Foreign | Thrown exceptions | Normalize at boundary |
// Pattern: Normalize unknown errors at boundary
const safeBoundary = Effect.catchAllDefect(effect, (defect) =>
Effect.fail(new UnknownError({ cause: defect }))
)
// Pattern: Catch user-initiated cancellations separately
Effect.catchTag(effect, "UserCancelledError", () => Effect.succeed(null))
// Pattern: Handle interruptions differently from failures
Effect.onInterrupt(effect, () => Effect.log("Operation cancelled"))When you need to use Effect's Match module for pattern matching, see references/pattern-matching.md.
For schema decoding, JSON Schema generation, closed object shapes, and Schema.Record({ key: Schema.String, value: Schema.Never }), see references/schema-jsonschema.md.
For @effect/ai tool definitions, empty tool parameters, OpenAI strict schema behavior, and prompt cache enum gotchas, see references/ai.md.
For service definition patterns (Context.Tag, Effect.Service, Context.Reference, Context.ReadonlyTag) and the generator pattern (Effect.gen, Effect.fn), see references/services-layers.md.
For resource lifecycles, durations, scheduling, state management, reactive refs, and concurrency primitives, see references/runtime.md.
When you need to read configuration with Config, handle secrets via Redacted, or wire custom config providers, see references/config.md.
For Effect's Array/Record reducers, filters, predicates, object traversal replacements, and Order sorting helpers, see references/collection-operations.md.
For small utility functions like constVoid and the running list of deprecations, see references/quick-utils.md.
For HttpLayerRouter, RpcSerialization.makeMsgPack, and deployment gotchas such as Cloudflare Workers msgpack support, see references/platform-rpc.md.
@effect/ai tools, Tool.EmptyParams, OpenAI provider notesConfig, Redacted, and custom config providersArray/Record reducers, filters, predicates, sortingMatch module for tagged unions and conditionals@effect/platform and @effect/rpc integration notesEffect.gen / Effect.fn)@effect/sql, SqlSchema, row decoding, repository patterns~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.