Agent SkillsUsefulSoftwareCo/executor › wrdn-effect-raw-fetch-boundary

wrdn-effect-raw-fetch-boundary

GitHub

规范 HTTP 请求通过 Effect HttpClient 服务而非原生 fetch,以支持测试替换。明确禁止在核心 SDK 和插件接口直接使用 fetch,规定仅允许特定边界(如 Worker 适配)使用,确保网络层可模拟。

.agents/skills/wrdn-effect-raw-fetch-boundary/SKILL.md UsefulSoftwareCo/executor

Trigger Scenarios

代码中出现原生 fetch 调用 涉及网络协议或 Provider 开发 需要为测试注入 Mock HttpClient

Install

npx skills add UsefulSoftwareCo/executor --skill wrdn-effect-raw-fetch-boundary -g -y
More Options

Non-standard path

npx skills add https://github.com/UsefulSoftwareCo/executor/tree/main/.agents/skills/wrdn-effect-raw-fetch-boundary -g -y

Use without installing

npx skills use UsefulSoftwareCo/executor@wrdn-effect-raw-fetch-boundary

指定 Agent (Claude Code)

npx skills add UsefulSoftwareCo/executor --skill wrdn-effect-raw-fetch-boundary -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-raw-fetch-boundary",
    "description": "Route HTTP through Effect boundaries instead of raw fetch. Use when lint flags executor\/no-raw-fetch or when adding networked protocol\/provider code.",
    "allowed-tools": "Read Grep Glob Bash"
}

HTTP in core SDK and protocol plugins should go through Effect services so tests can replace real networks with local protocol fixtures or mock HttpClient layers.

Fix Shape

  • Prefer effect/unstable/http HttpClient and HttpClientRequest for ordinary HTTP calls.
  • Accept a Layer.Layer<HttpClient.HttpClient> option on plugin/provider code when callers need to inject a test client.
  • In tests, use real local servers plus FetchHttpClient.layer or a captured HttpClient service from the test layer.
  • Do not add fetch-shaped abstractions in SDK or plugin seams. If a third-party library truly only accepts fetch, keep the adapter in the owning package, name the forced boundary explicitly, and delegate internally to Effect HttpClient.
  • Do not type new protocol/plugin seams as typeof globalThis.fetch; keep the ambient runtime boundary out of domain and test APIs.
  • Do not patch globalThis.fetch. Replace those tests with a local server, HttpClient layer, or the approved Effect-backed adapter.
  • Do not add a broad allowlist entry unless the file is a platform entrypoint or a temporary migration target.

Approved Boundaries

  • Worker/handler objects whose public API must expose a fetch method.
  • Test calls to a worker or Miniflare binding's .fetch(...) method.
  • Small adapters for libraries that only accept fetch, if the implementation delegates to Effect HttpClient.
  • Browser UI event handlers may remain raw only until app-side boundaries are classified; prefer SDK/client APIs where available.

Bad

const response = await fetch(url);
const fetchImpl = options.fetch ?? globalThis.fetch;

Good

const client = yield * HttpClient.HttpClient;
const response = yield * client.execute(HttpClientRequest.get(url));
const plugin = graphqlPlugin({ httpClientLayer: testHttpClientLayer });

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-schema-boundaries/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
8bc037d
Hash
42eef6c8
Indexed
2026-07-05 10:55

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-17 03:26
浙ICP备14020137号-1 $Carte des visiteurs$