- Branch off
trunkand open pull requests intotrunk. Don't commit totrunkdirectly. - Open a draft PR as soon as you start, so others can see the work. Keep one PR per change, even a large one; related issues can share a PR.
- Out-of-scope work you notice goes in a new issue, not the current PR. Keep issue bodies evergreen: context, problem and proposed fix in the body, not appended as comments.
- Dependabot updates dependencies. Update one by hand only when your change needs it, or for the steps Dependabot cannot do (below).
- Getting your PR green, reviewed and free of conflicts is your responsibility. Rebase onto
origin/trunk; don't mergetrunkin.
Vite+ (vp) manages Node.js, pnpm and the tools; run everything through it (vp exec <bin>, not npx). vp install installs dependencies and the git hooks; the pre-commit hook formats and lints staged files, then runs the Fallow audit.
| Command | Does |
|---|---|
vp check |
Format and lint (Oxfmt, Oxlint with the Effect presets, type-aware) |
vp run check |
The type gates: sources and type-level tests, the emitted declarations, the examples |
vp run -r test:unit |
The root and example test suites |
vp run build |
dist/ |
vp run docgen |
Compiles and runs every JSDoc @example against dist/; writes docs/api/ |
vp run ci |
All of the above plus pnpm audit and typecheck:floor (network), as CI runs it |
vp run test:coverage |
The coverage map fallow audit reads |
Fallow checks dead code, duplication and complexity. The pre-commit hook runs vp run fallow:audit (coverage, then fallow audit against origin/trunk) and blocks a commit on findings the change introduces; vp run fallow summarises the whole tree. Use it to polish your work: its findings are guidance, not dogma, and CI doesn't run it.
vp check (format and lint) and vp run check (type gates) are different commands.
Versions live only in the pnpm-workspace.yaml catalog; never edit one in a package.json. After changing the catalog, run vp install and commit pnpm-lock.yaml.
Dependabot can't make the toolchain moves, so make them in a PR from a new branch started from its head (never push to a dependabot/* branch, which stops it rebasing), and it closes its own PR once yours merges. There, also move: the vite alias (equal to vite-plus), the typescript / @typescript/native aliases (to a pairing @effect/tsgo supports), and the devcontainer image tag (equal to vite-plus). Raise or drop the advisory floors under overrides when pnpm audit or their dependents change.
Use Effect idioms throughout, and strongly prefer Effect v4's own modules (Option, Array, Match, Schema, Result, …) over re-inventing them. Convert existing code where practical. The exceptions are non-Effect APIs adapted at the edge and hot paths where measured performance needs plain code. Read the installed effect package (node_modules/effect/dist/*.d.ts, its src/, AGENTS.md and ai-docs/) rather than guessing an API.
- HTTP modules are
effect/httpandeffect/http-api. - Import Effect modules as namespaces (
import * as Option from "effect/Option"); never bind effect'sRecordasRecord(useR). - Absence is
Option.exactOptionalPropertyTypesis on: an options member isreadonly x?: T, with no| undefined. JSON:API wire shapes keep their native optionals andnull, spelled from their schemas. - Relative imports carry
.js. - Exports follow Effect's layout: one PascalCase module per file, re-exported as a namespace from
src/index.ts(export * as Resource from "./Resource.js") and importable through its own subpath (./Resource). A new module needs itsexportsentry. - Fix lint findings in code; a rule is relaxed only in
vite.config.ts, with its reason.
architecture.md explains how the modules derive from one resource definition.
- A file-level comment is optional: under 50 words, only for context the code can't give.
- Doc comments on exports add to what IntelliSense shows: what to reach for and when, not a restated signature. Public exports keep
@since, a@categoryand, for principal APIs, an@example. - Inline comments only where the code isn't self-explanatory: workarounds, performance, non-obvious decisions.
- No references to issues, PRs or CI runs, and no history ("this used to…"). Stable links to external docs are fine.
vp run docgen compiles and runs every @example (and every ts fence in a doc comment), importing the package by name through dist/. An example is a complete program that imports everything it uses, never uses declare const, imports assertions by name (import { strictEqual } from "node:assert") and doesn't throw. Fence a non-runnable sketch as ts skip-type-checking.
- Test logic and edge cases that would regress; don't test what the type system enforces or trivial behaviour.
- Import from
vite-plus/test. Effect tests takeitfrom@effect/vitest(it.effect,it.livefor real time); neverEffect.runPromisein a test body. - Compile-time assertions go in
test/*.types.ts, with@ts-expect-errorabove a statement that must fail.test/emitted/*.types.tscheck the built declarations. - Never lower a coverage threshold; add the test.
Run vp run ci (or each gate in its order). The pre-commit hook runs the Fallow audit.
Every change to the published package's behaviour, including doc comments that reach the emitted .d.ts, needs a changeset: vp exec changeset. Docs-, CI- and tooling-only changes need none. Pre-1.0, a breaking change is minor; never major. Never version or publish by hand: the Release workflow runs vp run release (vp run release:dry-run shows what it would publish); see PUBLISHING.md.