How to scaffold an Anchor program with Claude
Quando usar: You need a new Anchor program and don't want to pattern-match from random GitHub repos.
Pré-requisitos
- Rust + Anchor CLI installed — rustup + cargo install --git https://github.com/coral-xyz/anchor anchor-cli
- Skill cloned — git clone https://github.com/sendaifun/skills ~/.claude/skills/skills-sendai
Fluxo
-
State the program goalScaffold an Anchor program for a simple escrow: deposit SOL, release to seller on confirmation.✓ Copiado→ Program with accounts, instructions, and idiomatic Anchor attributes
-
TestsAdd TypeScript client tests using the Anchor test harness.✓ Copiado→ tests/ directory with typed client
-
Build and deploy to localnetBuild, deploy to localnet, and verify the escrow flow with a test transaction.✓ Copiado→ Successful local deploy
Resultado: A working Anchor program with tests.
Armadilhas
- Missing account constraints — Insist on explicit constraints for every account; skill prompts Claude to enumerate them