effect-schema-v4

Documents Effect Schema v4 API changes and migration patterns from v3.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Effect Schema v4 renamed and restructured many APIs from v3, so code written with v3 patterns fails or behaves incorrectly. This Skill provides an authoritative migration reference so you write correct v4 Schema code and avoid outdated v3 patterns. ## Core Features & Use Cases - Rename Tables: Complete find-and-replace mappings for renamed APIs such as annotations to annotate, compose to decodeTo, and all parser functions like decodeUnknown to decodeUnknownEffect. - Pattern Migrations: Side-by-side v3/v4 code examples for filters to checks, transforms to SchemaTransformation, variadic to array arguments, and mapFields-based structural operations. - Use Case: When migrating a codebase from Effect v3 to v4, use this reference to rewrite Schema.filter calls into .check(Schema.isMinLength(...)) and Schema.transform into Schema.decodeTo with SchemaTransformation. ## Quick Start Ask the AI to review my Effect Schema code and update any v3 patterns to the correct v4 API equivalents.

Frequently Asked Questions about effect-schema-v4

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

FAQPage Schema
How do I migrate Effect Schema from v3 to v4?

Start with the rename tables: annotations becomes annotate, compose becomes decodeTo, and filters like minLength become checks like isMinLength used with .check(). Transforms move from Schema.transform to Schema.decodeTo with SchemaTransformation.

What replaced Schema.filter in Effect Schema v4?

Schema.filter is replaced by .check() with is-prefixed validators such as Schema.isMinLength(5) or Schema.isInt(). Custom predicates use Schema.makeFilter, and type-narrowing refinements use Schema.refine.

Does Effect Schema v4 still support Schema.transform?

No, Schema.transform and Schema.transformOrFail were removed. Use Schema.decodeTo with SchemaTransformation.transform for pure bidirectional transforms, or SchemaGetter.transformOrFail for fallible effectful transforms.

What happened to Schema.Data in Effect v4?

Schema.Data was removed in v4 with no replacement needed. Equal.equals now performs deep structural comparison on plain objects by default, so plain structs get structural equality out of the box.

How do I pick or omit fields in Effect Schema v4?

Use mapFields with Struct helpers: struct.mapFields(Struct.pick(['a'])) for pick, Struct.omit(['b']) for omit, Struct.map(Schema.optional) for partial, and Struct.assign for extending structs.

Why is my Effect v3 Schema code failing after upgrading to v4?

Most failures come from renamed APIs: decodeEither is now decodeExit, parseJson is now UnknownFromJsonString, and *FromSelf schemas dropped the suffix. Check the rename tables to find the v4 equivalent of each failing call.