1---2name: anchor3description: Anchor framework for Solana programs — program structure, PDAs, CPI, IDL, errors, events, zero-copy, constraints, account types, and CLI for agent-driven tooling.4metadata:5 author: hairy6 version: "2026.2.9"7 source: Generated from https://github.com/coral-xyz/anchor, scripts located at https://github.com/antfu/skills8---910> Skill is based on Anchor v0.32.1, generated 2026-02-09.1112Concise reference for building Solana programs with Anchor: macros, accounts, PDAs, CPI, IDL, custom errors, events, zero-copy, constraints, account types, and CLI.1314## Core References1516| Topic | Description | Reference |17|-------|-------------|-----------|18| Program Structure | declare_id, #[program], #[derive(Accounts)], #[account], Context | [core-program-structure](references/core-program-structure.md) |19| PDA | seeds, bump, init, IDL/client resolution, PDA signer | [core-pda](references/core-pda.md) |20| CPI | CpiContext, transfer, PDA signer, invoke/invoke_signed | [core-cpi](references/core-cpi.md) |21| IDL | Instructions, accounts, discriminators, client usage | [core-idl](references/core-idl.md) |2223## Features2425| Topic | Description | Reference |26|-------|-------------|-----------|27| Custom Errors | error_code, err!, require! macros, client handling | [features-errors](references/features-errors.md) |28| Events | emit!, emit_cpi!, #[event], addEventListener, event-cpi | [features-events](references/features-events.md) |29| Zero-Copy | AccountLoader, #[account(zero_copy)], load/load_mut/load_init | [features-zero-copy](references/features-zero-copy.md) |3031## References3233| Topic | Description | Reference |34|-------|-------------|-----------|35| Account Constraints | signer, mut, init, seeds/bump, has_one, address, owner | [references-account-constraints](references/references-account-constraints.md) |36| Account Types | Account, Signer, Program, AccountLoader, Interface types | [references-account-types](references/references-account-types.md) |37| CLI | build, deploy, test, idl, keys, account, expand, upgrade, verify | [references-cli](references/references-cli.md) |