[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CR30XY9QZNP5RMBN2YA67G":3,"skill-same:01M7CR30XY9QZNP5RMBN2YA67G":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7CR30XY9QZNP5RMBN2YA67G","frontend-playbook",null,"The complete build-to-production pipeline for Ethereum dApps. Fork mode setup, IPFS deployment, Vercel config, ENS subdomain setup, and the full production checklist. Built around Scaffold-ETH 2 but applicable to any Ethereum frontend project. Use when deploying any dApp to production.","bro-rad\u002Fcoti-garbled-data-quickstart","bro-rad","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F325375301?v=4","01M7CR1FXF6N50Z1F90A5PAKE3","rad bro bot","01M7CR1FY2PSK9YKV9XG22M21X",0,"MIT","https:\u002F\u002Fgithub.com\u002Fbro-rad\u002Fcoti-garbled-data-quickstart\u002Fblob\u002Fcoti-garbled-data-quickstart\u002F.agents\u002Fskills\u002Ffrontend-playbook\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: frontend-playbook\ndescription: The complete build-to-production pipeline for Ethereum dApps. Fork mode setup, IPFS deployment, Vercel config, ENS subdomain setup, and the full production checklist. Built around Scaffold-ETH 2 but applicable to any Ethereum frontend project. Use when deploying any dApp to production.\n---\n\n# Frontend Playbook\n\n## What You Probably Got Wrong\n\n**\"I'll use `yarn chain`.\"** Wrong. `yarn chain` gives you an empty local chain with no protocols, no tokens, no state. `yarn fork --network base` gives you a copy of real Base with Uniswap, Aave, USDC, real whale balances — everything (verified addresses: `addresses\u002FSKILL.md`). Always fork.\n\n**\"I deployed to IPFS and it works.\"** Did the CID change? If not, you deployed stale output. Did routes work? Without `trailingSlash: true`, every route except `\u002F` returns 404. Did you check the OG image? Without `NEXT_PUBLIC_PRODUCTION_URL`, it points to `localhost:3000`.\n\n**\"I'll set up the project manually.\"** Don't. `npx create-eth@latest` handles everything — Foundry, Next.js, RainbowKit, scaffold hooks. Never run `forge init` or create Next.js projects from scratch.\n\n---\n\n## Fork Mode Setup\n\n### Why Fork, Not Chain\n\n```\nyarn chain (WRONG)              yarn fork --network base (CORRECT)\n└─ Empty local chain            └─ Fork of real Base mainnet\n└─ No protocols                 └─ Uniswap, Aave, etc. available\n└─ No tokens                    └─ Real USDC, WETH exist\n└─ Testing in isolation         └─ Test against REAL state\n```\n\n### Setup\n\n```bash\nnpx create-eth@latest          # Select: foundry, target chain, name\ncd \u003Cproject-name>\nyarn install\nyarn fork --network base       # Terminal 1: fork of real Base\nyarn deploy                    # Terminal 2: deploy contracts to fork\nyarn start                     # Terminal 3: Next.js frontend\n```\n\n### Critical: Chain ID Gotcha\n\n**When using fork mode, the frontend target network MUST be `chains.foundry` (chain ID 31337), NOT the chain you're forking.**\n\nThe fork runs locally on Anvil with chain ID 31337. Even if you're forking Base:\n\n```typescript\n\u002F\u002F scaffold.config.ts during development\ntargetNetworks: [chains.foundry],  \u002F\u002F ✅ NOT chains.base!\n```\n\nOnly switch to `chains.base` when deploying contracts to the REAL network.\n\n### Enable Block Mining\n\n```bash\n# In a new terminal — REQUIRED for time-dependent logic\ncast rpc anvil_setIntervalMining 1\n```\n\nWithout this, `block.timestamp` stays FROZEN. Any contract logic using timestamps (deadlines, expiry, vesting) will break silently.\n\n**Make it permanent** by editing `packages\u002Ffoundry\u002Fpackage.json` to add `--block-time 1` to the fork script.\n\n---\n\n## Deploying to IPFS (Recommended)\n\nIPFS is the recommended deploy path for SE2. Avoids Vercel's memory limits entirely. Produces a fully decentralized static site.\n\n### Full Build Command\n\n```bash\ncd packages\u002Fnextjs\nrm -rf .next out  # ALWAYS clean first\n\nNEXT_PUBLIC_PRODUCTION_URL=\"https:\u002F\u002Fyourapp.yourname.eth.link\" \\\n  NODE_OPTIONS=\"--require .\u002Fpolyfill-localstorage.cjs\" \\\n  NEXT_PUBLIC_IPFS_BUILD=true \\\n  NEXT_PUBLIC_IGNORE_BUILD_ERROR=true \\\n  yarn build\n\n# Upload to BuidlGuidl IPFS\nyarn bgipfs upload out\n# Save the CID!\n```\n\n### Node 25+ localStorage Polyfill (REQUIRED)\n\nNode.js 25+ ships a built-in `localStorage` object that's MISSING standard WebStorage API methods (`getItem`, `setItem`). This breaks `next-themes`, RainbowKit, and any library that calls `localStorage.getItem()` during static page generation.\n\n**Error you'll see:**\n```\nTypeError: localStorage.getItem is not a function\nError occurred prerendering page \"\u002F_not-found\"\n```\n\n**The fix:** Create `polyfill-localstorage.cjs` in `packages\u002Fnextjs\u002F`:\n```javascript\nif (typeof globalThis.localStorage !== \"undefined\" &&\n    typeof globalThis.localStorage.getItem !== \"function\") {\n  const store = new Map();\n  globalThis.localStorage = {\n    getItem: (key) => store.get(key) ?? null,\n    setItem: (key, value) => store.set(key, String(value)),\n    removeItem: (key) => store.delete(key),\n    clear: () => store.clear(),\n    key: (index) => [...store.keys()][index] ?? null,\n    get length() { return store.size; },\n  };\n}\n```\n\n**Why `--require` and not `instrumentation.ts`?** Next.js spawns a separate build worker process for prerendering. `--require` injects into EVERY Node process (including workers). `next.config.ts` polyfill only runs in the main process. `instrumentation.ts` doesn't run in the build worker. Only `--require` works.\n\n### IPFS Routing — Why Routes Break\n\nIPFS gateways serve static files. No server handles routing. Three things MUST be true:\n\n**1. `output: \"export\"` in next.config.ts** — generates static HTML files.\n\n**2. `trailingSlash: true` (CRITICAL)** — This is the #1 reason routes break:\n- `trailingSlash: false` (default) → generates `debug.html`\n- `trailingSlash: true` → generates `debug\u002Findex.html`\n- IPFS gateways resolve directories to `index.html` automatically, but NOT bare filenames\n- Without trailing slash: `\u002Fdebug` → 404 ❌\n- With trailing slash: `\u002Fdebug` → `debug\u002F` → `debug\u002Findex.html` ✅\n\n**3. Pages must survive static prerendering** — any page that crashes during `yarn build` (browser APIs at import time, localStorage) gets skipped silently → 404 on IPFS.\n\n**The complete IPFS-safe next.config.ts pattern:**\n```typescript\nconst isIpfs = process.env.NEXT_PUBLIC_IPFS_BUILD === \"true\";\nif (isIpfs) {\n  nextConfig.output = \"export\";\n  nextConfig.trailingSlash = true;\n  nextConfig.images = { unoptimized: true };\n}\n```\n\n**SE2's block explorer pages** use `localStorage` at import time and crash during static export. Rename `app\u002Fblockexplorer` to `app\u002F_blockexplorer-disabled` if not needed.\n\n### Stale Build Detection\n\n**The #1 IPFS footgun:** You edit code, then deploy the OLD build.\n\n```bash\n# MANDATORY after ANY code change:\nrm -rf .next out                     # 1. Delete old artifacts\n# ... run full build command ...     # 2. Rebuild from scratch\ngrep -l \"YOUR_STRING\" out\u002F_next\u002Fstatic\u002Fchunks\u002Fapp\u002F*.js  # 3. Verify changes present\n\n# Timestamp check:\nstat -f '%Sm' app\u002Fpage.tsx           # Source modified time\nstat -f '%Sm' out\u002F                   # Build output time\n# Source NEWER than out\u002F = STALE BUILD. Rebuild first!\n```\n\n**The CID is proof:** If the IPFS CID didn't change after a deploy, you deployed the same content. A real code change ALWAYS produces a new CID.\n\n### Verify Routes After Deploy\n\n```bash\nls out\u002F*\u002Findex.html                  # Each route has a directory + index.html\ncurl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" -L \"https:\u002F\u002FGATEWAY\u002Fipfs\u002FCID\u002Fdebug\u002F\"\n# Should return 200, not 404\n```\n\n---\n\n## Deploying to Vercel (Alternative)\n\nSE2 is a monorepo — Vercel needs special configuration.\n\n### Configuration\n\n1. **Root Directory:** `packages\u002Fnextjs`\n2. **Install Command:** `cd ..\u002F.. && yarn install`\n3. **Build Command:** leave default (`next build`)\n4. **Output Directory:** leave default (`.next`)\n\n```bash\n# Via API:\ncurl -X PATCH \"https:\u002F\u002Fapi.vercel.com\u002Fv9\u002Fprojects\u002FPROJECT_ID\" \\\n  -H \"Authorization: Bearer $VERCEL_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"rootDirectory\": \"packages\u002Fnextjs\", \"installCommand\": \"cd ..\u002F.. && yarn install\"}'\n```\n\n### Common Failures\n\n| Error | Cause | Fix |\n|-------|-------|-----|\n| \"No Next.js version detected\" | Root Directory not set | Set to `packages\u002Fnextjs` |\n| \"cd packages\u002Fnextjs: No such file\" | Build command has `cd` | Clear it — root dir handles this |\n| OOM \u002F exit code 129 | SE2 monorepo exceeds 8GB | Use IPFS instead, or `vercel --prebuilt` |\n\n### Decision Tree\n\n```\nWant to deploy SE2?\n├─ IPFS (recommended) → yarn ipfs \u002F manual build + upload\n│   └─ Fully decentralized, no memory limits, works with ENS\n├─ Vercel → Set rootDirectory + installCommand\n│   └─ Fast CDN, but centralized. May OOM on large projects\n└─ vercel --prebuilt → Build locally, push artifacts to Vercel\n    └─ Best of both: local build power + Vercel CDN\n```\n\n---\n\n## ENS Subdomain Setup\n\nTwo mainnet transactions to point an ENS subdomain at your IPFS deployment.\n\n### Transaction 1: Create Subdomain (new apps only)\n\n1. Open `https:\u002F\u002Fapp.ens.domains\u002Fyourname.eth`\n2. Go to \"Subnames\" tab → \"New subname\"\n3. Enter the label (e.g. `myapp`) → Next → Skip profile → Open Wallet → Confirm\n4. If gas is stuck: switch MetaMask to Ethereum → Activity tab → \"Speed up\"\n\n### Transaction 2: Set IPFS Content Hash\n\n1. Navigate to `https:\u002F\u002Fapp.ens.domains\u002Fmyapp.yourname.eth`\n2. \"Records\" tab → \"Edit Records\" → \"Other\" tab\n3. Paste in Content Hash field: `ipfs:\u002F\u002F\u003CCID>`\n4. Save → Open Wallet → Confirm in MetaMask\n\nFor **updates** to an existing app: skip Tx 1, only do Tx 2.\n\n### Verify\n\n```bash\n# 1. Onchain content hash matches\nRESOLVER=$(cast call 0x00000000000C2e074eC69A0dFb2997BA6C7d2e1e \\\n  \"resolver(bytes32)(address)\" $(cast namehash myapp.yourname.eth) \\\n  --rpc-url https:\u002F\u002Feth.llamarpc.com)\ncast call $RESOLVER \"contenthash(bytes32)(bytes)\" \\\n  $(cast namehash myapp.yourname.eth) --rpc-url https:\u002F\u002Feth.llamarpc.com\n\n# 2. Gateway responds (may take 5-15 min for cache)\ncurl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" -L \"https:\u002F\u002Fmyapp.yourname.eth.link\"\n\n# 3. OG metadata correct (not localhost)\ncurl -s -L \"https:\u002F\u002Fmyapp.yourname.eth.link\" | grep 'og:image'\n```\n\n**Use `.eth.link` NOT `.eth.limo`** — `.eth.link` works better on mobile.\n\n---\n\n## Go to Production — Complete Checklist\n\nWhen the user says \"ship it\", follow this EXACT sequence.\n\n### Step 1: Final Code Review 🤖\n- All feedback incorporated\n- No duplicate h1, no raw addresses, no shared isLoading\n- `scaffold.config.ts` has `rpcOverrides` and `pollingInterval: 3000`\n\n### Step 2: Choose Domain 👤\nAsk: *\"What subdomain do you want? e.g. `myapp.yourname.eth` → `myapp.yourname.eth.link`\"*\n\n### Step 3: Generate OG Image + Fix Metadata 🤖\n- Create 1200×630 PNG (`public\u002Fthumbnail.png`) — NOT the stock SE2 thumbnail\n- Set `NEXT_PUBLIC_PRODUCTION_URL` to the live domain\n- Verify `og:image` will resolve to an absolute production URL\n\n### Step 4: Clean Build + IPFS Deploy 🤖\n```bash\ncd packages\u002Fnextjs && rm -rf .next out\nNEXT_PUBLIC_PRODUCTION_URL=\"https:\u002F\u002Fmyapp.yourname.eth.link\" \\\n  NODE_OPTIONS=\"--require .\u002Fpolyfill-localstorage.cjs\" \\\n  NEXT_PUBLIC_IPFS_BUILD=true NEXT_PUBLIC_IGNORE_BUILD_ERROR=true \\\n  yarn build\n\n# Verify before uploading:\nls out\u002F*\u002Findex.html                        # Routes exist\ngrep 'og:image' out\u002Findex.html             # Not localhost\nstat -f '%Sm' app\u002Fpage.tsx                 # Source older than out\u002F\nstat -f '%Sm' out\u002F\n\nyarn bgipfs upload out                     # Save the CID\n```\n\n### Step 5: Share for Approval 👤\nSend: *\"Build ready for review: `https:\u002F\u002Fcommunity.bgipfs.com\u002Fipfs\u002F\u003CCID>`\"*\n**Wait for approval before touching ENS.**\n\n### Step 6: Set ENS 🤖\nCreate subdomain (if new) + set IPFS content hash. Two mainnet transactions.\n\n### Step 7: Verify 🤖\n- Content hash matches onchain\n- `.eth.link` gateway responds with 200\n- OG image loads correctly\n- Routes work (`\u002Fdebug\u002F`, etc.)\n\n### Step 8: Report 👤\n*\"Live at `https:\u002F\u002Fmyapp.yourname.eth.link` — ENS content hash confirmed onchain, unfurl metadata set.\"*\n\n---\n\n## Build Verification Process\n\nA build is NOT done when the code compiles. It's done when you've tested it like a real user.\n\n### Phase 1: Code QA (Automated)\n- Scan `.tsx` files for raw address strings (should use `\u003CAddress\u002F>`)\n- Scan for shared `isLoading` state across multiple buttons\n- Scan for missing `disabled` props on transaction buttons\n- Verify RPC config and polling interval\n- Verify OG metadata with absolute URLs\n- Verify no public RPCs in any file\n\n### Phase 2: Smart Contract Testing\n```bash\nforge test                    # All tests pass\nforge test --fuzz-runs 10000  # Fuzz testing\n```\nTest edge cases: zero amounts, max amounts, unauthorized callers, reentrancy attempts.\n\n### Phase 3: Browser Testing (THE REAL TEST)\n\nOpen the app and do a FULL walkthrough:\n\n1. **Load the app** — does it render correctly?\n2. **Check page title** — is it correct, not \"Scaffold-ETH 2\"?\n3. **Connect wallet** — does the connect flow work?\n4. **Wrong network** — connect on wrong chain, verify \"Switch to Base\" appears\n5. **Switch network** — click the switch button, verify it works\n6. **Approve flow** — verify approve button shows, click it, wait for tx, verify action button appears\n7. **Main action** — click primary action, verify loader, wait for tx, verify state updates\n8. **Error handling** — reject a transaction in wallet, verify UI recovers\n9. **Address displays** — all addresses showing ENS\u002Fblockies, not raw hex?\n10. **Share URL** — check OG unfurl (image, title, description)\n\n### Phase 4: QA Sub-Agent (Complex Builds)\nFor bigger projects, spawn a sub-agent with fresh context. Give it the repo path and deployed URL. It reads all code against the UX rules, opens a browser, clicks through independently, and reports issues.\n\n---\n\n## Don't Do These\n\n- ❌ `yarn chain` — use `yarn fork --network \u003Cchain>`\n- ❌ `forge init` — use `npx create-eth@latest`\n- ❌ Manual Next.js setup — SE2 handles it\n- ❌ Manual wallet connection — SE2 has RainbowKit pre-configured\n- ❌ Edit `deployedContracts.ts` — it's auto-generated by `yarn deploy`\n- ❌ Hardcode API keys in `scaffold.config.ts` — use `.env.local`\n- ❌ Use `mainnet.base.org` in production — use Alchemy or similar\n\n---\n\n## Resources\n\n- **SE2 Docs:** https:\u002F\u002Fdocs.scaffoldeth.io\u002F\n- **UI Components:** https:\u002F\u002Fui.scaffoldeth.io\u002F\n- **SpeedRun Ethereum:** https:\u002F\u002Fspeedrunethereum.com\u002F\n- **ETH Tech Tree:** https:\u002F\u002Fwww.ethtechtree.com\n- **BuidlGuidl IPFS:** https:\u002F\u002Fupload.bgipfs.com\n","# Frontend Playbook\n\n## What You Probably Got Wrong\n\n**\"I'll use `yarn chain`.\"** Wrong. `yarn chain` gives you an empty local chain with no protocols, no tokens, no state. `yarn fork --network base` gives you a copy of real Base with Uniswap, Aave, USDC, real whale balances — everything (verified addresses: `addresses\u002FSKILL.md`). Always fork.\n\n**\"I deployed to IPFS and it works.\"** Did the CID change? If not, you deployed stale output. Did routes work? Without `trailingSlash: true`, every route except `\u002F` returns 404. Did you check the OG image? Without `NEXT_PUBLIC_PRODUCTION_URL`, it points to `localhost:3000`.\n\n**\"I'll set up the project manually.\"** Don't. `npx create-eth@latest` handles everything — Foundry, Next.js, RainbowKit, scaffold hooks. Never run `forge init` or create Next.js projects from scratch.\n\n---\n\n## Fork Mode Setup\n\n### Why Fork, Not Chain\n\n```\nyarn chain (WRONG)              yarn fork --network base (CORRECT)\n└─ Empty local chain            └─ Fork of real Base mainnet\n└─ No protocols                 └─ Uniswap, Aave, etc. available\n└─ No tokens                    └─ Real USDC, WETH exist\n└─ Testing in isolation         └─ Test against REAL state\n```\n\n### Setup\n\n```bash\nnpx create-eth@latest          # Select: foundry, target chain, name\ncd \u003Cproject-name>\nyarn install\nyarn fork --network base       # Terminal 1: fork of real Base\nyarn deploy                    # Terminal 2: deploy contracts to fork\nyarn start                     # Terminal 3: Next.js frontend\n```\n\n### Critical: Chain ID Gotcha\n\n**When using fork mode, the frontend target network MUST be `chains.foundry` (chain ID 31337), NOT the chain you're forking.**\n\nThe fork runs locally on Anvil with chain ID 31337. Even if you're forking Base:\n\n```typescript\n\u002F\u002F scaffold.config.ts during development\ntargetNetworks: [chains.foundry],  \u002F\u002F ✅ NOT chains.base!\n```\n\nOnly switch to `chains.base` when deploying contracts to the REAL network.\n\n### Enable Block Mining\n\n```bash\n# In a new terminal — REQUIRED for time-dependent logic\ncast rpc anvil_setIntervalMining 1\n```\n\nWithout this, `block.timestamp` stays FROZEN. Any contract logic using timestamps (deadlines, expiry, vesting) will break silently.\n\n**Make it permanent** by editing `packages\u002Ffoundry\u002Fpackage.json` to add `--block-time 1` to the fork script.\n\n---\n\n## Deploying to IPFS (Recommended)\n\nIPFS is the recommended deploy path for SE2. Avoids Vercel's memory limits entirely. Produces a fully decentralized static site.\n\n### Full Build Command\n\n```bash\ncd packages\u002Fnextjs\nrm -rf .next out  # ALWAYS clean first\n\nNEXT_PUBLIC_PRODUCTION_URL=\"https:\u002F\u002Fyourapp.yourname.eth.link\" \\\n  NODE_OPTIONS=\"--require .\u002Fpolyfill-localstorage.cjs\" \\\n  NEXT_PUBLIC_IPFS_BUILD=true \\\n  NEXT_PUBLIC_IGNORE_BUILD_ERROR=true \\\n  yarn build\n\n# Upload to BuidlGuidl IPFS\nyarn bgipfs upload out\n# Save the CID!\n```\n\n### Node 25+ localStorage Polyfill (REQUIRED)\n\nNode.js 25+ ships a built-in `localStorage` object that's MISSING standard WebStorage API methods (`getItem`, `setItem`). This breaks `next-themes`, RainbowKit, and any library that calls `localStorage.getItem()` during static page generation.\n\n**Error you'll see:**\n```\nTypeError: localStorage.getItem is not a function\nError occurred prerendering page \"\u002F_not-found\"\n```\n\n**The fix:** Create `polyfill-localstorage.cjs` in `packages\u002Fnextjs\u002F`:\n```javascript\nif (typeof globalThis.localStorage !== \"undefined\" &&\n    typeof globalThis.localStorage.getItem !== \"function\") {\n  const store = new Map();\n  globalThis.localStorage = {\n    getItem: (key) => store.get(key) ?? null,\n    setItem: (key, value) => store.set(key, String(value)),\n    removeItem: (key) => store.delete(key),\n    clear: () => store.clear(),\n    key: (index) => [...store.keys()][index] ?? null,\n    get length() { return store.size; },\n  };\n}\n```\n\n**Why `--require` and not `instrumentation.ts`?** Next.js spawns a separate build worker process for prerendering. `--require` injects into EVERY Node process (including workers). `next.config.ts` polyfill only runs in the main process. `instrumentation.ts` doesn't run in the build worker. Only `--require` works.\n\n### IPFS Routing — Why Routes Break\n\nIPFS gateways serve static files. No server handles routing. Three things MUST be true:\n\n**1. `output: \"export\"` in next.config.ts** — generates static HTML files.\n\n**2. `trailingSlash: true` (CRITICAL)** — This is the #1 reason routes break:\n- `trailingSlash: false` (default) → generates `debug.html`\n- `trailingSlash: true` → generates `debug\u002Findex.html`\n- IPFS gateways resolve directories to `index.html` automatically, but NOT bare filenames\n- Without trailing slash: `\u002Fdebug` → 404 ❌\n- With trailing slash: `\u002Fdebug` → `debug\u002F` → `debug\u002Findex.html` ✅\n\n**3. Pages must survive static prerendering** — any page that crashes during `yarn build` (browser APIs at import time, localStorage) gets skipped silently → 404 on IPFS.\n\n**The complete IPFS-safe next.config.ts pattern:**\n```typescript\nconst isIpfs = process.env.NEXT_PUBLIC_IPFS_BUILD === \"true\";\nif (isIpfs) {\n  nextConfig.output = \"export\";\n  nextConfig.trailingSlash = true;\n  nextConfig.images = { unoptimized: true };\n}\n```\n\n**SE2's block explorer pages** use `localStorage` at import time and crash during static export. Rename `app\u002Fblockexplorer` to `app\u002F_blockexplorer-disabled` if not needed.\n\n### Stale Build Detection\n\n**The #1 IPFS footgun:** You edit code, then deploy the OLD build.\n\n```bash\n# MANDATORY after ANY code change:\nrm -rf .next out                     # 1. Delete old artifacts\n# ... run full build command ...     # 2. Rebuild from scratch\ngrep -l \"YOUR_STRING\" out\u002F_next\u002Fstatic\u002Fchunks\u002Fapp\u002F*.js  # 3. Verify changes present\n\n# Timestamp check:\nstat -f '%Sm' app\u002Fpage.tsx           # Source modified time\nstat -f '%Sm' out\u002F                   # Build output time\n# Source NEWER than out\u002F = STALE BUILD. Rebuild first!\n```\n\n**The CID is proof:** If the IPFS CID didn't change after a deploy, you deployed the same content. A real code change ALWAYS produces a new CID.\n\n### Verify Routes After Deploy\n\n```bash\nls out\u002F*\u002Findex.html                  # Each route has a directory + index.html\ncurl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" -L \"https:\u002F\u002FGATEWAY\u002Fipfs\u002FCID\u002Fdebug\u002F\"\n# Should return 200, not 404\n```\n\n---\n\n## Deploying to Vercel (Alternative)\n\nSE2 is a monorepo — Vercel needs special configuration.\n\n### Configuration\n\n1. **Root Directory:** `packages\u002Fnextjs`\n2. **Install Command:** `cd ..\u002F.. && yarn install`\n3. **Build Command:** leave default (`next build`)\n4. **Output Directory:** leave default (`.next`)\n\n```bash\n# Via API:\ncurl -X PATCH \"https:\u002F\u002Fapi.vercel.com\u002Fv9\u002Fprojects\u002FPROJECT_ID\" \\\n  -H \"Authorization: Bearer $VERCEL_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"rootDirectory\": \"packages\u002Fnextjs\", \"installCommand\": \"cd ..\u002F.. && yarn install\"}'\n```\n\n### Common Failures\n\n| Error | Cause | Fix |\n|-------|-------|-----|\n| \"No Next.js version detected\" | Root Directory not set | Set to `packages\u002Fnextjs` |\n| \"cd packages\u002Fnextjs: No such file\" | Build command has `cd` | Clear it — root dir handles this |\n| OOM \u002F exit code 129 | SE2 monorepo exceeds 8GB | Use IPFS instead, or `vercel --prebuilt` |\n\n### Decision Tree\n\n```\nWant to deploy SE2?\n├─ IPFS (recommended) → yarn ipfs \u002F manual build + upload\n│   └─ Fully decentralized, no memory limits, works with ENS\n├─ Vercel → Set rootDirectory + installCommand\n│   └─ Fast CDN, but centralized. May OOM on large projects\n└─ vercel --prebuilt → Build locally, push artifacts to Vercel\n    └─ Best of both: local build power + Vercel CDN\n```\n\n---\n\n## ENS Subdomain Setup\n\nTwo mainnet transactions to point an ENS subdomain at your IPFS deployment.\n\n### Transaction 1: Create Subdomain (new apps only)\n\n1. Open `https:\u002F\u002Fapp.ens.domains\u002Fyourname.eth`\n2. Go to \"Subnames\" tab → \"New subname\"\n3. Enter the label (e.g. `myapp`) → Next → Skip profile → Open Wallet → Confirm\n4. If gas is stuck: switch MetaMask to Ethereum → Activity tab → \"Speed up\"\n\n### Transaction 2: Set IPFS Content Hash\n\n1. Navigate to `https:\u002F\u002Fapp.ens.domains\u002Fmyapp.yourname.eth`\n2. \"Records\" tab → \"Edit Records\" → \"Other\" tab\n3. Paste in Content Hash field: `ipfs:\u002F\u002F\u003CCID>`\n4. Save → Open Wallet → Confirm in MetaMask\n\nFor **updates** to an existing app: skip Tx 1, only do Tx 2.\n\n### Verify\n\n```bash\n# 1. Onchain content hash matches\nRESOLVER=$(cast call 0x00000000000C2e074eC69A0dFb2997BA6C7d2e1e \\\n  \"resolver(bytes32)(address)\" $(cast namehash myapp.yourname.eth) \\\n  --rpc-url https:\u002F\u002Feth.llamarpc.com)\ncast call $RESOLVER \"contenthash(bytes32)(bytes)\" \\\n  $(cast namehash myapp.yourname.eth) --rpc-url https:\u002F\u002Feth.llamarpc.com\n\n# 2. Gateway responds (may take 5-15 min for cache)\ncurl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" -L \"https:\u002F\u002Fmyapp.yourname.eth.link\"\n\n# 3. OG metadata correct (not localhost)\ncurl -s -L \"https:\u002F\u002Fmyapp.yourname.eth.link\" | grep 'og:image'\n```\n\n**Use `.eth.link` NOT `.eth.limo`** — `.eth.link` works better on mobile.\n\n---\n\n## Go to Production — Complete Checklist\n\nWhen the user says \"ship it\", follow this EXACT sequence.\n\n### Step 1: Final Code Review 🤖\n- All feedback incorporated\n- No duplicate h1, no raw addresses, no shared isLoading\n- `scaffold.config.ts` has `rpcOverrides` and `pollingInterval: 3000`\n\n### Step 2: Choose Domain 👤\nAsk: *\"What subdomain do you want? e.g. `myapp.yourname.eth` → `myapp.yourname.eth.link`\"*\n\n### Step 3: Generate OG Image + Fix Metadata 🤖\n- Create 1200×630 PNG (`public\u002Fthumbnail.png`) — NOT the stock SE2 thumbnail\n- Set `NEXT_PUBLIC_PRODUCTION_URL` to the live domain\n- Verify `og:image` will resolve to an absolute production URL\n\n### Step 4: Clean Build + IPFS Deploy 🤖\n```bash\ncd packages\u002Fnextjs && rm -rf .next out\nNEXT_PUBLIC_PRODUCTION_URL=\"https:\u002F\u002Fmyapp.yourname.eth.link\" \\\n  NODE_OPTIONS=\"--require .\u002Fpolyfill-localstorage.cjs\" \\\n  NEXT_PUBLIC_IPFS_BUILD=true NEXT_PUBLIC_IGNORE_BUILD_ERROR=true \\\n  yarn build\n\n# Verify before uploading:\nls out\u002F*\u002Findex.html                        # Routes exist\ngrep 'og:image' out\u002Findex.html             # Not localhost\nstat -f '%Sm' app\u002Fpage.tsx                 # Source older than out\u002F\nstat -f '%Sm' out\u002F\n\nyarn bgipfs upload out                     # Save the CID\n```\n\n### Step 5: Share for Approval 👤\nSend: *\"Build ready for review: `https:\u002F\u002Fcommunity.bgipfs.com\u002Fipfs\u002F\u003CCID>`\"*\n**Wait for approval before touching ENS.**\n\n### Step 6: Set ENS 🤖\nCreate subdomain (if new) + set IPFS content hash. Two mainnet transactions.\n\n### Step 7: Verify 🤖\n- Content hash matches onchain\n- `.eth.link` gateway responds with 200\n- OG image loads correctly\n- Routes work (`\u002Fdebug\u002F`, etc.)\n\n### Step 8: Report 👤\n*\"Live at `https:\u002F\u002Fmyapp.yourname.eth.link` — ENS content hash confirmed onchain, unfurl metadata set.\"*\n\n---\n\n## Build Verification Process\n\nA build is NOT done when the code compiles. It's done when you've tested it like a real user.\n\n### Phase 1: Code QA (Automated)\n- Scan `.tsx` files for raw address strings (should use `\u003CAddress\u002F>`)\n- Scan for shared `isLoading` state across multiple buttons\n- Scan for missing `disabled` props on transaction buttons\n- Verify RPC config and polling interval\n- Verify OG metadata with absolute URLs\n- Verify no public RPCs in any file\n\n### Phase 2: Smart Contract Testing\n```bash\nforge test                    # All tests pass\nforge test --fuzz-runs 10000  # Fuzz testing\n```\nTest edge cases: zero amounts, max amounts, unauthorized callers, reentrancy attempts.\n\n### Phase 3: Browser Testing (THE REAL TEST)\n\nOpen the app and do a FULL walkthrough:\n\n1. **Load the app** — does it render correctly?\n2. **Check page title** — is it correct, not \"Scaffold-ETH 2\"?\n3. **Connect wallet** — does the connect flow work?\n4. **Wrong network** — connect on wrong chain, verify \"Switch to Base\" appears\n5. **Switch network** — click the switch button, verify it works\n6. **Approve flow** — verify approve button shows, click it, wait for tx, verify action button appears\n7. **Main action** — click primary action, verify loader, wait for tx, verify state updates\n8. **Error handling** — reject a transaction in wallet, verify UI recovers\n9. **Address displays** — all addresses showing ENS\u002Fblockies, not raw hex?\n10. **Share URL** — check OG unfurl (image, title, description)\n\n### Phase 4: QA Sub-Agent (Complex Builds)\nFor bigger projects, spawn a sub-agent with fresh context. Give it the repo path and deployed URL. It reads all code against the UX rules, opens a browser, clicks through independently, and reports issues.\n\n---\n\n## Don't Do These\n\n- ❌ `yarn chain` — use `yarn fork --network \u003Cchain>`\n- ❌ `forge init` — use `npx create-eth@latest`\n- ❌ Manual Next.js setup — SE2 handles it\n- ❌ Manual wallet connection — SE2 has RainbowKit pre-configured\n- ❌ Edit `deployedContracts.ts` — it's auto-generated by `yarn deploy`\n- ❌ Hardcode API keys in `scaffold.config.ts` — use `.env.local`\n- ❌ Use `mainnet.base.org` in production — use Alchemy or similar\n\n---\n\n## Resources\n\n- **SE2 Docs:** https:\u002F\u002Fdocs.scaffoldeth.io\u002F\n- **UI Components:** https:\u002F\u002Fui.scaffoldeth.io\u002F\n- **SpeedRun Ethereum:** https:\u002F\u002Fspeedrunethereum.com\u002F\n- **ETH Tech Tree:** https:\u002F\u002Fwww.ethtechtree.com\n- **BuidlGuidl IPFS:** https:\u002F\u002Fupload.bgipfs.com\n",{"name":5,"description":7},"coti-garbled-data-quickstart","a42ff7e0f45ad7809fc2db6bd9d2ef253c1688ed",".agents\u002Fskills\u002Ffrontend-playbook","https:\u002F\u002Fgithub.com\u002Fbro-rad\u002Fcoti-garbled-data-quickstart","https:\u002F\u002Fgithub.com\u002Fbro-rad","2026-10-01 08:51:30",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add bro-rad\u002Fcoti-garbled-data-quickstart --skill frontend-playbook",{"tool":36,"command":37},"bunx","bunx skills add bro-rad\u002Fcoti-garbled-data-quickstart --skill frontend-playbook",{"tool":39,"command":40},"pnpm","pnpm dlx skills add bro-rad\u002Fcoti-garbled-data-quickstart --skill frontend-playbook","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbro-rad\u002Fcoti-garbled-data-quickstart\u002Fblob\u002Fcoti-garbled-data-quickstart\u002F.agents\u002Fskills\u002Ffrontend-playbook\u002FSKILL.md",true,[],[45,52,59,66,73,80],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":19},"01M7CR605WRFVMSS3PW3CWJBAV","x402","Add x402 payment-gated routes to a Scaffold-ETH 2 project. Use when the user wants to: monetize an API with micropayments, add HTTP 402 payment required to routes, gate content behind crypto payments, implement pay-per-call APIs, or integrate the x402 protocol.","https:\u002F\u002Fgithub.com\u002Fbro-rad\u002Fcoti-garbled-data-quickstart\u002Fblob\u002Fcoti-garbled-data-quickstart\u002F.agents\u002Fskills\u002Fx402\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M7CR5WPS4WBP6MRF67SWGK13","why-ethereum","Why build on Ethereum specifically. The AI agent angle — ERC-8004, x402, composability, permissionless deployment. Use when a user asks \"should I build on Ethereum?\", \"why blockchain?\", or when an agent needs to recommend a chain for a project.","https:\u002F\u002Fgithub.com\u002Fbro-rad\u002Fcoti-garbled-data-quickstart\u002Fblob\u002Fcoti-garbled-data-quickstart\u002F.agents\u002Fskills\u002Fwhy\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7CR5RNY740CT0P9DT9HFB2T","wallets","How to create, manage, and use Ethereum wallets. Covers EOAs, smart contract wallets, multisig (Safe), and account abstraction. Use this skill whenever you are sending transactions, signing messages, or managing funds. Includes guardrails for safe key handling.","https:\u002F\u002Fgithub.com\u002Fbro-rad\u002Fcoti-garbled-data-quickstart\u002Fblob\u002Fcoti-garbled-data-quickstart\u002F.agents\u002Fskills\u002Fwallets\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7CR5MGAM27HZHA688XRD6PV","tools","Current Ethereum development tools, frameworks, libraries, RPCs, and block explorers. What actually works today for building on Ethereum. Includes tool discovery for AI agents — MCPs, abi.ninja, Foundry, Scaffold-ETH 2, Hardhat, and more. Use when setting up a dev environment, choosing tools, or when an agent needs to discover what's available.","https:\u002F\u002Fgithub.com\u002Fbro-rad\u002Fcoti-garbled-data-quickstart\u002Fblob\u002Fcoti-garbled-data-quickstart\u002F.agents\u002Fskills\u002Ftools\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7CR5HWD8ZR834W3XDEEKTXY","testing","Smart contract testing with Foundry — unit tests, fuzz testing, fork testing, invariant testing. Use when writing tests for a smart contract.","https:\u002F\u002Fgithub.com\u002Fbro-rad\u002Fcoti-garbled-data-quickstart\u002Fblob\u002Fcoti-garbled-data-quickstart\u002F.agents\u002Fskills\u002Ftesting\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7CR5DW03X87CNGQ1BX7QX0Q","subgraph","Integrate The Graph subgraph into a Scaffold-ETH 2 project for indexing blockchain events. Use when the user wants to: index contract events with The Graph, add a subgraph, query onchain data with GraphQL, set up a local graph node, or deploy a subgraph to Subgraph Studio.","https:\u002F\u002Fgithub.com\u002Fbro-rad\u002Fcoti-garbled-data-quickstart\u002Fblob\u002Fcoti-garbled-data-quickstart\u002F.agents\u002Fskills\u002Fsubgraph\u002FSKILL.md",[],[]]