dist/codex/acp-agentic-commerce/skills/acp-dev-patterns/SKILL.md
Cross-cutting ACP development patterns — idempotency, error handling, 3D Secure flows, request signing, rate limiting, monitoring, and security best practices. Use when designing architecture or solving production concerns.
npx skillsauth add orcaqubits/agentic-commerce-claude-plugins acp-dev-patternsInstall 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://developers.openai.com/commerce/specs/checkout/ for error codes and idempotency ruleshttps://developers.openai.com/commerce/guides/production/ for operational requirementssite:docs.stripe.com agentic-commerce for PSP-side patternssite:github.com agentic-commerce-protocol CHANGELOG for latest changesEvery POST request MUST include Idempotency-Key (UUID v4, max 255 chars).
Server-side implementation:
Idempotent-Replayed: true headeridempotency_conflictidempotency_in_flight with Retry-After headerClient-side implementation:
Retry-After then retryingACP uses a flat error structure:
{type, code, message, param}
type: invalid_request | processing_error | service_unavailablecode: Well-known identifier (e.g., idempotency_conflict, invalid_card, rate_limit_exceeded)message: Human-readable descriptionparam: JSONPath (RFC 9535) to the offending fieldRetry strategy:
429 rate_limit_exceeded — Exponential backoff with jitter409 idempotency_in_flight — Wait per Retry-After header5xx — Retry with same idempotency key, exponential backoff4xx (except 429) — Do not retry, fix the requestWhen complete returns authentication_required:
complete again with authentication_result:
three_ds_cryptogramelectronic_commerce_indicatortransaction_idversionHandle authentication timeouts and failures gracefully.
For request integrity verification:
Merchant → Agent webhook best practices:
API-Version: YYYY-MM-DD headerRetry-After header when exceededRetry-After, add jitter to prevent thundering herd$19.99 = 1999 (cents)decimal in Python, BigInt in JS)Fetch the latest spec and production guide for current error codes, header requirements, and security recommendations 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.