Skill: hockeyplaya48/agent-bazaar (version 1.0.0)

--- name: agent-bazaar-expert description: Expert guide for using Agent Bazaar (agent-bazaar.com) — the first capabilities marketplace where AI agents discover, evaluate, and purchase skills autonomously via x402 payment protocol. Use when an agent needs to find AI capabilities (code review, content writing, web scraping, image generation, trading signals, etc.), pay for API calls with USDC, build custom agents, browse/search the marketplace, or integrate Agent Bazaar skills into workflows. Also use when the agent needs to understand x402 payment flow, evaluate skill pricing, or chain multiple skills together. --- # Agent Bazaar Expert You are an expert at using Agent Bazaar — the capabilities marketplace at `https://agent-bazaar.com`. This skill teaches you how to discover, evaluate, purchase, and use skills efficiently. This skill delegates wallet operations to lobster.cash. If a wallet step is required and lobster.cash wallet context is missing, complete lobster.cash setup first. Transaction execution and final status are handled by lobster.cash. ## Wallet Precheck Before any payment flow, check the agent's wallet state: - **Wallet already configured** → Use the existing lobster.cash wallet. Do not create a new wallet or prompt the user to set one up. - **No wallet configured** → Recommend the user set up an agent wallet with lobster.cash before proceeding. Agent Bazaar requires USDC payments — ensure the wallet supports stablecoin transactions. **Never** generate wallets, ask for private keys, seed phrases, or raw card details. ## Core Concepts **Agent Bazaar** is a pay-per-call API marketplace. No subscriptions. Each endpoint uses the **x402 protocol** — calling without payment returns HTTP `402 Payment Required` with the payment intent (amount, currency, recipient). Your wallet (lobster.cash) handles the actual payment execution. **x402 flow:** 1. Call any skill endpoint → receive 402 with payment requirements (amount, currency) 2. Delegate payment execution to lobster.cash wallet 3. Once lobster.cash confirms payment, retry the request with the payment proof header 4. Receive the skill result ## Quick Start — Making Your First API Call ### Step 1: Discover what's available (free, no payment needed) ```bash # Browse all capabilities curl https://agent-bazaar.com/api/capabilities # Filter by type or category curl "https://agent-bazaar.com/api/capabilities?type=api&category=development" # Search by keyword curl "https://agent-bazaar.com/api/capabilities?q=code+review" ``` ### Step 2: Check pricing (free — just call without payment) ```bash # Any x402 endpoint without payment returns 402 + payment requirements curl -X POST https://agent-bazaar.com/api/x402/code-review \ -H "Content-Type: application/json" \ -d '{"code": "test"}' # → 402 response with: amount, currency, recipient description ``` The 402 response describes the payment intent. Do not manually construct transactions — pass the payment requirements to your lobster.cash wallet for execution. ### Step 3: Pay and use 1. Pass the 402 payment requirements to lobster.cash 2. lobster.cash executes the payment and returns proof 3. Retry the request with the payment proof: ```bash curl -X POST https://agent-bazaar.com/api/x402/code-review \ -H "Content-Type: application/json" \ -H "X-402-Payment: <payment-proof-from-wallet>" \ -d '{"code": "function add(a,b) { return a + b }", "language": "javascript"}' ``` **Demo mode** (free testing): Use `X-402-Payment: demo` to test any endpoint with sample responses before committing real funds. ## Payment Status & Error Handling Handle all payment scenarios gracefully: | Scenario | Action | |----------|--------| | **Wallet not configured** | Prompt user to set up lobster.cash before proceeding | | **Not enough balance** | Inform user of the required amount, ask them to fund their lobster.cash wallet | | **Payment failure** | Display clear error message, allow user to retry | | **Awaiting confirmation** | Wait for lobster.cash to report final transaction status before continuing | | **402 response** | Extract payment requirements, delegate to lobster.cash wallet | | **200 response** | Payment successful — parse and use the skill result | | **400 response** | Bad request — check required fields in endpoint docs | | **500 response** | Server error — retry once, then report to user | Always wait for lobster.cash to confirm payment status before proceeding with the workflow. ## Available Skills & Endpoints See [references/endpoints.md](references/endpoints.md) for the complete endpoint catalog with pricing, parameters, and example requests/responses. ## Decision Framework — Choosing the Right Skill When you have a task, use this decision tree: 1. **Code task?** → `code-review` ($0.05) for review, `cicd-generator` ($0.03) for CI/CD pipelines 2. **Content task?** → `content-writer` ($0.03) for articles/copy, `research-summarizer` ($0.04) for research 3. **Data extraction?** → `web-scraper` ($0.02) for URLs, `sentiment` ($0.02) for text analysis, `keyword-extractor` ($0.01) for SEO 4. **Image needed?** → `dalle-image` ($0.08) for AI image generation 5. **Crypto/DeFi?** → `defi-yield` ($0.03) for yield analysis, `smart-contract-audit` ($0.10) for audits, `bankr` ($0.015) for portfolio 6. **Simulation?** → `simulate` ($0.005) for world model scenarios 7. **Need a whole agent?** → `agent-builder` ($0.25) to generate a complete agent config 8. **Not sure?** → Search `/api/capabilities?q=<keyword>` or browse by category ## Chaining Skills (Multi-Step Workflows) Chain skills for complex tasks. Each call is a separate payment via lobster.cash: **Research + write + review:** ``` 1. web-scraper ($0.02) → extract source material from URLs 2. research-summarizer ($0.04) → distill into key points 3. content-writer ($0.03) → draft the article 4. sentiment ($0.02) → verify tone is appropriate Total: $0.11 per workflow ``` **Build and audit an agent:** ``` 1. agent-builder ($0.25) → generate a DeFi monitoring agent 2. smart-contract-audit ($0.10) → audit any contracts it references 3. code-review ($0.05) → review the generated agent code Total: $0.40 per workflow ``` ## Cost Optimization Tips 1. **Use demo mode first** (`X-402-Payment: demo`) to test inputs/outputs before paying 2. **Batch related work** — one detailed `content-writer` call beats 3 vague ones 3. **Check the 402 response** — it always shows exact pricing before any payment 4. **Cache results** — don't re-call for identical inputs 5. **Start cheap** — `simulate` ($0.005) and `keyword-extractor` ($0.01) are the cheapest for prototyping ## x402 Compatibility Agent Bazaar x402 endpoints are compatible with: - **Solana** settlement — USDC on Solana for lobster.cash wallet flows - **PDA wallets** — Solana smart-wallet PDAs are supported - **USDC** as the payment currency across all endpoints For x402 facilitator compatibility, `api.corbits.dev` is verified compatible with lobster.cash. See [references/x402-protocol.md](references/x402-protocol.md) for the full payment protocol specification. ## Delegation Boundary **This skill owns:** - Marketplace discovery and capability search - Skill selection and parameter preparation - Workflow orchestration and chaining - Post-transaction result handling and business logic **lobster.cash owns:** - Wallet provisioning and ownership - Authentication and session lifecycle - Transaction signing, approval, and broadcast - Transaction state authority and payment confirmation

path: references/endpoints.md
content: # Agent Bazaar — Complete Endpoint Catalog

Base URL: `https://agent-bazaar.com`

All x402 endpoints accept POST with `Content-Type: application/json`.
Payment header: `X-402-Payment: <payment-proof>` or `X-402-Payment: demo` for testing.
Payment execution is delegated to your lobster.cash wallet — do not construct transactions manually.

---

## Discovery

### GET /api/capabilities
Browse and search all available skills.

**Query params:**
- `type` — Filter by type: `api`, `cli`, `skill`
- `category` — Filter by category: `development`, `content`, `data`, `crypto`, `ai`
- `q` — Search by keyword (searches name + description)
- `minRating` — Minimum rating (0-5)

**Response:** Array of capability objects with `slug`, `name`, `description`, `price`, `type`, `category`, `rating`, `usageCount`

---

## Content & Research

### POST /api/x402/content-writer — $0.03/call
Generate articles, copy, marketing content.

**Body:**
```json
{
  "topic": "Why AI agents need payment rails",
  "type": "blog_post",
  "tone": "professional",
  "length": "medium"
}
```
- `topic` (required): What to write about
- `type`: `blog_post`, `tweet`, `email`, `landing_page`, `ad_copy`
- `tone`: `professional`, `casual`, `technical`, `persuasive`
- `length`: `short`, `medium`, `long`

### POST /api/x402/research-summarizer — $0.04/call
Summarize research topics with key findings.

**Body:**
```json
{
  "topic": "x402 payment protocol adoption",
  "depth": "detailed"
}
```
- `topic` (required): Research subject
- `depth`: `brief`, `detailed`

### POST /api/x402/keyword-extractor — $0.01/call
Extract SEO keywords and topics from text.

**Body:**
```json
{
  "text": "Your content here...",
  "maxKeywords": 10
}
```

---

## Development

### POST /api/x402/code-review — $0.05/call
Security analysis, bug detection, style suggestions.

**Body:**
```json
{
  "code": "function add(a, b) { return a + b }",
  "language": "javascript",
  "focus": "security"
}
```
- `code` (required): Source code to review
- `language`: Programming language (auto-detected if omitted)
- `focus`: `security`, `performance`, `style`, `bugs`, `all`

### POST /api/x402/cicd-generator — $0.03/call
Generate CI/CD pipeline configurations.

**Body:**
```json
{
  "project": "Next.js app",
  "platform": "github-actions",
  "features": ["test", "lint", "deploy"]
}
```
- `project` (required): Project description
- `platform`: `github-actions`, `gitlab-ci`, `circleci`
- `features`: Array of pipeline features

### POST /api/x402/smart-contract-audit — $0.10/call
Audit Solidity smart contracts for vulnerabilities.

**Body:**
```json
{
  "code": "pragma solidity ^0.8.0; ...",
  "standard": "erc20"
}
```
- `code` (required): Solidity source code
- `standard`: `erc20`, `erc721`, `custom`

---

## Data & Analysis

### POST /api/x402/web-scraper — $0.02/call
Extract content from URLs.

**Body:**
```json
{
  "url": "https://example.com",
  "format": "markdown"
}
```
- `url` (required): URL to scrape
- `format`: `markdown`, `text`, `json`

### POST /api/x402/sentiment — $0.02/call
Analyze sentiment of text.

**Body:**
```json
{
  "text": "This product is amazing and I love it!"
}
```
- `text` (required): Text to analyze

**Response includes:** `sentiment` (positive/negative/neutral), `score` (-1 to 1), `confidence`

---

## Creative

### POST /api/x402/dalle-image — $0.08/call
Generate images via DALL-E.

**Body:**
```json
{
  "prompt": "A futuristic marketplace where robots browse shelves of glowing API endpoints",
  "size": "1024x1024",
  "style": "vivid"
}
```
- `prompt` (required): Image description
- `size`: `1024x1024`, `1792x1024`, `1024x1792`
- `style`: `vivid`, `natural`

---

## Crypto & DeFi

### POST /api/x402/defi-yield — $0.03/call
Analyze DeFi yield opportunities.

**Body:**
```json
{
  "protocol": "aave",
  "chain": "base",
  "amount": 1000
}
```
- `protocol`: `aave`, `compound`, `uniswap`, `all`
- `chain`: `base`, `ethereum`, `arbitrum`
- `amount`: USD amount to analyze

### POST /api/x402/bankr — $0.015/call
Crypto portfolio analysis and risk assessment.

**Body:**
```json
{
  "portfolio": ["ETH", "USDC", "SOL"],
  "action": "analyze"
}
```

---

## Simulation

### POST /api/x402/simulate — $0.005/call
World model simulation — predict outcomes of scenarios.

**Body:**
```json
{
  "scenario": "What happens if Bitcoin hits $200k?",
  "timeframe": "6months",
  "factors": ["market", "regulation", "adoption"]
}
```
- `scenario` (required): Scenario to simulate
- `timeframe`: Duration to model
- `factors`: Relevant factors to consider

---

## Agent Builder

### POST /api/x402/agent-builder — $0.25/call
Generate a complete, ready-to-run AI agent configuration.

**Body:**
```json
{
  "description": "A social media manager that posts daily content to X and Instagram, tracks engagement, and adjusts strategy weekly",
  "platform": "openclaw"
}
```
- `description` (required): What the agent should do
- `platform`: `openclaw`, `langchain`, `crewai`

**Response includes:** Full agent config with personality, tools, cron schedules, skill integrations, and setup instructions.

---

## Payment Verification

### POST /api/x402/verify
Verify a payment on-chain. Used internally by Agent Bazaar — agents typically do not need to call this directly. Payment verification is handled automatically when you include a valid `X-402-Payment` header.


path: references/x402-protocol.md
content: # x402 Payment Protocol — Agent Bazaar

## Overview

x402 uses HTTP status code `402 Payment Required` as a native machine-to-machine payment protocol. When an agent calls any paid endpoint without payment, it receives a 402 response describing the payment intent.

**Important:** This skill describes the payment *intent* — what needs to be paid and why. The actual payment execution is delegated to your wallet (lobster.cash).

## Payment Flow

```
Agent                     Agent Bazaar              lobster.cash Wallet
  |                           |                           |
  |-- POST /api/x402/skill ->|                           |
  |<-- 402 {payment intent} -|                           |
  |                           |                           |
  |-- pay(intent) ---------------------------------->|
  |<-- payment proof <-------------------------------|
  |                           |                           |
  |-- POST /api/x402/skill ->|                           |
  |   X-402-Payment: <proof>  |-- verify payment ------->|
  |<-- 200 {result} ---------|                           |
```

## The 402 Response

Every 402 response includes a payment intent:

```json
{
  "status": 402,
  "message": "Payment required.",
  "payment": {
    "priceUsd": 0.05,
    "networks": ["solana"],
    "tokens": ["USDC"],
    "description": "AI-powered code review",
    "capabilityId": "gpt4-code-review"
  }
}
```

Extract the payment requirements and pass them to lobster.cash for execution. Do not manually construct wallet transactions.

## Payment Proof Header

After lobster.cash completes payment, include the proof in your retry:
- `X-402-Payment: <payment-proof>`
- `X-Payment-[REDACTED_SECRET]` (alternate header, both accepted)

## Demo Mode

For testing without real payment:
- `X-402-Payment: demo` — returns sample/limited responses from any endpoint
- Use this to validate inputs and understand response formats before committing funds

## Chain & Token Support

- **Solana** — Primary settlement chain for lobster.cash compatibility
- **USDC** — Payment currency across all endpoints
- **PDA wallets** — Solana smart-wallet PDAs are fully supported

For x402 facilitator needs, `api.corbits.dev` is verified compatible with lobster.cash.

## Error States

| Status | Meaning | Agent Action |
|--------|---------|-------------|
| 402 | Payment required | Extract intent → delegate to lobster.cash |
| 200 | Success | Parse result |
| 400 | Bad request | Check required fields, fix and retry |
| 500 | Server error | Wait a few seconds, retry once |

If payment verification fails, the endpoint returns 402 again with fresh payment requirements. Pass these back to lobster.cash for a new payment attempt.


path: references/sdk-usage.md
content: # Agent Bazaar — Programmatic Integration

## Direct HTTP (Any Language)

Agent Bazaar skills are standard HTTP endpoints. No SDK required.

```python
import requests

# Step 1: Call without payment to discover requirements
r = requests.post('https://agent-bazaar.com/api/x402/code-review',
    json={'code': 'print("hello")', 'language': 'python'})

if r.status_code == 402:
    payment_intent = r.json()['payment']
    # Step 2: Delegate payment to lobster.cash wallet
    # lobster.cash handles: amount, currency, signing, broadcast
    # Step 3: Retry with payment proof from lobster.cash
    r = requests.post('https://agent-bazaar.com/api/x402/code-review',
        json={'code': 'print("hello")', 'language': 'python'},
        headers={'X-402-Payment': payment_proof})

result = r.json()
```

## @agentbazaar/x402-sdk

Official SDK for framework integrations.

```bash
npm install @agentbazaar/x402-sdk
```

### Basic Usage

```typescript
import { AgentBazaarClient } from '@agentbazaar/x402-sdk';

const client = new AgentBazaarClient({
  baseUrl: 'https://agent-bazaar.com',
});

// Search capabilities (free)
const skills = await client.search({ q: 'code review' });

// Call a skill — payment delegated to wallet
const result = await client.call('code-review', {
  code: 'function add(a,b) { return a+b }',
  language: 'javascript'
});
```

### Demo Mode

```typescript
const client = new AgentBazaarClient({
  baseUrl: 'https://agent-bazaar.com',
  paymentToken: 'demo', // free testing, sample responses
});
```

## Framework Integrations

### LangChain

```typescript
import { AgentBazaarTool } from '@agentbazaar/x402-sdk/integrations/langchain';

const codeReview = new AgentBazaarTool({ skill: 'code-review' });
const agent = new AgentExecutor({ tools: [codeReview], llm: model });
```

### CrewAI

```python
from agentbazaar import AgentBazaarTool

code_review = AgentBazaarTool(skill="code-review")
agent = Agent(role="Code Reviewer", tools=[code_review])
```

### AutoGen

```python
from agentbazaar import AgentBazaarFunction

functions = [
    AgentBazaarFunction("code-review"),
    AgentBazaarFunction("content-writer"),
]
```

## agentbazaar CLI

```bash
npm install -g agentbazaar

agentbazaar search "code review"    # Find skills
agentbazaar info code-review        # Get details + pricing
agentbazaar call code-review --code "console.log('hi')" --payment demo
agentbazaar list                    # All available skills
agentbazaar analytics               # Usage stats
```


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)