src/**/*.sql.ts.<entity>_id; indexes are <table>*<column>\_idx.drizzle.config.ts (schema: ./src/**/*.sql.ts, output: ./migration).bun run db generate --name <slug>.migration/<timestamp>_<slug>/migration.sql and snapshot.json._journal.json).Use these rules when writing or migrating Effect code.
See specs/effect-migration.md for the compact pattern reference and examples.
Effect.gen(function* () { ... }) for composition.Effect.fn("Domain.method") for named/traced effects and Effect.fnUntraced for internal helpers.Effect.fn / Effect.fnUntraced accept pipeable operators as extra arguments, so avoid unnecessary outer .pipe() wrappers.Effect.callback for callback-based APIs.DateTime.nowAsDate over new Date(yield* Clock.currentTimeMillis) when you need a Date.Schema.Class for multi-field data.Schema.brand) for single-value types.Schema.TaggedErrorClass for typed errors.Schema.Defect instead of unknown for defect-like causes.Effect.gen / Effect.fn, prefer yield* new MyError(...) over yield* Effect.fail(new MyError(...)) for direct early-failure branches.src/effect/instances.ts for per-directory or per-project services that need InstanceContext, per-instance state, or per-instance cleanup.Instances.InstanceContext, not Instance.* globals.FileSystem.FileSystem instead of raw fs/promises for effectful file I/O.ChildProcessSpawner.ChildProcessSpawner with ChildProcess.make(...) instead of custom process wrappers.HttpClient.HttpClient instead of raw fetch.Path.Path, Config, Clock, and DateTime when those concerns are already inside Effect code.Effect.repeat or Effect.schedule with Effect.forkScoped in the layer definition.Instance.bind(fn) captures the current Instance AsyncLocalStorage context and restores it synchronously when called.
Use it for native addon callbacks (@parcel/watcher, node-pty, native fs.watch, etc.) that need to call Bus.publish, Instance.state(), or anything that reads Instance.directory.
You do not need it for setTimeout, Promise.then, EventEmitter.on, or Effect fibers.
const cb = Instance.bind((err, evts) => {
Bus.publish(MyEvent, { ... })
})
nativeAddon.subscribe(dir, cb)