This repository uses AI agents to assist with development tasks. This file provides entry points for agent discovery.
effectionx is a TypeScript monorepo containing community packages built on
Effection structured concurrency library.
Packages are published to NPM under the @effectionx scope.
This repository builds on Effection, a structured concurrency library. Before working with code here, read the Effection AGENTS.md for essential concepts:
- Operations vs Promises (lazy vs eager execution)
- Scope ownership and structured concurrency
- Entry points (
main(),run(),createScope()) - Streams, channels, and the
each()pattern
| Agent | Purpose | Location |
|---|---|---|
| Policy Officer | Enforces code and documentation policies | .agents/policy-officer.md |
Static analysis policies are documented in .policies/index.md. The Policy Officer agent uses these to verify compliance.
When working in this repository:
- Read this file first to understand available agents and policies
- Check applicable policies before making changes (see
.policies/index.md) - Follow progressive disclosure - start with index files, then drill into specifics as needed
- Runtime: Node.js 22.12.0 (via Volta)
- Package Manager: pnpm 9.15.9
- Build: TypeScript 5+, Turbo
- Linting/Formatting: Biome
- Testing: Vitest, via the
@effectionx/vitestadapter
IMPORTANT: All code reviews must follow the policies in .policies/index.md.
Read .agents/policy-officer.md for the expected review format and process.
When reviewing PRs:
- Read
.policies/index.mdto get the list of active policies - Read each linked policy document
- Apply policy checks to changed files
- Use the output format from
.agents/policy-officer.md
- Strict mode enabled
- Use
NodeNextmodule resolution - Target ES2022
- Prefer
typeimports for type-only imports - Use explicit return types on public functions
- Comments must say what the code cannot. Do not narrate the next line, and do not
restate a rule that already lives in
.policies/. Before keeping a comment, ask why it is needed at all (see the Code Comments policy)
- Use structured concurrency (spawn, scope)
- Resources must clean up properly on scope exit
- Teardown that needs
yield*must go inensure(), never in afinallyblock. When a task is halted Effection unwinds it withiterator.return(); if afinallyyields, the resume comes back asiterator.next(), which takes the frame out of return-mode and the halt is lost. Synchronous cleanup infinallyis fine. See the Async Teardown policy - Never register event listeners with
emitter.once(); listener lifetime must depend on a scope, not on the event firing. Register named handlers with.on()and remove them with.off()in the scope's own teardown — after any teardown wait that needs the listener still attached. See the Scope-Bound Event Registration policy - Prefer
Operation<T>for async operations - Use
*[Symbol.iterator]pattern for reusable stream operations (see Stateless Streams policy) - Avoid
sleep()for test synchronization (see No-Sleep Test Sync policy)
Use gitmoji for commit and pull request subjects. For changes to files that direct the behavior of AI such as AGENTS.md or llms.txt use a robot emoji instead of the standard gitmoji for documentation
Do not include any agent marketing material (e.g. "Generated with...", "Co-Authored-By: <agent>") in commits, pull requests, issues, or comments.
Each package requires:
<package>/
├── mod.ts # Main entry point (exports public API)
├── package.json # Package manifest with peerDependencies
├── tsconfig.json # Extends root tsconfig
├── *.test.ts # Tests using @effectionx/vitest
└── README.md # Documentation (text before --- used as description)
name:@effectionx/<package-name>description: Required — single sentence, under 120 chars, no Markdown, no trailing period (see Package.json Metadata policy)type:"module"exports: Must includetypes,development,import, anddefaultconditionspeerDependencies: Usuallyeffection: "^3 || ^4"files: Include only published artifacts (dist). Exceptions:bddalso shipsmod.deno.ts(the./denosubpath serves source directly);inlinealso shipsswc/target/wasm32-wasip1/release/swc_plugin_inline.wasm. Workspace dev resolves source via thedevelopmentexport condition — source.tsfiles do not need to be infiles
- Import
describe/itfrom@effectionx/vitest, which runs Effection operations as tests. This is what new packages should use bddandinlineare the two exceptions. Both are excluded from Vitest invitest.config.ts, import@effectionx/bdd, and run undernode --testviapnpm test:node- Tests run with
--env-file=../.env - Do not use
sleep()to wait for a result — see the No-Sleep Test Synchronization policy
pnpm build # Build all packages (TypeScript + bundling)
pnpm build:tsc # Build TypeScript only
pnpm test # Run all tests (vitest)
pnpm test:node # Run the bdd and inline suites under node --test
pnpm test:matrix # Test against peer dependency versions
pnpm check # Type-check all packages
pnpm lint # Lint all packages
pnpm fmt # Format all files
pnpm fmt:check # Check formatting
pnpm sync # Check tsconfig references
pnpm sync:fix # Fix tsconfig references and dependencieseffectionx/
├── .github/workflows/ # CI/CD workflows
├── .internal/ # Internal tooling (not published)
├── .policies/ # Code review policies
├── .agents/ # Agent instructions
├── <package>/ # Individual packages
└── package.json # Root workspace config