ap2-setup
Scaffold a new AP2 project — install the SDK, set up agent roles, configure credentials, and create a basic multi-agent payment system. Use when starting a new AP2 agentic payments project from scratch.
Best use case
ap2-setup is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Scaffold a new AP2 project — install the SDK, set up agent roles, configure credentials, and create a basic multi-agent payment system. Use when starting a new AP2 agentic payments project from scratch.
Teams using ap2-setup should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/ap2-setup/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How ap2-setup Compares
| Feature / Agent | ap2-setup | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Scaffold a new AP2 project — install the SDK, set up agent roles, configure credentials, and create a basic multi-agent payment system. Use when starting a new AP2 agentic payments project from scratch.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# AP2 Project Setup
## Before writing code
**Fetch live docs**:
1. Fetch `https://ap2-protocol.org/` for the latest protocol overview
2. Fetch `https://github.com/google-agentic-commerce/AP2` for the current README and installation instructions
3. Web-search `site:github.com google-agentic-commerce AP2 samples python` for the sample project structure
4. Fetch `https://github.com/google-agentic-commerce/AP2/tree/main/samples/python` for Python sample layout
## Conceptual Architecture
### What Setup Involves
An AP2 project creates a multi-agent payment system with distinct roles:
1. **Install the AP2 Python package** from GitHub
2. **Create agent role directories** — Shopping Agent, Merchant, Credentials Provider, Payment Processor
3. **Configure authentication** — Google API key or Vertex AI credentials
4. **Define Agent Cards** — each agent advertises its AP2 capabilities
5. **Set up the agent framework** — Google ADK (Agent Development Kit) is the reference framework
### Installation
```bash
# Requires Python 3.10+ and uv
uv pip install git+https://github.com/google-agentic-commerce/AP2.git@main
```
### Project Structure (Reference from Official Samples)
```
my-ap2-project/
├── roles/
│ ├── shopping_agent/ # Shopping Agent — orchestrates purchases
│ │ ├── __init__.py
│ │ └── agent.py
│ ├── merchant_agent/ # Merchant — product catalog, cart creation
│ │ ├── __init__.py
│ │ └── agent.py
│ ├── credentials_provider_agent/ # CP — payment methods, tokenization
│ │ ├── __init__.py
│ │ └── agent.py
│ └── merchant_payment_processor_agent/ # MPP — payment processing
│ ├── __init__.py
│ └── agent.py
├── .env # GOOGLE_API_KEY or Vertex AI config
├── pyproject.toml
├── run.sh # Launches all agents
└── tests/
└── test_flow.py
```
### Environment Configuration
Two authentication options:
- **Google API Key** (development): Set `GOOGLE_API_KEY` in `.env`
- **Vertex AI** (production): Set `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION`
### Agent Ports (Reference)
Each agent runs on its own port:
- Shopping Agent: port 8000 (with ADK web UI)
- Merchant Agent: separate port
- Credentials Provider: port 8002 (RPC path `/a2a/credentials_provider`)
- Payment Processor: separate port
### Key Dependencies
- **Python 3.10+**
- **uv** — Python package manager (recommended)
- **Google ADK** — Agent Development Kit
- **Gemini 2.5 Flash** — LLM for agent reasoning
- **AP2 types** — `ap2.types` for mandate and payment structures
### Key Decisions During Setup
- **Which roles to implement** — You may implement one role (e.g., just a Merchant) or all four
- **Framework choice** — ADK is reference, but AP2 works with LangGraph, CrewAI, AG2, or any framework
- **Payment methods** — Start with mocked payments for development
- **A2A transport** — Agents communicate via A2A protocol over HTTP
### Best Practices
- Start with the official sample as a template
- Use mocked payment providers for development (no real money)
- Keep each agent role in a separate directory/module
- Use `.env` files for credentials, never hardcode
- Set up logging early — the `.logs/watch.log` pattern from samples is useful
- Test with the "verbose" mode to see all mandate payloads
Fetch the latest GitHub README and sample READMEs for exact setup commands, current package versions, and framework requirements before scaffolding.Related Skills
woo-setup
Install WooCommerce, configure the development stack, and set up a local dev environment with WP-CLI, Docker, or wp-env. Use when setting up a new WooCommerce project or development environment.
webmcp-setup
Set up a WebMCP project — enable Chrome flags, install MCP-B polyfill, scaffold tool registration, and configure development environment. Use when starting a new WebMCP-enabled website from scratch.
ucp-setup
Set up a UCP project — scaffold a merchant server or platform client with discovery profile, SDK installation, and project structure. Use when starting a new UCP implementation.
mpp-setup
Scaffold an MPP project — install mppx SDK, configure payment methods, set up server middleware, and create a basic paid API endpoint. Use when starting a new MPP machine payments project from scratch.
spree-setup
Bootstrap a new Spree project — `create-spree-app` CLI (v5.2+), `spree-starter` Rails backend, the Next.js storefront repo, `bin/rails g spree:install`, sample data, Docker Compose, and the PostgreSQL + Redis + Sidekiq prerequisites. Use when starting a new Spree project from scratch or onboarding an existing repo.
shopify-setup
Set up a Shopify development environment — Shopify CLI installation, Partner account, development stores, environment variables, project structures for themes, apps, and Hydrogen. Use when starting a new Shopify project.
sf-setup
Set up a Salesforce Commerce development environment — sfcc-ci CLI for B2C, sf CLI for B2B, Business Manager access, sandbox management, dw.json configuration, .sfdx project setup, and project structures for SFRA, PWA Kit, and Lightning. Use when starting a new Salesforce Commerce project.
saleor-setup
Set up a Saleor development environment — saleor-platform Docker Compose, CLI, PostgreSQL/Redis prerequisites, manage.py commands, environment variables, project structure. Use when starting a new Saleor project.
nlweb-setup
Bootstrap a local NLWeb development environment from scratch — clone the repo, configure .env, install Python deps via `nlweb init-python`, run `nlweb init` for interactive LLM/retrieval selection, load sample Schema.org data, and verify with `nlweb check`. Use when starting a new NLWeb deployment from zero.
medusa-setup
Set up a Medusa v2 development environment — CLI, PostgreSQL/Redis prerequisites, project creation, medusa-config.ts, directory structure, environment variables. Use when starting a new Medusa project.
magento-setup
Set up a Magento 2 Open Source project — installation, Composer setup, system requirements verification, and initial configuration. Use when starting a new Magento project or setting up a development environment.
bc-setup
Set up a BigCommerce development environment — Stencil CLI, API credentials, sandbox stores, Catalyst, and developer tools. Use when starting a new BigCommerce project or configuring development tools.