hairyf

anchor

Anchor framework for Solana programs — program structure, PDAs, CPI, IDL, errors, events, zero-copy, constraints, account types, and CLI for agent-driven tooling.

hairyf 4 1 Updated 3mo ago

Resources

2
GitHub

Install

npx skillscat add hairyf/blockchain-skills/anchor

Install via the SkillsCat registry.

SKILL.md

Skill is based on Anchor v0.32.1, generated 2026-02-09.

Concise reference for building Solana programs with Anchor: macros, accounts, PDAs, CPI, IDL, custom errors, events, zero-copy, constraints, account types, and CLI.

Core References

Topic Description Reference
Program Structure declare_id, #[program], #[derive(Accounts)], #[account], Context core-program-structure
PDA seeds, bump, init, IDL/client resolution, PDA signer core-pda
CPI CpiContext, transfer, PDA signer, invoke/invoke_signed core-cpi
IDL Instructions, accounts, discriminators, client usage core-idl

Features

Topic Description Reference
Custom Errors error_code, err!, require! macros, client handling features-errors
Events emit!, emit_cpi!, #[event], addEventListener, event-cpi features-events
Zero-Copy AccountLoader, #[account(zero_copy)], load/load_mut/load_init features-zero-copy

References

Topic Description Reference
Account Constraints signer, mut, init, seeds/bump, has_one, address, owner references-account-constraints
Account Types Account, Signer, Program, AccountLoader, Interface types references-account-types
CLI build, deploy, test, idl, keys, account, expand, upgrade, verify references-cli