solana-program-dev (Solana Program Development Skill)
Use this skill when the user asks for help with:
- Solana on-chain program design/implementation (native Rust, Anchor, Steel, Pinocchio, Star Frame).
- PDA/account schema design, CPIs, token integrations, upgradeability/verifiable builds.
- Testing strategy (local validator, Anchor tests, Mollusk), compute/unit optimization.
- Client generation and modern TS/Rust client stacks (@solana/kit, Codama).
This skill assumes intermediate-to-advanced familiarity. Keep responses concise, structured, and checklist-driven (not an essay).
Scope Boundaries
- Ask for missing context (cluster, program id(s), token standard, upgrade authority posture) instead of guessing.
- Do not "sign off" security without an explicit threat model + adversarial test coverage.
- Avoid mainnet deployment/key management guidance unless the user provides their operational constraints.
Default Output Shape (what to produce)
When building or modifying a program, produce (in order):
- Problem restatement (1-3 bullets) + explicit assumptions.
- Instruction spec (list instructions + accounts + signer/writable + invariants).
- Account model (PDAs, seeds, bumps, ownership, sizing/serialization).
- Implementation plan (small steps, file touch list).
- Security checklist hits (what you validated / what still needs validation).
- Testing plan (unit/integration, negative tests, edge cases).
- Notes on DX/tooling (Anchor vs native Rust vs Steel vs Pinocchio vs Star Frame; Codama/Kit client plan).
If reviewing code, produce (in order):
- Findings (severity + impact + fix)
- Patch plan (minimal diffs)
- Regression tests to add
Operating Principles
- Treat every account/arg as adversarial input.
- Validate close to where data enters (constraints, owners, addresses, types).
- Design for composability: stable IDLs, predictable accounts, explicit invariants.
- Track compute, binary size, and account locks from day 1.
Navigate This Skill
Workflow (repeatable)
1) Choose the stack (fast decision)
- Default: Anchor (fast iteration, strong IDL/DX, lots of examples).
- Native Rust: minimal deps + maximum control; more boilerplate.
- Steel: performance/binary-size oriented; lower-level patterns.
- Pinocchio: minimal runtime surface + perf focus; requires very disciplined validation.
- Star Frame: trait-based architecture + compile-time patterns; ecosystem may be smaller.
- Client-side:
- Prefer
@solana/kit for TS.
- Prefer Codama for generated clients + avoiding manual serialization.
2) Write the spec before code
- List instructions and invariants.
- Define PDAs and their seed namespaces.
- Define which program owns each account and why.
- Define authority model (who can mutate what, under what conditions).
3) Implement with "validation first"
- Validate accounts (address/owner/type), then validate authorization (signer/authority), then validate inputs, then mutate state.
4) Tests must prove invariants
Minimum:
- happy path per instruction
- all authorization failures
- PDA substitution attempts
- "wrong program id" CPI attempts (where applicable)
- boundary arithmetic tests (overflows, rounding)
- account sizing/rent-exemption + realloc paths (where applicable)
- discriminator/serialization mismatch tests (wrong account type, corrupted data)
5) Security and deployment posture
- Have an upgrade authority plan (multisig? timelock? finalize?).
- Plan for verifiable builds and source authenticity.
- Document breaking changes and IDL versioning.
Response Style Requirements
- Use headings + bullets.
- Short paragraphs only when necessary.
- Code blocks should be minimal and relevant.
- Call out invariants explicitly (they are the real "API").
1---2name: solana-program-dev3description: Design, implement, test, and security-review modern Solana programs (native Rust/Anchor/Steel/Pinocchio/Star Frame) and clients (@solana/kit + Codama) with an intermediate-to-advanced workflow.4---56# solana-program-dev (Solana Program Development Skill)78Use this skill when the user asks for help with:9- Solana on-chain program design/implementation (native Rust, Anchor, Steel, Pinocchio, Star Frame).10- PDA/account schema design, CPIs, token integrations, upgradeability/verifiable builds.11- Testing strategy (local validator, Anchor tests, Mollusk), compute/unit optimization.12- Client generation and modern TS/Rust client stacks (@solana/kit, Codama).1314This skill assumes intermediate-to-advanced familiarity. Keep responses **concise, structured, and checklist-driven** (not an essay).1516## Scope Boundaries17- Ask for missing context (cluster, program id(s), token standard, upgrade authority posture) instead of guessing.18- Do not "sign off" security without an explicit threat model + adversarial test coverage.19- Avoid mainnet deployment/key management guidance unless the user provides their operational constraints.2021## Default Output Shape (what to produce)22When building or modifying a program, produce (in order):231. **Problem restatement** (1-3 bullets) + explicit assumptions.242. **Instruction spec** (list instructions + accounts + signer/writable + invariants).253. **Account model** (PDAs, seeds, bumps, ownership, sizing/serialization).264. **Implementation plan** (small steps, file touch list).275. **Security checklist hits** (what you validated / what still needs validation).286. **Testing plan** (unit/integration, negative tests, edge cases).297. **Notes on DX/tooling** (Anchor vs native Rust vs Steel vs Pinocchio vs Star Frame; Codama/Kit client plan).3031If reviewing code, produce (in order):321. **Findings** (severity + impact + fix)332. **Patch plan** (minimal diffs)343. **Regression tests** to add3536## Operating Principles37- Treat every account/arg as adversarial input.38- Validate close to where data enters (constraints, owners, addresses, types).39- Design for composability: stable IDLs, predictable accounts, explicit invariants.40- Track compute, binary size, and account locks from day 1.4142## Navigate This Skill43- Core mental model: [concepts.md](./concepts.md)44- "If you remember nothing else": [maxims.md](./maxims.md)45- Rust cleanliness/DRY/idioms: [rust-style.md](./rust-style.md)46- Security checklist + common vulns: [security.md](./security.md)47- Dos/don'ts: [dos-donts.md](./dos-donts.md)48- Framework chooser: [frameworks.md](./frameworks.md)49- Modern toolchain: [tooling.md](./tooling.md)50- Built-in + common mainnet programs: [mainnet-programs.md](./mainnet-programs.md)51- Ecosystem snapshot (Jan 2026): [ecosystem-jan-2026.md](./ecosystem-jan-2026.md)52- Cursor rules template: [cursor.cursorrules.template](./cursor.cursorrules.template)53- Templates: [template-program-spec.md](./template-program-spec.md), [template-security-review.md](./template-security-review.md), [template-test-plan.md](./template-test-plan.md)54- Links: [links.md](./links.md)5556## Workflow (repeatable)57### 1) Choose the stack (fast decision)58- Default: Anchor (fast iteration, strong IDL/DX, lots of examples).59- Native Rust: minimal deps + maximum control; more boilerplate.60- Steel: performance/binary-size oriented; lower-level patterns.61- Pinocchio: minimal runtime surface + perf focus; requires very disciplined validation.62- Star Frame: trait-based architecture + compile-time patterns; ecosystem may be smaller.63- Client-side:64 - Prefer `@solana/kit` for TS.65 - Prefer Codama for generated clients + avoiding manual serialization.6667### 2) Write the spec before code68- List instructions and invariants.69- Define PDAs and their seed namespaces.70- Define which program owns each account and why.71- Define authority model (who can mutate what, under what conditions).7273### 3) Implement with "validation first"74- Validate accounts (address/owner/type), then validate authorization (signer/authority), then validate inputs, then mutate state.7576### 4) Tests must prove invariants77Minimum:78- happy path per instruction79- all authorization failures80- PDA substitution attempts81- "wrong program id" CPI attempts (where applicable)82- boundary arithmetic tests (overflows, rounding)83- account sizing/rent-exemption + realloc paths (where applicable)84- discriminator/serialization mismatch tests (wrong account type, corrupted data)8586### 5) Security and deployment posture87- Have an upgrade authority plan (multisig? timelock? finalize?).88- Plan for verifiable builds and source authenticity.89- Document breaking changes and IDL versioning.9091## Response Style Requirements92- Use headings + bullets.93- Short paragraphs only when necessary.94- Code blocks should be minimal and relevant.95- Call out *invariants* explicitly (they are the real "API").