Skip to content

Add add-chain Claude skill for adding chains/tokens#55

Merged
reednaa merged 1 commit into
mainfrom
add-chain-skill
Jun 18, 2026
Merged

Add add-chain Claude skill for adding chains/tokens#55
reednaa merged 1 commit into
mainfrom
add-chain-skill

Conversation

@reednaa

@reednaa reednaa commented Jun 18, 2026

Copy link
Copy Markdown
Member

What

Adds a self-contained Claude Code skill (.claude/skills/add-chain/SKILL.md) that lets an agent add a new EVM chain and/or tokens to the demo app in one focused turn, for demoing the service on new networks.

The skill edits only src/lib/config.ts (the single source of truth for chains — wallet onboarding auto-derives from chainMap) across its 7 coupled sites, and handles:

  • viem-supported chains (wraps the export so the user's display name + custom RPC reach chainMap) and non-viem chains (defineChain).
  • Custom RPCs (prepended as primary, viem defaults as fallback).
  • Native + ERC-20 tokens — fetches decimals/symbol via RPC; native uses ADDRESS_ZERO.
  • Demo-readiness verification (non-blocking): chainId, infra codehash compare vs a reference chain, Polymer info_health, RouteMesh, CORS — plus bun run check as the one blocking gate.
  • Ends with a usage + verification summary. Does not commit or open a PR itself.

Also narrows the .claude gitignore so the skill is tracked:

.claude/*
!.claude/skills/

(local settings/worktrees stay ignored).

How it was built

Design and the skill file were each independently reviewed (review subagent + Codex oracle); findings on secret handling, the viem-wrap requirement, native-token templating, verification rigor, and the duplicate-chain guard were folded in.

Validation

Smoke-tested end-to-end on a viem chain (Optimism + USDC + native ETH): all 7 edits applied, invariant check passed, bun run check introduced zero new errors (verified against baseline), infra codehashes matched base, and Polymer reported chain 10 healthy. Reverted afterward — this PR contains only the skill + gitignore change.

Note: bun run check currently fails on main for an unrelated reason — local .env lacks PRIVATE_ROUTEMESH_API_KEY (present in .env.example). The skill documents this baseline gotcha.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Added a detailed guide for adding new EVM chains and tokens to the application, including step-by-step procedures, validation requirements, and verification strategies.
  • Chores

    • Updated Git configuration to manage skill documentation files.

Adds a self-contained Claude Code skill that adds a new EVM chain and/or
tokens to the demo app by editing src/lib/config.ts (the single source of
truth for chains). It handles viem-supported and non-viem chains, custom
RPCs, native + ERC-20 tokens, and runs RPC/codehash/Polymer verification,
ending with a usage + verification summary. No commit/PR is performed by the
skill itself.

Also narrows the .claude gitignore (.claude/* + !.claude/skills/) so the
skill is tracked while local settings/worktrees stay ignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3f1eb5c5-a36f-433f-b7d3-29f4b8446c1a

📥 Commits

Reviewing files that changed from the base of the PR and between fd3980c and 4f74f1e.

📒 Files selected for processing (2)
  • .claude/skills/add-chain/SKILL.md
  • .gitignore

📝 Walkthrough

Walkthrough

Adds .claude/skills/add-chain/SKILL.md, a 332-line procedural skill document for an AI assistant describing how to add EVM chains and tokens to src/lib/config.ts. Updates .gitignore to ignore .claude/* broadly while explicitly unignoring .claude/skills/ so the new file is tracked.

Changes

Add-chain skill document and gitignore wiring

Layer / File(s) Summary
Gitignore exposure and skill front-matter/rules
.gitignore, .claude/skills/add-chain/SKILL.md
.gitignore switches from ignoring .claude as a whole to ignoring .claude/* with a negation for .claude/skills/. SKILL.md opens with name: add-chain metadata, hard rules restricting edits to src/lib/config.ts, a once-only question policy, and bun run check as the sole blocking gate.
Chain/token resolution logic and 7-edits checklist
.claude/skills/add-chain/SKILL.md
Steps 1–3: chainId lookup, viem canonicalization, mainnet/testnet bucketing, native vs ERC-20 token metadata fetching, naming collision rules, and a checklist of seven required edits to src/lib/config.ts (chain objects, chainMap, chain lists, POLYMER_ORACLE, coinList, clients, polymerChainIds).
Invariant checks, verification, output template, and appendix
.claude/skills/add-chain/SKILL.md
Steps 4–6 and appendix: deterministic invariant check, bun run check compile gate, non-blocking external verifications (infra codehash comparisons, Polymer health, optional RouteMesh, CORS), a structured deliverable output template with a ✅/⚠️/❌ verification table, and a reference appendix of infra constants, RPC endpoints, and tooling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A skill was born in a hidden lair,
.claude/skills/ now floats in the air.
Seven edits, a bun run check,
No commits made — what the heck!
The rabbit hops from chain to chain,
Tokens added, nothing in vain. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly summarizes the main change: adding a Claude skill for adding chains and tokens to the demo app, which aligns perfectly with the PR's core objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-chain-skill

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

🚀 Preview deployed!

Worker: lintent-pr-55
URL: https://lintent-pr-55.li-fi374.workers.dev

Comment thread .claude/skills/add-chain/SKILL.md
@reednaa reednaa merged commit 42f1fa3 into main Jun 18, 2026
7 checks passed
@reednaa reednaa deleted the add-chain-skill branch June 18, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant