solana-anchor

Agent-oriented skills for the Anchor framework—Solana program structure, accounts, CPI, IDL, clients, and tooling.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "solana-anchor" with this command: npx skills add hairyf/blockchain-skills/hairyf-blockchain-skills-solana-anchor

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

TopicDescriptionReference
Program Structuredeclare_id, #[program], #[derive(Accounts)], #[account], Context, discriminatorscore-program-structure
CPICross-program invocation, CpiContext, PDA signers, invoke/invoke_signedcore-cpi
IDLInterface Description Language, instructions/accounts/discriminators, client usecore-idl
PDAProgram Derived Addresses, seeds, bump, seeds::program, init, IDL resolutioncore-pda
Workspaceinit, new, program layout, build/test/deploy flowcore-workspace
ReallocResize accounts, realloc::payer, realloc::zerocore-realloc
Close Accountclose = target, rent reclamationcore-close-account
Remaining Accountsctx.remaining_accounts, variadic instructions, CPIcore-remaining-accounts

References (Program & Config)

TopicDescriptionReference
Account TypesAccount, Signer, Program, AccountLoader, UncheckedAccount, etc.references-account-types
Account Constraintsinit, mut, seeds/bump, has_one, close, realloc, SPL, #[instruction]references-account-constraints
Anchor.tomlprovider, scripts, workspace, programs, test, toolchain, hooksreferences-anchor-toml
CLIbuild, deploy, test, idl, keys, migrate, upgrade, verifyreferences-cli
SpaceAccount size calculation, InitSpace, type sizesreferences-space
Type ConversionRust ↔ TypeScript type mapping for IDL/clientreferences-type-conversion

Features

TopicDescriptionReference
Eventsemit!, emit_cpi!, addEventListener, decodingfeatures-events
Errors#[error_code], err!, require! and variantsfeatures-errors
Zero-CopyAccountLoader, load_init/load_mut/load, init vs zerofeatures-zero-copy
declare_program!IDL-based CPI and Rust client generationfeatures-declare-program
Tokens (SPL)anchor-spl, mints, token accounts, ATAs, Token 2022, InterfaceAccountfeatures-tokens
Token 2022 ExtensionsExtensionType, tlv_data, extension lifecycle, anchor-spl token_2022_extensionsfeatures-token-extensions
Example ProgramsCurated program-examples repo—Basics, Tokens, Token 2022—when to use eachfeatures-examples
TestingMollusk (Rust instruction harness), LiteSVM (Rust/TS/Python VM)features-testing
Upgrade and Migrateanchor upgrade, migrate script, upgrade authorityfeatures-upgrade-migrate

Clients

TopicDescriptionReference
TypeScriptProgram, methods, accounts, signers, rpc/transaction/instruction, fetchclients-typescript
Rustanchor-client, declare_program!, request/instructions/send, account fetchclients-rust

Best Practices

TopicDescriptionReference
SecuritySealevel attacks, constraints, UncheckedAccount usagebest-practices-security
Constraints and ValidationWhen to use which constraints, avoid UncheckedAccount pitfallsbest-practices-constraints

Advanced

TopicDescriptionReference
Verifiable Buildsanchor build --verifiable, verify, Dockeradvanced-verifiable-builds
AVMAnchor Version Manager, install, use, listadvanced-avm

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Web3

openzeppelin-contracts

No summary provided by upstream source.

Repository SourceNeeds Review
Web3

viem

No summary provided by upstream source.

Repository SourceNeeds Review
Web3

ton

No summary provided by upstream source.

Repository SourceNeeds Review
Web3

solana

No summary provided by upstream source.

Repository SourceNeeds Review