agirails-patterns

Guidance for choosing and structuring AGIRAILS SDK integrations, including different API levels, payment routes, and test or live environments.

In plain words
What is it for?
Use it to decide between API styles, configure mock mode or testnet and mainnet environments, manage keys, discover providers, and organize ACTP integrations.
Why use it?
It helps developers select an appropriate integration approach without manually routing every payment operation.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/agirails/claude-plugin/agirails-patterns
Any agent
npx skills add agirails/claude-plugin --skill agirails-patterns
Clone the repo
git clone --depth 1 https://github.com/agirails/claude-plugin

Made for: Claude Code, Codex.

Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,147 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00083 $0.04147
Opus 5 $0.00042 $0.02073
Sonnet 5 $0.00017 $0.00829
Haiku 4.5 $0.00008 $0.00415

Measured 2d ago against content hash 23b44231ba9b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agirails-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/agirails-patterns/SKILL.md · 570 lines

How it starts

The opening of the file, as written. The whole thing — 570 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGIRAILS SDK Patterns (v4.0)

The AGIRAILS SDK provides a multi-level API with intelligent adapter routing. Payments are routed automatically based on the to parameter, so you pick the right level of abstraction for your needs and the SDK handles the rest.

Quickstart (Copy-Paste-Run)

Install and run in 30 seconds — no wallet, no keys, no config:

npm install @agirails/sdk

Save as quickstart.js and run with node quickstart.js:

const { ACTPClient } = require('@agirails/sdk');

async function main() {
  // Create client in mock mode (no blockchain, no keys needed)
  const client = await ACTPClient.create({ mode: 'mock' });
  console.log('Address:', client.getAddress());

  // Mint test USDC (mock only — starts with 0 balance)
  await client.mintTokens(client.getAddress(), '10000000000'); // 10,000 USDC
  const balance = await client.getBalance(client.getAddress());
  console.log('Balance:', balance, 'wei (', Number(balance) / 1e6, 'USDC)');

  // Pay a provider (escrow flow)
  const result = await client.pay({
    to: '0x0000000000000000000000000000000000000001',
    amount: '5.00', // 5 USDC (human-readable, not wei)
  });
  console.log('Payment created:', result.txId);
  console.log('State:', result.state); // COMMITTED
  console.log('Escrow ID:', result.escrowId);
  console.log('Release required:', result.releaseRequired);
}

main().catch(console.error);

Output:

Address: 0x... (random mock address)
Balance: 10000000000 wei ( 10000 USDC)
Payment created: 0x... (transaction hash)
State: COMMITTED
Escrow ID: 0x...
Release required: true

Next steps: Replace mock with testnet (add ACTP_PRIVATE_KEY env var) or mainnet for production.

Adapter Routing (Most Important Pattern)

The SDK inspects the to parameter and routes to the correct payment adapter automatically:

to value Adapter Registration Settlement
0x1234... (address) ACTP escrow Default, always available Lock / hold / release
https://... (URL) x402 instant Must register X402Adapter Single atomic transfer
agent ID (number) ERC-8004 resolve then ACTP Must configure ERC-8004 bridge Lock / hold / release

Read the full file on GitHub · 570 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 570 lines · 83 tokens per session scan A 23b44231ba9b

Subscribe to this mod's changes

agirails-patterns is a skill published in the GitHub repository agirails/claude-plugin (2 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 83 tokens to every session and 4,147 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.