How to scaffold an Anchor program with Claude
Quand l'utiliser : You need a new Anchor program and don't want to pattern-match from random GitHub repos.
Prérequis
- 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
Déroulement
-
State the program goalScaffold an Anchor program for a simple escrow: deposit SOL, release to seller on confirmation.✓ Copié→ Program with accounts, instructions, and idiomatic Anchor attributes
-
TestsAdd TypeScript client tests using the Anchor test harness.✓ Copié→ tests/ directory with typed client
-
Build and deploy to localnetBuild, deploy to localnet, and verify the escrow flow with a test transaction.✓ Copié→ Successful local deploy
Résultat : A working Anchor program with tests.
Pièges
- Missing account constraints — Insist on explicit constraints for every account; skill prompts Claude to enumerate them