What you'll be asked for.
- The campaign's API key, from the Campaigns App in your Next Commerce dashboard.
- Your page designs, or "use the template as-is".
- A preview site, where the built pages go for QA's test orders.
For agents (and people who want the commands)
The same build, as the commands your agent runs. The pin is stamped from this portal's toolkit dependency.
Check the prerequisites.
Node.js 20.19 or newer with npm 10 or 11 (
node --version && npm --version), Git, a POSIX shell, and the campaign's Campaign Cart API key from the Campaigns App (public; stored in the map).Agents: read the orientation contract first.
Before installing or running anything, read AGENTS.md at the pinned commit; it sets the reading order.
Create the campaign folder.
A page-kit project. Replace
<route>with the campaign's public route (its folder name),<family>with the starter design to clone (compare; the map may name one). For an existing page-kit campaign,cdinto it instead; if it already holds a matchingsrc/<route>/, the toolkit skips its own setup stage.createmkdir -p "<route>" && cd "<route>" && npm init -y && npm i next-campaign-page-kit && npx campaign-init --non-interactive --template <family> --slug "<route>" --name "<campaign name>"
Pin the toolkit in the campaign.
Commit
package.jsonandpackage-lock.json; CI and Netlify install the pin from them.pinnpm i -D "github:NextCommerceCo/campaigns-os#bbff33d12c3d92bdbef25a29ea4b75c5d3e899d2"
Install the skills into your agent, then restart it.
Pick one. Writes the five lifecycle skills into
~/.claude/skillsor~/.codex/skills, replacing same-name folders. Restart the agent.install-skillsnpx campaigns-os install-skills --platform claude npx campaigns-os install-skills --platform codex
Prepare the source folder.
startneeds an existing./sourcefolder even for template-only builds. Create it, then:- Bespoke pages: Page Kit-ready HTML, one file per page (source adapters), listed in a source manifest with desktop and mobile screenshots (design source package).
- Template pages as shipped: leave it empty and set
build_scope.mode: "partial"in the map, which takes every page without adesign_sourceout of source scope so the build copies it from the family; a page that keeps adesign_sourcestill needs its source or an explicit manifestskip_reason(template-stock pages).
sourcemkdir -p source
Run
start.startwrites the Build Packet (campaign-runtime.build.json, read by every later stage) and runtime files into the folder, opens a run session, and by default sends its Run Record to NEXT's telemetry endpoint;npx campaigns-os telemetry offfirst keeps it local.startnpx campaigns-os start --map-id <map-id> --target . --source ./source --template-family <family>
Add
--proxy-base <origin>when the map was saved on a non-production map store. After a fresh scaffold the first readiness check names two routine blockers:_data/campaigns.jsonstill carries the template's demo store profile and SDK version. Replace them with the map's values (your agent'snext-campaigns-osskill, step 5, does this), then runnextagain. For source blocks see clearing the readiness block.Install the browser, then hand the folder to your agent.
Polish capture and QA drive Chromium; install it once. Open the folder in Claude Code or Codex and have the agent run
nextafter every stage, following the skill it names (setup → build → polish → preview → QA). Prefix commands it prints that begin withcampaigns-oswithnpx; for the browser install and QA use this page's commands (the toolkit at this pin prints a checkout-onlynpm run qa:install-browser); to re-run intake, re-run the fullstartline above.nextnpx playwright install chromium npx campaigns-os next --packet ./campaign-runtime.build.json --json
QA against the deployed preview:
npx campaigns-os qa run --packet ./campaign-runtime.build.json --base-url "<preview-url>" --browser --test-order common --post-verdict.commonsamples the usual checkout paths;fullfollows every terminal offer path from the selected checkout;tiers:fulladds each declared package tier. Stage reports land under.campaign-runtime/; posting the verdict to your Map ID is attempted.
The template pages' npx campaign-init quick start is step 3 here. Contributors on a toolkit checkout replace npx campaigns-os with npm run campaigns-os -- and the browser install with npm run qa:install-browser.