x402-scaffold

x402-scaffold is a command for Claude Code from Aznatkoiny/zAI-Skills. It costs 29 tokens per session (1,049 once invoked), scanned A, original, MIT.

A command that creates an x402 payment starter: either a seller API that requires payment or a buyer client that pays for access.

In plain words
What is it for?
Use it to scaffold a seller or buyer implementation for Base or Solana, provided you specify the role and blockchain.
Why use it?
It provides a defined starting point for the payment flow and uses test networks by default to reduce the risk of accidental real payments.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: positional $N argument.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the ai-toolkit plugin — 6 skills, 4 commands, 2 agents shipped together

Good fit Use it to scaffold a seller or buyer implementation for Base or Solana, provided you specify the role and blockchain.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Aznatkoiny/zAI-Skills
Claude Code
/plugin install ai-toolkit

Made for: Claude Code.

Or install ai-toolkit, the plugin that ships this one along with the rest of its 6 skills, 4 commands, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for x402-scaffold

README.md
[![agentmods](https://agentmods.dev/badge/commands/aznatkoiny/zai-skills/x402-scaffold/github.svg)](https://agentmods.dev/commands/aznatkoiny/zai-skills/x402-scaffold)
Your own site
<a href="https://agentmods.dev/commands/aznatkoiny/zai-skills/x402-scaffold"><img src="https://agentmods.dev/badge/commands/aznatkoiny/zai-skills/x402-scaffold/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for x402-scaffold

Your own site · 80×15
<a href="https://agentmods.dev/commands/aznatkoiny/zai-skills/x402-scaffold"><img src="https://agentmods.dev/badge/commands/aznatkoiny/zai-skills/x402-scaffold.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,049 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00029 $0.01049
Opus 5 $0.00015 $0.00524
Sonnet 5 $0.00006 $0.00210
Haiku 4.5 $0.00003 $0.00105

Measured 10d ago against content hash 17d31ddf09eb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

x402-scaffold 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 10d 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.

AI-Toolkit/commands/x402-scaffold.md · 67 lines

How it starts

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

You are scaffolding an x402 protocol starter using the x402-payments skill.

Arguments

$ARGUMENTS

Parse two choices from the arguments:

  • Role: seller (an API that requires payment) or buyer (a client/agent that pays for x402-protected resources).
  • Chain: evm (Base) or svm (Solana).

If either is missing, ask the user rather than guessing. Default environment is testnet — Base Sepolia (eip155:84532) for EVM, Solana Devnet for SVM, facilitator https://x402.org/facilitator. Never scaffold mainnet configuration unless explicitly requested (see the safety note below).

Step 1: Load the skill

Read ${CLAUDE_PLUGIN_ROOT}/skills/x402-payments/SKILL.md first, then the reference matching the role:

  • Seller → ${CLAUDE_PLUGIN_ROOT}/skills/x402-payments/references/server-patterns.md (Express/Hono/Next.js middleware, multi-route config, facilitator configuration, environment variables template).
  • Buyer → ${CLAUDE_PLUGIN_ROOT}/skills/x402-payments/references/client-patterns.md (fetch/axios wrappers, wallet setup, lifecycle hooks, error handling, environment variables template).
  • For header/payload details or CAIP-2 network IDs, consult ${CLAUDE_PLUGIN_ROOT}/skills/x402-payments/references/protocol-spec.md.

Follow the skill's Critical Implementation Notes exactly — in particular: register schemes before wrapping fetch/axios; use V2 headers; dollar-string prices ("$0.001"); Node.js v24+ for the TypeScript SDK.

Step 2: Generate the starter

Create a TypeScript Node project (ask before writing into a non-empty directory):

<project>/
├── package.json          # "engines": { "node": ">=24" }
├── tsconfig.json
├── .env.example          # placeholders only — never real keys
├── .gitignore            # must include .env
├── README.md             # run instructions + faucet links
└── src/
    └── index.ts

Seller (src/index.ts) — follow the server-patterns reference for the chosen framework (default Express unless the user names Hono or Next.js):

Read the full file on GitHub · 67 lines

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. 10d ago First seen · 67 lines · 29 tokens per session scan A 17d31ddf09eb

Subscribe to this mod's changes

x402-scaffold is a command published in the GitHub repository Aznatkoiny/zAI-Skills (9 stars, last pushed 1mo ago), licensed MIT. It adds 29 tokens to every session and 1,049 once invoked, about $0.0001 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.