Use when @effect/schema patterns including schema definition, validation, parsing, encoding, and transformations. Use for type-safe data validation in Effect applications.
View on GitHubSelect agents to install to:
npx add-skill https://github.com/TheBushidoCollective/han/blob/main/plugins/frameworks/effect/skills/effect-schema/SKILL.md -a claude-code --skill effect-schemaInstallation paths:
.claude/skills/effect-schema/# Effect Schema
Master type-safe data validation and transformation with @effect/schema. This
skill covers schema definition, parsing, encoding, and advanced schema patterns
for building robust data pipelines.
## Basic Schema Types
### Primitive Schemas
```typescript
import { Schema } from "@effect/schema"
// Primitive types
const StringSchema = Schema.String
const NumberSchema = Schema.Number
const BooleanSchema = Schema.Boolean
const BigIntSchema = Schema.BigInt
const SymbolSchema = Schema.Symbol
// Special types
const UndefinedSchema = Schema.Undefined
const VoidSchema = Schema.Void
const NullSchema = Schema.Null
const UnknownSchema = Schema.Unknown
const AnySchema = Schema.Any
```
### Literal Values
```typescript
import { Schema } from "@effect/schema"
// String literal
const HelloSchema = Schema.Literal("hello")
// Number literal
const FortyTwoSchema = Schema.Literal(42)
// Boolean literal
const TrueSchema = Schema.Literal(true)
// Multiple literals (union)
const StatusSchema = Schema.Literal("pending", "approved", "rejected")
```
## Struct Schemas
### Basic Struct
```typescript
import { Schema } from "@effect/schema"
// Define user schema
const UserSchema = Schema.Struct({
id: Schema.String,
name: Schema.String,
age: Schema.Number,
email: Schema.String
})
// Infer TypeScript type
type User = Schema.Schema.Type<typeof UserSchema>
// { id: string; name: string; age: number; email: string }
```
### Optional Fields
```typescript
import { Schema } from "@effect/schema"
const PersonSchema = Schema.Struct({
name: Schema.String,
age: Schema.Number,
email: Schema.optional(Schema.String),
phone: Schema.optional(Schema.String)
})
type Person = Schema.Schema.Type<typeof PersonSchema>
// { name: string; age: number; email?: string; phone?: string }
```
### Nested Schemas
```typescript
import { Schema } from "@effect/schema"
const AddressSchema = Schema.Struct({
street: Schema.String,
city: Schema.String,
zipCode: Schema.String