migrating-an-onchainkit-app
БесплатноБез исполняемых скриптовНе проверенMigrates apps from @coinbase/onchainkit to standalone wagmi/viem components. Handles provider replacement (OnchainKitProvider to WagmiProvider), wallet…
от jiayaoqijia★ 81 звезда на GitHubОб этом скилле
OnchainKit Migration Skill
Migrate apps from @coinbase/onchainkit to standalone wagmi/viem components with zero OnchainKit dependency.
Before Starting
Create a mistakes.md file in the project root:
# Migration Mistakes & Learnings
Track errors, fixes, and lessons learned during OnchainKit migration.
## Errors
## Lessons Learned
Append every error, fix, and lesson to this file throughout the migration. This file improves the skill over time.
Migration Workflow
Migrations MUST happen in this order. Do not skip steps.
Step 1: Detection
Scan the project to understand current OnchainKit usage:
- Search all files for
@coinbase/onchainkitimports - Identify which components are used:
- Provider:
OnchainKitProvider(always present if using OnchainKit) - Wallet:
Wallet,ConnectWallet,WalletDropdown,WalletModal,Connected - Transaction:
Transaction,TransactionButton,TransactionStatus - Other:
Identity,Avatar,Name,Address,Swap,Checkout, etc.
- Provider:
- Check
package.jsonfor existingwagmi,viem,@tanstack/react-querydependencies - Identify the project's styling approach (Tailwind, CSS Modules, styled-components, etc.)
- Report findings to the user before proceeding
Step 2: Provider Migration (always first)
Read references/provider-migration.md for detailed instructions and code.
Summary:
- Ensure
wagmi,viem, and@tanstack/react-queryare installed - Create
wagmi-config.tswith chain and connector configuration - Replace
OnchainKitProviderwithWagmiProvider+QueryClientProvider - Remove
@coinbase/onchainkit/styles.cssimport - Remove any
SafeAreaor MiniKit imports from layout files
Validation gate: Run npm run build (or the project's build command). Must pass before continuing. If it fails, fix errors and document them in mistakes.md.
Step 3: Wallet Migration (after provider)
Read references/wallet-migration.md for detailed instructions and code.
Summary:
- Create a
WalletConnectcomponent using wagmi hooks (useAccount,useConnect,useDisconnect) - Component includes a modal with wallet options: Base Account, Coinbase Wallet, MetaMask
- Shows truncated address + disconnect button when connected
- Replace all OnchainKit wallet imports and component usage
Validation gate: Run npm run build. Must pass before continuing. Document any errors in mistakes.md.
Step 4: Transaction Migration (after wallet)
Read references/transaction-migration.md for detailed instructions and code.
Summary:
- Check the
chainIdprop on existing<Transaction />components -- add any missing chains towagmi-config.ts - Create a
TransactionFormcomponent using wagmi hooks (useWriteContract,useWaitForTransactionReceipt,useSwitchChain) - Component handles the full lifecycle: idle, pending wallet confirmation, confirming on-chain, success, error
- Replace all OnchainKit transaction imports (
Transaction,TransactionButton,TransactionStatus,TransactionSponsor, etc.) - Update the
callsarray format -- useaddress,abi,functionName,argswith properas consttyping - Map
onStatuscallback to the new lifecycle status names (init, pending, confirmed, success, error)
Validation gate: Run npm run build. Must pass before continuing. Document any errors in mistakes.md.
Step 5: Cleanup
- Search for any remaining
@coinbase/onchainkitimports -- there should be none - Optionally remove
@coinbase/onchainkitfrompackage.jsondependencies - Run final
npm run buildto verify everything works - Update
mistakes.mdwith final lessons learned
Troubleshooting
Build fails after provider migration
- Missing dependencies: Ensure
wagmi,viem,@tanstack/react-queryare installed - Type errors with wagmi config: Check that
chainsarray has at least one chain andtransportshas a matching entry - "use client" missing: Both the provider and wallet components must have
"use client"directive
MetaMask SDK react-native warning
- The warning
Can't resolve '@react-native-async-storage/async-storage'is harmless in web builds. It comes from MetaMask SDK and does not affect functionality.
Wallet won't connect
- Verify the wagmi config has the correct connectors configured
- Check that
WagmiProviderwraps the component tree before any wallet hooks are used - Ensure
QueryClientProvideris insideWagmiProvider
Transaction receipt stuck in pending
- Symptom: Transaction hash appears, tx confirms on-chain, but UI stays stuck on "Transaction in progress..." forever
- Cause:
useWaitForTransactionReceipthas no RPC to poll because the transaction's chain is missing from the wagmi config'schains+transports - Fix: (1) Add the target chain to
Установить migrating-an-onchainkit-app в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл migrating-an-onchainkit-app?
Migrates apps from @coinbase/onchainkit to standalone wagmi/viem components. Handles provider replacement (OnchainKitProvider to WagmiProvider), wallet component replacement (Wallet/ConnectWallet to custom WalletConnect), and transaction component replacement. Use when the user says "migrate my onchainkit", "replace onchainkit provider", "migrate my wallet component", "replace my onchainkit wallet", "migrate my transaction component", "remove onchainkit dependency", or "move off onchainkit".
Как установить скилл migrating-an-onchainkit-app?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл migrating-an-onchainkit-app запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic