Effect Schema Type Parity Verification
Define and verify Effect schemas aligned with TypeScript domain types. Uses satisfies, tsafe Equals, and assertions to ensure parity between schemas and types.
Sby Skills Guide Bot
DevelopmentIntermediate1 views0 installs3/2/2026Claude CodeCursorWindsurfCopilot
typescripteffect-schematype-safetyvalidationzerospin
name: effect-schema description: Define Effect schemas that are verified against domain types. Use when authoring or updating Effect Schema definitions, or when the user mentions schema/type parity, satisfies, or tsafe Equals checks.
Effect Schema Type Parity
Instructions
- Define the domain type first (prefer
interface), then define the schema and assert parity. - Always use
satisfies Schema.Schema<YourType, any>on the schema. - Add
assert<Equals<typeof YourSchema.Type, Readonly<YourType>>>()usingtsafe. - If the
assert<Equals<...>>isn't typed correctly but thesatisfiesis, you can optionally add the_check1/_check2assignments withvoid(seeZerospinCommandSchema). - When validating unknown input against an Effect schema, prefer
validateUnknownfromzerospinif available.
Example
import type { Equals } from 'tsafe';
import { Schema } from 'effect';
import { assert } from 'tsafe';
export interface IFoo {
bar: string;
}
export const ZFoo = Schema.Struct({
bar: Schema.String,
}) satisfies Schema.Schema<IFoo, any>;
const _check1: typeof ZFoo.Type = {} as IFoo;
const _check2: IFoo = {} as typeof ZFoo.Type;
void _check1;
void _check2;
assert<Equals<typeof ZFoo.Type, Readonly<IFoo>>>();
Related skills
Next.js App Router Expert
100
A skill that turns Claude into a Next.js App Router expert.
Claude CodeCursoradvanced
8902342513Admin
README Generator
100
Creates professional and comprehensive README.md files for your projects.
claudeCursorWindsurfbeginner
25972520Admin
API Documentation Writer
100
Generates comprehensive API documentation in OpenAPI/Swagger format.
claudeCursorWindsurfintermediate
15644375Admin