effect-v4

$npx mdskill add ComposioHQ/composio/effect-v4

The CLI, `@composio/cli-keyring`, and `@composio/json-schema-to-effect-schema` run on Effect v4. Every claim below is grounded in the migrated source, not memory of v3.

SKILL.md

.github/skills/effect-v4View on GitHub ↗
---
name: effect-v4
description: Write, review, or upgrade Effect v4 code in the Composio CLI, cli-keyring, and json-schema-to-effect-schema packages, all using the matching range effect@^4.1.0 — Context.Service and explicit layers, Schema.TaggedError and typed recovery, the effect/cli command surface, and the vendored effect source oracle. Use when writing or reviewing Effect v4 code, answering a v4 API question, working in effect/cli, defining a Context.Service service, modeling an error with Schema.TaggedError, bumping the Effect pins, or verifying an unfamiliar API against ts/vendor/effect. Do not use for CLI command UX/wiring design (use cli-command) or CLI E2E tests (use cli-e2e).
---

# Effect v4

The CLI, `@composio/cli-keyring`, and `@composio/json-schema-to-effect-schema` run on
Effect v4. Every claim below is grounded in the migrated source, not memory of v3.

## Version matrix

`effect`, `@effect/platform-bun`, and `@effect/vitest`
use the **same range** `^4.1.0`; keep their lockfile resolutions aligned. Do not use
`@next` or mismatched versions across packages. `@effect/cli` and `@effect/platform` no longer exist as
dependencies; their surfaces are consolidated into `effect` and `effect/*`.
See [versions.json](versions.json) for the exact example-check matrix (also `typescript`, `vitest`).

## Read next

- [references/core-patterns.md](references/core-patterns.md) — services, layers, typed
  errors, Schema, choosing between `Effect.gen` and `Effect.fn`, `Option` combinators in
  place of `isSome` ternaries, driving time in tests with
  `TestClock` (fork, adjust until the fiber settles, join) instead of `it.live`, and the v3→v4 rename table
  (labeled historical, for recognizing stale patterns).
- [references/cli-surface.md](references/cli-surface.md) — `effect/cli`:
  `Command`, `Flag`, `Argument`, `GlobalFlag`, `CliConfig`, the custom
  `CliOutput.Formatter`, and the runner's double-print rule.
- [references/upgrade-workflow.md](references/upgrade-workflow.md) — procedure for
  bumping to a newer release.

References label source excerpts and standalone framework examples separately. Repo-linked
excerpts name the file checked by `validate:cli-skills`. The cited source remains authoritative
when an excerpt or explanation disagrees with the implementation.

## Non-negotiables

- `Effect.gen(function* () {...})` for effect values — the dominant form, including named
  module consts — and `(params) => Effect.gen(...)` for parameterized helpers.
  `Effect.fn(...)` is the function form whose effects carry stack-frame annotations (its
  optional name string adds a per-call tracing span), worth it for service members and
  combinator callbacks that should be attributable in error reports. All forms re-run
  their body per execution. See "`Effect.gen` vs `Effect.fn`" in core-patterns.
- Define services with `Context.Service` and an explicit `static readonly Default`/`layer`
  layer built with `Layer.succeed`/`Layer.effect`/`Layer.provide`. V4 does not generate a
  layer for you.
- Model expected failures with `Schema.TaggedError` (or a plain `Data.TaggedError`
  when no Schema fields are needed) and recover with `Effect.catchTag`/`catchTags`/`Match`,
  never manual `_tag` string comparisons.
- Wrap fallible Promises with `Effect.tryPromise({ try, catch })`; `Effect.promise` turns
  rejection into a defect. No `async`/`await` or `try`/`catch` inside Effect workflows —
  ESLint bans them in `ts/packages/cli/src`.
- Treat every remembered v3 package name and API as wrong until verified against
  `ts/vendor/effect` (read-only source oracle — never edit or import from it) and the
  installed `effect@^4.1.0` typings. Source may be ahead of the published package;
  the compiler is the compatibility gate.

## Verification

```bash
pnpm typecheck
pnpm --filter @composio/cli run lint:effect
pnpm --filter @composio/cli test
```

Run `bun run validate:agent-skills` and `bun run validate:skill-routing` after editing this
skill or its descriptions, and compile the TypeScript blocks in this skill and in
`typescript-testing/references/effect-v4-cli.md` against the pinned packages with:

```bash
node .agents/skills/effect-v4/scripts/check-examples.mjs
```

Blocks that quote repo files with unresolvable imports carry a `no-check` fence info string.

`bun run validate:cli-skills` also verifies repo-linked command examples, their native Effect client requests, and the selected invocation contracts in Agent Substrate CI. Standalone snippet compilation and routing probes alone do not certify command behavior or agent task performance.

More from ComposioHQ/composio

SkillDescription
bug-fixingFix defects in the Composio SDK repository with focused reproduction, root-cause analysis, regression tests, and narrow verification. Use when the user reports a bug, failing test, CI regression, runtime defect, or incorrect SDK behavior. Do not use for new feature design or broad refactors.
cli-commandDesign, implement, or review Composio CLI commands under ts/packages/cli using Effect, effect/cli, services, output conventions, configuration and environment variables, and local vendor references. Use for CLI command UX, command wiring, service changes, or CLI source edits. Do not use for CLI E2E-only work; use cli-e2e there.
cli-e2eWrite, modify, or debug Docker-based Composio CLI end-to-end tests under ts/e2e-tests/cli, including binary invocation, fixture isolation, output assertions, and package manifests. Use for CLI E2E test suites only; use cli-command for CLI source implementation.
cli-releaseRelease and recover first-party Composio CLI binaries through Build CLI Binaries, including automatic beta builds, promote-stable dispatches, beta-tag selection, asset and installation verification, and failed release recovery. Use when a contributor asks to build a CLI beta, publish or promote a stable CLI version, choose a release candidate, monitor a CLI release, or diagnose a failed CLI release. Do not use for TypeScript SDK Changesets releases or CLI source implementation.
composioRoute and complete Composio work across Composio For You and Composio Platform. Use when the user mentions Composio; wants an agent to use apps such as Gmail, Slack, GitHub, Notion, Calendar, or Linear; needs first-time setup, an SDK or MCP integration, CLI operation, migration guidance, current documentation, or help diagnosing a connection or tool call.
cross-sdk-parityKeep TypeScript and Python SDK behavior, generated client usage, public API naming, and docs examples aligned. Use when a change affects both SDKs, when generated client pins move, when comparing TS/Python behavior, or when a backend API contract changed. Do not use for single-language internal-only changes.
docs-decisionsWork on Composio documentation content, Fumadocs configuration, changelogs, docs automation prompts, docs decisions, ADR-style records, and docs review guidance. Use for files under docs/, documentation workflows, or requests to record or update a docs decision. Do not use for SDK runtime changes unless docs are the main deliverable.
eveBuild durable backend AI agents with the eve framework. Use when creating, editing, or debugging an eve project — agent instructions, skills, tools, connections, channels, sandboxes, subagents, schedules, or evals.
good-docs-auditAudit a doc, guide, README, or block of prose against the good-docs-writing style guide and report violations. Use when the user asks to review, critique, lint, or check the voice and tone of documentation or text. Produces a structured findings report (file:line, rule violated, offending text, suggested rewrite) and does NOT edit files unless explicitly asked.
good-docs-writingWriting style guide derived from Modal's documentation voice. Apply when writing or editing docs, guides, tutorials, or technical prose that should read direct, second-person, confident, low-jargon, and example-first. Use to draft new docs in this voice or to revise existing prose toward it.