Skill based on Anchor (Solana program framework), generated from sources/solana-anchor/docs/ at 2026-02-25.
Anchor is a Solana program framework: Rust eDSL with macros (declare_id, #[program], #[derive(Accounts)], #[account]), IDL generation, TypeScript/Rust clients, and CLI for build, test, and deploy. Use this skill when implementing or reviewing Anchor programs, CPIs, account validation, and client integration.
Core References
| Topic |
Description |
Reference |
| Program Structure |
declare_id, #[program], #[derive(Accounts)], #[account], Context, discriminators |
core-program-structure |
| CPI |
Cross-program invocation, CpiContext, PDA signers, invoke/invoke_signed |
core-cpi |
| IDL |
Interface Description Language, instructions/accounts/discriminators, client use |
core-idl |
| PDA |
Program Derived Addresses, seeds, bump, seeds::program, init, IDL resolution |
core-pda |
References (Program & Config)
| Topic |
Description |
Reference |
| Account Types |
Account, Signer, Program, AccountLoader, UncheckedAccount, etc. |
references-account-types |
| Account Constraints |
init, mut, seeds/bump, has_one, close, realloc, SPL, #[instruction] |
references-account-constraints |
| Anchor.toml |
provider, scripts, workspace, programs, test, toolchain, hooks |
references-anchor-toml |
| CLI |
build, deploy, test, idl, keys, migrate, upgrade, verify |
references-cli |
| Space |
Account size calculation, InitSpace, type sizes |
references-space |
| Type Conversion |
Rust ↔ TypeScript type mapping for IDL/client |
references-type-conversion |
Features
Clients
| Topic |
Description |
Reference |
| TypeScript |
Program, methods, accounts, signers, rpc/transaction/instruction, fetch |
clients-typescript |
Best Practices
Advanced