solana-dev

软件研发 工程流程 · 其它 33 文件 EN 原文

Solana 链上开发

'Use when user asks to "build a Solana dapp", "write an Anchor program", "create a token", "debug Solana errors", "set up wallet connection", "test my Solana program", "fuzz my Solana program", "deploy to devnet", "send a v1 transaction", "support larger transactions", "fix maxSupportedTransactionVersion", or "explain Solana concepts" (rent, accounts, PDAs, CPIs). Also for program architecture — state layout, reducing compute units, throughput bottlenecks, instruction naming — and quick on-chain lookups via public RPC + curl (balance, transaction, token account). End-to-end playbook: wallet connection, Anchor/Pinocchio programs, Codama clients, Surfpool/LiteSVM/Mollusk testing, security review, and the v1 transaction format (SIMD-0385, 4096-byte transactions). Prefers @solana/kit 8 plugin clients (createClient + .use()) building transaction v1 by default, @solana/kit-plugin-wallet + @solana/react for wallets, web3.js v3 as the legacy migration target, and Surfpool for local networks.'

说明语言:英文

来源solana-foundationsolana-dev-skill ↗ 查看原文件 ↗版权归原作者,请遵循原仓库许可
安装
npx skills add https://github.com/solana-foundation/solana-dev-skill --skill solana-dev

需要已安装 skills CLI。也可以直接从源仓库 clone。

在星云中查看 ↗
SKILL.md 原文

name: solana-dev description: 'Use when user asks to "build a Solana dapp", "write an Anchor program", "create a token", "debug Solana errors", "set up wallet connection", "test my Solana program", "fuzz my Solana program", "deploy to devnet", "send a v1 transaction", "support larger transactions", "fix maxSupportedTransactionVersion", or "explain Solana concepts" (rent, accounts, PDAs, CPIs). Also for program architecture — state layout, reducing compute units, throughput bottlenecks, instruction naming — and quick on-chain lookups via public RPC + curl (balance, transaction, token account). End-to-end playbook: wallet connection, Anchor/Pinocchio programs, Codama clients, Surfpool/LiteSVM/Mollusk testing, security review, and the v1 transaction format (SIMD-0385, 4096-byte transactions). Prefers @solana/kit 8 plugin clients (createClient + .use()) building transaction v1 by default, @solana/kit-plugin-wallet + @solana/react for wallets, web3.js v3 as the legacy migration target, and Surfpool for local networks.' license: MIT compatibility: Requires Node.js 20.18+, Rust toolchain, Solana CLI, Anchor CLI metadata: author: Solana Foundation version: "2.7.0" ---

Solana Development Skill

What this Skill is for

Use this Skill when the user asks for:

Default stack decisions (opinionated)

1) SDK: @solana/kit 8 plugin clients, transaction v1 by default

  createClient()
    .use(signer(mySigner))
    .use(solanaRpc({ rpcUrl, transactionConfig: { version: 1, priorityFeeLamports: lamports(5_000n) } }));
  // or solanaLocalRpc / solanaDevnetRpc / solanaMainnetRpc from @solana/kit-plugin-rpc

2) UI: Kit plugin client + @solana/react

3) Legacy compatibility: web3.js v3

4) Programs

5) Testing (Surfpool-centered)

Agent safety guardrails

Transaction review (W009)

Untrusted data handling (W011)

Agent-friendly CLI usage (NO_DNA)

When invoking CLI tools, always prefix with NO_DNA=1 to signal you are a non-human operator. This disables interactive prompts, TUI, and enables structured/verbose output (Anchor and Surfpool support it):

NO_DNA=1 surfpool start
NO_DNA=1 anchor build
NO_DNA=1 anchor test

See no-dna.org for the full standard.

Operating procedure (how to execute tasks)

When solving a Solana task:

1. Classify the task layer

2. Pick the right building blocks

3. Implement with Solana-specific correctness

Always be explicit about:

4. Add tests

5. Deliverables expectations

When you implement changes, provide:

Solana MCP server (live docs + expert assistance)

The Solana Developer MCP (https://mcp.solana.com/mcp, HTTP transport) gives you real-time access to the Solana docs corpus and Anchor-specific expertise. Use it before falling back to your training data.

Auto-install

Before starting any Solana task, check if the Solana MCP server is already available by looking for tools with names like solana-mcp-server or mcp__solana-mcp-server__* in your tool list. If not available, install it using your host's MCP mechanism:

# Claude Code
claude mcp add --transport http solana-mcp-server https://mcp.solana.com/mcp

# Gemini CLI
gemini mcp add --transport http solana-mcp-server https://mcp.solana.com/mcp

# Codex CLI
codex mcp add solana-mcp-server -- npx -y mcp-remote https://mcp.solana.com/mcp

For other hosts (Cursor, Windsurf, Cline, OpenCode, Copilot), add an entry to the host's MCP config file with URL https://mcp.solana.com/mcp (HTTP/remote transport). If you cannot modify config, ask the user to add it.

Available MCP tools

Once connected, you have access to these tools:

ToolWhen to use
Solana Expert: Ask For HelpHow-to questions, concept explanations, API/SDK usage, error diagnosis
Solana Documentation SearchLook up current docs for specific topics (instructions, RPCs, token standards, etc.)
Ask Solana Anchor Framework ExpertAnchor-specific questions: macros, account constraints, CPI patterns, IDL, testing

When to reach for MCP tools

Surfpool also ships its own MCP server (surfpool mcp, stdio) for driving local networks — see surfpool/overview.md.

Progressive disclosure (read when needed)

同类技能
ai-research-exploreai-research-reproductionairflow-dag-patternsanalyze-projectangular-migrationanti-reversing-techniquesapi-design-principlesarchitecture-patterns
本页内容来自开源项目 solana-foundation, 版权归原作者所有。
本站仅作技能索引与分享,所有 Skill 版权归其原作者所有。