migrate-web3

migrate-web3 is a command for Claude Code from solanabr/solana-ai-kit. It costs 20 tokens per session (1,046 once invoked), scanned A, original, MIT.

A migration workflow for replacing the older Solana web3.js JavaScript library with the newer Solana Kit TypeScript library. It scans the codebase, identifies APIs in use, and guides file-by-file changes.

In plain words
What is it for?
Use it to find web3.js imports, identify connections and other APIs, update frontend or backend code, and verify the migration.
Why use it?
It helps locate all affected code and manage compatibility between the old and new libraries during the upgrade.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it to find web3.js imports, identify connections and other APIs, update frontend or backend code, and verify the migration.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/solanabr/solana-ai-kit/migrate-web3
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/solanabr/solana-ai-kit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for migrate-web3

README.md
[![agentmods](https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/migrate-web3/github.svg)](https://agentmods.dev/commands/solanabr/solana-ai-kit/migrate-web3)
Your own site
<a href="https://agentmods.dev/commands/solanabr/solana-ai-kit/migrate-web3"><img src="https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/migrate-web3/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for migrate-web3

Your own site · 80×15
<a href="https://agentmods.dev/commands/solanabr/solana-ai-kit/migrate-web3"><img src="https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/migrate-web3.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,046 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00020 $0.01046
Opus 5.5 $0.00008 $0.00418
Sonnet 5.5 $0.00004 $0.00209
Haiku 4.5 $0.00002 $0.00105

Measured 25d ago against content hash 8d42336c387b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

migrate-web3 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 25d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

.claude/commands/migrate-web3.md · 40 lines

How it starts

The opening of the file, as written. The whole thing — 40 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Migrate @solana/web3.js 1.x code to @solana/kit. $ARGUMENTS can limit the scope to paths or packages; empty means the whole repo.

Read first: kit-web3-interop.md (choosing the target, dependency boundaries) and kit/overview.md (the current plugin-client API). Detailed mappings and edge cases: solana-kit-migration, with its resources/api-mappings.md and docs/edge-cases.md. Where it disagrees with kit/overview.md (older type names, no plugin client), follow kit/overview.md.

Steps

  1. Inventory: run the migration skill's scripts/analyze-migration.sh <path>, or grep for @solana/web3.js and @solana/spl-token imports outside node_modules. List the dependencies that need v1 objects (Connection, sync Keypair), such as the Anchor TS client, wallet-adapter and protocol SDKs.
  2. Agree the target with the user:
    • Kit plugin client (createClient().use(...)) for code you own.
    • web3.js v3 (@solana/web3.js@rc, the v1 classes rebuilt on Kit) as a stepping stone for a large v1 codebase. It is a release candidate, so pin exact versions; its official migration skill is linked from kit-web3-interop.md.
    • Code that must keep v1 objects stays behind one adapter module that converts at the seam with @solana/compat (fromLegacyPublicKey, fromLegacyKeypair, fromLegacyTransactionInstruction, fromVersionedTransaction).
  3. Migrate leaf utilities first, then shared modules, then pages and entry points. Run npx tsc --noEmit after each file and the tests after each module.
  4. Finish when no @solana/web3.js import remains outside the adapter, tests pass, and unused packages are gone from package.json.

Mappings that commonly go wrong

web3.js 1.x @solana/kit
new Connection(url) createClient().use(solanaRpc({ rpcUrl })), or createSolanaRpc(url) + createSolanaRpcSubscriptions(wsUrl); raw RPC calls end in .send()
new PublicKey(s), .equals() address(s): a branded string, compared with ===
Keypair.generate(), Keypair.fromSecretKey(b) await generateKeyPairSigner(), await createKeyPairSignerFromBytes(b) (async, WebCrypto)
new Transaction() + sendAndConfirmTransaction client.sendTransaction([ix]), or pipe(createTransactionMessage({ version: 0 }), ...), then signTransactionMessageWithSigners and sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })
TransactionInstruction the Instruction type (IInstruction is the old name)
SystemProgram.transfer getTransferSolInstruction from @solana-program/system
@solana/spl-token @solana-program/token or @solana-program/token-2022 (Codama-generated)
number lamports, LAMPORTS_PER_SOL bigint: lamports(1_000_000_000n), solToLamports(sol('1.5')); RPC numbers come back as bigint
bs58 getBase58Codec()
@solana/wallet-adapter-* @solana/kit-plugin-wallet (hooks in /react) with @solana/react; see frontend.md
@coral-xyz/anchor @anchor-lang/core, which still uses v1 types: keep it behind the adapter or replace it with a Codama client (/generate-idl-client)

Read the full file on GitHub · 40 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 25d ago Changed · -162 lines · +5 tokens per session 8d42336c387b
  2. 26d ago Changed d96f80dcefc6
  3. 1mo ago First seen · 202 lines · 15 tokens per session scan A 757ec17e73dc

Subscribe to this mod's changes

migrate-web3 is a command published in the GitHub repository solanabr/solana-ai-kit (104 stars, last pushed 26d ago), licensed MIT. It adds 20 tokens to every session and 1,046 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.