Skip to main content

AI Prompts for Commerce Engine

Copy these prompts into your AI coding assistant (Claude, Cursor, Copilot, etc.) to generate production-quality Commerce Engine code. Each prompt includes the right context for accurate results.
For best results, install the Commerce Engine skills package in your project, or paste the LLM docs URL so your assistant can fetch live API details.
Type import rule: All prompts assume types are imported directly from @commercengine/storefront (e.g., import type { Cart, Product, CreateCartBody } from "@commercengine/storefront"), never hand-written. If the AI generates custom interfaces for API types, ask it to use the SDK’s named exports instead. See Importing Types for details.

Foundation Context

Prepend this block to any prompt for best results. It gives the AI the essential Commerce Engine knowledge that every task depends on.

Type Lookup

Look Up a Schema Definition

Look Up an SDK Method Signature


SDK Setup

Initialize SDK (React / Vue / SPA)

Initialize SDK (Next.js App Router)

Initialize SDK (Node.js Backend)


Authentication

Email OTP Login Flow

Phone OTP Login Flow

Next.js Server Action Auth


Product Catalog

Product Listing Page

Product Detail Page (Next.js SSG)


Cart & Checkout

Shopping Cart

Apply Coupon / Promotions

Checkout Flow

Hosted Checkout Integration


Customer Account

Customer Profile & Order Management


Webhooks

Webhook Handler


Full Application

Complete Next.js Storefront

React Context + Hooks Setup


Pro tip: When using these prompts, paste the relevant curl commands so your AI assistant can fetch the latest API schemas directly. This ensures the generated code matches the current API exactly.