Skip to content

Commit d74d228

Browse files
committed
docs: add CLAUDE.md and AGENTS.md documentation across packages and examples
- Add root-level CLAUDE.md, DEBUGGING.md, CHEATSHEET.md guides - Add CLAUDE.md files for all examples explaining their purpose and usage - Add AGENTS.md files for key packages with CI/automation guidance - Update AGENTS.md, README.md with improved documentation - Add changesets for version tracking
1 parent 1870046 commit d74d228

56 files changed

Lines changed: 3966 additions & 73 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
"@layerzerolabs/oft-example": patch
3+
"@layerzerolabs/oapp-example": patch
4+
"@layerzerolabs/oft-adapter-example": patch
5+
"@layerzerolabs/onft721-example": patch
6+
"@layerzerolabs/oapp-read-example": patch
7+
"@layerzerolabs/oft-solana-example": patch
8+
"@layerzerolabs/oft-aptos-move-example": patch
9+
"@layerzerolabs/oapp-aptos-example": patch
10+
"@layerzerolabs/oapp-solana-example": patch
11+
"@layerzerolabs/mint-burn-oft-adapter-example": patch
12+
"@layerzerolabs/native-oft-adapter-example": patch
13+
"@layerzerolabs/oft-adapter-aptos-move-example": patch
14+
"@layerzerolabs/oft-adapter-initia-example": patch
15+
"@layerzerolabs/oft-initia-example": patch
16+
"@layerzerolabs/oft-hyperliquid-example": patch
17+
"@layerzerolabs/oft-alt-example": patch
18+
"@layerzerolabs/onft721-zksync-example": patch
19+
"@layerzerolabs/omni-call-example": patch
20+
"@layerzerolabs/lzapp-migration-example": patch
21+
"@layerzerolabs/uniswap-read-example": patch
22+
"@layerzerolabs/view-pure-read-example": patch
23+
"@layerzerolabs/ovault-evm-example": patch
24+
"@layerzerolabs/oft-upgradeable-example": patch
25+
---
26+
27+
docs: add CLAUDE.md and AGENTS.md files for AI agent context, create missing READMEs
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@layerzerolabs/toolbox-hardhat": patch
3+
"@layerzerolabs/ua-devtools-evm-hardhat": patch
4+
"@layerzerolabs/devtools-evm-hardhat": patch
5+
"@layerzerolabs/oft-evm": patch
6+
"@layerzerolabs/oapp-evm": patch
7+
"@layerzerolabs/test-devtools-ton": patch
8+
---
9+
10+
docs: add CLAUDE.md and AGENTS.md files for AI agent context, enhance README with full task reference

AGENTS.md

Lines changed: 87 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,48 @@ notifications:
1616
1717
---
1818
19-
## 2. Environment Setup
19+
## 2. Package Relationship Diagram
20+
21+
```
22+
toolbox-hardhat
23+
(main entry point)
24+
25+
┌───────────────┼───────────────┐
26+
│ │ │
27+
▼ ▼ ▼
28+
ua-devtools- devtools-evm- protocol-devtools-
29+
evm-hardhat hardhat evm
30+
│ │ │
31+
└───────┬───────┴───────┬───────┘
32+
│ │
33+
▼ ▼
34+
devtools-evm devtools
35+
(core types)
36+
```
37+
38+
**Key Packages:**
39+
- `toolbox-hardhat` - Main entry point, re-exports everything
40+
- `ua-devtools-evm-hardhat` - OApp/OFT wiring tasks
41+
- `devtools-evm-hardhat` - Deploy tasks, HRE utilities
42+
- `devtools` - Core types (OmniPoint, OmniGraph)
43+
44+
---
45+
46+
## 3. Directory-Specific AGENTS.md Files
47+
48+
Codex will apply the most specific `AGENTS.md` under:
49+
50+
| Directory | Contains |
51+
|-----------|----------|
52+
| `examples/AGENTS.md` | Example-specific guidelines, structure templates |
53+
| `packages/AGENTS.md` | Package-specific guidelines, naming conventions |
54+
| `tests/AGENTS.md` | Test-specific guidelines |
55+
| `examples/*/AGENTS.md` | Per-example build/test commands |
56+
| `packages/*/AGENTS.md` | Per-package build/test commands |
57+
58+
---
59+
60+
## 4. Environment Setup
2061

2162
1. **Setup Script** (internet + proxy phase)
2263

@@ -52,38 +93,36 @@ notifications:
5293
* `cache/metadata/dvns.json`: Contains DVN (Decentralized Verifier Network) records with contract addresses and endpoint IDs
5394
* `cache/metadata/defaultConfig.json`: Contains default cross-chain configuration settings between Endpoints
5495

55-
* Benefits:
56-
* Setup captures latest metadata during internet access
57-
* Code-mode runs fully offline using local JSON snapshots
58-
* Provides reference data for metadata-tools package and LayerZero configurations
59-
6096
---
6197

62-
## 3. Repo Structure Overview
98+
## 5. Repo Structure Overview
6399

64100
```
65101
/
66102
├── examples/ ← standalone demo projects
67-
│ ├── oapp/ ← LayerZero OApp examples
68-
│ ├── oft/ ← OFT implementation examples
69-
── onft/ ← ONFT implementation examples
70-
| └── .../
103+
│ ├── oapp/ OApp example (start here for messaging)
104+
│ ├── oft/ ← OFT example (start here for tokens)
105+
── oft-adapter/ ← Wrap existing ERC20
106+
└── .../
71107
├── packages/ ← reusable libraries & plugins
72-
│ ├── devtools/ ← core devtools package
73-
│ ├── oft-evm/ ← OFT implementations
74-
│ └── onft-evm/ ← ONFT implementations
75-
│ └── .../
108+
│ ├── toolbox-hardhat/ ← Main entry point
109+
│ ├── devtools/ ← Core types
110+
│ ├── devtools-evm-hardhat/ ← Deploy tasks
111+
│ ├── ua-devtools-evm-hardhat/ ← OApp/OFT tasks
112+
│ ├── oft-evm/ ← OFT contracts
113+
│ └── .../
76114
├── tests/ ← integration & helper suites
77-
| └── .../
78-
├── .gitignore
79115
├── turbo.json ← Turbo Pipeline config
80116
├── package.json ← monorepo root
117+
├── WORKFLOW.md ← Deployment workflow guide
118+
├── DEBUGGING.md ← Troubleshooting guide
119+
├── CHEATSHEET.md ← Quick reference
81120
└── AGENTS.md ← this file
82121
```
83122
84123
---
85124
86-
## 4. JS Tooling & Build
125+
## 6. JS Tooling & Build
87126
88127
* **Package Manager**: pnpm v8.15.6 (via Corepack or `npm install -g pnpm@8.15.6`).
89128
* **Monorepo Runner**: Turbo (`turbo.json`).
@@ -101,15 +140,29 @@ notifications:
101140
102141
---
103142
104-
## 5. Agent Workflow
143+
## 7. Common Hardhat Tasks
144+
145+
| Task | Description | Package |
146+
|------|-------------|---------|
147+
| `lz:deploy` | Deploy contracts to all configured networks | devtools-evm-hardhat |
148+
| `lz:oapp:wire` | Wire OApp pathways (setPeer, setConfig) | ua-devtools-evm-hardhat |
149+
| `lz:oapp:config:get` | Get current on-chain configuration | ua-devtools-evm-hardhat |
150+
| `lz:oapp:config:get:default` | Get LayerZero default configuration | ua-devtools-evm-hardhat |
151+
| `lz:oapp:peers:get` | Get peer relationships | ua-devtools-evm-hardhat |
152+
| `lz:read:wire` | Wire OApp Read channels | ua-devtools-evm-hardhat |
153+
| `lz:errors:decode` | Decode LayerZero error messages | ua-devtools-evm-hardhat |
154+
155+
---
156+
157+
## 8. Agent Workflow
105158
106159
1. **Initial Setup**
107160
* Run `pnpm install` to install dependencies
108161
* Ensure all required system tools are available
109162
110163
2. **Development Phase**
111164
* Make necessary code changes
112-
* Follow platform-specific guidelines in respective CODEX.md files
165+
* Follow platform-specific guidelines in respective AGENTS.md files
113166
* Ensure changes are properly documented
114167
115168
3. **Pre-Submission Checks**
@@ -127,7 +180,19 @@ notifications:
127180
128181
---
129182
130-
## 6. Versioning & Changesets
183+
## 9. Common Troubleshooting Patterns
184+
185+
| Issue | Diagnostic | Solution |
186+
|-------|------------|----------|
187+
| "Peer not set" | `lz:oapp:peers:get` | Run `lz:oapp:wire` |
188+
| "InvalidNonce" | Check message lifecycle | Verify DVN verification |
189+
| Config mismatch | `lz:oapp:config:get` | Compare with expected config |
190+
| Build fails | `pnpm build --filter <pkg>` | Check dependencies |
191+
| Deploy fails | Check `.env` | Verify RPC URLs, credentials |
192+
193+
---
194+
195+
## 10. Versioning & Changesets
131196
132197
After modifying any packages under `examples/`, `packages/`, or `tests/`:
133198
@@ -139,7 +204,7 @@ Generates and stages a changeset for versioning & changelog.
139204

140205
---
141206

142-
## 7. Commit & PR Guidelines
207+
## 11. Commit & PR Guidelines
143208

144209
* **Commits**: semantic scope:
145210

@@ -152,15 +217,3 @@ Generates and stages a changeset for versioning & changelog.
152217
2. What changed
153218
3. How to verify (build/test commands)
154219
* **Footer**: link to changeset, list breaking changes.
155-
156-
---
157-
158-
## 8. Directory-Specific Overrides
159-
160-
Codex will apply the most specific `AGENTS.md` under:
161-
162-
* `examples/AGENTS.md`
163-
* `packages/AGENTS.md`
164-
* `tests/AGENTS.md`
165-
166-
Each sub-directory's AGENTS.md provides platform-specific guidelines while maintaining consistency with this root configuration.

0 commit comments

Comments
 (0)