Agent skill
schema-patterns
Effect Schema conventions and patterns. Triggers on Schema class creation, tagged unions, enums, type guards, or test fixtures using Effect Schema.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/effect-schema-patterns-jasonkuhrt-dotfiles
SKILL.md
Effect Schema Patterns
Class Instantiation
ALWAYS use Schema.make() for creating instances:
// ✅ 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:
// ✅ 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():
// ✅ 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_tagchecks - Inline enum values directly in
Schema.Enums() - Access runtime enum values via
.enumsproperty
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?