effect-schema-composition

Compose and validate multi-stage data transformations with Effect Schema.

22|1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/mpsuesser/pi-effect-harness --skill effect-schema-composition
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: effect-schema-composition
Source: https://github.com/mpsuesser/pi-effect-harness/tree/main/harnesses/effect/skills/effect-schema-composition
Command: npx skills add https://github.com/mpsuesser/pi-effect-harness --skill effect-schema-composition

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Effect Schema composition can become error-prone when you need multi-step transformations plus validation, because you must keep types, decoding/encoding behavior, and refinement rules consistent across stages.

Core Features & Use Cases

  • Schema.decodeTo chaining: Connects different decoded/encoded types across multiple stages without manual glue code.
  • .check-based validation: Adds filters and refinements to keep the value type stable while enforcing constraints (ranges, patterns, casing, UUID/ULID, etc.).
  • Reusable transformations: Builds and applies SchemaTransformation objects for trimming, casing changes, mapping, and decode/encode logic.
  • Advanced composition patterns: Covers structs, optional/nullable fields, branded types, defaults, array/object composition, and effectful validation.
  • Use case: Parsing an API payload where fields require staged normalization (e.g., strings to numbers, then business rules), while returning precise, path-aware validation errors.

Quick Start

Use this skill to design an end-to-end Effect Schema that decodes raw input, applies sequential transformations, and then validates with .check before returning strongly typed results.

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 multiple Effect Schema transformations while keeping decoded types correct?▼

To chain Effect Schema transformations, use Schema.decodeTo to connect different decoded and encoded types across multiple stages without manual glue code, ensuring decoded output types stay correct throughout the data pipeline.

What is the best way to validate refined values in Effect Schema without changing their type?▼

Using .check-based validation in Effect Schema adds filters and refinements to enforce constraints like ranges, patterns, casing, or UUIDs while keeping the value type stable throughout the validation process.

How do I get path-aware validation errors when parsing an API payload with Effect Schema?▼

Composing multi-stage Effect Schemas for API payload parsing provides schema-aware error path handling, returning precise validation errors that identify exactly which fields failed during decoding and transformation.

Can I use Effect Schema for optional and effectful validation patterns on struct fields?▼

Yes, Effect Schema supports advanced composition patterns including structs, optional and nullable fields, branded types, defaults, and array/object composition, enabling effectful validation across complex data structures.

Does Effect Schema composition work for normalizing string inputs to numbers before applying business rules?▼

Effect Schema composition handles staged normalization from strings to numbers using Schema.decodeTo transformations, then applies business rules via .check refinements to return strongly typed, validated results.