Agents copy the codebase.

Strict by design.

Effect starter, part 2

Typecheck. Lint. Tests. Dependencies.

Agents take shortcuts

They copy the shape of the codebase.
They make the checks pass without solving the problem.

A convention in a document does not stop that.

Effect gives the code a model. The checks enforce it.

An agent that copies the shape also copies the model.

Starter at a glance

LocationRole
apps/apiEffect HTTP API, Drizzle, PostgreSQL
apps/webReact or TanStack Start with Effect Atom, or no frontend
packages/contractsSchemas and the HTTP contract

One workspace. One contract.

One type instead of many libraries

Zod, p-limit, p-retry, dotenv, a DI container → Effect<A, E, R>

Success, typed failure, dependencies. Every combinator tracks those three channels in its type.

One model. Not a complete list.

What Effect replaces

Common choiceEffect
Zod, valibot, io-tsSchema
dotenvConfig
p-limit, async-semaEffect.forEach, Semaphore
p-retry, async-retryEffect.retry, Schedule
TanStack Query, React QueryEffect atoms (@effect/atom-react for React)
p-queueQueue, PersistedQueue
pino, OpenTelemetrylogs, metrics, traces
tsyringe, InversifyJSLayer, Context.Service
Hono, Expresseffect/http, effect/http-api
RxJSStream

The list is long. The point is one model.

Schemas at the boundary

packages/contracts → API / client / OpenAPI

One definition. Several jobs.

One schema, several jobs

const User = Schema.Struct({
  id: Schema.String.pipe(Schema.check(Schema.isGUID())),
  name: Schema.NonEmptyString,
  createdAt: Schema.DateTimeUtcFromString,
});

class UsersListError extends Schema.TaggedError<UsersListError>()(
  "UsersListError",
  { message: Schema.String },
) {}

One definition types the API, the client, and the OpenAPI document.

Example: concurrency

p-limit: the limit is yours to manage

const limit = pLimit(4);
const items = await Promise.all(
  ids.map((id) => limit(() => fetchItem(id))),
);

Retry, cleanup, and spans need more wrappers.

Example: concurrency

Effect: the limit is one option

const items = yield* Effect.forEach(
  ids,
  (id) => fetchItem(id).pipe(Effect.retry(Schedule.recurs(3))),
  { concurrency: 4 },
);

Same limit. Structured failure, cleanup, and retries.

Beyond concurrency

AreaEffect
QueuesQueue / PersistedQueue
Recurring workCron / Schedule
Observabilitylogs, metrics, traces
ConfigConfig
HTTP / SQLeffect/http, effect/sql
StreamsStream

p-limit is one example. The same argument applies to the rest of the toolbox.

Type checking rejects unexecuted Effects

Effect.log("never executed"); // floatingEffect
Effect.succeed(Promise.resolve(1)); // promiseInEffectSuccess
Effect.fail(new Error("oops")); // globalErrorInEffectFailure

An unexecuted Effect is a type error.

Type checking: the details

Promoted to errorStrict TypeScript flags
floatingEffectexactOptionalPropertyTypes
runEffectInsideEffectnoUncheckedIndexedAccess
promiseInEffectSuccesserasableSyntaxOnly
leakingRequirementsverbatimModuleSyntax
unknownInEffectCatch
globalTimersInEffect
abortControllerInEffect

TypeScript 7 + effect-tsgo. Warnings stay visible; errors fail the build.

Lint is project policy

  • categories: correctness and suspicious are errors, perf is a warning
  • typeAware: true: the type-aware rules use the compiler
  • plugins: React, a11y, TypeScript, import, Vitest, Effect
  • jsPlugins: the starter’s rules and anti-slop
  • overrides: strict in domain code, relaxed at the edges

A rule that applies everywhere is noise. A rule that applies where the decision is made is a guardrail.

The Effect preset

1001332
recommended rulesalready errorsupgraded to errorturned off

Upgraded catch-all-tag-dispatch-to-catch-tag, catch-if-tag-to-catch-tag, schema-struct-with-tag

Off lazy-effect (keep service methods as functions), schema-class-missing-brand (not needed yet)

The starter’s rules

RuleWhat it reports
runtime-boundaryEffect.run* outside an entrypoint or adapter
test-runtimeManual runtimes in tests; use it.effect
schema-compile-scopeSchema compilers inside a function
workspace-importsPrivate app code or deep src imports
no-direct-react-effectuseEffect / useLayoutEffect in apps/web/src
no-wall-clock-in-testsDate.now, new Date() in tests
no-timer-waits-in-testssetTimeout waits in unit tests
suppression-reasonDisables and ignores without a reason

The code is in tools/oxlint/index.js.

Anti-slop

RuleWhat it reports
no-chained-type-assertionsvalue as unknown as User
no-widen-then-assertWiden to unknown, then assert back
no-unsafe-dictionary-typeRecord<string, unknown> and similar
no-unknown-parametersunknown parameters outside cause
no-unknown-returnsFunctions returning unknown
no-module-mockingvi.mock, vi.doMock
no-reduce-accumulator-copyGrowing copies inside reduce
no-manual-effect-error-tagHand-discriminating _tag in catch
no-manual-tagged-constructionLiteral { _tag: "Ready" }

Adapted from Dillon Mulroy’s anti-slop project.

The React rules

Rules of Reactno-direct-react-effectno-unstable-nested-components
Hooks, purity, refs, immutabilityBan useEffect and useLayoutEffect. Use Effect atoms or useSyncExternalStoreKeep component identity stable

Not agent-specific. Good rules that are now cheap to run.

Error messages should give the next step

Execute Effects only in an entrypoint or framework adapter. Compose Effects and yield services here; tests use it.effect.

The rules are tested. Roughly 700 lines of fixtures.

Tests: no real time

it.effect("retries", () => Effect.gen(function* () {
  yield* TestClock.adjust("1 second");
  // ...
}));

Use TestClock. Put real sockets and processes in *.integration.test.ts.

Dependencies: one catalog

catalog:
  "@effect/platform-node": "^4.1.4"
  "@effect/sql-pg": "^4.1.4"
  "@effect/vitest": "4.1.4"
  effect: "^4.1.4"
  vite-plus: "1.7.0"

One version per shared dependency.

Dependencies: the supply chain

minimumReleaseAgeallowBuildslockfile
1440 minutes. No package published in the last 24 hoursOnly three packages may run install scriptsA fresh install uses the versions I tested

Agents install packages. The graph needs guardrails.

One toolchain

vp lint .
vp fmt . --check
vp test
vp pack
vp run --cache --concurrency-limit 4 typecheck

One CLI. One root config.

What this costs

Speed is not the cost.

Lint and typecheck finish in seconds. Tests use TestClock.

False positivesWorkaroundsDesign
A valid pattern can still get a warningAn agent may write a stranger fix to satisfy a ruleLint cannot tell you the design is wrong

Give the codebase a shape an agent can copy.

Typecheck. Lint. Tests. Dependencies.

The English deck for part 2 of the series, in the same Cobalt Grid design as the Japanese one. 25 slides.

It covers the checks in the order they run: typecheck, lint, tests, and the dependency graph. The written version is Effect starter, part 2: checks agents can run.

Both parts together are also available as one Japanese deck.