Skip to content

Commit f0929f3

Browse files
authored
Add contribution guidelines for coding agents (#42)
This document outlines the guidelines for coding agents on how to contribute to the repository, including rules for token submissions, editing files, and maintaining generated outputs.
1 parent 6c13907 commit f0929f3

1 file changed

Lines changed: 246 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
# AGENTS.md — mega-tokenlist
2+
3+
This file tells coding agents how to contribute to this repository safely.
4+
5+
## Purpose
6+
7+
This repository stores token metadata under `data/` and generates tokenlists automatically.
8+
9+
For routine token submissions, agents should only edit token metadata and logos. Generated tokenlists and repo logic are maintained separately.
10+
11+
---
12+
13+
## Default rule: edit only `data/`
14+
15+
For normal token submission PRs, you may only change files under:
16+
17+
- `data/<SYMBOL>/data.json`
18+
- `data/<SYMBOL>/logo.svg`
19+
- `data/<SYMBOL>/logo.png`
20+
21+
If your diff contains files outside `data/`, stop and reassess.
22+
23+
External contributor PRs that modify files outside `data/` will fail CI.
24+
25+
---
26+
27+
## Never edit generated outputs manually
28+
29+
Do not manually edit:
30+
31+
- `megaeth.tokenlist.json`
32+
- `megaeth.testnet.tokenlist.json`
33+
34+
These files are generated automatically after merge.
35+
36+
Generated tokenlists are CI-owned artifacts. Agents should treat them as read-only in routine PRs.
37+
38+
If your PR includes changes to generated tokenlists for a routine token submission, remove them before submitting.
39+
40+
---
41+
42+
## Allowed PR types
43+
44+
### 1. Routine token submission
45+
46+
Examples:
47+
48+
- add a new token
49+
- update token metadata
50+
- add or replace a token logo
51+
- add a testnet token entry in `data/`
52+
53+
For these PRs:
54+
55+
- modify only `data/**`
56+
- do not change repo code
57+
- do not change docs
58+
- do not regenerate outputs manually
59+
60+
### 2. Maintainer-level repo change
61+
62+
Examples:
63+
64+
- add new supported chain keys
65+
- change generation logic
66+
- change output file structure
67+
- change CI/workflows
68+
- update README/AGENTS/docs for contributor policy
69+
70+
These are not routine token submissions.
71+
72+
If asked to do this, explicitly state that the PR is a repo-level change and may be blocked by external contributor rules.
73+
74+
---
75+
76+
## Supported token keys
77+
78+
Inside `data/<SYMBOL>/data.json`, use the `tokens` object with supported keys:
79+
80+
- `ethereum`
81+
- `megaeth`
82+
- `megaeth_testnet`
83+
- `solana` (source tracking only)
84+
85+
Example:
86+
87+
```json
88+
{
89+
"name": "Example Token",
90+
"symbol": "EXAMPLE",
91+
"decimals": 18,
92+
"tokens": {
93+
"megaeth": {
94+
"address": "0x1234567890abcdef1234567890abcdef12345678",
95+
"isOrigin": true,
96+
"mechanism": "native"
97+
}
98+
}
99+
}
100+
```
101+
102+
---
103+
104+
## Testnet policy
105+
106+
Testnet tokens belong in `data/` just like mainnet tokens.
107+
108+
To add a MegaETH testnet token, use:
109+
110+
- `tokens.megaeth_testnet`
111+
112+
Do not create or edit generated testnet tokenlist files manually.
113+
114+
Example:
115+
116+
```json
117+
{
118+
"name": "Project Blue",
119+
"symbol": "BLU",
120+
"decimals": 18,
121+
"tokens": {
122+
"megaeth_testnet": {
123+
"address": "0x1234567890abcdef1234567890abcdef12345678",
124+
"isOrigin": true,
125+
"mechanism": "native"
126+
}
127+
}
128+
}
129+
```
130+
131+
---
132+
133+
## Per-chain fields
134+
135+
Each chain entry may include:
136+
137+
- `address` (required)
138+
- `isOrigin`
139+
- `mechanism`
140+
- `bridge`
141+
- `isOFT`
142+
143+
### Mechanism meanings
144+
145+
- `native` — originated on this chain
146+
- `lock` — locked on this chain when bridging out
147+
- `mint` — minted on this chain from another chain
148+
- `burn` — burned on this chain when bridging out
149+
150+
If mechanism/origin/bridge data is uncertain, do not guess. Ask or leave the PR narrower.
151+
152+
---
153+
154+
## Address and metadata rules
155+
156+
### Addresses
157+
158+
- Use checksummed EVM addresses (EIP-55)
159+
- Verify addresses on the target chain before submitting
160+
- Only use `0x0000000000000000000000000000000000000000` when the repo convention explicitly uses it for the native gas token representation
161+
162+
### Decimals
163+
164+
- Must match on-chain decimals
165+
- Do not infer blindly
166+
167+
### Logos
168+
169+
- Use `logo.svg` or `logo.png`
170+
- Prefer clean, production-safe assets
171+
- Keep filenames exactly `logo.svg` or `logo.png`
172+
173+
### Folder naming
174+
175+
Use `data/<SYMBOL>/` following existing repo conventions.
176+
177+
If a symbol collision or naming ambiguity exists, inspect existing folders first and follow precedent.
178+
179+
---
180+
181+
## Required pre-PR check
182+
183+
Before submitting a routine token PR, confirm the diff only touches `data/**`.
184+
185+
Example:
186+
187+
```bash
188+
git diff --name-only origin/main...HEAD
189+
```
190+
191+
If any file outside `data/` appears, remove it unless this is explicitly a maintainer-level repo change.
192+
193+
---
194+
195+
## PR scope rules
196+
197+
Keep PRs narrow.
198+
199+
Good:
200+
201+
- one token addition
202+
- one metadata correction
203+
- one logo replacement
204+
205+
Bad:
206+
207+
- multiple unrelated token edits
208+
- mixed repo logic + token data
209+
- generated output noise
210+
- opportunistic cleanup unrelated to the request
211+
212+
---
213+
214+
## PR writing rules
215+
216+
PR title should be direct, for example:
217+
218+
- `Add BLU token on MegaETH testnet`
219+
- `Update CUSD bridge metadata`
220+
- `Add logo for USDM`
221+
222+
PR body should include:
223+
224+
- token name
225+
- token symbol
226+
- decimals
227+
- chain(s)
228+
- contract address(es)
229+
- whether native / bridged / OFT
230+
- bridge address if applicable
231+
232+
---
233+
234+
## What agents must not do
235+
236+
Do not:
237+
238+
- manually regenerate tokenlists for routine token PRs
239+
- commit changes outside `data/` in a normal token PR
240+
- modify workflows, README, or generator code unless explicitly asked
241+
- invent bridge metadata
242+
- guess origin/mechanism when uncertain
243+
- rename folders casually
244+
- bundle unrelated cleanup with a token submission
245+
246+
When uncertain, prefer a smaller PR and state the uncertainty clearly.

0 commit comments

Comments
 (0)