---
name: clashofcoins-agentcash-validator
description: Use when an agent should use AgentCash to discover, validate, and smoke-test a live Clash of Coins deployment end to end, then write concise reusable integration notes or a follow-up skill for other agents.
---

# Clash of Coins AgentCash Validator

Use this skill when the task is to validate a live Clash of Coins deployment with minimal context bloat.

## Scope

- Surfaces: gateway root, sale, and shop
- Purpose: discovery validation and contract consistency checks
- Mode: one target origin per validation pass

## Functional Coverage (Validation Matrix)

- Root gateway validation:
  - discovery docs (`/`, `/openapi.json`, `/openapi.full.json`, `/mcp.json`, `/skills/index.json`)
  - aggregated routing index (`/catalog`)
  - skills and agent documents (`/skill.md`, `/.well-known/agent.json`, `/.well-known/agents.json`)
- Sale validation:
  - protocol discovery for x402/MPP
  - offers, quote, buy probe, and status route checks under `/agentic/*`
  - payable-flow sanity: unpaid vs paid retry expectations
- Shop validation:
  - `/shop/*` discovery docs and OpenAPI variants
  - anonymous + recipient-scoped catalog behavior
  - offers, quote, buy probe, and status route checks under `/shop/*`
  - recipient constraint validation for quote/buy
- Cross-surface checks:
  - `GET /catalog` route correctness (`sale` items never map to `/shop/*`, and vice versa)
  - mismatch reporting with endpoint, status, and evidence
- Agent-wallet checks (if enabled on this deployment):
  - `GET /agent-wallet/` (source of truth for `fundingProtocol` and `fundingRoute`)
  - `POST /agent-wallet/orders`
  - `POST /agent-wallet/<fundingProtocol>/fund` (expect auto sweep+finalize on successful paid call)
  - `GET /agent-wallet/orders/{orderId}`
  - `GET /agent-wallet/<fundingProtocol>/purchases/{paymentReference}`
  - verify `/agent-wallet/` exposes `fundingProtocol` and `supportedPurchaseProtocols` consistent with live sale/shop protocol availability
  - verify OpenAPI `x-bazaar` and `agent-wallet` path hints stay aligned with runtime behavior

## Use This Skill When

- you need a smoke-test pass before deeper integration
- discovery metadata might be stale or inconsistent
- you must produce a compact handoff for follow-up agents

## Do Not Use This Skill When

- the user asked to directly execute a known purchase flow without validation
- the task is a narrow sale-only or shop-only build task

## Compatible Agents

- AgentCash and OpenClaw style discovery agents
- direct HTTP agents validating `OpenAPI`, `llms.txt`, `skill.md`, and `/.well-known/*`
- MCP-aware agents that first inspect `GET /mcp.json`

## Interaction Modes

- smoke-test one origin
- compare discovery metadata against live endpoints
- produce a compact handoff for follow-up agents

Load this skill alone first. Do not preload the other Clash of Coins skills unless the task becomes narrower and clearly sale-only or shop-only.

## Goal

Do three things in order:

1. discover the live deployment from the target origin
2. validate the reachable endpoints for the enabled protocol on that origin
3. produce a compact handoff that other agents can reuse without re-learning the service

## Pick One Origin

Never mix origins during the first pass.

- x402 sale/shop origin: `https://x402.clashofcoins.com`
- mpp sale/shop origin: `https://mpp.clashofcoins.com`

If the user says `mpp`, stay on the `mpp` origin.
If the user says `x402`, stay on the `x402` origin.
If the user says only "Clash of Coins", start from the origin they gave you or ask for one target origin.

## Source Of Truth

Trust live discovery more than prior chat history.

Read in this order:

1. `GET /`
2. `GET /health`
3. `GET /openapi.json`
4. `GET /openapi.full.json`
5. `GET /x402/cheap-health` if advertised in x402 discovery
6. `GET /mcp.json`
7. `GET /skills/index.json`
8. `GET /catalog`
9. `GET /.well-known/agent.json`
10. `GET /.well-known/agents.json`
11. `GET /llms.txt`
12. `GET /skill.md`

If agent-wallet flow is advertised in root discovery/OpenAPI, also read:

1. `GET /agent-wallet`
2. use `fundingProtocol`/`fundingRoute` from `GET /agent-wallet/` as canonical runtime hints
3. `POST /agent-wallet/orders` (schema/probe only when safe)
4. `POST /agent-wallet/<fundingProtocol>/fund` (expect `402` on unpaid probe)
5. `GET /agent-wallet/orders/{orderId}` (status semantics, especially auto-execution outcomes)

If shop is relevant, also read:

1. `GET /shop`
2. `GET /shop/health`
3. `GET /shop/openapi.json`
4. `GET /shop/openapi.full.json`
5. `GET /shop/llms.txt`
6. `GET /shop/skill.md`

Read `/.well-known/x402` when validating x402 expectations; `404` means x402 resources are disabled on this deployment.
Read `/.well-known/mpp` when MPP is expected on this deployment.
Infer active payable protocols from `/openapi.json` and buy-route behavior, not from `/.well-known/x402` status alone.

## Surface Model

There are two separate product surfaces sharing one gateway family:

- `sale`: root + `/agentic/*`
- `shop`: `/shop/*`

Do not confuse them.

- `sale` is for NFT/presale lots
- `shop` is for in-game items like keys, gems, packs
- `GET /catalog` may aggregate both in one response, but every item still has to be bought through its own surface-specific route

## Recipient Rule

Shop catalog reads can be anonymous, but purchases cannot.

Before quoting or buying a shop item, obtain exactly one of:

- `nickname`
- `address`

You may call `GET /shop/api/shop/items` without a recipient to read the general catalog.
Never send both `nickname` and `address`.

## Validation Order

Validate cheap discovery routes before any payment flow.

Start by checking whether `GET /catalog` returns both sale and shop items together with purchase metadata that points to the correct surface.

### Sale

If `x402` is enabled:

- `GET /agentic/x402/offers`
- `GET /agentic/x402/quote` with a real sale id if required by the contract
- `GET /agentic/x402/buy` probe if supported

If `mpp` is enabled:

- `GET /agentic/mpp/capabilities`
- `GET /agentic/mpp/offers`
- `POST /agentic/mpp/quote`
- `GET /agentic/mpp/buy` probe if supported

### Shop

Start with the general catalog or use a real `nickname` or `address` when personalized offers matter:

- `GET /shop/api/shop/items`

If `x402` is enabled:

- `GET /shop/x402/offers?nickname=<player>` or `?address=<0x...>`
- `POST /shop/x402/quote`
- `GET /shop/x402/buy` probe if supported

If `mpp` is enabled:

- `GET /shop/mpp/offers?nickname=<player>` or `?address=<0x...>`
- `POST /shop/mpp/quote`
- `GET /shop/mpp/buy` probe if supported

## Payment Rules

### x402

- the first unpaid buy request may return `402 payment_required`
- paid retry must preserve the exact same method and JSON body
- use canonical `PAYMENT-SIGNATURE`
- if challenge data is provided, preserve `resource` and one `accepted` requirement

### MPP

- prefer the canonical `mppx` SDK
- do not hand-roll MPP unless the task explicitly requires manual verification
- if manual MPP is unavoidable, use `Authorization: Payment`
- for Tempo hash-based credentials, use `credential.payload.type = "hash"` and `credential.payload.hash`

## AgentCash-Specific Behavior

When using AgentCash:

- let AgentCash discover enabled protocols from the live origin first
- if MCP is available, record that `GET /mcp.json` advertises the stdio setup and tool surface
- do not hardcode x402 routes while testing an `mpp` origin
- do not hardcode `x402.clashofcoins.com/shop` when validating `mpp.clashofcoins.com`
- if discovery and endpoint behavior disagree, report the exact mismatch with URLs and responses

## What To Report

Always return:

1. enabled protocols on the chosen origin
2. which sale routes work
3. which shop routes work
4. whether shop discovery links point to the correct origin
5. whether offers, quote, and buy probe are consistent
6. any mismatch between root discovery, shop discovery, skills, llms, and actual live endpoints

Use concrete URLs and statuses.
If something fails, say which endpoint, what status, and what body or error was returned.

## Final Handoff Format

End with a compact reusable handoff for other agents:

- target origin
- enabled protocols
- correct discovery order
- exact sale buy endpoint
- exact shop buy endpoint
- recipient requirement for shop
- canonical payment rule for the active protocol
- known gotchas

If the service behavior was confusing, add:

- "I need a skill so other agents can follow this exact flow without rediscovering it."

## Do Not Do

- do not preload every Clash of Coins skill on day one
- do not mix `x402` and `mpp` domains in the same validation pass
- do not infer protocol availability from memory
- do not buy or quote shop items without a recipient
- do not claim MPP is broken if only manual credentials failed while `mppx` was not tried
- do not call a response "wrong" without naming the endpoint and quoting the conflicting live contract
