# AGENTS.md: TypeScript library

## Commands
`pnpm build` (tsdown or tsup) · `pnpm test` · `pnpm typecheck` · `pnpm lint` · package checks: `npx publint` and `npx @arethetypeswrong/cli --pack .`

## Package shape
- ESM-first (`"type": "module"`). `exports` map is the public API: each entry has `types` first, then `import` (and `require` only if CJS is still supported).
- `files` whitelist (`dist`, `README.md`, `LICENSE`); nothing else is published.
- `sideEffects: false` unless a module truly has side effects.
- `engines.node` states the minimum supported Node version; test against it in CI.

## Code rules
- Public API is exported from `src/index.ts` (and declared subpaths). Anything not exported is internal and may change.
- Breaking changes (removed exports, changed signatures or behavior) need a major version. Mark deprecations with `/** @deprecated use x */` first.
- No runtime dependencies unless necessary; prefer peer dependencies for frameworks (React, etc.).
- Every public function has TSDoc with an example.
- Don't rely on Node-only APIs if the package claims browser/edge support.

## Releases
- Add a changeset (`pnpm changeset`) describing user-facing changes with the right bump.
- Never run `npm publish` or `pnpm changeset publish` from the agent.

## Done
Build, tests, typecheck, publint and attw all pass.
