effect-v4
Skill1 starsChanged 6 months agoMITView on GitHub
Use when writing, reviewing, or debugging Effect v4 beta code in Theseus, especially core Effect composition, Effect.gen, v3-to-v4 API translation, typed Effect signatures, and deciding which narrower Effect skill applies.
- Reads credentials
8 other projects use a version of this.
Adopted by
Most recently taken up by
- ComposioHQ/composiotheir own version, first seen Nov 5, 2026
- cill-i-am/skillstheir own version, first seen Nov 1, 2026
- peterpme/skillstheir own version, first seen Nov 1, 2026
- Floriferous/tipee-toolstheir own version, first seen Oct 30, 2026
- anis-dr/skillstheir own version, first seen Oct 15, 2026
- zhe-qi/clhoria-templatetheir own version, first seen Oct 8, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- ComposioHQ/composio★ 31ksame name
- zhe-qi/clhoria-template★ 193same name
- peterpme/skills★ 28same name
- anis-dr/skills★ 3same name
- gmdotdev/skills★ 2same name
- tunnckoCore/skills★ 2same name
- cill-i-am/skills★ 1same name
- Floriferous/tipee-tools★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-self-checkSkill
- biome-grit-rulesSkill
- biome-toolingSkill
- bun-testSkill
- bun-workspaceSkill
- cleanup-auditSkill
- code-reviewSkill
- dispatch-satelliteSkill
- docs-managementSkill
- docs-readingSkill
- effect-concurrency-lifecycleSkill
- effect-errors-schemaSkill
- effect-observability-timeSkill
- effect-services-layersSkill
- effect-testing-runtimeSkill
- jsx-md-authoringSkill
- monorepo-maintenanceSkill
- refactoring-disciplineSkill
- roadmap-managementSkill
- runtime-engineSkill
- server-runtimeSkill
- testing-patternsSkill
- theseus-designSkill
- tool-authoringSkill
- typescript-strictSkill
- ui-layout-disciplineSkill
- theseus-designSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
30 rules. 0 are common, 12 are distinctive, and 18 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
12
Distinctive
This author's own choices. Worth a look.
18
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill for general Effect mechanics and routing.
- Distinctive: line 20
If several apply, load only the ones needed for the change.
- Distinctive: line 38
Search current repo usage.
- Very specific: line 40
Prefer patterns already used in packages/theseus-core and packages/theseus-server.
- Distinctive: line 41
Treat web examples as v3 unless verified against local v4 types.
- Distinctive: line 71
Use the constructor that matches the boundary:
- Very specific: line 87
Use Effect.try / Effect.tryPromise at foreign boundaries.
- Very specific: line 89
Do not wrap already-effectful code in tryPromise.
- Very specific: line 90
Do not use Effect.runPromise as a composition tool.
- Very specific: line 94
Prefer Effect.gen for sequential business logic and pipe combinators for local transformations.
- Very specific: line 107
Use Effect.map for success-value transformation.
- Very specific: line 108
Use Effect.flatMap when the next step returns an Effect.
- Very specific: line 109
Use Effect.tap for effectful observation without changing the value.
- Very specific: line 110
Use Effect.all for independent effects.
- Very specific: line 111
Use Effect.partition when partial success is a valid outcome.
- Distinctive: line 112
Use validation mode on collection operations only when the caller needs all failures, not fail-fast behavior.
- Very specific: line 113
Keep Effect.gen blocks linear.
- Very specific: line 114
Use Effect.fn("Name") for important service methods or runtime operations where tracing and better diagnostic names matter.
- Very specific: line 118
Use Match for tagged unions or multi-branch domain logic when chained conditionals obscure exhaustiveness.
- Very specific: line 132
Prefer Match.tag / Match.tags for _tag unions.
- Distinctive: line 133
Prefer exhaustive matching when the input union is closed.
- Distinctive: line 134
Keep simple two-branch cases as normal conditionals when that is clearer.
- Very specific: line 151
Do not cargo-cult Effect.Service unless local v4 types and repo patterns support it for the case at hand.
- Very specific: line 155
Avoid these unless the file is explicitly a process/test/script boundary:
- Distinctive: line 168
Before finalizing Effect changes:
- Distinctive: line 170
Search for matching local patterns.
- Distinctive: line 172
Check whether the code is at a boundary or inside the domain.
- Distinctive: line 173
Run the narrow package test when behavior changed.
- Very specific: line 174
Run bun run typecheck after service, layer, schema, or error-channel changes.
- Distinctive: line 175
If an API was inferred from external material, verify it in the locally installed Effect type declarations before committing the pattern.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Effect v4
Use this skill for general Effect mechanics and routing. For Theseus product/domain choices, use the Theseus design skill.
Route To Narrow Skills
Load the narrower skill when the task clearly matches it:
effect-services-layers- Context.Service, service interfaces, Layer construction, dependency graphs, test seams.effect-errors-schema- typed failures, defects, Cause, Schema decoding/encoding, schema-backed errors, boundary normalization.effect-concurrency-lifecycle- Fiber, Deferred, Queue, PubSub, Stream, Scope, interruption, background loops, backpressure.effect-observability-time- Clock, Duration, timeout, retry schedules, logging, tracing spans, metrics, config, redaction.effect-testing-runtime- Effect.runPromise boundaries, test layers, deterministic services, TestClock/TestContext, runtime verification.
If several apply, load only the ones needed for the change.
Operating Model
Effect code is explicit about:
- what succeeds
- what can fail
- what services are required
- what resources must be acquired and released
- what runs concurrently and how it is interrupted
Good Effect code keeps these facts in the type signature until a deliberate boundary handles them.
Workflow
Effect APIs move. Before using an unfamiliar API:
- Search current repo usage.
- Resolve the installed
effectpackage from the lockfile or package manager layout, then inspect its local type declarations. - Prefer patterns already used in
packages/theseus-coreandpackages/theseus-server. - Treat web examples as v3 unless verified against local v4 types.
Useful searches:
rg "Context.Service|Layer.mergeAll|Layer.provideMerge|Effect.catchTag|Effect.forkDetach" packages
find node_modules -path '*effect*/dist/Effect.d.ts' -o -path '*effect*/dist/Schema.d.ts'
rg "export declare const catch|forkDetach|TaggedErrorClass" node_modulesThe repo already has @effect/language-service configured in root tsconfig.json. Trust its diagnostics when Effect types look strange.
Effect language-service commands:
bun run effect:diagnostics- run Effect diagnostics across configured non-web packages.bun run effect:ls:check- check whether local TypeScript is patched for build-time Effect diagnostics.bun run effect:ls:patch- patch local TypeScript so Effect diagnostics surface through compiler tooling.
Type Shape
Effect.Effect<Success, Error, Requirements> means:
Success- success valueError- expected typed failureRequirements- required services/environment
Expected failures belong in the error channel. Defects are bugs, thrown exceptions, rejected promise defects, or violated invariants; handle them only at boundaries.
Core Constructors
Use the constructor that matches the boundary:
Effect.succeed(value) // pure success value
Effect.fail(error) // expected typed failure
Effect.sync(() => value) // sync, non-throwing side effect
Effect.try(() => risky()) // sync code that may throw
Effect.promise(() => p) // promise that cannot usefully map rejection
Effect.tryPromise({ // promise with rejection normalized to typed failure
try: () => fetchThing(),
catch: (cause) => new FetchFailed({ cause }),
})Rules:
- Use
Effect.try/Effect.tryPromiseat foreign boundaries. - Normalize foreign exceptions into typed errors as early as possible.
- Do not wrap already-effectful code in
tryPromise. - Do not use
Effect.runPromiseas a composition tool.
Composition
Prefer Effect.gen for sequential business logic and pipe combinators for local transformations.
const program = Effect.gen(function* () {
const user = yield* Users.find(userId)
const account = yield* Accounts.find(user.accountId)
yield* Audit.log({ type: "account.viewed", userId })
return account
})Rules:
- Use
Effect.mapfor success-value transformation. - Use
Effect.flatMapwhen the next step returns an Effect. - Use
Effect.tapfor effectful observation without changing the value. - Use
Effect.allfor independent effects; setconcurrencywhen work is unbounded or expensive. - Use
Effect.partitionwhen partial success is a valid outcome. - Use validation mode on collection operations only when the caller needs all failures, not fail-fast behavior.
- Keep
Effect.genblocks linear; extract named effects when nesting grows. - Use
Effect.fn("Name")for important service methods or runtime operations where tracing and better diagnostic names matter.
Pattern Matching
Use Match for tagged unions or multi-branch domain logic when chained conditionals obscure exhaustiveness.
import { Match } from "effect"
const render = Match.type<Event>().pipe(
Match.tag("Started", (event) => `started ${event.id}`),
Match.tag("Done", (event) => `done ${event.id}`),
Match.exhaustive,
)Rules:
- Prefer
Match.tag/Match.tagsfor_tagunions. - Prefer exhaustive matching when the input union is closed.
- Keep simple two-branch cases as normal conditionals when that is clearer.
v4 Translation Table
Common v3 or stale examples need translation:
| Stale pattern | Theseus v4 pattern |
Effect.catchAll | Effect.catch |
Effect.catchAllDefect | Effect.catchDefect |
Context.Tag for services | Context.Service<Service, Shape>()("Name") |
uncurried Layer.effect(Tag, effect) | Layer.effect(Tag)(effect) |
ServiceMap.Service | removed; use Context.Service |
Schema.TaggedError | Schema.TaggedErrorClass for schema-backed failures |
| bare millisecond numbers for time | Duration.millis, Duration.seconds, or accepted duration strings when verified |
throw in Effect.gen | return yield* Effect.fail(error) or return yield* error for yieldable errors |
Do not cargo-cult Effect.Service unless local v4 types and repo patterns support it for the case at hand. This repo currently uses Context.Service.
Anti-Patterns
Avoid these unless the file is explicitly a process/test/script boundary:
Effect.runPromiseorEffect.runSyncinside services or domain functions.throwfor expected failures insideEffect.gen.try/catcharoundyield*expecting to catch typed Effect failures.console.login runtime code.- direct
process.envaccess outside config boundaries. Option.getOrThrowin runtime code.- unbounded queues or concurrency without an explicit bounding argument.
- type assertions that erase the error or requirements channel (
as any,as never) instead of fixing the layer/error model.
Theseus Checks
Before finalizing Effect changes:
- Search for matching local patterns.
- Re-read the involved service/layer/error signatures.
- Check whether the code is at a boundary or inside the domain; choose schemas/errors accordingly.
- Run the narrow package test when behavior changed.
- Run
bun run typecheckafter service, layer, schema, or error-channel changes. - If an API was inferred from external material, verify it in the locally installed Effect type declarations before committing the pattern.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

