The Solana Anchor Claude skill automates the creation and editing of Solana Anchor projects, ensuring adherence to best practices and conventions. It benefits developers and operations teams by streamlining Solana blockchain development workflows. The skill integrates with Claude Code, providing a strong tool for managing Solana projects efficiently.
git clone https://github.com/mikemaccana/solana-anchor-claude-skill.gitThe Solana Anchor Claude skill automates the creation and editing of Solana Anchor projects, ensuring adherence to best practices and conventions. It benefits developers and operations teams by streamlining Solana blockchain development workflows. The skill integrates with Claude Code, providing a strong tool for managing Solana projects efficiently.
[{"step":"Prepare your specifications. Gather requirements like project name, features (e.g., 'NFT marketplace with royalties'), and any custom modifications needed. Use the format: 'Create a project with [FEATURES] and ensure it follows [BEST_PRACTICES].'","tip":"Be specific about features. Instead of 'NFT marketplace,' say 'NFT marketplace with creator royalties up to 10%, listing fees, and Metaplex metadata support.'"},{"step":"Run the skill in Claude Code. Paste the prompt template into Claude and replace placeholders with your specifications. Example: 'Generate a Solana Anchor project named 'ticketing-system' with NFT ticketing features and Metaplex metadata support. Ensure it follows Anchor best practices and includes a fee mechanism for events.'","tip":"Use Claude Code's `run` command to execute the generated project setup. Monitor the output for errors and adjust specifications if needed."},{"step":"Review and modify the generated project. After creation, use the skill to make targeted modifications. Example: 'Modify the program to add a new instruction for bulk ticket transfers.'","tip":"Check the generated `lib.rs` and instruction files. Use Anchor's CLI (`anchor build`, `anchor test`) to verify changes before proceeding."},{"step":"Integrate with your workflow. Use the generated project in your development pipeline. Deploy to devnet/testnet, test with frontend clients, or integrate with CI/CD pipelines.","tip":"Leverage the TypeScript client generated in the `app/` directory for frontend integration. Use `anchor deploy` for quick devnet testing."},{"step":"Document changes and share with your team. The skill generates a `README.md` with setup instructions. Update it with any custom modifications or deployment steps.","tip":"Include deployment addresses, test accounts, and any environment variables required for your team to replicate the setup."}]
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/mikemaccana/solana-anchor-claude-skillCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Generate a new Solana Anchor project named [PROJECT_NAME] with the following specifications: [SPECIFICATIONS]. Ensure the project follows Anchor best practices and includes [FEATURES]. After creation, modify the program to [MODIFICATION_TASK]. Use Claude Code to execute all steps and provide a summary of the changes made.
```
# Solana Anchor Project: 'nft-marketplace' Generated
## Project Structure
```
project/
├── Anchor.toml
├── Cargo.toml
├── programs/
│ └── nft_marketplace/
│ ├── src/
│ │ ├── lib.rs
│ │ ├── instructions/
│ │ │ ├── create_listing.rs
│ │ │ ├── purchase_nft.rs
│ │ │ └── cancel_listing.rs
│ │ └── state/
│ │ └── listing.rs
│ └── tests/
│ └── nft_marketplace.ts
├── app/
│ ├── package.json
│ └── src/
│ └── index.ts
└── README.md
## Key Changes Made
1. **Added NFT Metadata Standard Compliance**: Integrated Metaplex Token Metadata Program (mpl_token_metadata) to ensure NFTs follow the Metaplex standard. Updated `lib.rs` to include:
```rust
use mpl_token_metadata::state::Metadata;
```
2. **Implemented Fee Mechanism**: Added a 2% marketplace fee to all NFT sales. Modified `purchase_nft.rs`:
```rust
let fee = sale_amount * 2 / 100;
let fee_account = next_account_info(account_info_iter)?;
**fee_account.lamports.borrow_mut() += fee;
```
3. **Added Royalty Support**: Enabled creators to set royalties (default 5%). Updated `state/listing.rs`:
```rust
pub struct Listing {
pub royalty_basis_points: u16, // 0-10000 (5% = 500)
}
```
## Build Output
```bash
$ anchor build
Compiling nft_marketplace v0.1.0 (/path/to/project/programs/nft_marketplace)
Finished release [optimized] target(s) in 1m 23s
# Verification
$ anchor test
nft_marketplace
✓ Initialize Marketplace (123ms)
✓ Create Listing (456ms)
✓ Purchase NFT with Royalty (789ms)
✓ Cancel Listing (321ms)
4 passing (1.7s)
```
## Next Steps
1. Deploy to devnet: `anchor deploy --provider.cluster devnet`
2. Verify on Solana Explorer: https://explorer.solana.com/address/[PROGRAM_ID]
3. Test frontend integration using the generated TypeScript client in `app/src/`
## Best Practices Followed
- Used Anchor's `#[account]` macro for all PDAs
- Implemented proper error handling with Anchor's `ErrorCode`
- Added security checks for all external accounts
- Followed the Metaplex NFT standard for metadata
```AI copilot for robotic process automation
banking and payment solutions for businesses
AI assistant built for thoughtful, nuanced conversation
IronCalc is a spreadsheet engine and ecosystem
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan