Skip to content

Add wallet skill: use the Stellar CLI as a wallet#49

Open
aristidesstaffieri wants to merge 5 commits into
mainfrom
feat/wallet-skills-cli
Open

Add wallet skill: use the Stellar CLI as a wallet#49
aristidesstaffieri wants to merge 5 commits into
mainfrom
feat/wallet-skills-cli

Conversation

@aristidesstaffieri

@aristidesstaffieri aristidesstaffieri commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a wallet skill that documents using the Stellar CLI (stellar) as a wallet by composing existing commands — key management, funding, balances, account readiness, trustlines, value transfer, the stellar token client, and transaction diagnosis — with structured JSON output and a branchable error contract.

Commands were verified against stellar-cli 25.1.0 on testnet. Some of the surface this skill documents is still gated on in-flight CLI work and is called out as forthcoming rather than presented as shipped — see In-progress dependencies below.

What's in this PR

  • skills/wallet/SKILL.md — entry point: wallet-operation → command map, prerequisites (install, RPC/relayer config), and the {status, result, error} output/error contract.
  • skills/wallet/keys.md — key lifecycle, private-key security, funding, and key selection.
  • skills/wallet/accounts-and-tx.md — balances/readiness, trustlines, tx diagnosis, sign + submit, account draining, plus an inline Stellar account & transaction model (reserves, sequence numbers/idempotency, fees & fee-bumps, tx lifecycle).
  • skills/wallet/tokens.md — the stellar token client (SEP-41 / SAC), trusted token lists, error remediation, and asset anatomy.
  • site/src/data/skills.ts — new "Wallets" filter category and a SKILL_CARD_SOURCES entry so the skill renders on skills.stellar.org and in llms.txt.

In-progress dependencies

This skill documents CLI surface that is not yet fully shipped. These are flagged as forthcoming in the content so readers aren't misled:

  • stellar token client (stellar-cli#2620) — the typed SEP-41/SAC client that tokens.md and several examples depend on (e.g. stellar token balance noted # (via #2620)).
  • Structured JSON output + {status, result, error} receipt (stellar-cli#2622) — the output/error contract in SKILL.md.
  • Relayer submission (stellar-cli#2623) — the optional relayer config / fee-bump-on-submit path.
  • DeFi skills — the "Working with Soroban protocols" section links to ../defi/SKILL.md, which does not exist in this repo yet. The link is intentional forward-routing to that forthcoming skill package.

Test plan

  • Commands verified against stellar-cli 25.1.0 on testnet
  • Fixed a deprecated command surfaced during verification (stellar contract asset idstellar contract id asset)
  • Confirm the skill card renders under the new "Wallets" filter on the site preview
  • CI green

  Add a `wallet` skill that documents using the Stellar CLI as a wallet by
  composing existing commands, closing the protocol/usability gap called for
  in the Agentic Wallet CLI epic (stellar/stellar-cli#2628, #2624).

  The skill is a SKILL.md entry plus three task-focused companions:
  - SKILL.md: composition map (wallet operation -> command), prerequisites
    (install, RPC/relayer config), and the structured output/error contract
  - keys.md: key lifecycle, private-key security, funding, selection
  - accounts-and-tx.md: balances/readiness, trustlines, tx diagnosis,
    sign + submit, and account draining
  - tokens.md: the stellar token client (SEP-41/SAC), trusted token lists,
    error remediation, and asset anatomy

  Wire it into the site: new "Wallets" filter category and a SKILL_CARD_SOURCES
  entry so it renders on skills.stellar.org and in llms.txt.

  Commands verified against stellar-cli 25.1.0 on testnet. Surface still gated
  on in-flight work is documented as forthcoming: the `stellar token` client
  (#2620), structured JSON output and the {status,result,error} receipt (#2622),
  and relayer submission (#2623).
  Add an inline "Stellar account & transaction model" section to
  accounts-and-tx.md covering the mechanics the command pipeline handles
  by default, so readers can diagnose and recover when a default isn't
  enough. Closes a gap against design-doc goal #1 ("sane defaults for
  fees, sequences, retry, error handling") and its Idempotency row:

  - minimum balance & reserves (why you can't spend to zero)
  - sequence numbers & idempotency (txBAD_SEQ; check inclusion before retry)
  - fees, surge pricing & fee-bumps (max-bid model, CAP-15, relayer link)
  - transaction lifecycle: time bounds, poll-to-inclusion, safe retries

  Wire cross-links: readiness checklist and drain ordering -> reserves;
  tokens.md insufficient-balance row -> reserves; fee-bump -> relayer
  section; lifecycle -> tx diagnosis.

  Also fix a deprecated command surfaced during testnet verification:
  `stellar contract asset id` -> `stellar contract id asset`.
  Add a "Working with Soroban protocols (DeFi)" section to the wallet
  SKILL.md that draws the boundary — this skill covers wallet primitives
  (value transfer, trustlines, tx mechanics), not protocol-specific logic
  — and points readers to the DeFi skills when they need to understand how
  a Soroban protocol works or craft the transaction(s) to act on it
  (swap, lend/borrow, vault deposit/withdraw, provide liquidity).

  Link the section from Related skills and point at the forthcoming
  ../defi/ playbooks. Supports design-doc goal #2 (skills to discover and
  interact with on-chain protocols).
@aristidesstaffieri aristidesstaffieri self-assigned this Jul 8, 2026
Copilot AI review requested due to automatic review settings July 8, 2026 17:45
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://stellar.github.io/stellar-dev-skill/pr/pr-49/

Built to branch gh-pages at 2026-07-09 15:38 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “wallet” skill to the Stellar Skills collection, documenting how to use the stellar CLI for key management, account readiness, transfers, trustlines, token operations, and transaction diagnosis, and surfaces it on the skills landing page under a new “Wallets” filter.

Changes:

  • Introduces the skills/wallet skill overview plus supporting docs for keys, accounts/transactions, and tokens.
  • Adds a new “Wallets” category/filter and a “CLI Wallet” card entry to the site skills registry.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
skills/wallet/SKILL.md Adds the wallet skill entrypoint, prerequisites, structured JSON guidance, and navigation to the wallet subtopics.
skills/wallet/keys.md Documents CLI key lifecycle operations and private-key safety guidance.
skills/wallet/accounts-and-tx.md Documents account readiness, reserves/fees/sequence mechanics, trustlines, building/signing/sending, and diagnosis flows.
skills/wallet/tokens.md Documents stellar token usage: target resolution, common subcommands, examples, and error remediation.
site/src/data/skills.ts Registers the new “Wallets” filter and adds the “CLI Wallet” card entry pointing at the new skill.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread site/src/data/skills.ts
Comment thread skills/wallet/SKILL.md Outdated
Comment thread skills/wallet/accounts-and-tx.md Outdated
@aristidesstaffieri aristidesstaffieri changed the title Feat/wallet skills cli Add wallet skill: use the Stellar CLI as a wallet Jul 8, 2026
- site/src/app/styles.scss: add "Wallets" to the filter whitelist so the
  category actually shows its cards when selected (the @each list mirrors
  FILTERS minus "All" and was missing the new entry)
- skills/wallet/SKILL.md: fix typo "provicers" -> "providers"
- skills/wallet/accounts-and-tx.md: move the "readiness" anchor onto its own
  line to match the other anchors

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@oceans404

Copy link
Copy Markdown
Contributor

I stress tested this skill by giving fresh agents (no Stellar context) only the SKILL.md URL, real wallet tasks, and --help, on testnet with CLI 26.0.0. Setting aside the sections gated on unshipped CLI work (#2620, #2622, #2623), here is what agents actually hit, ranked by impact. All flows completed, but every agent had to escape the doc into --help to do it.

accounts-and-tx.md

  1. Amount units. tx new payment --amount is stroops, but the examples (--amount 100, --amount 10) read as human units, and tokens.md primes "pass human units." An agent transferred 100 stroops thinking 100 tokens. It succeeds silently, off by 10^7. State the unit next to every --amount and use a realistic value like --amount 100000000 # 10 XLM.
  2. Add a tx new create-account example. Paying a non-existent account with tx new payment fails on-chain with NoDestination, and create-account (the actual fix, --starting-balance, also stroops) has no example anywhere. This is the most common onboarding flow.
  3. Drop --output json from the tx new payment, tx new account-merge, and tx send examples. The flag doesn't exist on those commands (error: unexpected argument '--output' found). Also worth noting: tx new prints nothing to stdout on success (hash on stderr only), so show what success looks like.
  4. Name the real errors. Failures agents saw are Rust debug dumps like TxFailed(VecM([OpInner(Payment(NoTrust))])), and the names NoTrust, NoDestination, Underfunded, HasSubEntries, InvalidLimit appear nowhere in the doc. Agents recovered only where prose sat next to the example (InvalidLimit gives zero hint that "balance must be 0"; Underfunded never connects to "reserve"). A small error-name table would fix this.
  5. Readiness details. The checklist says "decimal balance" but ledger entry fetch account returns raw stroops. A missing account returns success with empty entries, not an error. Failed txs still charge the fee.

keys.md

  1. Document the stdin pipe for keys add. echo "$SEED" | stellar keys add <name> --secure-store works with no TTY. The current "reads the secret from an interactive prompt" wording made an agent conclude import can't be automated.
  2. keys rm needs --force non-interactively. Bare keys rm <name> with no TTY fails with removal cancelled by user. --force isn't mentioned.
  3. Fix the secure-store claims. It's seed-phrase-only (no S-key import, per --help), and secure-store keys can never be exported (Secure Store does not reveal secret key). Worth a one-way-door callout since the doc recommends it.
  4. Small fixes. The pubnet note implies tx new payment can fund a new address (it can't, see Add dedicated ZK skill for Protocol 25 X-Ray #2). keys ls --long prints file paths, not addresses.

SKILL.md

  1. Scope habit Fix README installation commands: correct org name and plugin syntax #1. "Pass --output json on any command that supports it" holds only for reads (ledger entry fetch, tx fetch, network health) in 26.0.0. Say that, since agents attach it everywhere and their first command errors.
  2. Network section. Testnet ships preconfigured, so network add testnet re-adds a built-in, and "the default is the public testnet RPC" overstates it (no network selected = error). Say "select the built-in testnet with -n testnet or network use testnet."

tokens.md

  1. Make the invoke bridge actionable until token ships. "Thin wrapper over contract invoke" is true but unteachable as written. Two lines close it: discover functions with stellar contract invoke --id <SAC> --network testnet -- --help, and raw invoke amounts are base units (call decimals first). Without the second, the human-units framing causes the same silent 10^7 error as Fix README installation commands: correct org name and plugin syntax #1. (contract id asset and contract asset deploy worked perfectly as documented.)
  2. Small fixes. The publishing-asset-information link 404s. Transferring a SAC token to its issuer emits Burn and the issuer balance stays at the i64::MAX sentinel, so destination-balance verification reads as failure. A pointer to ../assets/SKILL.md for "how do I get an issued asset in the first place" would help; agents needed outside knowledge for that.

What held up well: the file structure and relative links (every agent navigated them cold), the keys lifecycle, the tx fetch result|fee|events family, --build-only and the tx sign | tx send pipe, drain ordering, and the reserve/fee/idempotency facts, which we verified on-chain (resending the same signed envelope really does return the identical receipt). The "discover before you guess" habit is what carried every agent, so the doc's bones are right.

  Fresh agents given only the wallet SKILL.md, real tasks, and --help
  completed every flow but had to escape into --help to do it, and hit a
  silent 10^7 amount-units error. Reconcile the docs with observed CLI
  26.0.0 behavior (verified on-chain on testnet), and settle two framing
  decisions: amounts are raw base units everywhere, and state-changing
  commands are documented against the target CLI that returns --output
  json receipts.

  accounts-and-tx.md:
  - Label every --amount / --starting-balance as stroops with realistic
    values; call out the silent 10^7 trap.
  - Add a create-account example; note payment to a non-existent account
    fails with NoDestination.
  - Add a Named errors section (TxFailed(VecM([OpInner(...)])) dumps) for
    NoDestination, NoTrust, Underfunded, InvalidLimit, HasSubEntries, and
    note failed txs still charge the fee.
  - Fix readiness: fetch returns raw stroops; a missing account succeeds
    with entries:[], not an error.
  - Distinguish classic assets (always 7-decimal) from SEP-41 tokens
    (variable decimals, look up via decimals()).

  keys.md:
  - Document the stdin pipe for keys add --secure-store (no TTY).
  - Note keys rm needs --force non-interactively.
  - Correct secure-store: seed-phrase only, never exportable (one-way door).
  - Fix keys ls --long (config-file paths, not addresses) and the pubnet
    funding note (payment can't fund a new address; use create-account).

  SKILL.md:
  - Correct the network section: testnet/pubnet/etc. are built-in; reserve
    network add for custom/private RPCs.

  tokens.md:
  - Reframe amounts as raw base units (10^decimals, not always 7; read
    decimals() first), consistent with the rest of the CLI.
  - Add an interim contract-invoke path until `stellar token` ships.
  - Fix the 404 publishing-asset-info link; note the burn-to-issuer
    i64::MAX sentinel; point to ../assets for acquiring an issued asset.
@aristidesstaffieri

Copy link
Copy Markdown
Collaborator Author

I stress tested this skill by giving fresh agents (no Stellar context) only the SKILL.md URL, real wallet tasks, and --help, on testnet with CLI 26.0.0. Setting aside the sections gated on unshipped CLI work (#2620, #2622, #2623), here is what agents actually hit, ranked by impact. All flows completed, but every agent had to escape the doc into --help to do it.

accounts-and-tx.md

  1. Amount units. tx new payment --amount is stroops, but the examples (--amount 100, --amount 10) read as human units, and tokens.md primes "pass human units." An agent transferred 100 stroops thinking 100 tokens. It succeeds silently, off by 10^7. State the unit next to every --amount and use a realistic value like --amount 100000000 # 10 XLM.
  2. Add a tx new create-account example. Paying a non-existent account with tx new payment fails on-chain with NoDestination, and create-account (the actual fix, --starting-balance, also stroops) has no example anywhere. This is the most common onboarding flow.
  3. Drop --output json from the tx new payment, tx new account-merge, and tx send examples. The flag doesn't exist on those commands (error: unexpected argument '--output' found). Also worth noting: tx new prints nothing to stdout on success (hash on stderr only), so show what success looks like.
  4. Name the real errors. Failures agents saw are Rust debug dumps like TxFailed(VecM([OpInner(Payment(NoTrust))])), and the names NoTrust, NoDestination, Underfunded, HasSubEntries, InvalidLimit appear nowhere in the doc. Agents recovered only where prose sat next to the example (InvalidLimit gives zero hint that "balance must be 0"; Underfunded never connects to "reserve"). A small error-name table would fix this.
  5. Readiness details. The checklist says "decimal balance" but ledger entry fetch account returns raw stroops. A missing account returns success with empty entries, not an error. Failed txs still charge the fee.

keys.md

  1. Document the stdin pipe for keys add. echo "$SEED" | stellar keys add <name> --secure-store works with no TTY. The current "reads the secret from an interactive prompt" wording made an agent conclude import can't be automated.
  2. keys rm needs --force non-interactively. Bare keys rm <name> with no TTY fails with removal cancelled by user. --force isn't mentioned.
  3. Fix the secure-store claims. It's seed-phrase-only (no S-key import, per --help), and secure-store keys can never be exported (Secure Store does not reveal secret key). Worth a one-way-door callout since the doc recommends it.
  4. Small fixes. The pubnet note implies tx new payment can fund a new address (it can't, see Add dedicated ZK skill for Protocol 25 X-Ray #2). keys ls --long prints file paths, not addresses.

SKILL.md

  1. Scope habit Fix README installation commands: correct org name and plugin syntax #1. "Pass --output json on any command that supports it" holds only for reads (ledger entry fetch, tx fetch, network health) in 26.0.0. Say that, since agents attach it everywhere and their first command errors.
  2. Network section. Testnet ships preconfigured, so network add testnet re-adds a built-in, and "the default is the public testnet RPC" overstates it (no network selected = error). Say "select the built-in testnet with -n testnet or network use testnet."

tokens.md

  1. Make the invoke bridge actionable until token ships. "Thin wrapper over contract invoke" is true but unteachable as written. Two lines close it: discover functions with stellar contract invoke --id <SAC> --network testnet -- --help, and raw invoke amounts are base units (call decimals first). Without the second, the human-units framing causes the same silent 10^7 error as Fix README installation commands: correct org name and plugin syntax #1. (contract id asset and contract asset deploy worked perfectly as documented.)
  2. Small fixes. The publishing-asset-information link 404s. Transferring a SAC token to its issuer emits Burn and the issuer balance stays at the i64::MAX sentinel, so destination-balance verification reads as failure. A pointer to ../assets/SKILL.md for "how do I get an issued asset in the first place" would help; agents needed outside knowledge for that.

What held up well: the file structure and relative links (every agent navigated them cold), the keys lifecycle, the tx fetch result|fee|events family, --build-only and the tx sign | tx send pipe, drain ordering, and the reserve/fee/idempotency facts, which we verified on-chain (resending the same signed envelope really does return the identical receipt). The "discover before you guess" habit is what carried every agent, so the doc's bones are right.

@oceans404 thanks for going through this in detail. I've fixed most of these issues in 2f3dd63

for 3 and 10, the doc targets a future version of the CLI where the assumption is that both the token command and the structured outputs have landed upstream. Given that, it seems like we shouldn't make the changes listed in those lien items. Does that sound right to you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants