cabin-sol
FreeRuns bundled scriptsNot checkedSolana development tutor and builder. Teaches program development through challenges, Anchor framework, Token-2022, Compressed NFTs, and security best…
by lxyeternal★ 68 GitHub starsAbout this skill
Cabin Sol 🌲
"Return to primitive computing."
A comprehensive Solana development guide for AI agents. Build programs with Anchor, master the account model, and avoid the gotchas that wreck most developers.
THE MOST IMPORTANT CONCEPT
ACCOUNTS ARE EVERYTHING ON SOLANA.
Unlike Ethereum where contracts have internal storage, Solana programs are stateless. All data lives in accounts that programs read and write.
For EVERY feature, ask:
- Where does this data live? (which account)
- Who owns that account? (program-owned vs user-owned)
- Is it a PDA? (Program Derived Address - no private key)
- Who pays rent? (rent-exempt = 2 years upfront)
AI AGENT MODES
Teaching Mode
- "How do PDAs work?"
- "Explain the Solana account model"
- "What's the difference between SPL Token and Token-2022?"
Build Mode
- "Help me build a staking program"
- "Create an NFT collection with Metaplex"
- "Build a token swap"
Review Mode
- "Review this program for vulnerabilities"
- "Check my PDA derivation"
- "Audit this CPI"
Debug Mode
- "Why is my transaction failing?"
- "Debug this 'account not found' error"
- "Fix my token transfer"
QUICK START
Option A: create-solana-dapp (Recommended)
npx create-solana-dapp@latest
# Select: Next.js + next-tailwind-counter
cd my-project
npm install
npm run anchor localnet # Terminal 1
npm run anchor build && npm run anchor deploy # Terminal 2
npm run dev # Terminal 3
Option B: Pure Anchor
anchor init my_program
cd my_program
solana-test-validator # Terminal 1
anchor build && anchor deploy # Terminal 2
anchor test
PROJECT STRUCTURE
my-solana-dapp/
├── anchor/ # Solana programs (Rust)
│ ├── programs/
│ │ └── my_program/
│ │ └── src/lib.rs # Your Rust program
│ ├── tests/ # TypeScript tests
│ └── Anchor.toml # Anchor config
├── src/ # Next.js frontend
│ ├── app/
│ └── components/
└── package.json
CHALLENGES
Learn Solana through progressive challenges:
| # | Challenge | Core Concept |
|---|---|---|
| 0 | Hello Solana | First Anchor program, accounts |
| 1 | SPL Token | Fungible tokens, ATAs, minting |
| 2 | NFT Metaplex | NFT standard, metadata, collections |
| 3 | PDA Escrow | PDAs, program authority, escrow |
| 4 | Staking | Time-based rewards, deposits |
| 5 | Token-2022 | Transfer hooks, extensions |
| 6 | Compressed NFTs | State compression, Merkle trees |
| 7 | Oracle (Pyth) | Price feeds, staleness checks |
| 8 | AMM Swap | Constant product, liquidity pools |
| 9 | Blinks & Actions | Shareable transactions |
RUST ESSENTIALS
Ownership (The Hard Part)
// Each value has ONE owner
let s1 = String::from("hello");
let s2 = s1; // s1 MOVED to s2
// println!("{}", s1); // ERROR!
// Borrowing lets you use without owning
fn get_length(s: &String) -> usize {
s.len() // Borrow, don't own
}
Result & Option
// Result for errors
pub fn do_thing(ctx: Context<DoThing>) -> Result<()> {
let value = some_operation().ok_or(ErrorCode::Failed)?;
Ok(())
}
// Option for nullable
let maybe: Option<u64> = Some(42);
let value = maybe.unwrap_or(0); // Safe default
ANCHOR FRAMEWORK
Program Structure
use anchor_lang::prelude::*;
declare_id!("YourProgramId11111111111111111111111111111");
#[program]
pub mod my_program {
use super::*;
pub fn initialize(ctx: Context<Initialize>, data: u64) -> Result<()> {
ctx.accounts.my_account.data = data;
ctx.accounts.my_account.authority = ctx.accounts.authority.key();
Ok(())
}
}
#[derive(Accounts)]
pub struct Initialize<'info> {
#[account(
init,
payer = authority,
space = 8 + 8 + 32, // discriminator + u64 + Pubkey
)]
pub my_account: Account<'info, MyAccount>,
#[account(mut)]
pub authority: Signer<'info>,
pub system_program: Program<'info, System>,
}
#[account]
pub struct MyAccount {
pub data: u64,
pub authority: Pubkey,
}
Account Constraints Cheatsheet
// Initialize new account
#[account(init, payer = payer, space = 8 + SIZE)]
pub new_account: Account<'info, Data>,
// Mutable existing
#[account(mut)]
pub existing: Account<'info, Data>,
// Verify ownership
#[account(has_one = authority)]
pub owned: Account<'info, Data>,
// PDA with seeds
#[account(
seeds = [b"vault", user.key().as_ref()],
bump,
)]
pub vault: Account<'info, Vault>,
// Initialize PDA
#[account(
init,
payer = user,
space = 8 + 64,
seeds = [b"user", user.key().as_ref()],
bump,
)]
pub user_data: Account<'info, UserData>,
// Close and reclaim rent
#[account(mut, close = recipient)]
pub closing: Account<'info, Data>,
PDAs (Program Derived Addresses)
// PDAs are deterministic addresses with no private key
// Your p
Install cabin-sol in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the cabin-sol skill do?
Solana development tutor and builder. Teaches program development through challenges, Anchor framework, Token-2022, Compressed NFTs, and security best practices. "Return to primitive computing."
How do I install the cabin-sol skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the cabin-sol skill run scripts?
Yes, this skill bundles executable scripts. Review the source before installing.
Related skills
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
by Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
by Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
by Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
by Anthropic