hairyf

solana-anchor

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

hairyf 4 1 Updated 3mo ago

Resources

2
GitHub

Install

npx skillscat add hairyf/blockchain-skills/solana-anchor

Install via the SkillsCat registry.

SKILL.md

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

Topic Description Reference
Events emit!, emit_cpi!, addEventListener, decoding features-events
Errors #[error_code], err!, require! and variants features-errors
Zero-Copy AccountLoader, load_init/load_mut/load, init vs zero features-zero-copy
declare_program! IDL-based CPI and Rust client generation features-declare-program

Clients

Topic Description Reference
TypeScript Program, methods, accounts, signers, rpc/transaction/instruction, fetch clients-typescript

Best Practices

Topic Description Reference
Security Sealevel attacks, constraints, UncheckedAccount usage best-practices-security

Advanced

Topic Description Reference
Verifiable Builds anchor build --verifiable, verify, Docker advanced-verifiable-builds
AVM Anchor Version Manager, install, use, list advanced-avm