Anchor for Solana
Develop, audit, and deploy Solana programs with the Anchor framework. Covers account structures and constraints, security-by-default checks, CPI interactions, PDA design, and testing with Mollusk and LiteSVM — the full write-test-deploy loop.
This skill makes Claude an Anchor expert for Solana. It designs account structures with declarative constraints, applies Anchor's built-in security checks, builds cross-program invocations, models PDAs, and writes fast program tests with Mollusk and LiteSVM — then scripts deployment. It follows current (2026) Anchor and Solana best practices for safe, auditable on-chain code.
When to use
Use when writing or auditing Solana programs, defining Anchor account structures and constraints, building CPIs, designing PDAs, testing with Mollusk or LiteSVM, or deploying and upgrading Solana programs.
Examples
Secure account constraints
Design Anchor accounts with the right guards
Write an Anchor instruction with account structs that enforce ownership, signer, and PDA seed constraints so an attacker can't pass forged accounts
CPI to the token program
Compose a cross-program invocation
Implement a CPI from my Anchor program to the SPL token program to transfer tokens from a PDA-owned vault, with proper signer seeds
Fast program tests
Test with Mollusk / LiteSVM
Set up LiteSVM tests for my Anchor program covering the happy path plus reverts on invalid authority and insufficient balance