skills/create-paid-skill/SKILL.md
Use this skill when the user asks to "create a paid skill", "monetize an API", "create a SKILL.md", "set up x402 payments", "make a paid API for agents", "create an agent skill with payments", "build a skill for skills.sh", "convert OpenAPI to SKILL.md", "create an MCP tool", "create an A2A agent card", or wants to create a service that AI agents can discover and pay for autonomously. Guides the user step-by-step through creating a SKILL.md file following the SKILL.md Specification v2.0 (RFC), including payment configuration, endpoint definitions, agent-ready documentation, and publishing.
npx skillsauth add 402md/agent-skills create-paid-skillInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a specialist in creating SKILL.md files following the SKILL.md Specification v2.0. SKILL.md is the open standard for describing capabilities that AI agents can discover, understand, and pay for autonomously using the x402 payment protocol.
This skill generates SKILL.md files only — it does NOT execute payments, make HTTP requests, or interact with any blockchain. All payment fields are documentation for the generated file.
Specification: https://github.com/402-md/skillmd/blob/main/SPEC.md
Reference implementation: npm install @402md/skillmd
additionalProperties: true).A SKILL.md file consists of two parts separated by --- delimiters:
---
[YAML frontmatter]
---
[Markdown body]
---. Contains structured metadata.---. Contains documentation, instructions, or both.SKILL.md (case-sensitive).Frontmatter extraction regex: ^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$
When the user asks to create a skill, follow these steps IN ORDER:
Ask the user what kind of skill they want. There are THREE profiles:
For services that charge per API call via x402.
Required fields: name, description, base_url, payment, endpoints
---
name: web-scraper
description: Real-time web scraping with structured output
base_url: https://api.scraper.dev
type: API
payment:
networks: [stellar]
asset: USDC
payTo: GABC...XYZ
endpoints:
- path: /v1/scrape
method: POST
description: Scrape a URL
priceUsdc: "0.005"
---
For pure agent instructions — no paid endpoints. Compatible with Anthropic's format.
Required fields: name, description
---
name: code-reviewer
description: >-
This skill should be used when the user asks to "review code",
"check for bugs", "audit this file", or mentions code quality.
version: 1.0.0
type: SKILL
allowed-tools: [Read, Grep, Glob]
---
# Code Reviewer
When reviewing code, follow these steps:
1. Read the file completely before commenting
2. Check for security vulnerabilities (OWASP top 10)
3. Verify error handling at boundaries
4. Suggest improvements only when asked
Note: The
SKILLtype makespaymentandendpointsoptional. The body follows Anthropic convention — imperative form, step-by-step procedures.
A paid API that also provides agent instructions for how to use it.
Required fields: name, description, base_url, payment, endpoints
---
name: weather-api
description: >-
This skill should be used when the user asks about "weather",
"temperature", "forecast", or needs meteorological data.
Real-time weather data for any location worldwide.
base_url: https://api.weatherco.com
type: API
version: 1.0.0
payment:
networks: [stellar, base]
asset: USDC
payTo: GABC...XYZ
endpoints:
- path: /v1/current
method: POST
description: Get current weather
priceUsdc: "0.001"
inputSchema:
type: object
properties:
location:
type: string
required: [location]
tags: [weather, geolocation]
---
# Weather API
When the user asks about weather:
1. Call `/v1/current` with the location ($0.001 per call)
2. If they want a forecast, call `/v1/forecast` ($0.005)
3. Always show the cost before making the call
Based on the profile, ask the user:
For all profiles:
For Paid API and Hybrid (Profile A & C) — also ask:
3. What endpoints does it have? (method, path, what each does)
4. What should each call cost? (in USDC — see Pricing Guidelines below)
5. What blockchain network? Options: stellar, base, stellar-testnet, base-sepolia
6. What is your wallet address? (Stellar G-address for Stellar, EVM 0x-address for Base)
7. Do you also have an EVM address? (for payToEvm fallback — optional)
8. What is the base URL? (e.g., https://api.myservice.com)
9. Do you have an SLA? (e.g., "99.9%" — optional)
10. What is your rate limit? (e.g., "1000/hour" — optional)
11. Do you have a sandbox/free test endpoint? (URL — optional)
For Agent Skill (Profile B) — also ask:
3. What tools should the agent be allowed to use? (e.g., Read, Bash, Write, Grep, Glob, WebFetch)
4. What trigger phrases should invoke this skill? (for Claude Code auto-invocation)
If the user already has a local OpenAPI spec file, read it to extract endpoints automatically using the generateFromOpenAPI() function from @402md/skillmd.
Generate the frontmatter using ALL applicable fields from the spec:
---
#3.1 Core Fields (required)
name: {kebab-case-name} # ^[a-z0-9][a-z0-9_-]*$ — max 100 chars
description: >- # max 2000 chars
This skill should be used when the user asks to "{trigger phrase 1}",
"{trigger phrase 2}", "{trigger phrase 3}", or needs {general description}.
{One-line summary of what the API does}.
version: 1.0.0 # semver (recommended)
#3.2 Identity Fields (optional)
displayName: {Human Readable Name} # max 200 chars, falls back to name
author: {author-name} # max 100 chars
license: {MIT | proprietary | etc}
#3.3 Classification Fields
type: API # API | SAAS | PRODUCT | SERVICE | SUBSCRIPTION | CONTENT | SKILL
tags: [{tag1}, {tag2}, {tag3}] # max 20 items, for discovery
category: {primary-category} # for marketplace listing
#3.4 Service Fields (for APIs)
base_url: {https://api.example.com} # REQUIRED when endpoints present
sla: "99.9%" # uptime guarantee (optional)
rateLimit: "1000/hour" # rate limit info (optional)
sandbox: {https://sandbox.example.com} # free test endpoint URL (optional)
#3.5 Payment Fields (REQUIRED when endpoints present, optional for type: SKILL)
payment:
networks: # min 1 required
- stellar # stellar | stellar-testnet | base | base-sepolia
- base
asset: USDC # default: USDC
payTo: {G-address or 0x-address} # primary recipient (REQUIRED)
payToEvm: {0x-address} # EVM fallback (optional, ^0x[a-fA-F0-9]{40}$)
facilitator: https://facilitator.402.md # payment verification service (optional)
#3.6 Endpoint Fields (REQUIRED for API types)
endpoints:
- path: /v1/{resource} # MUST start with /
method: POST # GET | POST | PUT | DELETE | PATCH
description: {What this endpoint does}
priceUsdc: "{price}" # decimal string: ^\d+(\.\d+)?$
inputSchema: # JSON Schema (optional)
type: object
properties:
{param}:
type: string
description: {param description}
required: [{required-params}]
outputSchema: # JSON Schema (optional)
type: object
properties:
{field}:
type: string
#3.7 Agent Integration Fields
allowed-tools: [Read, Write, Bash] # tools the skill can use (Anthropic compatible)
#3.8 Extensibility — any additional fields are preserved
# x-custom-field: "value"
# mcp_server: "@402md/mcp"
# marketplace:
# featured: true
# verified: true
---
The body is the most important part. The frontmatter provides metadata for tooling, but the body is what an AI agent actually reads to understand how to use the skill.
Key insight from the spec: No LLM has been trained on x402. The body MUST teach the agent what x402 is, how payment works, and how to call each endpoint — step by step, with examples.
For Paid API (Profile A) and Hybrid (Profile C), write the body in this order:
# {Skill Name}
{One paragraph: what it does, when to use it, no API keys needed.}
## Payment Protocol (x402)
This API uses the x402 payment protocol. No API keys or accounts needed.
Payment is per-request in USDC on {network}.
**How it works:**
1. Make a normal HTTP request to any endpoint
2. The server responds with HTTP 402 (Payment Required) and a JSON body
containing payment requirements (amount, recipient address, network)
3. Sign a USDC transfer authorization with your wallet (non-custodial,
no funds leave your wallet until verified)
4. Retry the same request with the signed payment in the `X-PAYMENT` header
5. The server verifies the payment, settles on-chain, and returns the result
**Payment properties:**
- **Non-custodial**: The agent signs locally. No private key leaves the wallet.
- **Atomic**: On Stellar, settlement uses multi-op transactions. On Base, a Solidity contract splits in a single transaction.
- **Gasless**: The facilitator covers gas fees. Agent and seller pay zero gas.
**If using @402md/mcp:** Payment is handled automatically. Just call the
endpoint via `use_skill` and the MCP server handles steps 2-5.
**If calling directly:** Use `x402Fetch` from `@402md/x402` — see the library docs for usage.
## Authentication
No API keys, no accounts, no registration. Authentication IS the payment.
Each request is independently paid via x402. The agent's wallet signature
serves as both authentication and payment authorization.
## Endpoints
### {Endpoint Name}
**{METHOD} {path}** — ${price} USDC
{Description of what this endpoint does.}
**Request:**
\`\`\`json
POST {base_url}{path}
Content-Type: application/json
{
"param": "value"
}
\`\`\`
**Response (200):**
\`\`\`json
{
"field": "value"
}
\`\`\`
**Parameters:**
- `param` (required): Description.
- `optionalParam`: Description. Default: `value`.
## Workflow
### {Common Use Case}
1. Call `{METHOD} {path}` with `{ "param": "value" }` (${price})
2. {Next step}
3. Always tell the user the cost before making the call
4. Wait for user confirmation, then execute
### {Another Use Case}
1. Call endpoint A first
2. Use result from A to call endpoint B
3. Total cost = $X — confirm with user first
## Error Handling
| Status | Meaning | What to do |
|--------|---------|------------|
| 400 | Bad request | Check input format. Show the error message to the user. |
| 402 | Payment required | Normal x402 flow — handled automatically by @402md/x402 or MCP. |
| 403 | Insufficient funds | Tell user: "Wallet balance too low. Fund your wallet to continue." |
| 404 | Not found | The resource doesn't exist. Don't retry. |
| 429 | Rate limited | Wait 60 seconds and retry once. If still 429, tell the user. |
| 500 | Server error | Retry once after 5 seconds. If still failing, tell the user. |
| 504 | Timeout | The request timed out. Retry once or suggest simpler parameters. |
## Pricing Summary
| Endpoint | Method | Price | Description |
|----------|--------|-------|-------------|
| `{path}` | {METHOD} | ${price} | {description} |
**Cost examples:**
- {Common operation}: ${cost}
- {Batch operation}: ${cost} × {count}
## Sandbox (Free Testing)
Test endpoint for free (limited):
\`\`\`
{METHOD} {sandbox_url}{path}
\`\`\`
No payment required. Use this to verify your integration works before making paid calls.
For Agent Skill (Profile B), write the body as imperative instructions:
# {Skill Name}
{One paragraph: what this skill does.}
When {trigger condition}, follow these steps:
1. {Step 1}
2. {Step 2}
3. {Step 3}
## {Section for specific procedure}
1. {Detailed step}
2. {Detailed step}
For Hybrid (Profile C), combine both: Start with the API documentation (like Profile A) but add agent-specific workflow instructions telling the agent exactly what to do and when.
| Skill complexity | Recommended body length | |-----------------|------------------------| | Simple (1-2 endpoints) | 500-1,000 words | | Medium (3-5 endpoints) | 1,000-3,000 words | | Complex (6+ endpoints, workflows) | 3,000-8,000 words | | Platform API (many features) | 5,000-15,000 words |
Err on the side of more detail. An agent with too much context wastes tokens. An agent with too little context makes wrong API calls, wastes money, and fails.
After generating, validate using the @402md/skillmd library:
import { validateSkillMd } from '@402md/skillmd'
import { readFileSync } from 'fs'
const content = readFileSync('SKILL.md', 'utf-8')
const result = validateSkillMd(content)
if (!result.valid) {
console.error('Errors:', result.errors)
}
if (result.warnings.length > 0) {
console.warn('Warnings:', result.warnings)
}
Or validate manually against these rules:
Errors (MUST fix):
| Rule | Field | Description |
|------|-------|-------------|
| MISSING_NAME | name | Name is required |
| INVALID_NAME | name | Must match ^[a-z0-9][a-z0-9_-]*$ |
| MISSING_DESCRIPTION | description | Description is required |
| MISSING_BASE_URL | base_url | Required when endpoints are present |
| INVALID_BASE_URL | base_url | Must be a valid URL |
| MISSING_PAYMENT | payment | Required when endpoints are present |
| MISSING_NETWORKS | payment.networks | At least one network required |
| INVALID_NETWORK | payment.networks[] | Must be: stellar, stellar-testnet, base, base-sepolia |
| MISSING_PAY_TO | payment.payTo | Recipient address required |
| MISSING_ENDPOINTS | endpoints | At least one endpoint required (unless type: SKILL) |
| INVALID_PATH | endpoints[].path | Must start with / |
| INVALID_METHOD | endpoints[].method | Must be: GET, POST, PUT, DELETE, PATCH |
| INVALID_PRICE | endpoints[].priceUsdc | Must match ^\d+(\.\d+)?$ |
| DUPLICATE_ENDPOINT | endpoints[] | Duplicate {method} {path} not allowed |
Warnings (SHOULD fix):
| Rule | Field | Description |
|------|-------|-------------|
| MISSING_VERSION | version | Recommended for published skills |
| INVALID_VERSION | version | Should follow semver |
| MISSING_TAGS | tags | Recommended for discovery |
| TOO_MANY_TAGS | tags | Max 20 tags |
| UNRECOGNIZED_ADDRESS | payment.payTo | Address doesn't match known formats |
Depending on the use case, recommend one of these structures:
Standalone (single skill):
project/
└── SKILL.md
Skill Package (with supporting files):
skill-name/
├── SKILL.md # Required
├── references/ # Loaded on demand
│ ├── api-docs.md
│ └── examples.md
├── scripts/ # Executable utilities
│ └── validate.sh
└── assets/ # Output resources
└── template.html
Monorepo (API + agent skills):
project/
├── SKILL.md # Root skill (the API itself)
└── skills/ # Agent skills that use the API
├── weather-helper/
│ └── SKILL.md
└── forecast-analyst/
└── SKILL.md
Tell the user about available format conversions:
Each endpoint becomes an MCP tool. Tool name: {skill-name}_{path} (e.g., weather-api_v1_current).
import { parseSkillMd, toMcpToolDefinitions } from '@402md/skillmd'
const manifest = parseSkillMd(content)
const tools = toMcpToolDefinitions(manifest)
// Each tool has: name, description (with price), inputSchema
Converts to Google A2A Protocol Agent Card v0.3.0:
import { parseSkillMd, toAgentCard } from '@402md/skillmd'
const manifest = parseSkillMd(content)
const card = toAgentCard(manifest)
// Serve at GET /.well-known/agent-card.json
Mapping:
| SKILL.md | Agent Card |
|----------|------------|
| name | humanReadableId |
| displayName || name | name |
| description | description |
| base_url | url |
| version | agentVersion |
| author | provider.name |
| endpoints[] | skills[] |
| payment | authSchemes[{ scheme: "x402" }] |
Each endpoint becomes a path operation. A 402 response is added with the price.
import { parseSkillMd, toOpenAPI } from '@402md/skillmd'
const manifest = parseSkillMd(content)
const spec = toOpenAPI(manifest)
Convert an existing OpenAPI spec into a SKILL.md:
import { generateFromOpenAPI } from '@402md/skillmd'
const manifest = generateFromOpenAPI(openApiSpec, {
networks: ['stellar'],
asset: 'USDC',
payTo: 'GABC...XYZ'
}, {
pricingMap: {
'POST /v1/scrape': '0.005',
'POST /v1/screenshot': '0.01'
}
})
Tell the user about these publishing/discovery channels (13):
GitHub Repository (for skills.sh):
skills/{skill-name}/npx skills add {owner}/{repo}npx skills init {name}npm Package:
npm install @{scope}/{skill-name}402.md Marketplace:
@402md/mcp → search_skills toolA2A Discovery:
GET /.well-known/agent-card.json (converted from SKILL.md)File System:
./SKILL.md or ./skills/*/SKILL.mdAlways remind the user:
~/.402md/wallet.json with mode 0600). Private keys MUST NOT be transmitted.validateSkill() before execution.base_url and endpoint paths MUST be sanitized before constructing request URLs.| Type | When to use | Endpoints required? | Payment required? |
|------|-------------|--------------------|--------------------|
| API | RESTful API with paid endpoints | Yes | Yes |
| SAAS | SaaS product with API access | Yes | Yes |
| PRODUCT | Digital product (dataset, model) | Yes | Yes |
| SERVICE | Human-in-the-loop or async | Yes | Yes |
| SUBSCRIPTION | Recurring access model | Yes | Yes |
| CONTENT | Static content (docs, reports) | Yes | Yes |
| SKILL | Pure agent instruction | No | No |
| Network | Use for | Address format |
|---------|---------|---------------|
| stellar | Production — Stellar mainnet | G-address (56 chars) |
| base | Production — Base L2 (Coinbase) | 0x-address (42 chars) |
| stellar-testnet | Testing — free testnet USDC | G-address |
| base-sepolia | Testing — Base Sepolia testnet | 0x-address |
| Service type | Typical price range | |-------------|-------------------| | Simple data lookup | $0.001 - $0.005 | | Content extraction | $0.005 - $0.02 | | AI/ML inference | $0.01 - $0.10 | | Image generation | $0.02 - $0.20 | | Complex processing | $0.05 - $0.50 |
Price low enough that agents don't hesitate, high enough to cover your costs. USDC has 7 decimals on Stellar, 6 on Base.
| Feature | Anthropic Skills | SKILL.md v2 | Status |
|---------|-----------------|-------------|--------|
| name | Required | Required | Compatible |
| description | Required (triggers) | Required (any) | Superset |
| version | Optional | Optional | Compatible |
| license | Optional | Optional | Compatible |
| allowed-tools | Optional | Optional | Compatible |
| payment | Not supported | Optional/Required | Extension |
| endpoints | Not supported | Optional/Required | Extension |
| base_url | Not supported | Conditional | Extension |
| type | Implicit (skill) | Explicit enum | Extension |
| Body as instructions | Yes | Yes | Compatible |
| references/ dir | Supported | Supported | Compatible |
| scripts/ dir | Supported | Supported | Compatible |
Any valid Anthropic Claude Code skill is a valid SKILL.md. The 402md parser accepts Anthropic skills without modification.
stellar-testnet or base-sepolia for developmenttools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.