Claude-skill-registry effect-schema
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.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/effect-schema" ~/.claude/skills/majiayu000-claude-skill-registry-effect-schema && rm -rf "$T"
manifest:
skills/data/effect-schema/SKILL.mdsource content
Effect Schema Type Parity
Instructions
- Define the domain type first (prefer
), then define the schema and assert parity.interface - Always use
on the schema.satisfies Schema.Schema<YourType, any> - Add
usingassert<Equals<typeof YourSchema.Type, Readonly<YourType>>>()
.tsafe - If the
isn't typed correctly but theassert<Equals<...>>
is, you can optionally add thesatisfies
assignments with_check1/_check2
(seevoid
).ZerospinCommandSchema - When validating unknown input against an Effect schema, prefer
fromvalidateUnknown
if available.zerospin
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>>>();