AGENT SKILL

solana-dev-idl-codegen

Generate type-safe program clients from IDLs using Codama, eliminating hand-maintained serializers across languages.

License 许可
MIT
所属仓库
themusebook/skills
最近更新
2026-11-02
Stars
★ 0
Forks
1

01 前言 Front Matter

name
solana-dev-idl-codegen
license
MIT
metadata
{ "author": "Solana Foundation", "source": "https://github.com/solana-foundation/solana-dev-skill", "version": "2.7.0", "category": "Tooling" }
description
Generate type-safe program clients from IDLs using Codama, eliminating hand-maintained serializers across languages.

02 资源文件 2

03 SKILL.md 正文

IDL & Client Code Generation

Solana Foundation skill — mirrored in the Musebook skills hub. This entry reproduces, verbatim, the idl-codegen.md reference of the foundation-maintained solana-dev skill (v2.7.0, MIT) from https://github.com/solana-foundation/solana-dev-skill. It is one of the 16 topic references the solana-dev router discloses progressively; for the full skill (router + all references + nested guides), install the upstream original: npx skills add https://github.com/solana-foundation/solana-dev-skill — also mirrored in this hub as the solana-dev entry. Maintained by the Solana Foundation; Musebook does not author or maintain this content. Relative links in the body point at the upstream skill's file layout and resolve in the full install.

IDLs + client generation (Codama / Shank)

Goal

Never hand-maintain multiple program clients by manually re-implementing serializers. Prefer an IDL-driven, code-generated workflow.

Codama (preferred)

  • Use Codama as the "single program description format" to generate:
    • TypeScript clients (including Kit-friendly output)
    • Rust clients (when available/needed)
    • documentation artifacts

Anchor → Codama

If the program is Anchor:

  1. Produce Anchor IDL from the build
  2. Convert Anchor IDL to Codama nodes (nodes-from-anchor)
  3. Render a Kit-native TypeScript client (codama renderers)

Native Rust → Shank → Codama

If the program is native:

  1. Use Shank macros to extract a Shank IDL from annotated Rust
  2. Convert Shank IDL to Codama
  3. Generate clients via Codama renderers

Repository structure recommendation

  • programs/<name>/ (program source)
  • idl/<name>.json (Anchor/Shank IDL)
  • codama/<name>.json (Codama IDL)
  • clients/ts/<name>/ (generated TS client)
  • clients/rust/<name>/ (generated Rust client)

Generation guardrails

  • Codegen outputs should be checked into git if:
    • you need deterministic builds
    • you want users to consume the client without running codegen
  • Otherwise, keep codegen in CI and publish artifacts.

"Do not do this"

  • Do not write IDLs by hand unless you have no alternative.
  • Do not hand-write Borsh layouts for programs you own; use the IDL/codegen pipeline.

04 同仓库更多 Skills

themusebook
themusebook/skills

youtube-clipper

YouTube 视频智能剪辑工具。下载视频和字幕,AI 分析生成精细章节(几分钟级别), 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频,并生成总结文案。 使用场景:当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词:视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video

★ 0
themusebook
themusebook/skills

viem-integration

Integrate EVM blockchains using viem. Use when user says "read blockchain data", "send transaction", "interact with smart contract", "connect to Ethereum", "use viem", "use wagmi", "wallet integration", "viem setup", or mentions blockchain/EVM development with TypeScript.

★ 0
themusebook
themusebook/skills

v4-security-foundations

Security-first Uniswap v4 hook development. Use when user mentions "v4 hooks", "hook security", "PoolManager", "beforeSwap", "afterSwap", or asks about V4 hook best practices, vulnerabilities, or audit requirements.

★ 0
themusebook
themusebook/skills

v4-sdk-integration

App-layer SDK guide for building swap and liquidity experiences directly with the Uniswap v4 SDK. Use when user asks about "v4 sdk", "uniswap v4", "v4 swap", "v4 liquidity", "PoolManager", "V4Planner", "StateView", "PositionManager", "pool state", "v4 position", "uniswap sdk", or when building swap/liquidity UX directly with SDKs rather than via the Trading API.

★ 0
themusebook
themusebook/skills

v4-hook-generator

Generate Uniswap v4 hook contracts via OpenZeppelin MCP. Use when building custom swap logic, async swaps, hook-owned liquidity, custom curves, dynamic fees, MEV protection, limit orders, or oracle hooks.

★ 0
themusebook
themusebook/skills

testing

For testing with Light Protocol programs and clients on localnet, devnet, and mainnet validation.

★ 0