Effect V4 logo

Effect V4

Community
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.

Overview

Publisherpeterpme
Repositoryskills
Skill nameeffect-v4
Stars
28
Forks
0
Bundled files
17
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 17 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by peterpme on GitHub. Read the source before you install it.

Installation

Install the Effect V4 AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/peterpme/skills/tree/main/effect-v4
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Effect V4 in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Effect V4 on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Effect V4 is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Effect V4 AI skill do?

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.

Why use Effect V4 on TypingMind?

Because you install it once and use it with any model. Effect V4 is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Effect V4 in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/peterpme/skills/tree/main/effect-v4. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Effect V4?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Effect V4?

As many as you like. As long as a model supports skills, you can use Effect V4 with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Effect V4 AI skill free?

It is published on GitHub by peterpme. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇