npx skills add ...
npx skills add vercel-labs/agentic-commerce-skills --skill ucp
Expert-level implementation assistant for the Universal Commerce Protocol (UCP). Provides comprehensive tooling for adding UCP support to Next.js ecommerce codebases — from initial consultation through full implementation, testing, and validation.
npx skills add vercel-labs/agentic-commerce-skills --skill ucp
ucp.config.jsonCheck in this order:
./ucp/ — User's local copy (use as-is)./.ucp-spec/ — Previously cloned spec (update it)When cloning is needed:
If HTTPS fails, try SSH:
When ./.ucp-spec/ exists:
After cloning, ensure .ucp-spec/ is in .gitignore:
.gitignore if it exists.ucp-spec/ or .ucp-spec is already listed.ucp-spec/ on a new line./ucp.config.json at project root
| Field | Type | Description |
|---|---|---|
ucp_version | string | UCP spec version (date-based) |
roles | string[] | One or more of: business, platform, payment_provider, host_embedded |
runtime | string | nodejs (default) or bun |
capabilities.core | string[] | Required capabilities to implement |
capabilities.extensions | string[] | Optional extensions to implement |
transports | string[] | Enabled transports: rest, mcp, a2a, embedded |
transport_priority | string[] | Order to implement transports |
payment_handlers | string[] | Payment handler IDs to support |
features.ap2_mandates | boolean | Enable AP2 mandate signing |
features.identity_linking | boolean | Enable OAuth identity linking |
features.multi_destination_fulfillment | boolean | Enable multi-destination shipping |
domain | string | Business domain for /.well-known/ucp |
existing_apis | object | Map of existing API endpoints to analyze |
policy_urls | object | URLs for privacy, terms, refunds, shipping policies |
scaffold_depth | string | types | scaffolding | full |
generated_files | string[] | Files created by scaffold (for tracking) |
answers | object | Raw answers to qualifying questions |
User runs /ucp with no sub-command
Display help listing all available sub-commands:
User runs /ucp init
Bootstrap UCP in a project: clone spec, create config, ask essential questions.
./ucp/ exists
./.ucp-spec/ exists
git pull to update.ucp-spec/ to .gitignore./ucp.config.json existsQ1: What role(s) are you implementing?
If user selects multiple roles, WARN:
"Implementing multiple roles is unusual. This is typically for marketplace/aggregator scenarios. Are you sure?"
Q2: What runtime will you use?
NOTE: If user mentions Edge, respond:
"Edge runtime is not supported for UCP implementations. Please choose Node.js or Bun."
Q3: What is your business domain?
/.well-known/ucpshop.example.comQ4: Which transports do you need at launch?
Create ./ucp.config.json with:
ucp_version set to latest from specUser runs /ucp consult
Walk through all 12 qualifying questions, update config, produce implementation roadmap.
/ucp init first)Read ./ucp.config.json and use existing answers as defaults.
Ask each question. If already answered in config, show current value and ask to confirm or change.
Q1: Are we implementing the business side, the platform side, or both?
roles in configQ2: Which UCP version and which capabilities/extensions are in scope?
dev.ucp.shopping.checkout (required)dev.ucp.shopping.fulfillmentdev.ucp.shopping.discountdev.ucp.shopping.buyer_consentdev.ucp.shopping.ap2_mandatedev.ucp.shopping.orderdev.ucp.common.identity_linkingQ3: Which payment handlers do we need?
Q4: Do we need AP2 mandates and signing key infrastructure?
features.ap2_mandates: truefeatures.ap2_mandates: falseQ5: Do we need fulfillment options and multi-group/multi-destination support?
features.multi_destination_fulfillment: trueQ6: Do we need discounts, buyer consent capture, or identity linking?
dev.ucp.shopping.discount to extensionsdev.ucp.shopping.buyer_consent to extensionsdev.ucp.common.identity_linking, set features.identity_linking: trueQ7: What are the existing checkout and order APIs we should map to UCP?
existing_apis object/api/checkout, /api/cart, /api/ordersQ8: What are the required policy URLs?
policy_urls objectQ9: What authentication model is required for checkout endpoints?
answers.authentication_modelQ10: Who will receive order webhooks and what event cadence is required?
order.created, order.updated, order.fulfilled, order.canceledanswers.webhook_configQ11: Do we need to support MCP, A2A, or embedded checkout at launch?
transports arraytransport_priority orderQ12: What is the business domain that will host /.well-known/ucp?
domain fieldWrite all answers to ./ucp.config.json
Based on answers, produce a roadmap:
User runs /ucp plan
Generate detailed implementation plan with specific files and order of operations.
./ucp.config.jsonFor each capability/transport, list files to create/modify.
Example output:
Store the plan in answers.implementation_plan for scaffold reference.
User runs /ucp gaps
Deep analysis of existing codebase against UCP requirements. Uses AST parsing and data flow tracing.
Scan for:
app/api/**, pages/api/**)For each relevant file:
Analyze against UCP requirements:
| Requirement | Status | Finding |
|---|---|---|
| Discovery profile at /.well-known/ucp | MISSING | No route found |
| Checkout session creation | PARTIAL | Found /api/checkout but missing UCP fields |
| Status lifecycle | MISSING | No status state machine |
| Capability negotiation | MISSING | No UCP-Agent header handling |
| Payment handler support | PARTIAL | Stripe exists but not UCP-compliant |
| Response metadata (ucp object) | MISSING | Responses don't include ucp field |
User runs /ucp scaffold
Generate full working UCP implementation based on config and plan.
/ucp plan first, or scaffold will generate one)Ask user:
"What level of code generation do you want?"
- types: TypeScript interfaces and Zod schemas only
- scaffolding: Structure with TODO markers for business logic
- full: Complete working implementation (recommended)
Store choice in config.scaffold_depth
Identify required packages based on config:
zod — Always neededjose — If AP2 mandates or webhook signing enableduuid — For session ID generationAsk before installing:
"The following packages are required: zod, jose, uuid" "Install now? (npm install / bun add)"
If yes, run appropriate install command.
Generate files according to plan. For each file:
config.generated_filesWhen MCP transport is enabled in config, generate these additional files.
IMPORTANT: Use @modelcontextprotocol/sdk@1.25.2 or later — earlier versions have security vulnerabilities.
Set these in Vercel Dashboard → Settings → Environment Variables:
| Variable | Required | Description |
|---|---|---|
UCP_DOMAIN | Yes | Production domain (e.g., shop.example.com) |
UCP_SIGNING_KEY | If AP2 | JWS signing key (PEM or JWK) |
STRIPE_SECRET_KEY | If Stripe | Stripe API secret key |
Option 1: Direct HTTP (if client supports streamable HTTP) Add to MCP client config:
Option 2: Via mcp-remote bridge (for stdio-only clients)
When running /ucp scaffold with Vercel deployment, verify:
vercel.json created with function timeoutsnext.config.js updated for MCP streamingapp/api/mcp/[transport]/route.tsscripts/test-mcp.mjs.env.example updated with required variablesAfter deploying to Vercel:
Check discovery profile:
Test MCP endpoint:
Configure MCP client: Add the server to Claude Desktop, Cursor, or your preferred MCP client.
Verify in client: Ask the AI to "list available UCP tools" — it should show the checkout tools.
After generation, update ucp.config.json:
generated_files arrayscaffold_depth to reflect what was generatedUser runs /ucp validate
Validate the implementation against UCP JSON schemas.
/ucp scaffold first)Read JSON schemas from spec:
spec/schemas/shopping/checkout.jsonspec/schemas/shopping/fulfillment.jsonspec/schemas/shopping/discount.jsonspec/discovery/profile_schema.json/.well-known/ucp route (or read file directly)profile_schema.jsonFor each implemented endpoint:
Verify:
ucp objectUser runs /ucp profile
Generate and display the /.well-known/ucp discovery profile JSON.
Use the generateProfile() function from lib/ucp/profile.ts (or generate inline if not scaffolded yet).
Output the formatted JSON:
Ask: "Write this to public/.well-known/ucp for static serving, or keep as dynamic route?"
If static:
public/.well-known/ucp (no extension, JSON content)User runs /ucp test
Generate unit tests for UCP handlers.
Look for:
jest.config.js / jest.config.ts → Jestvitest.config.js / vitest.config.ts → Vitestpackage.json test script hintsFor each handler, generate corresponding test file.
User runs /ucp docs
Generate internal documentation for the UCP integration.
Create docs/ucp-integration.md:
incomplete → requires_escalation → ready_for_complete → complete_in_progress → completed ↘ canceled
UCP-Agent: profile="https://platform.example.com/.well-known/ucp"
Validate implementation against UCP schemas:
Generated documentation: CREATE docs/ucp-integration.md
Documentation includes:
project/ ├── app/ │ ├── .well-known/ │ │ └── ucp/ │ │ └── route.ts # Discovery profile │ └── api/ │ └── ucp/ │ ├── checkout/ │ │ ├── route.ts # POST create │ │ └── [id]/ │ │ └── route.ts # GET, PATCH, POST complete │ ├── mcp/ │ │ └── route.ts # MCP transport (if enabled) │ └── a2a/ │ └── route.ts # A2A transport (if enabled) ├── lib/ │ └── ucp/ │ ├── types/ │ │ ├── checkout.ts │ │ └── index.ts │ ├── schemas/ │ │ └── checkout.ts │ ├── handlers/ │ │ ├── checkout.ts │ │ ├── fulfillment.ts │ │ ├── discount.ts │ │ └── payment.ts │ ├── transports/ │ │ └── mcp.ts │ ├── profile.ts │ ├── negotiation.ts │ └── response.ts ├── docs/ │ └── ucp-integration.md ├── ucp.config.json └── .ucp-spec/ # Cloned spec (gitignored)
Or for Bun:
route.ts) not API Routes (pages/api)NextRequest and NextResponse from next/serverrequest.json() for body parsingrequest.headers.get() for header accessWhen a feature requires credentials, ask:
"AP2 mandates require a JWS signing key (ES256 recommended). Do you have an existing key pair, or should I explain how to generate one?"
If user needs generation instructions:
Credentials should be stored in environment variables, not in config:
UCP_SIGNING_KEY - Private key (PEM or JWK)UCP_OAUTH_CLIENT_ID - OAuth client IDUCP_OAUTH_CLIENT_SECRET - OAuth client secret./ucp/docs/ or ./.ucp-spec/docs/