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