← スキル一覧に戻る

schema-patterns
by jasonkuhrt
Tool configurations
⭐ 1🍴 0📅 2026年1月22日
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:
// ✅ 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
スコア
総合スコア
55/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
✓最近の活動
1ヶ月以内に更新
+10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
レビュー
💬
レビュー機能は近日公開予定です



