Skip to content
Back to skills

Effect Schema Patterns

ASecurity

Effect Schema conventions and patterns. Triggers on Schema class creation, tagged unions, enums, type guards, or test fixtures using Effect Schema.

  • 666 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added February 8, 2026
developmenttypescriptgo

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill effect-schema-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Effect Schema Patterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Effect Schema Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-effect-schema-patterns/badge)](https://www.skillsdirectory.com/skills/majiayu000-effect-schema-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: schema-patterns
description: Effect Schema conventions and patterns. Triggers on Schema class creation, tagged unions, enums, type guards, or test fixtures using Effect Schema.
---

# Effect Schema Patterns

## Class Instantiation

__ALWAYS use `Schema.make()` for creating instances:__

```typescript
// ✅ GOOD - Use Schema.make()
const user = Schema.make(User)({ name: 'Alice', age: 30 })

// ❌ BAD - Manual construction
const user = { _tag: 'User', name: 'Alice', age: 30 }
```

## Type Guards

__ALWAYS use `Schema.is()` or static `.is` method:__

```typescript
// ✅ GOOD
if (Standard.is(value)) { ... }
if (Schema.is(Standard)(value)) { ... }

// ❌ BAD - manual _tag check
if (value._tag === 'Standard') { ... }
```

## Enums

__ALWAYS inline enum values directly in `Schema.Enums()`:__

```typescript
// ✅ GOOD - inline values, use .enums for runtime access
export const Status = Schema.Enums({
  active: 'active',
  inactive: 'inactive',
})
export type Status = typeof Status.Type
// Runtime: Status.enums.active

// ❌ BAD - separate const object
export const StatusValues = {
  active: 'active',
  inactive: 'inactive',
} as const
export const Status = Schema.Enums(StatusValues)
```

## Key Points

* Use `Schema.make()` for type-safe instantiation
* Use `Schema.is()` for type predicates, never manual `_tag` checks
* Inline enum values directly in `Schema.Enums()`
* Access runtime enum values via `.enums` property

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.