1---2name: solana-anchor3description: Agent-oriented skills for the Anchor framework—Solana program structure, accounts, CPI, IDL, clients, and tooling.4---56> Skill based on Anchor (Solana program framework), generated from `sources/solana-anchor/docs/` at 2026-02-25.78Anchor 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.910## Core References1112| Topic | Description | Reference |13|-------|-------------|-----------|14| Program Structure | declare_id, #[program], #[derive(Accounts)], #[account], Context, discriminators | [core-program-structure](references/core-program-structure.md) |15| CPI | Cross-program invocation, CpiContext, PDA signers, invoke/invoke_signed | [core-cpi](references/core-cpi.md) |16| IDL | Interface Description Language, instructions/accounts/discriminators, client use | [core-idl](references/core-idl.md) |17| PDA | Program Derived Addresses, seeds, bump, seeds::program, init, IDL resolution | [core-pda](references/core-pda.md) |18| Workspace | init, new, program layout, build/test/deploy flow | [core-workspace](references/core-workspace.md) |19| Realloc | Resize accounts, realloc::payer, realloc::zero | [core-realloc](references/core-realloc.md) |20| Close Account | close = target, rent reclamation | [core-close-account](references/core-close-account.md) |21| Remaining Accounts | ctx.remaining_accounts, variadic instructions, CPI | [core-remaining-accounts](references/core-remaining-accounts.md) |2223## References (Program & Config)2425| Topic | Description | Reference |26|-------|-------------|-----------|27| Account Types | Account, Signer, Program, AccountLoader, UncheckedAccount, etc. | [references-account-types](references/references-account-types.md) |28| Account Constraints | init, mut, seeds/bump, has_one, close, realloc, SPL, #[instruction] | [references-account-constraints](references/references-account-constraints.md) |29| Anchor.toml | provider, scripts, workspace, programs, test, toolchain, hooks | [references-anchor-toml](references/references-anchor-toml.md) |30| CLI | build, deploy, test, idl, keys, migrate, upgrade, verify | [references-cli](references/references-cli.md) |31| Space | Account size calculation, InitSpace, type sizes | [references-space](references/references-space.md) |32| Type Conversion | Rust ↔ TypeScript type mapping for IDL/client | [references-type-conversion](references/references-type-conversion.md) |3334## Features3536| Topic | Description | Reference |37|-------|-------------|-----------|38| Events | emit!, emit_cpi!, addEventListener, decoding | [features-events](references/features-events.md) |39| Errors | #[error_code], err!, require! and variants | [features-errors](references/features-errors.md) |40| Zero-Copy | AccountLoader, load_init/load_mut/load, init vs zero | [features-zero-copy](references/features-zero-copy.md) |41| declare_program! | IDL-based CPI and Rust client generation | [features-declare-program](references/features-declare-program.md) |42| Tokens (SPL) | anchor-spl, mints, token accounts, ATAs, Token 2022, InterfaceAccount | [features-tokens](references/features-tokens.md) |43| Token 2022 Extensions | ExtensionType, tlv_data, extension lifecycle, anchor-spl token_2022_extensions | [features-token-extensions](references/features-token-extensions.md) |44| Example Programs | Curated program-examples repo—Basics, Tokens, Token 2022—when to use each | [features-examples](references/features-examples.md) |45| Testing | Mollusk (Rust instruction harness), LiteSVM (Rust/TS/Python VM) | [features-testing](references/features-testing.md) |46| Upgrade and Migrate | anchor upgrade, migrate script, upgrade authority | [features-upgrade-migrate](references/features-upgrade-migrate.md) |4748## Clients4950| Topic | Description | Reference |51|-------|-------------|-----------|52| TypeScript | Program, methods, accounts, signers, rpc/transaction/instruction, fetch | [clients-typescript](references/clients-typescript.md) |53| Rust | anchor-client, declare_program!, request/instructions/send, account fetch | [clients-rust](references/clients-rust.md) |5455## Best Practices5657| Topic | Description | Reference |58|-------|-------------|-----------|59| Security | Sealevel attacks, constraints, UncheckedAccount usage | [best-practices-security](references/best-practices-security.md) |60| Constraints and Validation | When to use which constraints, avoid UncheckedAccount pitfalls | [best-practices-constraints](references/best-practices-constraints.md) |6162## Advanced6364| Topic | Description | Reference |65|-------|-------------|-----------|66| Verifiable Builds | anchor build --verifiable, verify, Docker | [advanced-verifiable-builds](references/advanced-verifiable-builds.md) |67| AVM | Anchor Version Manager, install, use, list | [advanced-avm](references/advanced-avm.md) |