|
| 1 | +--- |
| 2 | +name: solana-dev |
| 3 | +description: End-to-end Solana development playbook (Jan 2026). Prefer Solana Foundation framework-kit (@solana/client + @solana/react-hooks) for React/Next.js UI. Prefer @solana/kit for all new client/RPC/transaction code. When legacy dependencies require web3.js, isolate it behind @solana/web3-compat (or @solana/web3.js as a true legacy fallback). Covers wallet-standard-first connection (incl. ConnectorKit), Anchor/Pinocchio programs, Codama-based client generation, LiteSVM/Mollusk/Surfpool testing, and security checklists. |
| 4 | +user-invocable: true |
| 5 | +--- |
| 6 | + |
| 7 | +# Solana Development Skill (framework-kit-first) |
| 8 | + |
| 9 | +## What this Skill is for |
| 10 | +Use this Skill when the user asks for: |
| 11 | +- Solana dApp UI work (React / Next.js) |
| 12 | +- Wallet connection + signing flows |
| 13 | +- Transaction building / sending / confirmation UX |
| 14 | +- On-chain program development (Anchor or Pinocchio) |
| 15 | +- Client SDK generation (typed program clients) |
| 16 | +- Local testing (LiteSVM, Mollusk, Surfpool) |
| 17 | +- Security hardening and audit-style reviews |
| 18 | +- Confidential transfers (Token-2022 ZK extension) |
| 19 | + |
| 20 | +## Default stack decisions (opinionated) |
| 21 | +1) **UI: framework-kit first** |
| 22 | +- Use `@solana/client` + `@solana/react-hooks`. |
| 23 | +- Prefer Wallet Standard discovery/connect via the framework-kit client. |
| 24 | + |
| 25 | +2) **SDK: @solana/kit first** |
| 26 | +- Prefer Kit types (`Address`, `Signer`, transaction message APIs, codecs). |
| 27 | +- Prefer `@solana-program/*` instruction builders over hand-rolled instruction data. |
| 28 | + |
| 29 | +3) **Legacy compatibility: web3.js only at boundaries** |
| 30 | +- If you must integrate a library that expects web3.js objects (`PublicKey`, `Transaction`, `Connection`), |
| 31 | + use `@solana/web3-compat` as the boundary adapter. |
| 32 | +- Do not let web3.js types leak across the entire app; contain them to adapter modules. |
| 33 | + |
| 34 | +4) **Programs** |
| 35 | +- Default: Anchor (fast iteration, IDL generation, mature tooling). |
| 36 | +- Performance/footprint: Pinocchio when you need CU optimization, minimal binary size, |
| 37 | + zero dependencies, or fine-grained control over parsing/allocations. |
| 38 | + |
| 39 | +5) **Testing** |
| 40 | +- Default: LiteSVM or Mollusk for unit tests (fast feedback, runs in-process). |
| 41 | +- Use Surfpool for integration tests against realistic cluster state (mainnet/devnet) locally. |
| 42 | +- Use solana-test-validator only when you need specific RPC behaviors not emulated by LiteSVM. |
| 43 | + |
| 44 | +## Operating procedure (how to execute tasks) |
| 45 | +When solving a Solana task: |
| 46 | + |
| 47 | +### 1. Classify the task layer |
| 48 | +- UI/wallet/hook layer |
| 49 | +- Client SDK/scripts layer |
| 50 | +- Program layer (+ IDL) |
| 51 | +- Testing/CI layer |
| 52 | +- Infra (RPC/indexing/monitoring) |
| 53 | + |
| 54 | +### 2. Pick the right building blocks |
| 55 | +- UI: framework-kit patterns. |
| 56 | +- Scripts/backends: @solana/kit directly. |
| 57 | +- Legacy library present: introduce a web3-compat adapter boundary. |
| 58 | +- High-performance programs: Pinocchio over Anchor. |
| 59 | + |
| 60 | +### 3. Implement with Solana-specific correctness |
| 61 | +Always be explicit about: |
| 62 | +- cluster + RPC endpoints + websocket endpoints |
| 63 | +- fee payer + recent blockhash |
| 64 | +- compute budget + prioritization (where relevant) |
| 65 | +- expected account owners + signers + writability |
| 66 | +- token program variant (SPL Token vs Token-2022) and any extensions |
| 67 | + |
| 68 | +### 4. Add tests |
| 69 | +- Unit test: LiteSVM or Mollusk. |
| 70 | +- Integration test: Surfpool. |
| 71 | +- For "wallet UX", add mocked hook/provider tests where appropriate. |
| 72 | + |
| 73 | +### 5. Deliverables expectations |
| 74 | +When you implement changes, provide: |
| 75 | +- exact files changed + diffs (or patch-style output) |
| 76 | +- commands to install/build/test |
| 77 | +- a short "risk notes" section for anything touching signing/fees/CPIs/token transfers |
| 78 | + |
| 79 | +## Progressive disclosure (read when needed) |
| 80 | +- UI + wallet + hooks: [frontend-framework-kit.md](frontend-framework-kit.md) |
| 81 | +- Kit ↔ web3.js boundary: [kit-web3-interop.md](kit-web3-interop.md) |
| 82 | +- Anchor programs: [programs-anchor.md](programs-anchor.md) |
| 83 | +- Pinocchio programs: [programs-pinocchio.md](programs-pinocchio.md) |
| 84 | +- Testing strategy: [testing.md](testing.md) |
| 85 | +- IDLs + codegen: [idl-codegen.md](idl-codegen.md) |
| 86 | +- Payments: [payments.md](payments.md) |
| 87 | +- Confidential transfers: [confidential-transfers.md](confidential-transfers.md) |
| 88 | +- Security checklist: [security.md](security.md) |
| 89 | +- Reference links: [resources.md](resources.md) |
0 commit comments