Skip to content

x402agent/SolanaOS / skills/solana-dev

solana-dev

Flagged

Use when user asks to "build a Solana dapp", "write an Anchor program", "create a token", "debug Solana errors", "set up wallet connection", "test my Solana program", "deploy to devnet", or "explain Solana concepts" (rent, accounts, PDAs, CPIs, etc.). End-to-end Solana development playbook covering wallet connection, Anchor/Pinocchio programs, Codama client generation, LiteSVM/Mollusk/Surfpool testing, and security checklists. Integrates with the Solana MCP server for live documentation search. Prefers framework-kit (@solana/client + @solana/react-hooks) for UI, wallet-standard-first connection (incl. ConnectorKit), @solana/kit for client/RPC code, and @solana/web3-compat for legacy boundaries.

references/kit/codama.md

View on GitHub
---
title: Codama Program Clients
description: Naming conventions and patterns for Codama-generated @solana-program/* Kit-compatible clients.
---

# Codama-Generated Program Clients

`@solana-program/*` packages are Codama-generated, Kit-compatible clients for Solana programs.

## Naming Conventions

| Category | Pattern | Example |
|----------|---------|---------|
| Program address | `{PROGRAM}_PROGRAM_ADDRESS` | `SYSTEM_PROGRAM_ADDRESS` |
| Instructions | `get{Name}Instruction()` | `getTransferSolInstruction()` |
| Instruction parse | `parse{Name}Instruction()` | `parseTransferSolInstruction()` |
| Account fetch | `fetch{Account}()` | `fetchMint()` |
| Account fetch maybe | `fetchMaybe{Account}()` | `fetchMaybeMint()` |
| Account fetch all | `fetchAll{Account}()` | `fetchAllMint()` |
| Account decode | `decode{Account}()` | `decodeMint()` |
| Account size | `get{Account}Size()` | `getMintSize()` |
| Codec | `get{Type}[Encoder\|Decoder\|Codec]()` | `getMintDecoder()` |
| PDA derivation | `find{Name}Pda()` | `findAssociatedTokenPda()` |
| Errors | `{PROGRAM}_ERROR__{NAME}` | `SYSTEM_ERROR__INSUFFICIENT_FUNDS` |
| Error check | `is{Program}Error()` | `isSystemError()` |

## Quick Examples

### Fetch Typed Account

```ts
import { fetchMint } from '@solana-program/token';

const mint = await fetchMint(rpc, mintAddress);
// mint.data.decimals, mint.data.supply — fully typed
```

### Create Instruction

```ts
import { getTransferSolInstruction } from '@solana-program/system';
import { lamports } from '@solana/kit';

const ix = getTransferSolInstruction({
  source: payer,
  destination: recipient.address,
  amount: lamports(1_000_000n),
});
```

### Derive PDA

```ts
import { findAssociatedTokenPda, TOKEN_PROGRAM_ADDRESS } from '@solana-program/token';

const [ata] = await findAssociatedTokenPda({
  owner,
  mint,
  tokenProgram: TOKEN_PROGRAM_ADDRESS,
});
```

### Error Handling

```ts
import { isSystemError, SYSTEM_ERROR__INSUFFICIENT_FUNDS } from '@solana-program/system';

try {
  await sendTransaction(tx);
} catch (e) {
  if (isSystemError(e, SYSTEM_ERROR__INSUFFICIENT_FUNDS)) {
    console.error('Not enough SOL');
  }
}
```

## Program-Specific References

For detailed APIs:
- [programs/system.md](programs/system.md) — Account creation, transfers, nonces
- [programs/token.md](programs/token.md) — SPL Token operations
- [programs/token-2022.md](programs/token-2022.md) — Token Extensions
- [programs/compute-budget.md](programs/compute-budget.md) — CU limits & priority fees
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall