Solana subscriptions skill
Agent skill for Solana Native Subscriptions and Allowances
npx -y skills add Dillxn/solana-subscriptions-skillAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 21 days oldThe repository was created 21 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Design and implement Solana Native Subscriptions and Allowances with the official @solana/subscriptions SDK. Use for fixed spending allowances, recurring delegations, merchant subscription plans, stablecoin SaaS billing, payroll, API tiers, bounded AI-agent budgets, delegated token pulls, cancellation and rent-recovery flows, or when choosing among the three native payment models. Also use when reviewing a subscriptions integration for amount conversion, lifecycle completeness, Token-2022 compatibility, collection-worker behavior, or localnet test coverage.
SKILL.md
5.1 KB, as published. Nobody here has run it
Solana Subscriptions
Build bounded token-pull flows with Solana's shared Subscriptions program. Start with a deterministic plan, then implement only the chosen model against the official SDK.
Program ID: De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44
Operating Procedure
- Identify who defines the terms, whether the cap resets, and who pulls funds.
- Write a planner input and run
scripts/plan_subscription.py. - Confirm every assumption in the planner output before generating transactions.
- Read the relevant recipe in
references/sdk-recipes.md. - Implement the complete create, collect, cancel/revoke, query, and rent-recovery lifecycle.
- Test on localnet or devnet. Do not use mainnet or request a real wallet signature unless the user explicitly asks.
- Report the selected model, signers, accounts, base-unit amounts, lifecycle, and test evidence.
Choose the Model
| Need | Model | Terms set by | Typical examples |
|---|---|---|---|
| One total cap, optionally expiring | Fixed delegation | User | Agent budget, capped checkout, one-time allowance |
| Cap resets each period | Recurring delegation | User | Payroll, contractor payments, recurring agent budget |
| Reusable merchant tier accepted by many users | Subscription plan | Merchant | SaaS, API tier, membership |
When the request is ambiguous, ask:
- Does the allowance reset?
- Does the user or merchant define the amount and cadence?
- Is this a reusable public tier or a bilateral agreement?
- Who is allowed to pull, and where may funds land?
- What ends the authorization?
Read references/decision-guide.md for lifecycle and operational tradeoffs.
Plan Before Coding
Create a JSON file:
{
"use_case": "agent_budget",
"token_program": "spl-token",
"amount": "25.00",
"token_decimals": 6,
"expiry_ts": 1789000000,
"nonce": 0
}
Run:
python3 scripts/plan_subscription.py --spec plan.json
The planner rejects ambiguous decimal amounts, missing cadence, incompatible token settings, and unsupported memo-required destinations. Treat its JSON as an implementation checklist, not as a transaction.
Implementation Rules
- Use decimal strings at product boundaries and
bigintbase units in transaction code. Never use JavaScript floating-point numbers for token amounts. - Initialize one Subscription Authority per
(user, mint)and reuse it. - Use the real stored
init_idwhen available. Do not treat close-and-recreate as revocation; revoke the specific delegation or cancel the subscription. - Treat a successful plan or delegation creation as authorization, not proof that future collection will succeed. Balances, approvals, freezes, and token-account existence can change.
- Keep collection idempotent off-chain. Persist the billing period and transaction signature before granting service.
- Model failed pulls and delinquency in the application database; the on-chain subscription does not do this for the application.
- Make cancellation, revoke, and rent recovery visible product flows.
- For Token-2022, test the exact mint extensions and transfer-hook account resolution. Reject memo-required destination accounts unless the official program adds support.
- Pin package versions in examples and state which version was verified. This skill's recipes were checked against
@solana/subscriptions0.4.0.
Required Test Matrix
At minimum, cover:
- exact base-unit conversion;
- maximum allowed pull and one-unit-over rejection;
- expiry or period-boundary behavior;
- unauthorized puller rejection;
- cancellation or revoke;
- insufficient balance or removed approval;
- duplicate collection-worker retry;
- rent recovery;
- Token-2022 extension behavior when applicable.
Prefer the upstream repository's local Surfpool/LiteSVM tests for program-level verification. Application tests may mock RPC only when they still assert instruction inputs and idempotency state.
Deliverable Format
Return:
- selected model and why;
- authority, delegatee/puller, receiver, payer, and required signers;
- human amount, token decimals, and exact base units;
- account and instruction lifecycle;
- collection-worker and retry behavior;
- cancellation/revoke path;
- tests run and remaining external proof.
References
- Read
references/decision-guide.mdfor model selection, account topology, lifecycle, rent, and production operations. - Read
references/sdk-recipes.mdfor official TypeScript SDK setup and instruction shapes. - Read
references/source-index.mdbefore updating version-sensitive facts.