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.

referencesschema-jsonschema.md

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

Schema and JSON Schema

Use Schema to decode untrusted input once at an IO boundary, then pass validated domain values internally. Prefer the Effect-returning decoder inside Effect code so parse failures stay typed.

import { Schema } from "effect";

const UserId = Schema.NonEmptyTrimmedString.pipe(Schema.brand("UserId"));

class User extends Schema.Class<User>("app/User")({
  id: UserId,
  email: Schema.NonEmptyTrimmedString,
}) {}

const decodeUser = Schema.decodeUnknown(User);

Model the Domain Precisely

  • Prefer Schema.Class for named entities and API models that need construction, encoding, annotations, or structural equality.
  • Brand identifiers and constrained primitives instead of weakening them to Schema.String or Schema.Number.
  • Use Schema.TaggedError for errors that cross encoded boundaries; use Data.TaggedError for internal-only errors.
  • Reuse decoders and encoders at module scope rather than rebuilding them for each request.

Encode Absence Intentionally

  • Schema.optionalWith(schema, { as: "Option" }) is appropriate when absence belongs to the decoded domain model.
  • Schema.NullOr(schema) is appropriate when the encoded contract uses null.
  • Exact optional fields reject unexpected keys when the boundary requires a closed shape.
  • Avoid *FromSelf schemas for JSON contracts unless the input is intentionally already decoded.

See option-null.md for the project boundary rule.

JSON Schema Consumers

For a closed no-parameter object, use Schema.Record({ key: Schema.String, value: Schema.Never }) or a library's named equivalent such as Tool.EmptyParams. Do not replace it with a loose record.

When generating JSON Schema directly, verify JSONSchema.fromAST options against the installed source. If generation fails, inspect unsupported AST nodes and missing annotations before weakening the domain schema.

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