cabin-sol
БесплатноЗапускает вложенные скриптыНе проверенSolana development tutor and builder. Teaches program development through challenges, Anchor framework, Token-2022, Compressed NFTs, and security best…
от lxyeternal★ 68 звёзд на GitHubОб этом скилле
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
Установить cabin-sol в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл cabin-sol?
Solana development tutor and builder. Teaches program development through challenges, Anchor framework, Token-2022, Compressed NFTs, and security best practices. "Return to primitive computing."
Как установить скилл cabin-sol?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cabin-sol запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
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…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от 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…
от Anthropic