Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

cabin-sol

БесплатноЗапускает вложенные скриптыНе проверен

Solana development tutor and builder. Teaches program development through challenges, Anchor framework, Token-2022, Compressed NFTs, and security best…

lxyeternalот 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:

  1. Where does this data live? (which account)
  2. Who owns that account? (program-owned vs user-owned)
  3. Is it a PDA? (Program Derived Address - no private key)
  4. 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
Полный SKILL.md на GitHub

Установить cabin-sol в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

CLAUDE.mdREADME.md_meta.jsondata/addresses/programs.jsonknowledge/challenges/00-hello-solana.mdknowledge/challenges/01-spl-token.mdknowledge/challenges/02-nft-metaplex.mdknowledge/challenges/03-pda-escrow.mdknowledge/challenges/04-staking.mdknowledge/challenges/05-token-2022.mdknowledge/challenges/06-compressed-nfts.mdknowledge/challenges/07-oracle-pyth.mdknowledge/challenges/08-amm-swap.mdknowledge/challenges/09-blinks.mdknowledge/foundations/01-account-model.mdknowledge/foundations/02-pdas.mdreferences/account-space.mdreferences/common-errors.mdscripts/new-project.sh

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 запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить cabin-sol с