@laitszkin/apollo-toolkit 2.5.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +4 -0
- package/CHANGELOG.md +23 -0
- package/README.md +4 -0
- package/codex-memory-manager/SKILL.md +2 -0
- package/fix-github-issues/SKILL.md +5 -3
- package/jupiter-development/SKILL.md +89 -0
- package/jupiter-development/agents/openai.yaml +4 -0
- package/jupiter-development/references/official-docs.md +157 -0
- package/learn-skill-from-conversations/SKILL.md +13 -2
- package/marginfi-development/LICENSE +21 -0
- package/marginfi-development/README.md +31 -0
- package/marginfi-development/SKILL.md +125 -0
- package/marginfi-development/agents/openai.yaml +4 -0
- package/marginfi-development/references/official-development-notes.md +191 -0
- package/marginfi-development/references/source-index.md +31 -0
- package/openclaw-configuration/SKILL.md +98 -0
- package/openclaw-configuration/agents/openai.yaml +4 -0
- package/openclaw-configuration/references/best-practices.md +55 -0
- package/openclaw-configuration/references/config-reference-map.md +189 -0
- package/openclaw-configuration/references/official-docs.md +40 -0
- package/package.json +1 -1
- package/solana-development/SKILL.md +89 -0
- package/solana-development/agents/openai.yaml +4 -0
- package/solana-development/references/official-solana-rust.md +199 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: solana-development
|
|
3
|
+
description: Build or maintain Solana applications in Rust using official Solana development docs. Use when users ask for native Solana programs, Rust SDK clients, account modeling, instruction design, PDAs, CPIs, local testing, deployment, upgrades, or Solana-specific debugging in Rust codebases.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Solana Development
|
|
7
|
+
|
|
8
|
+
## Dependencies
|
|
9
|
+
|
|
10
|
+
- Required: none.
|
|
11
|
+
- Conditional: `systematic-debug` when the task is about failing Solana tests, runtime errors, or observed-vs-expected on-chain behavior.
|
|
12
|
+
- Optional: none.
|
|
13
|
+
- Fallback: If the repository pins Solana crates or CLI behavior that differs from the latest official docs, follow the repository's pinned versions and document the mismatch explicitly.
|
|
14
|
+
|
|
15
|
+
## Standards
|
|
16
|
+
|
|
17
|
+
- Evidence: Ground commands, crate choices, and account-model decisions in the current repository plus official Solana docs under `solana.com/docs`.
|
|
18
|
+
- Execution: Classify the task as on-chain Rust, off-chain Rust client work, or both before changing code.
|
|
19
|
+
- Quality: Prefer minimal account surfaces, explicit instruction schemas, deterministic PDA seeds, and tests for every state transition or authority check.
|
|
20
|
+
- Output: Deliver Rust-focused changes with touched accounts, instructions, test commands, deployment notes, and any cluster or authority assumptions.
|
|
21
|
+
|
|
22
|
+
## Goal
|
|
23
|
+
|
|
24
|
+
Implement Solana Rust work in a way that matches the official execution model: accounts and instructions first, then PDAs/CPIs, then testing and deployment safety.
|
|
25
|
+
|
|
26
|
+
## Required Reference
|
|
27
|
+
|
|
28
|
+
- Read `references/official-solana-rust.md` before making non-trivial Solana changes.
|
|
29
|
+
- Refresh the linked official pages when crate versions, CLI commands, or deployment behavior appear different from the reference snapshot.
|
|
30
|
+
|
|
31
|
+
## Use This Skill For
|
|
32
|
+
|
|
33
|
+
- Native Solana programs written directly in Rust
|
|
34
|
+
- Rust clients, indexers, or operational tools built with the Solana Rust SDK
|
|
35
|
+
- Account modeling, authority rules, PDA design, and CPI orchestration
|
|
36
|
+
- Local validator workflows, Rust-native tests, build/deploy/upgrade flows
|
|
37
|
+
- Solana-specific debugging such as signer, owner, writable, rent, compute, and instruction-data issues
|
|
38
|
+
|
|
39
|
+
## Workflow
|
|
40
|
+
|
|
41
|
+
### 1) Classify the repository shape first
|
|
42
|
+
|
|
43
|
+
- Identify whether the codebase contains on-chain programs, Rust clients, or both.
|
|
44
|
+
- Detect whether the repository uses native Solana Rust or a higher-level framework already. Do not rewrite framework conventions unless the user asks.
|
|
45
|
+
- Locate program IDs, deploy scripts, test harnesses, keypair handling, and cluster configuration before editing.
|
|
46
|
+
|
|
47
|
+
### 2) Design the instruction and account contract up front
|
|
48
|
+
|
|
49
|
+
- List each instruction, the accounts it needs, which accounts must be signer or writable, and which program owns each account.
|
|
50
|
+
- Record PDA seeds, bump handling, rent expectations, realloc rules, and close authorities before implementing handlers.
|
|
51
|
+
- Reject invalid ownership, signer, and writable assumptions explicitly instead of relying on downstream runtime failures.
|
|
52
|
+
|
|
53
|
+
### 3) Keep native Rust program structure explicit
|
|
54
|
+
|
|
55
|
+
- Follow the official native Rust flow: `entrypoint` receives the program call, instruction parsing is explicit, and processor logic is separated from account data definitions.
|
|
56
|
+
- Keep serialization and versioning explicit for any state stored inside accounts.
|
|
57
|
+
- Prefer custom program errors over panics so failures remain diagnosable.
|
|
58
|
+
|
|
59
|
+
### 4) Use PDAs and CPIs deliberately
|
|
60
|
+
|
|
61
|
+
- Use PDAs for program-controlled state or authorities that should not require a private key.
|
|
62
|
+
- Use `invoke` for regular cross-program calls and `invoke_signed` only when the current program must sign as one of its PDAs.
|
|
63
|
+
- Treat signer and writable privileges as inherited, not escalated; verify every CPI account list carefully.
|
|
64
|
+
|
|
65
|
+
### 5) Choose the correct Rust crates for the job
|
|
66
|
+
|
|
67
|
+
- For on-chain code, center the implementation around `solana-program`.
|
|
68
|
+
- For off-chain Rust clients and tooling, use `solana-sdk` for transaction primitives and `solana-client` for RPC access.
|
|
69
|
+
- When a project mirrors CLI behavior, inspect whether it also depends on `solana-cli-config` or `solana-clap-utils`.
|
|
70
|
+
|
|
71
|
+
### 6) Validate locally before deploy
|
|
72
|
+
|
|
73
|
+
- Prefer fast Rust-native tests first, then run the repository's validator or end-to-end flow if available.
|
|
74
|
+
- Build with the repository's pinned toolchain when present; otherwise use the current official Solana build/deploy workflow from the reference.
|
|
75
|
+
- Exercise account initialization, authority checks, PDA signing, and failure paths instead of only happy-path success.
|
|
76
|
+
|
|
77
|
+
### 7) Deploy and upgrade safely
|
|
78
|
+
|
|
79
|
+
- Confirm target cluster, payer, program ID, and upgrade authority before deploy.
|
|
80
|
+
- Call out any action that makes a program immutable or permanently closes program state.
|
|
81
|
+
- When deployment changes operational assumptions, summarize the exact commands and authority implications in the final handoff.
|
|
82
|
+
|
|
83
|
+
## Final Checklist
|
|
84
|
+
|
|
85
|
+
- Account ownership, signer, writable, and PDA assumptions are explicit
|
|
86
|
+
- Instruction data and state serialization are version-aware where needed
|
|
87
|
+
- Local tests cover success and failure paths for state transitions
|
|
88
|
+
- Deployment or upgrade commands match the target cluster and authority setup
|
|
89
|
+
- Any mismatch between repo-pinned Solana versions and current docs is documented
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Solana Development"
|
|
3
|
+
short_description: "Build Solana Rust programs and clients from official docs"
|
|
4
|
+
default_prompt: "Use $solana-development to inspect the repository, determine whether the task is on-chain Rust, off-chain Rust client work, or both, follow the official Solana model for accounts, instructions, PDAs, CPIs, testing, and deployment, and deliver concise Rust-focused implementation notes grounded in current Solana docs."
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Official Solana Rust Development Reference
|
|
2
|
+
|
|
3
|
+
Snapshot date: 2026-03-20 (Asia/Hong_Kong).
|
|
4
|
+
|
|
5
|
+
Use this file when building, reviewing, or debugging Solana work in Rust. It condenses the most important development guidance from the official Solana documentation so the main skill can stay concise.
|
|
6
|
+
|
|
7
|
+
## Official source map
|
|
8
|
+
|
|
9
|
+
- Core accounts: `https://solana.com/docs/core/accounts`
|
|
10
|
+
- Core instructions: `https://solana.com/docs/core/instructions`
|
|
11
|
+
- Core transactions: `https://solana.com/docs/core/transactions`
|
|
12
|
+
- Core fees: `https://solana.com/docs/core/fees`
|
|
13
|
+
- Program Derived Addresses: `https://solana.com/docs/core/pda`
|
|
14
|
+
- Cross Program Invocation: `https://solana.com/docs/core/cpi`
|
|
15
|
+
- Native Rust programs overview: `https://solana.com/docs/programs/rust`
|
|
16
|
+
- Native Rust program structure: `https://solana.com/docs/programs/rust/program-structure`
|
|
17
|
+
- Program deployment and upgrades: `https://solana.com/docs/programs/deploying`
|
|
18
|
+
- Official Rust SDK overview: `https://solana.com/docs/clients/official/rust`
|
|
19
|
+
|
|
20
|
+
If any page changes structure, search `site:solana.com/docs <topic>` and refresh this reference before locking in version-sensitive commands.
|
|
21
|
+
|
|
22
|
+
## 1. Core execution model you must preserve
|
|
23
|
+
|
|
24
|
+
- Solana programs operate by receiving instruction data plus an ordered account list. Most implementation mistakes are really account-contract mistakes.
|
|
25
|
+
- Accounts are the durable storage boundary. Before editing logic, identify each account's owner, mutability, signer requirement, lamports behavior, and serialized data layout.
|
|
26
|
+
- Transactions package one or more instructions and execute atomically. Design instruction handlers with atomic state transitions in mind.
|
|
27
|
+
- The official fees model separates:
|
|
28
|
+
- base fee, currently documented as `5000` lamports per signature
|
|
29
|
+
- prioritization fee, computed from compute-unit limit and compute-unit price
|
|
30
|
+
- When performance or cost matters, review compute usage per instruction and avoid unnecessary account writes.
|
|
31
|
+
|
|
32
|
+
## 2. Native Rust program structure
|
|
33
|
+
|
|
34
|
+
The official native Rust docs and program-structure page emphasize a small, explicit layout:
|
|
35
|
+
|
|
36
|
+
- `entrypoint.rs`: Solana entrypoint and handoff into program logic
|
|
37
|
+
- `instruction.rs`: instruction enum / decoding
|
|
38
|
+
- `processor.rs`: instruction handlers and business logic
|
|
39
|
+
- `state.rs`: account data structs and serialization
|
|
40
|
+
- `error.rs`: custom program errors
|
|
41
|
+
|
|
42
|
+
Keep the logic readable and explicit:
|
|
43
|
+
|
|
44
|
+
- parse instruction data up front
|
|
45
|
+
- validate account shape before mutation
|
|
46
|
+
- separate state serialization from business logic
|
|
47
|
+
- return `ProgramError`-compatible failures instead of panicking
|
|
48
|
+
|
|
49
|
+
The official Rust-program walkthrough currently documents these setup details:
|
|
50
|
+
|
|
51
|
+
- create a library crate
|
|
52
|
+
- add `solana-program` as the primary on-chain dependency
|
|
53
|
+
- set `[lib] crate-type = ["cdylib", "lib"]`
|
|
54
|
+
- build SBF output with the Solana build flow documented on the page
|
|
55
|
+
|
|
56
|
+
As of the 2026-03-20 snapshot, the official examples show `solana-program@2.2.0` in native Rust setup examples. Re-check before pinning new projects because Solana crate versions move.
|
|
57
|
+
|
|
58
|
+
## 3. Instruction and account design checklist
|
|
59
|
+
|
|
60
|
+
Before writing handlers, lock down:
|
|
61
|
+
|
|
62
|
+
- instruction enum and binary format
|
|
63
|
+
- per-instruction account list order
|
|
64
|
+
- which accounts are signer
|
|
65
|
+
- which accounts are writable
|
|
66
|
+
- which program owns each account
|
|
67
|
+
- PDA seeds and bump strategy
|
|
68
|
+
- account initialization, realloc, close, and rent expectations
|
|
69
|
+
|
|
70
|
+
Useful rule: every handler should be reviewable from a table with columns for account, owner, signer, writable, PDA seeds, and failure conditions.
|
|
71
|
+
|
|
72
|
+
## 4. Program Derived Addresses (PDAs)
|
|
73
|
+
|
|
74
|
+
Official PDA guidance centers on these ideas:
|
|
75
|
+
|
|
76
|
+
- A PDA is a deterministic address derived from seeds plus a program ID.
|
|
77
|
+
- PDAs are intentionally off the Ed25519 curve, so they have no private key.
|
|
78
|
+
- Programs use PDAs for program-controlled authorities and state accounts.
|
|
79
|
+
- The same seeds plus the same program ID must derive the same PDA every time.
|
|
80
|
+
- The bump seed exists to find a valid off-curve address.
|
|
81
|
+
|
|
82
|
+
The official PDA page also documents practical limits to remember:
|
|
83
|
+
|
|
84
|
+
- up to 16 seeds per derivation
|
|
85
|
+
- each seed can be up to 32 bytes
|
|
86
|
+
|
|
87
|
+
Design advice:
|
|
88
|
+
|
|
89
|
+
- Use stable, domain-specific seeds such as fixed prefixes plus relevant public keys.
|
|
90
|
+
- Keep seed schemes obvious and documented near the instruction that consumes them.
|
|
91
|
+
- Prefer one clear PDA purpose per seed scheme instead of overloading one PDA for unrelated roles.
|
|
92
|
+
|
|
93
|
+
## 5. Cross Program Invocation (CPI)
|
|
94
|
+
|
|
95
|
+
Official CPI guidance highlights:
|
|
96
|
+
|
|
97
|
+
- Solana programs can invoke instructions in other programs.
|
|
98
|
+
- Use `invoke` when no PDA signature is required.
|
|
99
|
+
- Use `invoke_signed` when the current program must sign on behalf of one of its PDAs.
|
|
100
|
+
- Signer and writable privileges extend from the caller into the callee; CPI does not create new privileges.
|
|
101
|
+
|
|
102
|
+
Practical implications:
|
|
103
|
+
|
|
104
|
+
- Validate the entire downstream account list before the CPI.
|
|
105
|
+
- Never assume a callee can write to an account unless the outer instruction passed it as writable.
|
|
106
|
+
- When debugging CPI failures, inspect signer propagation, writable flags, PDA seed correctness, and program ownership first.
|
|
107
|
+
|
|
108
|
+
The official page notes a practical limit of 16 PDA signers in `invoke_signed`.
|
|
109
|
+
|
|
110
|
+
## 6. Fees and compute-budget awareness
|
|
111
|
+
|
|
112
|
+
The official fees page is the baseline for performance-sensitive work:
|
|
113
|
+
|
|
114
|
+
- base fee is charged per signature
|
|
115
|
+
- prioritization fee depends on compute-unit limit and compute-unit price
|
|
116
|
+
- transactions can set compute budget explicitly when needed
|
|
117
|
+
|
|
118
|
+
When implementing Rust clients or relayers:
|
|
119
|
+
|
|
120
|
+
- size transaction account lists carefully
|
|
121
|
+
- avoid unnecessary signatures
|
|
122
|
+
- consider compute budget instructions only when the workflow truly needs them
|
|
123
|
+
|
|
124
|
+
When implementing programs:
|
|
125
|
+
|
|
126
|
+
- keep account validation linear and obvious
|
|
127
|
+
- avoid redundant serialization passes
|
|
128
|
+
- separate expensive CPIs from cheap pure-validation paths when possible
|
|
129
|
+
|
|
130
|
+
## 7. Local testing workflow
|
|
131
|
+
|
|
132
|
+
Official Solana docs currently show a Rust-native local test flow for native programs.
|
|
133
|
+
|
|
134
|
+
From the current documentation snapshot:
|
|
135
|
+
|
|
136
|
+
- official examples show `litesvm@0.6.1` and `solana-sdk@2.2.0` as dev dependencies in the Rust testing walkthrough
|
|
137
|
+
- the docs position LiteSVM as a fast local execution harness for native Rust programs
|
|
138
|
+
|
|
139
|
+
Recommended execution order:
|
|
140
|
+
|
|
141
|
+
1. unit-test pure helpers and serialization logic
|
|
142
|
+
2. run Rust-native program tests for instruction/state behavior
|
|
143
|
+
3. run validator-backed integration flow only when the repository or task needs cluster realism
|
|
144
|
+
|
|
145
|
+
Test the following explicitly:
|
|
146
|
+
|
|
147
|
+
- initialization and duplicate-initialization rejection
|
|
148
|
+
- authority checks
|
|
149
|
+
- signer and writable enforcement
|
|
150
|
+
- PDA derivation and PDA signing flows
|
|
151
|
+
- state transitions, close flows, and realloc paths
|
|
152
|
+
- failure paths for malformed instruction data or wrong account order
|
|
153
|
+
|
|
154
|
+
## 8. Deployment, upgrades, and irreversible operations
|
|
155
|
+
|
|
156
|
+
The official deployment docs cover the core operational loop:
|
|
157
|
+
|
|
158
|
+
- local development often starts with `solana-test-validator`
|
|
159
|
+
- deploy with `solana program deploy ...`
|
|
160
|
+
- visibility can lag by roughly one slot after deployment
|
|
161
|
+
- a program becomes immutable when its upgrade authority is removed
|
|
162
|
+
- `solana program close` permanently closes the program and the same program ID cannot be reused for redeployment
|
|
163
|
+
|
|
164
|
+
Before any deploy or upgrade:
|
|
165
|
+
|
|
166
|
+
- confirm cluster URL
|
|
167
|
+
- confirm payer keypair
|
|
168
|
+
- confirm intended program ID
|
|
169
|
+
- confirm upgrade authority ownership
|
|
170
|
+
- confirm whether the deploy changes any downstream configuration or address registry
|
|
171
|
+
|
|
172
|
+
For production-facing tasks, always surface immutable or close operations as explicit risk points in the handoff.
|
|
173
|
+
|
|
174
|
+
## 9. Official Rust SDK crate roles
|
|
175
|
+
|
|
176
|
+
The official Rust SDK overview maps the common crates this way:
|
|
177
|
+
|
|
178
|
+
- `solana-program`: on-chain program primitives
|
|
179
|
+
- `solana-sdk`: transactions, instructions, keypairs, signatures, and shared primitives for Rust clients
|
|
180
|
+
- `solana-client`: RPC access for off-chain Rust applications
|
|
181
|
+
- `solana-cli-config`: reuse CLI config from Rust tools
|
|
182
|
+
- `solana-clap-utils`: CLI-oriented helper utilities
|
|
183
|
+
|
|
184
|
+
Default crate choice:
|
|
185
|
+
|
|
186
|
+
- on-chain program logic: `solana-program`
|
|
187
|
+
- Rust service/tool that talks to RPC: `solana-sdk` + `solana-client`
|
|
188
|
+
- Rust CLI that should mirror Solana CLI config behavior: add `solana-cli-config`
|
|
189
|
+
|
|
190
|
+
## 10. When to refresh the official docs before coding
|
|
191
|
+
|
|
192
|
+
Refresh the linked pages instead of relying on this snapshot when:
|
|
193
|
+
|
|
194
|
+
- the repository pins newer or older Solana crate versions
|
|
195
|
+
- CLI subcommands or flags differ from this reference
|
|
196
|
+
- the task depends on recently changed runtime features
|
|
197
|
+
- the repository uses Anchor or another framework that wraps native Solana APIs
|
|
198
|
+
|
|
199
|
+
When docs and code disagree, preserve the repository's actual pinned behavior and note the divergence.
|