/typescript:effectfrom typescript
Use when calling an Effect module family, covering HttpApi, HTTP clients and routes, RPC, sockets and atoms, SQL, AI, MCP and chat platforms, child processes, workers and CLIs, persistence and durable execution, files, encodings, crypto, and telemetry
Ships in typescript. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Covers module families effect exports by path (effect/<family>) and the @effect/* packages adding platform layers, drivers, and bridges.
[REFERENCES]:
Families serve one need each, and a need a row excludes takes the family it names:
| [INDEX] | [FAMILY] | [FITS] | [NOT] |
|---|---|---|---|
| [01] | effect/http-api | Endpoints a codebase serves and calls | Third-party APIs (HttpClient) |
| [02] | effect/http | Third-party HTTP, raw routes, static files | Endpoints a contract types (HttpApi) |
| [03] | effect/graphql | GraphQL servers a client calls | Serving GraphQL, no server module |
| [04] | effect/rpc, effect/socket | Procedures over sockets, stdio, workers | Public APIs needing OpenAPI (HttpApi) |
| [05] | effect/reactivity | UI state derived from effects | Server state (SubscriptionRef) |
| [06] | effect/sql | Relational reads and writes | Key lookups (KeyValueStore) |
| [07] | effect/ai | Language models, tools, MCP | Chat platform bots (effect/chat) |
| [08] | effect/chat | Chat platform bots | Model conversations (effect/ai Chat) |
| [09] | effect/process, /workers | Programs and modules beside the process | Work one thread's fibers run |
| [10] | effect/cli | Programs taking flags, servers included | Programs taking no flag (Layer.launch) |
| [11] | effect/persistence | Caches, stores, queues outliving one call | Values one process caches (Cache) |
| [12] | effect/workflow, /cluster | Work surviving restarts and machines | Single jobs (PersistedQueue) |
| [13] | effect/eventlog | Local-first state synced across devices | Server-owned rows (effect/sql) |
| [14] | effect/encoding | Byte, text, and archive formats | Records a schema decodes (Schema) |
| [15] | effect/protobuf | Protobuf messages from descriptors | Schema-typed binary (SchemaBinary) |
| [16] | effect/crypto, effect/jose | Digests, keys, ciphers, signed tokens | Structural hashes (Hash.hash) |
| [17] | effect/net | Addresses and name resolution | Connections (effect/socket) |
| [18] | effect/observability | Telemetry export | Spans and logs in code (Effect.fn) |
| [19] | effect/devtools | Spans streamed to a devtools process | Collectors (effect/observability) |
Runtimes supply platform services through layers, and the root provides them once:
| [INDEX] | [RUNTIME] | [LAYERS] |
|---|---|---|
| [01] | Node process | NodeServices.layer, NodeHttpServer.layerConfig, NodeHttpClient.layerNodeHttp, NodeCrypto.layer |
| [02] | Browser | FetchHttpClient.layer, layerWebCrypto per crypto service, KeyValueStore.layerStorage |
| [03] | Fetch handler | HttpServer.layerServices, FetchHttpClient.layer, ConfigProvider.fromUnknown(env) |
| [04] | Engine with own calls | FileSystem.make(FileSystem.makeNoop(...)), ChildProcessSpawner.make, Path.make |
NodeServices.layer provides ChildProcessSpawner, FileSystem, Path, Stdio, and Terminal, the environment a CLI command readsNodeHttpServer.layerConfig supplies HttpPlatform, Etag.Generator, and every NodeServices service beside the serverNodeCrypto.layer provides every effect/crypto service, each supplying its own SecureRandom, and NodeServices holds noneNodeHttpClient.layerNodeHttp sends through Node's node:http, where layerUndici adds the undici package to a bundlelayerNodeHttpOptions({ keepAlive: true }) reuses sockets, as its agents close each one after its response by defaultHttpServer.layerServices supplies HttpPlatform, Etag.Generator, Path, and a FileSystem holding no files, meeting HttpApiBuilder.layer on a fetch handlerEngines that run code with calls of their own and no platform layer (the Claude Code hooks engine) take platform services built over those calls, so libraries reading FileSystem, ChildProcessSpawner, and Path run unchanged:
PlatformError.systemError({ _tag, module, method, pathOrDescriptor, cause }), _tag read from the errno codeLayer.succeed(Scheduler.Scheduler, scheduler) sets how fibers yield, new Scheduler.MixedScheduler('sync') yielding through microtasksMixedScheduler subclasses overriding shouldYield yield by elapsed clock time for an engine that stops a long synchronous stretchContracts (HttpApi, RpcGroup, Toolkit, GraphQLGroup, Entity, Workflow, EventGroup) are schema declarations every side derives from, handlers binding through one layer built from services read once and clients deriving a method per member:
params: { handle: Bound.fields.handle }), never a restated Schema.StringUse typescript:testing for contract test clients.
Family errors are one class holding a tagged reason union: HttpClientError, HttpServerError, SqlError, AiError, McpClientError, PlatformError, WorkerError, RpcClientError, SocketError, CryptoError, JoseError, GraphQLClientError, ChatError, RateLimiterError, and CircuitBreakerError. Handlers select a reason by tag, and a package error declaring a reason union takes the same members:
Effect.catchReason(error, reason, f, orElse) handles one reason, orElse receiving every other reason of that errorEffect.catchReason('JoseError', 'KeySetUnavailable', Effect.fail, () => Effect.succeedNone) fails one reason and recovers the restEffect.catchReasons(error, { Reason: f }, orElse) handles a reason per key, and Effect.unwrapReason(error) puts the reasons in place of their errorPlatformError reasons are BadArgument and a SystemError with a SystemErrorTag (NotFound, PermissionDenied, AlreadyExists)Effect.catchReason('PlatformError', 'NotFound', () => Effect.succeed(Array.empty<string>())) reads a missing folder as emptyLibraries emit logs, spans, and metrics and export nothing. Each host entry provides one telemetry layer, and Node roots pass a teardown flushing it to runMain. A collector's transport selects the export member that layer composes:
| [INDEX] | [TRANSPORT] | [LAYER] |
|---|---|---|
| [01] | OTLP push, endpoint from env | Otlp.layerFromConfig({ resource }) over an OtlpSerialization layer |
| [02] | OTLP push, endpoint from code | Otlp.layerJson({ baseUrl }), Otlp.layerProtobuf({ baseUrl }) |
| [03] | Prometheus scrape | PrometheusMetrics.layerHttp({ path }) on HttpRouter |
| [04] | Browser OTLP through own origin | OtlpProxy.layer({ baseUrl, headers }) on the server's HttpRouter |
| [05] | OpenTelemetry Node SDK | startNodeSdk of @opentelemetry/sdk-node under OtelTracer.layerGlobal |
Otlp.layerFromConfig exports a signal when OTEL_EXPORTER_OTLP_<SIGNAL>_ENDPOINT or OTEL_EXPORTER_OTLP_ENDPOINT holds a URL and OTEL_<SIGNAL>_EXPORTER lists otlp, and provides a Flusher with nothing to flush otherwise:
OTEL_EXPORTER_OTLP_ENDPOINT take /v1/<signal> appendedOTEL_EXPORTER_OTLP_<SIGNAL>_HEADERS, then OTEL_EXPORTER_OTLP_HEADERSOTEL_SERVICE_NAME, OTEL_SERVICE_VERSION, and OTEL_RESOURCE_ATTRIBUTES, named variables winning over attributesOTEL_SDK_DISABLED disables every signal, and OTEL_METRIC_EXPORT_INTERVAL, OTEL_BSP_SCHEDULE_DELAY, OTEL_BLRP_SCHEDULE_DELAY set push intervalsOTEL_BSP_MAX_QUEUE_SIZE and OTEL_BLRP_MAX_QUEUE_SIZE bound the pending span and log queues, dropping arrivals past themOTEL_EXPORTER_OTLP_PROTOCOL reaches no Effect member, so a root's telemetry layer maps http/json and http/protobuf to an OtlpSerialization layerOtlpExporter.Flusher flush waits for every export in flight at its call and drains items queued before it, never fails, and has no timeoutflush with Effect.timeoutOptionNodeSdk.layer enables a signal only for a processor or reader its configuration names and takes no instrumentationsMetric.enableRuntimeMetricsLayer adds fiber runtime metrics where metrics exportLoggers are the set Logger.CurrentLoggers holds, the root rewrites it, and a stream's reading process decides where records go:
Logger.layer(loggers) replaces the set, { mergeWithExisting: true } adds to it, and OTLP loggers merge by defaultLayer.effect(Logger.CurrentLoggers, ...) over the current set drops Logger.defaultLogger and keeps exporter loggersLogger.map(Logger.formatSimple, (line) => host.log(line)) writes each formatted line to a host's own log callLogger.tracerLogger writes each log as an event on the current local span, writing none under an external or ended spanLogger.LogToStderr set true moves default and pretty loggers to stderr, and Logger.withConsoleError(Logger.formatJson) logs JSON to stderrLogger.toFile(logger, path) batches into one file it never rotatesReferences.MinimumLogLevel drops lines before any logger runs, so per-scope floors set it to the lowest floor and filter inside each loggerCommand.run parses --log-level into References.MinimumLogLevel, and a root running no command provides that referenceErrorReporter.layer([ErrorReporter.make(report)], { mergeWithExisting: true }) receives each reported failure[ErrorReporter.severity] for their level and [ErrorReporter.ignore] to skip reportingEffect.annotateLogs covers one effect, Effect.annotateLogsScoped the rest of a scope, and Effect.withLogSpan(label) times each lineLibraries read settings under a config path (log.level), and a root's provider maps the path to its spelling. ConfigProvider.fromEnv().pipe(ConfigProvider.nested(app), ConfigProvider.constantCase) reads log.level from <APP>_LOG_LEVEL, ConfigProvider.orElse(ConfigProvider.fromEnv()) keeping OTEL_* variables readable.
Spans name an operation, and attributes hold the values that differ per call:
{ attributes, links, parent, root, kind, sampled, level }, and spans below Tracer.MinimumTraceLevel go unsampled with their descendantsHttpMiddleware.SpanNameGenerator and HttpClient.SpanNameGenerator rename them<method> <target> over a low-cardinality target (a route, a URI template), each concrete value an attributeHttpTraceContext.toHeaders(span) writes a span to headers, and fromHeaders(headers) returns an Option of the remote span to parent fromHttpTraceContext.toHeaders(span) with upper-cased keys (TRACEPARENT)W3CTraceContextPropagator over EnvironmentGetter of @opentelemetry/propagator-env-carrierLayer.parentSpan(makeExternalSpan(spanContext)) of @effect/opentelemetry/OtelTracer parents a child's spans to the extracted contextMetrics take names from @opentelemetry/semantic-conventions (METRIC_*, ATTR_*, /incubating for development ones), and an attribute read from the outcome records after the run:
const operationDuration = Metric.mapInput(Metric.histogram(METRIC_MCP_SERVER_OPERATION_DURATION, { boundaries: [0.01, 0.1, 1, 10, 60] }), Duration.toSeconds);
const measured = Effect.fnUntraced(function* <A, E, R>(effect: Effect.Effect<A, E, R>, attributes: Readonly<Record<string, string>>) {
const [duration, exit] = yield* effect.pipe(Effect.exit, Effect.timed);
yield* Metric.update(Metric.withAttributes(operationDuration, { ...attributes, ...failureAttributes(exit) }), duration);
return yield* exit;
});
failureAttributes maps an exit to ATTR_ERROR_TYPE (cancelled for an interrupt, the failure's _tag, else ERROR_TYPE_VALUE_OTHER). Metrics with attributes known before the run take a tracking member:
Effect.track(metric), trackDuration, trackErrors, and trackSuccesses update a metric once per runMetric.timer records milliseconds, and a convention stating seconds maps its histogram's input through Duration.toSecondsreferences/ai.md (opens in a new tab)references/http.md (opens in a new tab)references/mcp.md (opens in a new tab)references/persistence.md (opens in a new tab)references/platform.md (opens in a new tab)references/processes.md (opens in a new tab)references/reactivity.md (opens in a new tab)references/rpc.md (opens in a new tab)references/sql.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub bsamiee/rasm --plugin typescript4 skills in this plugin
/codingUse when writing or reviewing TypeScript, covering functional design with Effect, Schema, and algebraic data types/debuggingUse when JavaScript or TypeScript misbehaves at runtime in Node, a browser page, a worker, a test runner, or a single executable and its cause is unproven, covering js-debug launch and attach routes, child programs, source maps, exception filters, Node's probe mode, and the evidence Node writes/testingUse when writing, running, or debugging TypeScript tests, covering Vitest and @effect/vitest, isolation options, type tests, benchmarks, controlled time, in-memory contract clients, service doubles, generated inputs, fixtures, browser and Workers suites, containers, and PlaywrightOther plugins' skills for the same job