Skip to content

About

Claude Agent Skill: make & manage stablecoin (USDC) payments over the rail0 gateway via the rail0 CLI — authorize/capture, charge, void, release, refund, dispute.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

22 Commits

Folders and files

Repository files navigation

rail0-skill

Claude Agent Skill Install via skills.sh rail0 License: MIT

Make and manage stablecoin (USDC) payments over the rail0 gateway from an AI agent — the full authorize → capture lifecycle plus charge, void, release, refund, and dispute — driven by the rail0 CLI.

A Claude Agent Skill. Point your agent at a rail0 gateway and it can take, capture, refund, or cancel stablecoin payments correctly: the skill encodes the lifecycle rules, who signs what, and the asynchronous act → wait pattern (-w) so operations never race the chain.

Install

npx skills add commercelayer/rail0-skill

The skill drives the rail0 CLI, which has to be on your PATH (see Requirements). Its install script fetches the latest release, checks it against the release checksums, and puts rail0 (and the r0 alias) in ~/.local/bin:

curl -fsSL https://raw.githubusercontent.com/commercelayer/rail0-cli/main/install.sh | sh

Then just ask your agent to make or manage a rail0 payment.

Quickstart — what the agent runs

export RAIL0_BASE_URL=https://your-gateway   # omit for the default, https://api.rail0.xyz
rail0 auth login -p @payee          # a session for reads; signing commands sign in themselves

# Authorize 10 USDC into escrow, then capture it. -w waits for each on-chain step;
# --yes is required for fund-moving commands in a non-interactive shell.
PID=$(rail0 payments create -F <payer> -T <payee> -t USDC -a 10.00 -c 5042002 \
        -p @payer -q)
rail0 payments authorize "$PID" -p @payee -w
rail0 payments capture   "$PID" -a 10.00 -p @payee --yes -w

Lifecycle at a glance

Operation Who signs What it does
authorize → capture payer creates + signs, payee authorizes and captures hold funds in escrow, capture later (partial or full)
charge payer creates + signs (-C), payee charges one-shot: pay through immediately, no escrow
void payee cancel an untouched authorization (before any capture, also once expired)
release payer or payee return the uncaptured escrow after authorization_expiry (released when nothing was captured; refunded when it leaves both balances at zero; otherwise status unchanged)
refund payee return captured funds to the buyer (partial or full; refunded only when fully settled)
dispute / close payer buyer signal — no funds move; optional reason code from rail0 disputes reasons

See references/lifecycle.md for the state machine, guards, and the two on-chain balances that drive the next legal step.

Requirements

  • The rail0 CLI ≥ v1.6.0 on your PATH — agent mode (RAIL0_AGENT=1: one JSON envelope per command, exit codes for every outcome). Older CLIs (≥ v1.3.0) still work through --json; see the skill's Agent mode section Help as data (rail0 help <command>), the page of a list and the finer exit codes (2 for any mistake in the call, 3 when no session is stored) need ≥ v1.10.0; the skill says what to do before that.
  • jq — to read fields from the CLI's JSON envelope (.data.…, .error.code)
  • A reachable rail0 gateway — set RAIL0_BASE_URL

What's inside

  • SKILL.md — the skill: mental model, setup, per-operation recipes, error handling, safety
  • references/ — lifecycle/state-machine + the full command reference
  • evals/ — the test prompts used to validate the skill (the first four pass end-to-end on Arc testnet; agent-mode-over-capture-is-refused runs once CLI v1.6.0 is released)

Waiting for the chain is built into the CLI (-w on every lifecycle command, and rail0 payments wait), so the skill needs nothing bundled to run.

Security

Private keys stay local. The CLI signs locally and sends only signatures and signed transactions to the gateway — never the key. Prefer the OS keychain (rail0 keys add → @name) or a secrets-manager-injected RAIL0_PRIVATE_KEY; never paste a raw key inline. See the skill's "Signing keys stay local — reference them, never embed them" setup step, and SECURITY.md for the full trust model.

License

MIT © Commerce Layer — see LICENSE.

About

Claude Agent Skill: make & manage stablecoin (USDC) payments over the rail0 gateway via the rail0 CLI — authorize/capture, charge, void, release, refund, dispute.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors