ap2-agentic-payments/skills/ap2-a2a-extension/SKILL.md
Implement AP2 as an A2A extension — mandate DataParts in A2A messages, Agent Card AP2 capabilities, payment-specific task flows, and inter-agent payment communication. Use when integrating AP2 payment capabilities into A2A multi-agent systems.
npx skillsauth add orcaqubits/agentic-commerce-claude-plugins ap2-a2a-extensionInstall 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.
Fetch live docs:
https://ap2-protocol.org/specification/ for the A2A extension specificationhttps://ap2-protocol.org/topics/ap2-a2a-and-mcp/ for protocol integration detailssite:github.com google-agentic-commerce AP2 a2a extension for reference implementationsite:github.com google-agentic-commerce AP2 samples a2a for A2A-based samplesAP2 is designed as a direct extension of the A2A protocol. It adds payment-specific capabilities to A2A's general-purpose agent-to-agent communication:
As the documentation states: "A2A is required to standardize intra-agent communication — as soon as you have more than one agent you need A2A." AP2 adds payment standardization on top.
AP2 agents declare payment support in their Agent Card:
{
"name": "MerchantAgent",
"capabilities": {
"extensions": [
{
"description": "AP2 Payment Extension",
"required": true,
"uri": "https://ap2-protocol.org/extension/v1"
}
]
},
"skills": [
{
"id": "checkout",
"name": "Cart and Payment",
"description": "Handles product search and cart creation",
"tags": ["ap2", "payment", "commerce"]
}
],
"security": [...],
"securitySchemes": {...}
}
AP2 mandates are transmitted as DataParts within A2A messages:
Each phase of the AP2 flow maps to A2A tasks:
A2A messages carrying AP2 mandates include:
{
"role": "user",
"parts": [
{
"type": "text",
"text": "I want to buy a coffee maker"
},
{
"type": "data",
"data": {
"intent_mandate": { ... }
}
}
]
}
┌─────────────────────────────┐
│ AP2 (Mandates, VDCs, Signing)│
├─────────────────────────────┤
│ A2A (Tasks, Messages, Parts) │
├─────────────────────────────┤
│ HTTP / JSON-RPC 2.0 │
└─────────────────────────────┘
Shopping Agents discover AP2-capable merchants by:
.well-known/agent-card.json or registries)capabilities.extensions[]The reference samples include a watch.log that captures:
This is valuable for debugging the A2A ↔ AP2 integration.
Fetch the specification for exact A2A extension schema, DataPart structures for mandates, and Agent Card AP2 capability declaration before implementing.
development
Build with Spree's headless Next.js storefront — the official `spree/storefront` repo (Next.js 16 App Router with Server Actions and Turbopack, React 19 Server Components, Tailwind CSS 4, TypeScript 5, `@spree/sdk`, Sentry), server-only auth (httpOnly JWT cookies + publishable key), MeiliSearch faceted catalog, one-page checkout with Apple/Google Pay/Klarna/Affirm/SEPA, multi-region market routing, GA4 + JSON-LD SEO, and Vercel/Docker deployment. Use when forking or customizing the storefront, or evaluating headless adoption.
tools
Build Spree extensions as Rails engines — gem scaffolding, `bin/rails g spree:extension`, mounting routes/migrations/assets, the modern `prepend` decorator pattern (`*_decorator.rb` with `self.prepended(base)`), generators (`spree:model_decorator`, `spree:controller_decorator`), the four customization surfaces in preference order (Events > Webhooks > Dependencies > Decorators), Spree::Dependencies for swapping service objects, gem release/versioning, and the deprecated Deface engine. Use when building a reusable Spree extension or adding non-trivial customization to an app.
development
Build with Spree's event bus and Webhooks 2.0 — `Spree::Events` publication, `Spree::Subscriber` DSL with `subscribes_to` and `on`, wildcard matching, lifecycle events (`{model}.created/.updated/.deleted` via `publishes_lifecycle_events`), the canonical event catalog (order.*, payment.*, shipment.*, product.*), Webhooks 2.0 endpoints, HMAC-SHA256 signing (`X-Spree-Webhook-Signature`), exponential-backoff retries, and Sidekiq job orchestration. Use when wiring event-driven business logic, building webhook consumers, or replacing ActiveSupport callback chains.
tools
Cross-cutting Spree development patterns — the customization preference hierarchy (Events > Webhooks > Dependencies > Decorators), `Spree::Dependencies` service-object swapping, the `_decorator.rb` + `prepend` + `self.prepended` idiom, idempotent subscribers and webhook receivers, multi-store scoping discipline, prefixed IDs, calculator polymorphism (shipping/promotion/tax share the base), service-object composition with `dry-monads` or simple results, why to avoid `class_eval` reopening and Deface, and Spree-on-Rails idioms (Hotwire/Turbo Stimulus, ActiveStorage, Action Cable, Sidekiq). Use when designing the architecture of a Spree extension or solving cross-cutting concerns.