Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Solana Pro

ASecurity

Build Solana programs with Anchor: accounts model, PDAs, CPIs, SPL tokens, testing on local validator, and devnet/mainnet deployment. Use when developing on Solana.

2 stars
0 votes
0 copies
0 views
Added 9/29/2026
ai-agentsrustgobashtestingsecurity

Works with

cli

Security Analysis

A100/100

Scanned 9/29/2026

$npx -y skills add aicodedecode/awesome-muse-skills --skill solana-pro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Solana Pro?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Solana Pro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aicodedecode-solana-pro/badge)](https://www.skillsdirectory.com/skills/aicodedecode-solana-pro)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: solana-pro
description: Build Solana programs with Anchor: accounts model, PDAs, CPIs, SPL tokens, testing on local validator, and devnet/mainnet deployment. Use when developing on Solana.
category: development
---

# Solana Pro

A practical guide to Solana program development with Anchor: the accounts model, Program Derived Addresses, cross-program invocations, SPL tokens, and a testing-to-deployment workflow that catches the bugs unique to Solana.

## Overview

Solana inverts the EVM model: **programs are stateless; all state lives in accounts** passed into each instruction. Your program never "owns" its data implicitly — every account it reads or writes must be handed to it, validated, and checked. This makes Solana fast and parallelizable, but it shifts security work onto account validation: wrong owner, missing signer, or spoofed account are the dominant bug classes.

Anchor (the standard framework) removes most boilerplate with declarative account constraints (`#[account(...)]`), an IDL for clients, and a test harness.

## When to use

- Writing Anchor programs: tokens, vaults, staking, NFT logic, governance.
- Working with SPL tokens and Metaplex-style NFTs.
- Deriving and using PDAs for program-controlled accounts.
- Calling other programs via CPI (e.g., transferring SPL tokens).
- Testing with the local validator and deploying to devnet/mainnet.

## Core concepts

- **Accounts, not storage.** An instruction receives a list of accounts; the program deserializes the ones it needs. Accounts have an `owner` (the program allowed to write them), `lamports` (rent-bearing balance), and `data`.
- **Rent exemption.** Accounts must hold enough lamports to be rent-exempt or they can be garbage-collected. Always fund new accounts sufficiently and prefer closing (not abandoning) accounts you no longer need — closing refunds lamports.
- **PDAs (Program Derived Addresses).** Deterministic addresses derived from seeds + program ID, with no private key. Only the program can "sign" for them via `invoke_signed`. Used for vaults, escrow, and authority accounts.
- **Signers.** Any account that must authorize must be marked `Signer` and actually sign the transaction. A missing signer check is a critical vulnerability.
- **CPI (Cross-Program Invocation).** Calling another program (e.g., the Token program to transfer). With PDAs, use `CpiContext::new_with_signer` and the exact seeds.
- **Compute units.** Each transaction has a compute budget (~1.4M CU default). Heavy loops or many CPIs can exhaust it — request more with `ComputeBudgetInstruction` when needed.
- **Sysvars & syscalls.** Clock, Rent sysvars give on-chain time and rent state; prefer them over client-supplied values.
- **IDL.** Anchor generates an Interface Description Language file from your program — clients (JS/TS) use it for typed calls. Keep it versioned with the program.

## Practical workflow

**1. Scaffold**
```bash
anchor init my-program && cd my-program
solana-test-validator &   # local cluster in background
```

**2. Define state and instructions**
```rust
#[account]
pub struct Vault {
    pub authority: Pubkey,
    pub bump: u8,
}

#[derive(Accounts)]
pub struct Initialize<'info> {
    #[account(
        init,
        payer = user,
        space = 8 + 32 + 1,
        seeds = [b"vault", user.key().as_ref()],
        bump
    )]
    pub vault: Account<'info, Vault>,
    #[account(mut)]
    pub user: Signer<'info>,
    pub system_program: Program<'info, System>,
}
```
Anchor's constraints (`init`, `seeds`, `bump`, `mut`, `Signer`) are your first line of defense — prefer constraints over manual checks.

**3. Test on the local validator**
```ts
// tests/my-program.ts — use anchor's provider against localhost
const tx = await program.methods.initialize().accounts({ user: wallet.publicKey }).rpc();
```
Write tests for: happy path, wrong signer rejected, wrong PDA seeds rejected, double-init rejected, close refunds lamports.

**4. Build, deploy, verify**
```bash
anchor build
anchor deploy --provider.cluster devnet   # then mainnet with a funded keypair
anchor idl init --filepath target/idl/my_program.json <PROGRAM_ID> --provider.cluster devnet
```
Pin the program ID in `Anchor.toml` and `lib.rs` (`declare_id!`) — they must match.

**5. Client integration.** Use `@coral-xyz/anchor` with the IDL; derive PDAs client-side with `PublicKey.findProgramAddressSync` using identical seeds.

## Common pitfalls

- **Missing signer checks.** If an instruction changes authority or moves funds, the authorizing account must be a `Signer` — Anchor won't infer this for raw `AccountInfo`.
- **Account substitution.** Validate every account's owner and (for PDAs) seeds. An attacker can pass any account; `#[account(owner = ...)]` or `has_one` constraints close this.
- **Seed collisions.** Two different account types derived from overlapping seeds can collide. Namespace seeds (`b"vault"`, `b"escrow"`) and include distinguishing keys.
- **Abandoned rent.** Creating accounts without a close path locks lamports forever. Add `close = destination` where the lifecycle ends.
- **Lamport/SOL confusion.** 1 SOL = 1,000,000,000 lamports. Use `LAMPORTS_PER_SOL`, never magic numbers.
- **Unchecked arithmetic.** Use `checked_add`/`checked_sub` or Anchor's default checked math; silent overflow corrupts balances.
- **Stale IDL.** Regenerate and republish the IDL on every program change; a mismatched IDL makes clients construct invalid transactions.
- **Mainnet keypair hygiene.** Deploy keys hold upgrade authority — store them in a hardware wallet or multisig (e.g., Squads), never in a repo or chat.
- **Ignoring compute limits.** Profile with `solana simulate`; a transaction that fits on devnet can fail on congested mainnet if it's near the CU ceiling.

Attribution

aicodedecodeaicodedecode
View sourceSee grades on GitHubMore from aicodedecode →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →