npx agentspec-cli install 2b24df60-6802-4819-bafd-826bc1798054 --framework ClaudeCode→ .claude/skills/x402-client/SKILL.md
# X402 Client Skill
## Overview
The X402 Client Skill enables seamless interaction with the X402 payment service. When a user's HTTP request returns a 402 status code, this skill will be triggered to handle the authentication process and facilitate secure payment transactions.
## Workflow
- Verify that dependencies are installed
- Verify the private key to use
- Verify the target network
- Execute the corresponding JS script
### Dependencies
```bash
npm install https://github.com/second-state/x402-client.git
```
### Get Private Key
- Check if there is a .env file in this skill folder
- If a .env file is found, verify that it contains the PRIVATE_KEY variable
- If no .env file is found, ask the user for a PRIVATE_KEY and create a .env file with that variable
### Target Network
- The HTTP 402 response will contain an accepts array with the payment methods supported by the target URL
- Select the network to use (e.g., base or base-sepolia)
- If there are multiple options, ask the user which network to use
### Execute Script
After obtaining the `TARGET_URL` and `PRIVATE_KEY`, execute the following script:
```js
import { createX402Client } from "x402-client";
const PRIVATE_KEY = "0x<PRIVATE_KEY>";
const TARGET_URL = "<TARGET_URL>";
const NETWORK = "<NETWORK>";
if (!PRIVATE_KEY) throw new Error("Missing PRIVATE_KEY");
const client = await createX402Client({
chain: NETWORK,
privateKey: PRIVATE_KEY,
});
const response = await client.fetchWithPayment(TARGET_URL, { method: "GET" });
console.log("Response headers:", Object.fromEntries(response.headers));
console.log("Response body:", await response.text());
const paymentHeader = response.headers.get("x-payment-response");
if (paymentHeader) {
console.log("Decoded payment response:", client.decodePaymentResponse(paymentHeader));
}
```
### Response
Return the result of the Execute Script to the user.
Built on the Agent Skills standard
x402 Payments Skill — Stellar Edition
Cursor IDE rules and conventions for AI-assisted development.
by AgentHub Crawler
xdrop
Use this skill when the user wants to send or fetch files through an Xdrop server from the terminal, asks to automate encrypted Xdrop share-link workflows, provides an Xdrop `/t/:transferId#k=...` link to download and decrypt locally, or needs Xdrop CLI flags such as `--quiet`, `--json`, `--expires-in`, `--output`, or `--api-url`, even if they do not explicitly mention the skill name.
by AgentHub Crawler
Cursor AI Rules for x402-exec
Before making ANY code changes or commits, you MUST: 1. **Read `.github/WORKFLOW.md`** for complete Git workflow rules 2. **Check current branch**: `git branch --show-current` 3. **Follow branch rules**:
by AgentHub Crawler
Sign in to leave a comment.
security-review
Use this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment/sensitive features. Provides comprehensive security checklist and patterns.
by AgentHub Crawler