solana-kit-migration
БесплатноЗапускает вложенные скриптыНе проверенHelps developers understand when to use @solana/kit vs @solana/web3.js (v1), provides migration guidance, API mappings, and handles edge cases for Solana…
от sendaifun★ 129 звёзд на GitHubОб этом скилле
Solana Kit Migration Assistant
This skill helps you navigate the transition between @solana/web3.js (v1.x) and @solana/kit (formerly web3.js 2.0), providing guidance on when to use each library and how to migrate between them.
Overview
The Solana JavaScript ecosystem has two major SDK options:
| Library | Status | Use Case |
|---|---|---|
@solana/web3.js (1.x) |
Maintenance mode | Legacy projects, Anchor-dependent apps |
@solana/kit |
Active development | New projects, performance-critical apps |
Key Decision: @solana/kit is the future, but migration isn't always straightforward.
When to Use Each Library
Use @solana/kit When:
- Starting a new project without Anchor dependencies
- Bundle size matters - Kit is tree-shakeable (26% smaller bundles)
- Performance is critical - ~200ms faster confirmation latency, 10x faster crypto ops
- Using standard programs (System, Token, Associated Token)
- Building browser applications where bundle size impacts load time
- Type safety is important - Better TypeScript support catches errors at compile time
- Using modern JavaScript - Native BigInt, WebCrypto, AsyncIterators
Use @solana/web3.js (v1.x) When:
- Using Anchor - Anchor doesn't support Kit out of the box yet
- Existing large codebase - Migration cost outweighs benefits
- Dependencies require v1 - Check if your SDKs support Kit
- Rapid prototyping - v1's OOP style may be more familiar
- Documentation/examples - More community resources for v1
Use Both (Hybrid Approach) When:
- Gradual migration - Use
@solana/compatfor interoperability - Mixed dependencies - Some libs require v1, some support Kit
- Feature-by-feature migration - Convert hot paths first
Quick Decision Flowchart
START
│
├─ New project? ─────────────────────────────────────────┐
│ │ │
│ ├─ Using Anchor? ──► YES ──► Use @solana/web3.js │
│ │ │
│ └─ No Anchor? ──► Use @solana/kit │
│ │
└─ Existing project? ────────────────────────────────────┤
│ │
├─ Performance issues? ──► Consider migration │
│ │
├─ Bundle size issues? ──► Consider migration │
│ │
└─ Working fine? ──► Stay with current SDK │
Instructions for Migration Analysis
When a user asks about migration, follow these steps:
Step 1: Analyze Current Codebase
Run the migration analysis script to detect:
- Which SDK version is currently used
- Anchor dependencies
- Third-party SDK dependencies
- Usage patterns that need migration
# Use the analyze-migration.sh script in scripts/
./scripts/analyze-migration.sh /path/to/project
Step 2: Check Dependencies
Look for these blocking dependencies:
@coral-xyz/anchoror@project-serum/anchor- Wait for Anchor Kit support- SDKs that haven't migrated (check their package.json)
Step 3: Assess Migration Complexity
Count occurrences of these patterns that need changes:
new Connection(...)→createSolanaRpc(...)Keypair.fromSecretKey(...)→createKeyPairSignerFromBytes(...)new PublicKey(...)→address(...)new Transaction()→createTransactionMessage(...)- Class-based patterns → Functional composition with
pipe()
Step 4: Recommend Strategy
Based on findings, recommend:
- Full Migration: If no blockers and < 50 migration points
- Gradual Migration: If 50-200 migration points, use
@solana/compat - Wait: If Anchor-dependent or critical SDKs don't support Kit
- Hybrid: If only specific modules need Kit performance
API Migration Reference
See resources/api-mappings.md for complete mappings. Key conversions:
Connection → RPC
// v1
const connection = new Connection(url, 'confirmed');
const balance = await connection.getBalance(pubkey);
// Kit
const rpc = createSolanaRpc(url);
const { value: balance } = await rpc.getBalance(address).send();
Keypair → KeyPairSigner
// v1
const keypair = Keypair.fromSecretKey(secretKey);
console.log(keypair.publicKey.toBase58());
// Kit
const signer = await createKeyPairSignerFromBytes(secretKey);
console.log(signer.address);
Transaction Building
// v1
const tx = new Transaction().add(
SystemProgram.transfer({
fromPubkey: sender.publicKey,
toPubkey: recipient,
lamports: amount,
})
);
tx.recentBlockhash = blockhash;
tx.feePayer = sender.publicKey;
// Kit
const tx = pipe(
createTransactionMessage({ version: 0 }),
tx => setTransactionMessageFeePayer(sender.address, tx),
tx => setTrans
Установить solana-kit-migration в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл solana-kit-migration?
Helps developers understand when to use @solana/kit vs @solana/web3.js (v1), provides migration guidance, API mappings, and handles edge cases for Solana JavaScript SDK transitions
Как установить скилл solana-kit-migration?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл solana-kit-migration запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic