Effect V4のロゴ

Effect V4

コミュニティ
peterpme
effect-v4

Effect v4 (4.0.0) for TypeScript. Use when writing, reviewing, or testing Effect code — Effect.gen, Effect.fn, Schema, TaggedError, Context.Service, Layer, ManagedRuntime, Config, Scope, Fiber, Queue, Ref, Schedule, Stream, Cache, HttpClient, HttpRouter, HttpApi, SqlClient, SqlSchema, effect/ai, the Vercel AI SDK inside Effect, @effect/vitest, TestClock — or running Effect on Cloudflare Workers.

概要

公開者peterpme
リポジトリskills
スキル名effect-v4
スター
28
フォーク
0
同梱ファイル
17
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 17個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    peterpmeがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルEffect V4をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/peterpme/skills/tree/main/effect-v4
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/peterpme/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/effect-v4 .claude/skills/effect-v4
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでEffect V4を有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にEffect V4を読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Effect V4は作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Effect v4

Effect 4.0.0 is the stable release. Write v4. Model memory and effect.website default to v3. Do not trust either. Every example that starts with import compiles against effect@4.0.0. Blocks under Fail review on are wrong on purpose.

The model

Effect.Effect<A, E, R> describes work. Building it runs nothing.

  • A is the success value.
  • E is the expected failures, as tagged errors.
  • R is the services still required. A Layer provides them.

Run an Effect once, at the program edge. Everything below the edge returns an Effect. Hover A, E, and R. Inference is the documentation.

Imports

NeedImport
Coreimport { Effect, Layer, Schema, Context } from "effect"
HTTP client and servereffect/http
HttpApieffect/http-api
SQLeffect/sql
LLMseffect/ai
Test serviceseffect/testing
Everything elseeffect/<area>: cli, rpc, workflow, cluster, persistence, reactivity, observability, encoding, process, socket, workers, eventlog, schema
Runtimes, drivers, providers@effect/platform-node, @effect/sql-sqlite-node, @effect/sql-d1, @effect/ai-openai, @effect/ai-anthropic, @effect/vitest

effect/unstable/*, @effect/platform, @effect/sql, and @effect/ai are prerelease paths. They do not exist in 4.0.0.

Most of effect/<area> is tagged @stability unstable. It is production code, but a 4.x minor can break it. Pin effect and every @effect/* to one exact version. Upgrade them together.

House rules

Write

  1. A reusable effectful function is Effect.fn("Owner.method"). One-off sequencing is inline Effect.gen. The name is the span.
  2. Pure work stays plain TypeScript. xs.map(f), never Effect.forEach(xs, (x) => Effect.succeed(f(x))).
  3. No ambient globals in Effect code. fetch → HttpClient. Date.now() → Clock or DateTime. console → Effect.log*. setTimeout → Effect.sleep. Math.random() → Random.
  4. Run effects only at the entry point. Never Effect.runPromise inside a helper.

Errors

  1. An expected failure is a Schema.TaggedError class. Fail with return yield* new ItemMissing({ id }). Returning { _tag: "ItemMissing" } is a success.
  2. _tag is the only discriminant. Success unions use Data.taggedEnum. Never write { _tag: "X" as const }.
  3. Handle an error only where you have a real answer: a fallback, a retry, a response, a settlement. Otherwise leave it in E.
  4. Never swallow. No Effect.ignore, no catch-to-void. Best-effort work returns a tagged outcome and logs it.
  5. Bugs and impossible states die. Only the entry point inspects Cause.

Data

  1. Decode unknown input once, at the boundary, with Schema. Do not decode values you just built.

Services

  1. A service owns I/O, state, credentials, or policy. Everything else is a function.
  2. Yield dependencies once in Layer.effect and close over them. Public methods have R = never.
  3. Service keys are path-shaped and unique: "@app/store/ItemStore".
  4. Provide shared infrastructure once, at the composition root: HTTP transport, SQL driver, logger.

Config

  1. Read env and host bindings only at the entry point. Pass plain typed values into layer constructors: catalogLayer({ baseUrl, apiKey }).
  2. Every setting is required. No ?? fallbacks. No Config.withDefault for business constants. Keep constants in one config module.

Retry

  1. One retry owner per failure. Bound every retry with times and a schedule. Set SDK retries to zero when Effect retries.

Testing

  1. No module mocks. No fake services. No stubbed HttpClient. Test pure functions, recorded fixtures through the production schema, and real local engines (SQLite :memory:, temp directories) with TestClock.
  2. Prove a workflow change with the project's real end-to-end run. Show the output.

Style

  1. No comments on functions. Names and types are the docs.

Choose

I needUseRead
Sequence effectsEffect.gen + yield*core
A named, traced operationEffect.fn("X.y")core
A value that may be absentOptioncore
A success-or-failure value, not an effectResultcore
Exhaustive branching on a unionMatch, $matchcore
Durations and datesDuration, DateTimecore
A typed expected failureSchema.TaggedErrorerrors
Recover from one failurecatchTag, catchTags, catchReasonerrors
Wrap a Promise or SDK callEffect.tryPromiseerrors
Validate unknown inputSchema.decodeUnknownEffectschema
Parse JSON textSchema.fromJsonStringschema
A dependency or capabilityContext.Service + Layerservices
Settings and secretsConfig, Redacted at the entryservices
Start the programNodeRuntime.runMain, ManagedRuntimeservices
Do work in parallelEffect.forEach(xs, f, { concurrency }), Effect.allconcurrency
Open and close a resourceEffect.acquireRelease, Scopeconcurrency
A background loopEffect.forkScoped in a layerconcurrency
Shared mutable stateRef, SynchronizedRef, SubscriptionRefconcurrency
Wait for a signal, limit accessDeferred, Latch, Semaphoreconcurrency
A work queue or fan-outQueue, PubSubconcurrency
Retry, repeat, pollEffect.retry, Effect.repeat, Scheduletime
A deadlineEffect.timeoutOrElsetime
Values over time, pagination, SSEStreamstreams
Memoize a lookupCache, Effect.cachedWithTTLcaching
Batch many lookups into one callRequest, RequestResolvercaching
Logs, spans, metricsEffect.log*, Effect.fn, Metricobservability
Call an HTTP APIHttpClienthttp
Serve HTTPHttpRouter, HttpApihttp
Query SQLSqlClient, SqlSchemasql
Call an LLMVercel AI SDK or effect/aillm
Files, paths, child processes, CLIsFileSystem, Path, ChildProcess, effect/cliplatform
Write a test@effect/vitest, TestClocktesting
RPC, durable workflows, cluster, persistence, atoms, event logs—modules
You wrote a v3 or prerelease name—v3 traps
Cloudflare Workers—cloudflare

Verify an API

Do not guess a signature. The installed package ships its source and docs:

  • node_modules/effect/src/<Module>.ts, or src/<area>/ for subpaths. Exports carry When to use and Gotchas JSDoc.
  • node_modules/effect/ai-docs/src/ holds the official examples by topic.
  • node_modules/effect/AGENTS.md is the upstream agent guide.

With pnpm, look under the package that depends on effect: <package>/node_modules/effect. rg smart case makes lowercase patterns case-insensitive. Search with rg -s. The Effect language service (@effect/tsgo) reports v3 names as outdatedApi. Run the typecheck.

Cloudflare Workers

Effect runs on Workers with no platform package. Build the layer graph per invocation from env. Use FetchHttpClient.layer and @effect/sql-d1. D1 has no transactions. Use batch([...]) on the D1Client service. Read cloudflare only for Workers work. Nothing else in this skill depends on it.

Review

  • Hover R. A service in R that no layer provides defects at run time → reject.
  • Hover E. A new error class with no catchTag update means an exhaustive edge is lying.
  • Effect.forEach whose callback only wraps a pure value → reject. That is xs.map.
  • { _tag: "X" as const } → reject. Use a constructor.
  • yield* of a service inside a public method → reject. Capture it in the layer.
  • Global fetch inside tryPromise for an HTTP API → reject. Use HttpClient.
  • Effect.ignore, catchCause, or a handler returning Effect.void below the entry → reject.
  • A retry without times → reject. It retries forever.
  • Cache.make without timeToLive → reject. It caches failures forever.
  • vi.mock, Layer.mock, Layer.succeed of an app service, or HttpClient.make in a test → reject.

Provenance

A copy of this skill also lives in a work repository. Update both copies when either changes.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Effect V4」では何ができますか?

Effect v4 (4.0.0) for TypeScript. Use when writing, reviewing, or testing Effect code — Effect.gen, Effect.fn, Schema, TaggedError, Context.Service, Layer, ManagedRuntime, Config, Scope, Fiber, Queue, Ref, Schedule, Stream, Cache, HttpClient, HttpRouter, HttpApi, SqlClient, SqlSchema, effect/ai, the Vercel AI SDK inside Effect, @effect/vitest, TestClock — or running Effect on Cloudflare Workers.

TypingMindでEffect V4を使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Effect V4はプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにEffect V4をインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/peterpme/skills/tree/main/effect-v4を貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Effect V4を使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Effect V4は何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもEffect V4を利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Effect V4」は無料ですか?

peterpmeがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇