How to scaffold an Anchor program with Claude
Когда использовать: You need a new Anchor program and don't want to pattern-match from random GitHub repos.
Предварительные требования
- 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
Поток
-
State the program goalScaffold an Anchor program for a simple escrow: deposit SOL, release to seller on confirmation.✓ Скопировано→ Program with accounts, instructions, and idiomatic Anchor attributes
-
TestsAdd TypeScript client tests using the Anchor test harness.✓ Скопировано→ tests/ directory with typed client
-
Build and deploy to localnetBuild, deploy to localnet, and verify the escrow flow with a test transaction.✓ Скопировано→ Successful local deploy
Итог: A working Anchor program with tests.
Подводные камни
- Missing account constraints — Insist on explicit constraints for every account; skill prompts Claude to enumerate them