Skip to main content

wrdn-effect-schema-boundaries

Normalize unknown or loosely typed data at boundaries with Effect Schema, named guards, or typed adapters. Use when lint flags double casts, inline object assertions, unknown shape probing, or ad hoc property checks on unknown values.

소스 정보

저장소
UsefulSoftwareCo/executor
최근 소스 활동
2026년 5월 6일 00:16
감지된 SKILL.md 언어
영어
스타
4,150
포크
364

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
wrdn-effect-schema-boundaries
description
Normalize unknown or loosely typed data at boundaries with Effect Schema, named guards, or typed adapters. Use when lint flags double casts, inline object assertions, unknown shape probing, or ad hoc property checks on unknown values.
allowed-tools
Read Grep Glob Bash
You fix one pattern: domain code is asserting or probing an unknown shape instead of parsing it once at the boundary. ## Fix Shape - Prefer `Schema.decodeUnknownEffect(MySchema)(value)` for untrusted input. - Prefer `Schema.decodeUnknownEffect(Schema.fromJsonString(MySchema))(text)` or `Schema.decodeUnknownOption(Schema.parseJson())(text)` for JSON strings. - Keep domain code typed after the decode; do not keep `unknown` and probe it repeatedly. - Replace `JSON.parse`, `value as string`, `as unknown as X`, `as Record<string, unknown>`, inline object assertions, `"field" in value`, and `Reflect.get` with a schema, typed adapter, or named guard. - A named guard is acceptable only when parsing is not the right abstraction and the guard has a precise return type. ## Good ```ts const ParsedConfig = Schema.Struct({ endpoint: Schema.String, }); const config = yield * Schema.decodeUnknownEffect(ParsedConfig)(raw); ``` ```ts const config = yield * Schema.decodeUnknownEffect(Schema.fromJsonString(ParsedConfig))(rawText); ``` ## Bad ```ts const config = raw as unknown as { endpoint: string }; ``` ```ts const config = JSON.parse(rawText) as { endpoint: string }; ``` ```ts const pattern = updated.pattern as string; ```
GitHub에서 보기