Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

migrating-an-onchainkit-app

БесплатноБез исполняемых скриптовНе проверен

Migrates apps from @coinbase/onchainkit to standalone wagmi/viem components. Handles provider replacement (OnchainKitProvider to WagmiProvider), wallet…

jiayaoqijiaот 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:

  1. Search all files for @coinbase/onchainkit imports
  2. 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.
  3. Check package.json for existing wagmi, viem, @tanstack/react-query dependencies
  4. Identify the project's styling approach (Tailwind, CSS Modules, styled-components, etc.)
  5. Report findings to the user before proceeding

Step 2: Provider Migration (always first)

Read references/provider-migration.md for detailed instructions and code.

Summary:

  1. Ensure wagmi, viem, and @tanstack/react-query are installed
  2. Create wagmi-config.ts with chain and connector configuration
  3. Replace OnchainKitProvider with WagmiProvider + QueryClientProvider
  4. Remove @coinbase/onchainkit/styles.css import
  5. Remove any SafeArea or 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:

  1. Create a WalletConnect component using wagmi hooks (useAccount, useConnect, useDisconnect)
  2. Component includes a modal with wallet options: Base Account, Coinbase Wallet, MetaMask
  3. Shows truncated address + disconnect button when connected
  4. 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:

  1. Check the chainId prop on existing <Transaction /> components -- add any missing chains to wagmi-config.ts
  2. Create a TransactionForm component using wagmi hooks (useWriteContract, useWaitForTransactionReceipt, useSwitchChain)
  3. Component handles the full lifecycle: idle, pending wallet confirmation, confirming on-chain, success, error
  4. Replace all OnchainKit transaction imports (Transaction, TransactionButton, TransactionStatus, TransactionSponsor, etc.)
  5. Update the calls array format -- use address, abi, functionName, args with proper as const typing
  6. Map onStatus callback 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

  1. Search for any remaining @coinbase/onchainkit imports -- there should be none
  2. Optionally remove @coinbase/onchainkit from package.json dependencies
  3. Run final npm run build to verify everything works
  4. Update mistakes.md with final lessons learned

Troubleshooting

Build fails after provider migration

  • Missing dependencies: Ensure wagmi, viem, @tanstack/react-query are installed
  • Type errors with wagmi config: Check that chains array has at least one chain and transports has 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 WagmiProvider wraps the component tree before any wallet hooks are used
  • Ensure QueryClientProvider is inside WagmiProvider

Transaction receipt stuck in pending

  • Symptom: Transaction hash appears, tx confirms on-chain, but UI stays stuck on "Transaction in progress..." forever
  • Cause: useWaitForTransactionReceipt has no RPC to poll because the transaction's chain is missing from the wagmi config's chains + transports
  • Fix: (1) Add the target chain to
Полный SKILL.md на GitHub

Установить migrating-an-onchainkit-app в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

SOURCE.mdTRUST.auto.yamlreferences/provider-migration.mdreferences/transaction-migration.mdreferences/troubleshooting.mdreferences/wallet-migration.md

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), без исполняемых скриптов.

Похожие скиллы

Сравнить migrating-an-onchainkit-app с