effect-schema-composition

Compose, transform, and validate data with Effect Schema v4 patterns.

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-schema-composition-lambdasolver2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-schema-composition
Source: https://github.com/lambdasolver2/opencode-effect-harness/tree/main/packages/module-typescript/assets/skills/effect-schema-composition
Command: npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-schema-composition-lambdasolver2

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires effect.

What problem does it solve? Writing correct Effect Schema v4 code requires knowing which composition API to use—Schema.decodeTo for type-changing transformations, .check() for same-type refinements, and SchemaTransformation objects for reusable transforms—and how v4 differs from v3 patterns like Schema.compose and Schema.split. ## Core Features & Use Cases - Schema Composition: Chain multi-stage transformations with Schema.decodeTo and apply sequential refinements with .check() filters. - Built-in and Custom Filters: Use Schema.isXxx() validators, Schema.makeFilter for custom logic with error paths, and SchemaGetter.checkEffect for async validation. - Transformations and Structs: Build reusable SchemaTransformation objects, manipulate structs via mapFields with Struct.pick/omit/assign, and handle optional fields and decoding defaults. - Use Case: When building an API response parser that decodes string IDs to numbers, validates email formats, and transforms nested user objects, this skill provides the exact v4 patterns and a quality checklist to avoid deprecated v3 APIs. ## Quick Start Ask the AI to write an Effect Schema v4 schema that decodes a string to a branded positive integer with validation filters and proper error messages.

Frequently Asked Questions about effect-schema-composition

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I chain schema transformations in Effect Schema v4?

Use Schema.decodeTo to chain schemas where each stage changes the type, connecting one schema's output to another's input. For same-type refinements, use .check() with filters like Schema.isInt() instead.

What is the difference between Schema.decodeTo and .check() in Effect?

Schema.decodeTo chains transformations that change the type at each stage, such as string to number. The .check() method applies validation refinements that keep the same type, like constraining a number to be positive.

How do I replace Schema.compose from Effect v3 in v4?

Schema.compose was replaced by Schema.decodeTo in v4. Pipe the source schema into Schema.decodeTo with the target schema, optionally passing a SchemaTransformation object when an explicit transformation is needed.

Does Effect Schema v4 support async validation?

Yes, use SchemaGetter.checkEffect inside a Schema.decode transformation for effectful async validation, such as checking a username against a remote service. Decode with Schema.decodeUnknownEffect since sync APIs cannot run async schemas.

Why was Schema.split removed in Effect v4 and what replaces it?

Schema.split was removed in v4 and must be implemented manually. Pipe Schema.String through Schema.decodeTo with SchemaTransformation.transform, using split in decode and join in encode.

How do I pick or omit fields from an Effect Schema struct?

Use schema.mapFields with Struct.pick or Struct.omit instead of the v3 schema.pick and schema.omit methods. You can also extend structs with Schema.fieldsAssign or Struct.assign.