/ucp-agentic-commerce:ucp-dev-patternsfrom ucp-agentic-commerce
UCP development patterns covering capability negotiation, idempotency implementation, error resolution loops, multi-binding servers, and production architecture for UCP implementations.
Ships in ucp-agentic-commerce. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fetch live reference: Web-search site:ucp.dev specification reference for the latest data model definitions and enum values. Also check https://ucp.dev/latest/specification/overview/ for architectural guidance.
Every request/response pair involves negotiation:
UCP-Agent header with its profile URIucp objectCaching: Cache the platform profile with a TTL (e.g., 5 minutes). Don't re-fetch on every request.
Version compatibility: If platform version > business version, return version_unsupported. If platform version <= business version, process using the platform's version semantics.
Every mutating operation uses Idempotency-Key (UUID):
Storage: Use Redis, database table, or in-memory store depending on scale. Key = idempotency_key, Value = serialized response + status code.
Race condition: If two identical requests arrive simultaneously, use locking (database row lock, Redis SETNX) to ensure only one processes.
The core Platform pattern for driving checkout to completion:
1. Create checkout
2. LOOP:
a. Inspect status
b. If "incomplete": read messages, resolve recoverable errors, update checkout, goto 2
c. If "requires_escalation": surface continue_url to user, wait, goto 2
d. If "ready_for_complete": acquire payment credential, call complete
e. If "complete_in_progress": payment is being processed, poll/wait, goto 2
f. If "completed": done — extract order
g. If "canceled": done — report to user
3. Timeout after N iterations or session expiry
Error resolution heuristics:
missing_shipping_address → prompt user for address, update checkoutmissing_email → prompt user for email, update checkoutinvalid_cart_items → item unavailable, suggest alternatives or removediscount_code_invalid → inform user, remove codeA single Business server can support REST + MCP + A2A simultaneously:
app/
├── core/
│ ├── checkout_service.py # Shared business logic (binding-agnostic)
│ ├── negotiation.py # Capability negotiation
│ └── models.py # UCP data models (from SDK)
├── bindings/
│ ├── rest/
│ │ └── routes.py # REST endpoints
│ ├── mcp/
│ │ └── tools.py # MCP tool handlers
│ └── a2a/
│ └── agent.py # A2A agent message handler
└── discovery.py # /.well-known/ucp serving all bindings
The key: all bindings share the same core business logic. The binding layer only handles transport-specific concerns (HTTP headers vs JSON-RPC envelope vs A2A message parts).
2999.items_discount, subtotal, discount, fulfillment, tax, fee, total.Business (sender):
Platform (receiver):
event_idRequest-Signature before processingcreated_time to determine freshness)Always check these for the latest developments before major implementation decisions:
What SKILL.md sets; muted values are Claude Code's defaults
23 skills in this plugin
/ucp-ap2-mandatesImplement UCP AP2 Mandates extension — cryptographic payment mandates for fully autonomous agent commerce using SD-JWT credentials, merchant authorization signatures, and the Agent Payments Protocol. Use when building autonomous agent payment flows without human-in-the-loop./ucp-buyer-consentImplement the UCP Buyer Consent extension — GDPR/CCPA consent collection, consent fields in checkout sessions, and privacy-compliant consent management. Use when adding consent flows, privacy compliance, or data processing agreements to UCP checkout./ucp-cartImplement the UCP Cart capability (`dev.ucp.shopping.cart`) — a lightweight CRUD surface for collecting line items before purchase intent exists, and its conversion into a Checkout session. Use when building pre-checkout item collection, shareable carts, or cart-recovery flows over REST, MCP, or Embedded bindings.npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin ucp-agentic-commerceOther plugins' skills for the same job