effect-program-design
できること
明確なサービス、型付きのエラー、テストしやすいレイヤーを備えた、Effect TypeScriptのアプリケーションを作るよう、エージェントを導きます。Effectライブラリを使い、保守しやすいコードがほしい開発者向けです。
使う場面
- ✓Effectのアプリで、サービスやレイヤーを作ったり変えたりしているとき。
- ✓Effectのプログラムで、型付きのエラー、設定、バックグラウンドのワーカーが必要なとき。
- ✓実際の境界で、偽の依存関係に差し替えるテストがほしいとき。
スキルのリンク
https://github.com/humanlayer/humanlayer/blob/main/.claude/skills/effect-program-design/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Effectのアプリにメール送信のサービスを追加してください。適切なエラー処理とテストを含めてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、まずプロジェクトの規約と、インストールされているEffectのバージョンを確認します。そのうえで、ライブラリのパターンに従ったコードを書きます。小さなサービスのインターフェースを使うので、各部分をテストしやすくなります。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Effect Program Design
Build production Effect v4 programs with small domain-shaped interfaces, typed success and error channels, declared dependencies, observable operation boundaries, and tests that substitute layers at real seams. This skill combines broad Effect mechanics with HumanLayer's deep-module, capture-before-narrow, and real-seam design standards.
Source rule
Check these before guessing:
- the nearest
CLAUDE.md/AGENTS.mdand project-local conventions; - the installed
effect,@effect/*, and related package versions and declarations; - the Effect v4 docs at https://effect-ts-effect-smol.mintlify.app/;
- the pinned/upstream source (
~/projects/effect-smol) when docs do not settle an API.
unstable-tagged modules (effect/http, effect/rpc, effect/process, ...) can change between beta/minor versions. Typecheck examples against the installed version. Local
project conventions take precedence unless the task explicitly changes them.
References
Read only the references relevant to the task; read all matching branches when work crosses concerns.
- Public module depth and domain-shaped APIs:
references/DEEP_MODULES.md. Read this any time you are modifying or creating services or layers - this is the core of our effect philosophy! - Service tags, live layers, file placement,
Effect.fn, or runtime composition:references/SERVICES_LAYERS.md. - Tagged errors, capture-before-narrow, spans, logs, or Sentry:
references/ERRORS_OBSERVABILITY.md. - Records, schemas, variants, optionality, brands, decoding, or construction:
references/SCHEMA_DATA_MODELING.md. - Config, env vars, providers, or secrets:
references/CONFIG_SECRETS.md. - HTTP/SDK/DB boundaries, Drizzle rows, JSONB, or transactions:
references/BOUNDARIES_PERSISTENCE.md. - Scopes, acquisition, concurrency, best-effort work, or workflow transitions:
references/RESOURCES_CONCURRENCY.md. - Retry, repeat, polling, pacing, backoff, or workers:
references/SCHEDULING_WORKERS.md. - Streams, queues, pubsub, pagination, backpressure, or long-lived consumers:
references/STREAMS.md. - Memoization, TTL caches, request dedupe, or batching:
references/CACHING_BATCHING.md. - Outgoing HTTP, provider adapters, status/decode handling, or HTTP retry:
references/HTTP_CLIENTS.md. - Effect tests, test services, clocks, synchronization, fakes, or real seams:
references/TESTING.md. - Platform-neutral services and the native-API boundary:
references/PLATFORM.md. - Node runtime, filesystem, path, crypto, child processes, sockets/WebSocket, Redis, or workers:
references/PLATFORM_NODE.md. - Effect Atom or React reactive Effect state:
references/EFFECT_ATOM.md. - TypeScript safety, Predicate refinements, Match dispatch, naming, collections, imports, and escape hatches:
references/TYPESCRIPT_CONTRACTS.md. - Local exemplars and foils:
references/REPOSITORY_EXAMPLES.md.
The creed
Deep modules. The interface is the cost and the hidden implementation is the benefit. Public operations use domain inputs and outputs; callers do not supply credentials, clients, rows, or other internals.
Everything stays in Effect. Keep expected failures in
E, dependencies inR, and resources in scopes. Do not pass services, layers, effects, or errors as ordinary values when composition expresses the relationship.Two-tier errors. Classify rich internal failures, capture them, then narrow to a small caller-actionable union. Prefer typed
catchTag/catchTags; never recover withinstanceof,Match, or manual_tagcomparisons. Respect the error channel! Errors stay in the error channel and are not passed as valuesObserve operations. Every public operation has a stable
Effect.fn("domain.operation"), an explicitEffect.withSpan, or both. Capture raw actionable/unexpected failures before narrowing or swallowing them.
Use Effect's logger to log info, errors, etc -yield* Effect.logError- do NOT pass in external loggers. Errors MUST also be captured to sentry as soon as they surface before they are re-mapped or transformed.someEffect.pipe( Effect.tapError(Effect.logError), Effect.tapError((e) => Effect.sync(() => Sentry.captureException(e))), )Test at real seams. Use
@effect/vitest, layers, deterministic test services, and real infrastructure where behavior depends on it. Assert both the result/error and externally v
よくある質問
すでにEffectを知っている必要がありますか?
TypeScriptの知識があると役立ちます。このスキルは、Effectのパターンに沿ってエージェントを導きます。
インストールされたEffectのバージョンに合わせますか?
はい。インストールされているバージョンを確認し、例をそのバージョンで型チェックします。リリースごとにモジュールが変わることがあるためです。
Effectのどの部分を扱いますか?
サービス、スキーマ、エラー、設定、並行処理、ストリーム、キャッシュ、HTTPクライアントを扱います。
詳細
作者による元の説明
Design, write, review, and test production Effect v4 programs: deep services and layers, schemas, tagged errors, observability, Config, persistence, resources, concurrency, schedules, workers, streams, caches, HTTP clients, Effect platform services (Node filesystem/path/crypto/process/socket), and Effect Atom integrations. Use for any Effect application or adapter work.
repo: humanlayer/humanlayer
人気
- GitHubのスター
- 13k
- ランキング
- #11384
- ライセンス
- Apache-2.0
- 更新日
- 2026/10/31
コメント
- …
このリポジトリの他のスキル
asd-ste100
13kエージェントが、分かりにくい英語を、人やほかのソフトウェアが読みやすい、短くて一つの意味しか持たない文に書き直せるよう教えます。
better-github-skill
13kプルリクエストの状態を確認し、そのレビューコメントを読み、CIのビルドが失敗した理由を、すぐに使えるGitHubのスクリプトで見つけるのを支援します。
calldiff
13kエージェントが、二つのgitのバージョンの間で、コードベースの関数呼び出しの連鎖を比べ、コードレビューで動作の変化を確認できるよう支援します。
chrome-devtools-cli
13kエージェントが、ターミナルからChromeを操作し、ページを開き、クリックし、フォームに入力し、ページのスナップショットを撮れるようにします。ブラウザの自動化とテストのためです。
似ているスキル
api-connector-builder
280kエージェントが既存のパターンに従って、新しいAPI連携を構築します。新しい方式を作らずに、もう一つ連携を追加したいときに使います。
api-design
280kエージェントがベストプラクティスに沿ってREST APIを設計できるようにします。APIの通信方法、エラーの表示方法、データの整理方法を決めるのに役立ちます。
backend-patterns
280kエージェントのサーバーサイドのアーキテクチャパターンとデータベースの最適化を支援します。サーバー上で動くコードを作成またはレビューするときに役立ちます。