Automate Solana development tasks with up-to-date best practices. Operations teams can streamline blockchain development, integrate with Solana tools, and maintain secure, efficient workflows.
git clone https://github.com/solana-foundation/solana-dev-skill.gitAutomate Solana development tasks with up-to-date best practices. Operations teams can streamline blockchain development, integrate with Solana tools, and maintain secure, efficient workflows.
1. **Customize the template**: Replace [PROJECT_NAME], [SOLANA_TOOLKIT], and other placeholders with your specific project details. Use `solana config set --url` to set your target network. 2. **Install dependencies**: Ensure you have the required tools installed: ```bash sh -c "$(curl -sSfL https://release.solana.com/stable/install)" cargo install --git https://github.com/coral-xyz/anchor anchor-cli --locked ``` 3. **Set up environment**: Configure your Solana CLI with: ```bash solana config set --url devnet solana config set --keypair ~/.config/solana/devnet.json solana airdrop 1 # For devnet accounts ``` 4. **Test the script**: Run it in a staging environment first: ```bash chmod +x deploy.sh ./deploy.sh ``` 5. **Integrate with CI/CD**: Add this script to your GitHub Actions or GitLab CI pipeline. Use `solana-keygen grind` to generate secure keypairs for production deployments. For mainnet deployments, always use hardware wallets or secure key management systems.
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/solana-foundation/solana-dev-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.
Automate the Solana smart contract deployment for [PROJECT_NAME] using [SOLANA_TOOLKIT: solana-cli/solana-program-library/anchor]. Follow current best practices for security, gas optimization, and error handling. Generate a deployment script that includes: 1) Environment setup with [NETWORK: devnet/testnet/mainnet-beta], 2) Build and test steps with [TEST_FRAMEWORK: mocha/anchor-test], 3) Secure deployment with [WALLET_TYPE: keypair/ledger], and 4) Post-deployment verification. Include error handling for common Solana issues like transaction timeouts or insufficient funds. Provide the complete script with inline comments explaining each step.
Here's a production-ready deployment script for the 'NFTMarketplace' project targeting devnet, using Anchor framework and a local keypair wallet:
```bash
#!/bin/bash
set -euo pipefail
# ===== CONFIGURATION =====
PROJECT_NAME="NFTMarketplace"
NETWORK="devnet"
ANCHOR_VERSION="0.29.0"
KEYPAIR_PATH="~/.config/solana/devnet.json"
PROGRAM_ID="Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
# ===== ENVIRONMENT SETUP =====
echo "🔧 Setting up Solana environment..."
solana config set --url $NETWORK
solana config set --keypair $KEYPAIR_PATH
solana balance --output json | jq -r '.value' | awk '$1 < 1 {print "⚠️ Insufficient SOL. Airdrop needed."; exit 1}'
# ===== BUILD AND TEST =====
echo "🔨 Building Anchor project..."
anchor build -- --features devnet
# Run tests with coverage
anchor test --skip-build -- --features devnet --coverage
# ===== DEPLOYMENT =====
echo "🚀 Deploying program..."
ANCHOR_PROVIDER_URL=https://api.devnet.solana.com anchor deploy
# Verify deployment
PROGRAM_ID=$(solana program show --output json | jq -r '.programId')
echo "✅ Program deployed with ID: $PROGRAM_ID"
# ===== POST-DEPLOYMENT =====
echo "🔍 Verifying program state..."
solana program dump $PROGRAM_ID ./program_dump.so
# Check for common issues
if ! solana program show $PROGRAM_ID --output json | jq -e '.data.parsed' > /dev/null; then
echo "❌ Program data not parsed correctly. Check logs for errors."
exit 1
fi
echo "🎉 Deployment completed successfully!"
```
Key security measures implemented:
1. Strict error handling with `set -euo pipefail` to catch failures early
2. Balance check before deployment to prevent failed transactions
3. Anchor's built-in security features for program initialization
4. Post-deployment verification of program state
5. Explicit network configuration to prevent mainnet accidents
The script follows Solana's current best practices for:
- Gas optimization by using Anchor's optimized build system
- Secure keypair management through environment variables
- Comprehensive error checking at each deployment stage
- Test coverage requirements before production deploymentAI copilot for robotic process automation
Unlock data insights with interactive dashboards and collaborative analytics capabilities.
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