How AI coding agents should operate in this repository.
Important migration note (Turborepo): Nx orchestration has been removed from this repository. Prefer Turbo + package scripts for all build/test/lint workflows.
- 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
Recommended setup for agents:
corepack enable
pnpm install --frozen-lockfileWorktree safety rule:
- In git worktree contexts, prefer running Turbo/package scripts directly (
pnpm exec turbo .../pnpm --filter ... run ...).
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:
corepack enable
pnpm install --frozen-lockfile- Run workspace tasks via Turbo/package scripts:
pnpm exec turbo run <task>
pnpm --filter <package-name> run <script>Use these as defaults unless the task explicitly requires something else.
- List effective tasks:
pnpm exec turbo run build --dry=json- Run a task across the workspace:
pnpm exec turbo run <task>- Run a task for packages only:
pnpm exec turbo run <task> --filter=./packages/**- Run a task for one package:
pnpm exec turbo run <task> --filter=@module-federation/<pkg>- Run a package script directly (bypasses workspace fanout):
pnpm --filter @module-federation/<pkg> run <script>- Disable cache for validation/debug runs:
pnpm exec turbo run <task> --force- Common Turbo tasks defined in
turbo.json:buildtest(depends on^build)linte2e/test:e2e/test:e2e:production
- CI-equivalent format gate:
pnpm exec prettier --check .- Local format fix:
pnpm exec prettier --write .Wrapper script also exists: pnpm run lint-fix.
- Package build (Turbo cache handled automatically):
pnpm run build:packages- Package tests:
pnpm run test:packages- Package lint:
pnpm run lint:packagesRoot build/lint scripts delegate to the package pipeline scripts.
- Build pkg + metro:
pnpm run build:packages- Metro tests:
pnpm exec turbo run test --filter=@module-federation/metro --filter=@module-federation/metro-plugin-rnef --filter=@module-federation/metro-plugin-rnc-cli- Metro lint:
pnpm exec turbo run lint --filter=@module-federation/metro --filter=@module-federation/metro-plugin-rnef --filter=@module-federation/metro-plugin-rnc-cli- 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 | pnpm exec prettier --check . |
Package code in packages/* (non-metro) |
pnpm exec prettier --check .; package build; package tests |
targeted project test/build commands |
Metro package code (packages/metro-*) |
metro parity set (build pkg+metro, 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
pnpm --filter @changesets/assemble-release-plan run buildFor 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 (
@commitlint/config-conventional).
- PR titles should use the same conventional-commit style as commits when practical, for example
fix(runtime): handle missing remote entryorchore(enhanced): remove unused plugin. - Prefer PR titles without extra prefixes such as
[codex]; the title should describe the change directly. - PR bodies should be prose-first and explain:
- what changed
- why the change was needed
- user or runtime impact
- validation that was run
- any failed or skipped checks, with cause
- If a PR is docs-only, say that explicitly and keep the body brief.
- When accessing webpack internals from repo code, prefer the repo's normalized webpack-path convention over direct bare-package imports.
- Prefer:
import { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';
const InternalThing = require(
normalizeWebpackPath('webpack/lib/some/internal/path'),
) as typeof import('webpack/lib/some/internal/path');- For top-level webpack access, prefer:
const webpack = require(normalizeWebpackPath('webpack')) as typeof import('webpack');- Avoid introducing new direct bare-path requires such as
require('webpack/lib/...')when the normalized path pattern is available. - Avoid introducing new direct webpack package imports for internals when the existing module uses normalized
require(...)conventions. - When editing an existing file, preserve the local webpack-loading style already used there unless there is a deliberate reason to migrate the file consistently.
- Keep changes minimal and directly scoped to the user request.
- Prefer modifying existing files over creating new files.
- Reuse existing Turbo tasks and package scripts; do not introduce redundant 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.