name: repo-bootstrap
description: Bootstrap this repository in a fresh shell or agent session, including loading Node from .nvmrc, using Corepack for the pinned pnpm version, running package-manager commands from web/, validating the environment, and troubleshooting missing pnpm or bootstrap drift.
Repo Bootstrap
When to use
- Starting work in a fresh local shell or Codex session
pnpmis missing, unexpected, or prompting for Corepack setup- A task depends on
web/commands and you need to confirm the right working directory .codex/environments/environment.toml,.nvmrc, orweb/package.jsonchanged and you want to verify the bootstrap still works
Source of truth
- Node version: repo-root
.nvmrc - Package manager and version:
web/package.json - Session bootstrap for Codex:
.codex/environments/environment.toml
Standard bootstrap flow
- From the repo root, load
nvmand activate the Node version from.nvmrc. - Change into
web/before running package-manager commands so Corepack sees the pinnedpnpmversion fromweb/package.json. - Run
pnpm installfromweb/. - Run the smallest relevant command for the ticket from
web/after install.
Example:
source "$HOME/.nvm/nvm.sh"
nvm use
cd web
pnpm install
Verification checklist
command -v noderesolvesnode -vmatches the version from.nvmrccd web && command -v pnpmresolvescd web && pnpm -vruns without falling back to an unexpected global installcd web && pnpm installcompletes without version or engine surprises
Troubleshooting
pnpm is missing
- Confirm
nvm useran successfully from the repo root instead of another directory. - Do not assume
pnpmlives in~/.local/share/pnpm; this repo expects it to come from Corepack through the active Node installation. - Re-run from
web/, because Corepack reads the pinned package manager version fromweb/package.json.
Corepack prompts for a download unexpectedly
- Check that the active Node version still matches
.nvmrc. - Confirm you are running
pnpmfromweb/, not the repo root. - On a fresh machine or cache, let Corepack prepare the pinned version once, then retry the command.
- If this started after bootstrap-related changes, re-check
.codex/environments/environment.tomlfor missingnvmsetup or temp/cache paths.
Fresh-session bootstrap drift
- If
.codex/environments/environment.tomlchanged, restart Codex before judging the fix. - After restart, re-run the verification checklist in a fresh session instead of relying on an older shell.
- If
noderesolves butpnpmbehavior changed, compare.nvmrc,web/package.json, and.codex/environments/environment.tomltogether before changing docs or scripts.
Practical guardrails
- Run package-manager, build, lint, and Playwright commands from
web/. - Keep bootstrap documentation aligned across
AGENTS.mdanddocs/ai-workflow.md; update those when the repo bootstrap changes. - Prefer documenting repo-specific surprises in
docs/ai-workflow.mdso future agents can detect them quickly.
Related files
.nvmrcweb/package.json.codex/environments/environment.tomlAGENTS.mddocs/ai-workflow.md