How AI coding agents should operate in this repository.
- Scope: this file applies to the full repository root.
- Precedence: a deeper
AGENTS.mdoverrides this file for its subtree. - This is an agent-operations document, not a contributor tutorial.
- GitHub Actions workflows in
.github/workflows/*.ymland.github/workflows/*.yaml - Local CI parity runner in
tools/scripts/ci-local.mjs - Root scripts in
package.jsonas wrappers/convenience entrypoints
If prose docs conflict with workflows (for example README.md or CONTRIBUTING.md), follow the workflow commands.
- Node.js:
20(from.nvmrcand workflow setup) - pnpm:
10.28.0(frompackage.jsonpackageManager) - Package manager: pnpm only
Preferred setup for agents:
pnpm run setup:codexFallback setup:
corepack enable
pnpm install --frozen-lockfileWorktree safety rule:
- In git worktree contexts, prefer
pnpm run nx:safe -- <nx args>to avoid Nx daemon issues.
Use these rules whenever the checkout is a git worktree (typically git rev-parse --git-dir differs from git rev-parse --git-common-dir):
- Setup/install via:
pnpm run setup:codex -- --frozen-lockfile- Run Nx commands via:
pnpm run nx:safe -- <nx args>- Avoid plain
pnpm nx ...for routine worktree commands unlessNX_DAEMON=falseis set explicitly. - If Nx reports missing projects or stale graph/cache behavior, refresh graph cache with:
NX_DAEMON=false pnpm exec nx show projects --json >/dev/nullUse these as defaults unless the task explicitly requires something else.
- CI-equivalent format gate:
npx nx format:check- Local format fix:
nx format:write --uncommittedWrapper script also exists: pnpm run lint-fix.
- Cold-cache package build:
npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4 --skip-nx-cache- Warm-cache package build:
npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4- Affected package tests:
npx nx affected -t test --parallel=3 --exclude='*,!tag:type:pkg'- Build pkg + metro:
npx nx run-many --targets=build --projects=tag:type:pkg,tag:type:metro --parallel=4 --skip-nx-cache- Affected metro tests:
npx nx affected -t test --parallel=2 --exclude='*,!tag:type:metro'- Metro lint:
npx nx run-many --targets=lint --projects=tag:type:metro --parallel=2- List available jobs:
pnpm run ci:local --list- Run a single job:
pnpm run ci:local --only=<job>- Current job names (from
tools/scripts/ci-local.mjs):build-and-testbuild-metroe2e-moderne2e-runtimee2e-manifeste2e-nodee2e-next-deve2e-next-prode2e-treeshakee2e-modern-ssre2e-routere2e-shared-tree-shakingdevtoolsbundle-sizeactionlint(listed, CI-only skip)bundle-size-comment(listed, CI-only skip)
Run the smallest deterministic set that matches the change type.
| Change type | Required checks | Optional checks |
|---|---|---|
| Docs-only (no code/config behavior change) | none by default; run only checks explicitly requested by user | npx nx format:check |
Package code in packages/* (non-metro) |
npx nx format:check; cold + warm pkg build; affected pkg tests |
targeted project test/build commands |
Metro package code (tag:type:metro) |
metro parity set (build pkg+metro, affected metro tests, metro lint) | E2E metro job via ci:local when relevant |
App/E2E-related changes in apps/* or E2E scripts/workflows |
pnpm run ci:local --only=<matching-job> |
additional related ci:local jobs |
| Release workflow/release tooling changes | release sanity commands only, no publish | package/metro builds if impacted |
Release sanity commands (no publish):
pnpm install --frozen-lockfile --ignore-scripts
npx nx build assemble-release-planFor every handoff, agents must report:
- Exactly which commands were run
- Which expected checks were skipped
- Why each skipped check was not run
- If a publishable package behavior changes, add a changeset:
pnpm run changeset- Release workflows are defined by:
.github/workflows/release.yml.github/workflows/release-pull-request.yml
- Do not run publish commands (
pnpm -r publish, release execution, or equivalent) unless the user explicitly requests release execution.
Current hooks:
.husky/pre-commitruns:npm run lint-fixgit add .
.husky/commit-msgruns:npm run commitlint ${1}
Guidance:
- This AGENTS update does not change hook behavior.
- Keep commit messages compatible with conventional commits and repo commitlint config (
@commitlint/config-conventional+@commitlint/config-nx-scopes).
- Keep changes minimal and directly scoped to the user request.
- Prefer modifying existing files over creating new files.
- Reuse existing Nx targets and scripts; do not introduce parallel tooling without need.
- Preserve public API compatibility unless user requests a breaking change.
- Never switch package manager or lockfile strategy.
- Do not alter CI/release mechanics unless explicitly requested.
- Never commit secrets or
.envvalues. - Never run destructive git commands unless explicitly requested.
- If unrelated files are dirty, leave them untouched.