This file defines global rules & conventions for Codex agents working in the devtools monorepo.
model: codex-32k
approvalMode: manual # Options: auto / manual / semi
notifications:
onCompletion: true
onError: true-
Setup Script (internet + proxy phase)
-
Install system deps:
solc, Foundry (forge&cast), Hardhat tools. -
Seed offline caches:
- Solidity compiler binaries under
~/.foundry/solc/… - Hardhat
list.jsonunder each project'scache/solc-bin/bin.
- Solidity compiler binaries under
-
Bootstrap JS deps:
pnpm install(root) to populate lockfile andnode_modules.
-
-
Code-Mode (network disabled)
- Only run builds & tests against prepared caches.
- No additional
apt-getor registry downloads allowed.
-
Offline Metadata
-
Snapshot LayerZero metadata during setup:
# In setup script mkdir -p cache/metadata curl -sSL https://metadata.layerzero-api.com/v1/metadata/deployments \ -o cache/metadata/deployments.json curl -sSL https://metadata.layerzero-api.com/v1/metadata/dvns \ -o cache/metadata/dvns.json curl -sSL https://metadata.layerzero-api.com/v1/metadata/defaultConfig \ -o cache/metadata/defaultConfig.json -
During code-mode, agents must read from local cache instead of live URLs:
cache/metadata/deployments.json: Contains all LayerZero on-chain deployment addresses for every chain (Endpoints, Message Libraries, etc.)cache/metadata/dvns.json: Contains DVN (Decentralized Verifier Network) records with contract addresses and endpoint IDscache/metadata/defaultConfig.json: Contains default cross-chain configuration settings between Endpoints
-
Benefits:
- Setup captures latest metadata during internet access
- Code-mode runs fully offline using local JSON snapshots
- Provides reference data for metadata-tools package and LayerZero configurations
-
/
├── examples/ ← standalone demo projects
│ ├── oapp/ ← LayerZero OApp examples
│ ├── oft/ ← OFT implementation examples
│ └── onft/ ← ONFT implementation examples
| └── .../
├── packages/ ← reusable libraries & plugins
│ ├── devtools/ ← core devtools package
│ ├── oft-evm/ ← OFT implementations
│ └── onft-evm/ ← ONFT implementations
│ └── .../
├── tests/ ← integration & helper suites
| └── .../
├── .gitignore
├── turbo.json ← Turbo Pipeline config
├── package.json ← monorepo root
└── AGENTS.md ← this file
-
Package Manager: pnpm v8.15.6 (via Corepack or
npm install -g pnpm@8.15.6). -
Monorepo Runner: Turbo (
turbo.json).- CI concurrency:
npx turbo run build --force --concurrency=2 - Local dev: adjust
--concurrencyup to available cores.
- CI concurrency:
-
Commands:
- Install:
pnpm install - Build:
npx turbo run build - Test CI:
pnpm test:ci - Test Local:
pnpm test:local - E2E User:
pnpm test:user - Lint:
pnpm lint:fix
- Install:
-
Initial Setup
- Run
pnpm installto install dependencies - Ensure all required system tools are available
- Run
-
Development Phase
- Make necessary code changes
- Follow platform-specific guidelines in respective CODEX.md files
- Ensure changes are properly documented
-
Pre-Submission Checks
- Run
pnpm buildto verify compilation - Run
pnpm lint:fixto ensure code style consistency - Run
pnpm test:localto verify tests pass - If package changes were made:
- Run
pnpm changesetto create version updates - Review and commit changeset files
- Run
- Run
-
PR Creation
- Create PR with clear title and description
- Include changeset if applicable
- Ensure CI checks pass
After modifying any packages under examples/, packages/, or tests/:
pnpm changesetGenerates and stages a changeset for versioning & changelog.
-
Commits: semantic scope:
feat(hardhat): add network mappingfix(example-onft721): correct anchor script
-
PR Title: brief summary (max 72 chars).
-
PR Body:
- Motivation
- What changed
- How to verify (build/test commands)
-
Footer: link to changeset, list breaking changes.
Codex will apply the most specific AGENTS.md under:
examples/AGENTS.mdpackages/AGENTS.mdtests/AGENTS.md
Each sub-directory's AGENTS.md provides platform-specific guidelines while maintaining consistency with this root configuration.