Monad-OPSTACK-DEX
CLAUDE.md1 starsChanged 26 days agoMITView on GitHub
Read this first. It is the short version of how this project works and what has already gone wrong. Details live in README.md (what the app does), CHANGELOG.md (every change and why) and the skill files in dex-skills/ (step-by-step recipes). Nothing here needs a separate agent: these files are the context. A non-custodial swap aggregator and cross-chain bridge, Base-first (Base is the main chain; the Dojo stays on Monad), with a game layer (the Dojo: Dojo Pass, warrior, garden, free-MON…
- Reads credentials
- Installs packages
In this repository9 other files it gives its agents.
- 1inch-aquaSkill
- 1inch-debugSkill
- 1inch-infrastructureSkill
- 1inch-market-dataSkill
- 1inch-mcp-serverSkill
- 1inch-orderbookSkill
- 1inch-swapSkill
- 1inch-walletconnectSkill
- 1inch-wallet-dataSkill
The file
We split this CLAUDE.md into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 3
Read this first. It is the short version of how this project works and what has already gone wrong.
- Distinctive: line 38
Never commit mockups, scratch scripts or harnesses.
- Distinctive: line 39
If a fix attempt fails, report what happened instead of looping.
- Distinctive: line 51
Simulate before signing: Every swap and Dojo action is dry-run first.
- Very specific: line 65
Read the token on its own chain (symbol, decimals, contract code).
- Very specific: line 66
Check it has real liquidity (KyberSwap price at about $20 and $200.
- Distinctive: line 68
Run each source through the app's own adapter code against a live server before listing it for a chain.
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md: working in the Bushido-dApp repo
Read this first. It is the short version of how this project works and what has already gone wrong. Details live in README.md (what the app does), CHANGELOG.md (every change and why) and the skill files in dex-skills/ (step-by-step recipes). Nothing here needs a separate agent: these files are the context.
What this is
A non-custodial swap aggregator and cross-chain bridge, Base-first (Base is the main chain; the Dojo stays on Monad), with a game layer (the Dojo: Dojo Pass, warrior,
garden, free-MON faucet). Vanilla JS front end (Vite 5) with React mounted lazily for the Bushido tab and the faucet pond,
an Express 5 server that proxies keyed APIs, ethers v6, Reown AppKit for wallets. Live at
https://bushido-dapp.onrender.com (Render, auto-deploys from main, about 2 minutes).
Commands
npm install && npm run build # front end -> dist/
cd server && npm install && npm start # API + the built site on :3001
npm run dev # Vite on :5173, proxies /api to :3001
npm test # node --test (all suites; fast, offline, fakes for the network)
npm run format # Prettier, ONLY on the files listed in package.json
npm run format:check # CI-style check of the same files
npm run verify:chains # read-only check of src/dex/chains.js against the real chains- New files are not formatted unless added to the
formatandformat:checklists inpackage.json. Add them. - CI (GitHub Actions): Node 20,
npm ci,npm test,npm run build. A green check must be for the final commit. - Status page:
GET /api/health(JSON: which keys are set, sources off, the faucet, and aproxysection).GET /healthzis Render's health check:200when the server is up anddist/is built,503otherwise; it never calls upstream APIs (server/healthz.js).
How the owner works
- Develop on a feature branch, never on
main. Open a PR with the template (Summary, Why, Test plan). - Every PR adds a CHANGELOG.md entry: what changed and the reasoning, plus anything not verified.
- The owner merges. Open the PR and wait for an explicit "merge"; then wait for CI on the final commit, merge, wait
for the Render deploy, and check the live site (
/api/health, a browser pass on a phone-sized screen). - Never commit mockups, scratch scripts or harnesses. Keep test scaffolding outside the repo.
- If a fix attempt fails, report what happened instead of looping. The owner decides what to retry.
- Say plainly what was not verified (for example: "no real wallet transaction was sent").
Hard rules
- Secrets: provider keys live in the server environment only. Never in
VITE_*(those ship to the browser), the repo, chat, screenshots or a committed file..envfiles are not committed. - The faucet key is the one key the server holds. It must be a fresh, dedicated wallet holding only a few MON
(
FAUCET_PRIVATE_KEY). Never use the owner's main wallet or any wallet that owns contracts or a Safe. A Safe cannot be the faucet wallet (no private key). Pattern: Safe as vault, small burner as the till, topped up by hand. The same burner pays the Base gas to collect Agent-tab payments (server/x402-local.js; about 87k gas each), so it also needs a little ETH on Base. The USDC goes from the payer straight to the fee wallet, never through it. - Simulate before signing. Every swap and Dojo action is dry-run first; a revert means no signature request.
- Reads never depend on the wallet's own connection. Some wallet in-app browsers (Zerion's) refuse
eth_calland balance reads. Use our public RPCs first, the wallet second (src/simulate.js, balances insrc/main.js). - Ask the wallet which chain it is on (
getWalletChainKey,eth_chainId), not AppKit's cached value. - Red only when confirmed. Glitches retry once quietly and show amber; red is for things that stayed broken or are
really wrong (a mismatched deposit address, a real revert). The ops log records
highonly for a real revert. - Native coins are listed with the chain's wrapped-native address and
isNative: true(MON uses the WMON contract). - Browser pickers: our own sheet (
src/token-picker.js), because native dropdowns never open in some wallet browsers.
Data rule: never add an address or decimals from memory
Hand-copied chain data has broken production twice (nine of fifteen Stargate token addresses were typo'd, truncated or badly cased; BNB Chain's USDC/USDT were given 6 decimals when they have 18). Before adding or editing a chain or coin:
- Read the token on its own chain (symbol, decimals, contract code).
npm run verify:chainsdoes this for the table. - Check it has real liquidity (KyberSwap price at about $20 and $200;
npm run verify:chains -- --prices). The Monad list keeps only coins under 0.5% loss at $20 and 0.25% at $200. - Run each source through the app's own adapter code against a live server before listing it for a chain.
- Watch for traps: BNB Chain stablecoins are 18 decimals; addresses must pass the EIP-55 checksum; explorers (BscScan, Snowtrace, MonadVision) block automated requests, so link-check by hand; KyberSwap rate-limits (429) and sometimes returns "no route" once, so retry before concluding.
Recipes: dex-skills/dex-chain-config, dex-swap-engine, dex-bridge, dex-dojo-faucet, dex-audit, dex-test, dex-deploy.
Where things are
| Area | Files |
| Chains, coins, sources | src/dex/chains.js (single source of truth), src/dex/adapters.js, src/dex/engine.js |
| Wallet and networks | src/config.js, src/utils/web3.js, src/siwx-share.js |
| Swap UI | src/main.js, src/token-picker.js, src/chain-menu.js, src/simulate.js |
| Bushido tab and Dojo | src/BushidoPanels.jsx, src/DojoCard.jsx, src/DojoPond.jsx, src/dojo/ |
| Faucet pond (Rewards tab) | src/FaucetPond.jsx, src/faucet-button.js, src/faucet-pond-mount.jsx |
| Bridge | src/bridge*.js, server/near.js, server/stargate.js, server/relay.js, server/aori.js, server/bridge-health.js |
| Server | server/index.js, server/limits.js, server/faucet.js, server/perks.js, server/switches.js |
| Tests | test/ (one file per area; fakes instead of the network) |
Environment facts
- Render sits behind Cloudflare:
TRUST_PROXY=3(Cloudflare, Render's edge, Render's proxy). Verify on/api/health:proxy.yourIpmust be the visitor's own address, not an internal10.xone. - Monad charges gas by gas limit (gas used equals gas limit), so do not read a "used = limit" transaction as out-of-gas.
- The Dojo contracts are verified on Sourcify (not on Monadscan): the Warrior's meters are
honorandreputationon-chain, though the card labels them "Vitality" and "Focus". .claude/skills/holds vendored 1inch skills locked byskills-lock.json: do not hand-edit them.
Known gaps (open, not forgotten)
- Ink has a single RPC. Aori's quote service has been returning 500s. 1inch Fusion+ is not configured.
- Zerion and Uniswap are not enabled on BNB Chain or Avalanche (unverified); Fusion cannot sell a native coin.
- A real swap transaction on BNB Chain or Avalanche has not been sent from this environment.
- A real Relay bridge has not been sent (quotes, checks and dry-runs only).
- Dojo meter labels (Vitality/Focus) differ from the contract's names (honor/reputation).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

