Agent SkillsUsefulSoftwareCo/executor › wrdn-effect-schema-boundaries

wrdn-effect-schema-boundaries

GitHub

通过 Effect Schema 或类型适配器在边界规范化未知数据,替换断言和探测模式,消除重复类型转换与 unsafe 检查。

.agents/skills/wrdn-effect-schema-boundaries/SKILL.md UsefulSoftwareCo/executor

Trigger Scenarios

代码中存在 unknown 类型的形状断言或属性探测 存在 double casts、内联对象断言或不安全的 JSON 解析

Install

npx skills add UsefulSoftwareCo/executor --skill wrdn-effect-schema-boundaries -g -y
More Options

Non-standard path

npx skills add https://github.com/UsefulSoftwareCo/executor/tree/main/.agents/skills/wrdn-effect-schema-boundaries -g -y

Use without installing

npx skills use UsefulSoftwareCo/executor@wrdn-effect-schema-boundaries

指定 Agent (Claude Code)

npx skills add UsefulSoftwareCo/executor --skill wrdn-effect-schema-boundaries -a claude-code -g -y

安装 repo 全部 skill

npx skills add UsefulSoftwareCo/executor --all -g -y

预览 repo 内 skill

npx skills add UsefulSoftwareCo/executor --list

SKILL.md

Frontmatter
{
    "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

const ParsedConfig = Schema.Struct({
  endpoint: Schema.String,
});

const config = yield * Schema.decodeUnknownEffect(ParsedConfig)(raw);
const config = yield * Schema.decodeUnknownEffect(Schema.fromJsonString(ParsedConfig))(rawText);

Bad

const config = raw as unknown as { endpoint: string };
const config = JSON.parse(rawText) as { endpoint: string };
const pattern = updated.pattern as string;

Version History

  • fd4fb02 Current 2026-07-05 10:55

Same Skill Collection

.agents/skills/stack/SKILL.md
.agents/skills/wrdn-effect-atom-optimistic/SKILL.md
.agents/skills/wrdn-effect-atom-reactivity-keys/SKILL.md
.agents/skills/wrdn-effect-promise-exit/SKILL.md
.agents/skills/wrdn-effect-raw-fetch-boundary/SKILL.md
.agents/skills/wrdn-effect-schema-inferred-types/SKILL.md
.agents/skills/wrdn-effect-typed-errors/SKILL.md
.agents/skills/wrdn-effect-value-inferred-types/SKILL.md
.agents/skills/wrdn-effect-vitest-tests/SKILL.md
.agents/skills/wrdn-package-boundaries/SKILL.md
.agents/skills/wrdn-typescript-type-safety/SKILL.md
.claude/skills/emulate/SKILL.md
.claude/skills/prod-telemetry/SKILL.md
.claude/skills/self-contained-modals/SKILL.md
.skills/cli-release/SKILL.md
.skills/effect-atom-optimistic-updates/SKILL.md
.skills/effect-http-testing/SKILL.md
.skills/effect-use-pattern/SKILL.md
.skills/graphite/SKILL.md
.skills/warden-security-review/SKILL.md

Metadata

Files
0
Version
f674fb8
Hash
aae568a8
Indexed
2026-07-05 10:55

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-13 00:31
浙ICP备14020137号-1 $お客様$