Start

Build a campaign with your coding agent.

Bring your page designs and a campaign you've set up in NEXT. Your agent builds the pages on your computer, connects them to your real products and prices, and places a test order before anything goes live.

Open your coding agent in an empty folder for the campaign, then paste:

Set up a NEXT campaign build in this folder. Follow https://campaigns.nextcommerce.com/llms.txt and ask me for anything you need.

Claude Code sets itself up in one step and asks you to restart it once. Codex and Cursor take a few manual steps, listed in the commands below.

  1. NEXT dashboard · Campaigns

    Set up the offer.

    Create the campaign in Campaigns, then create its offers. The products you pick in an offer are added to the campaign at your store price, and the Offer Preview shows each price as the campaign page will show it. Your agent reads products, offers, and prices from there and never makes up a price or an offer.

    You bringYour store's products and the offers you want to run.

    You getA configured campaign and its public API key.
  2. Your agent · your computer

    Build and test it locally.

    Give your agent the HTML, images, and a short brief. It writes the campaign plan, builds your pages on one of NEXT's starter templates, which handle checkout, upsells, and the receipt, and places a test order. The test order uses a test card, so no one is charged.

    You bringPage designs, or a starter template as-is, and a brief.

    You getA working preview and a test receipt on your computer.
  3. You and your agent

    Revise until it's right.

    Ask for changes. The agent rebuilds and rechecks what each change touches. The plan, pages, and results are saved in the folder, so a later session can pick up from there.

    You bringYour changes and decisions.

    You getAn updated preview with fresh checks.

Planned it in the Workspace?

Open the saved plan's Handoff and use Copy start prompt. Your agent builds from that plan instead of writing its own.

01 / Before you start

What you need.

  • A campaign set up in Campaigns in your NEXT dashboard, with its public API key.
  • Your page designs as HTML files with their images. No designs yet? Your agent can use a starter template as-is.
  • A short brief: the pages in order, what each offer is, your store's name and support contact, and links to your policy pages.
  • A coding agent that works in a folder on your computer, plus Node.js 20.19 or newer, npm 10 or 11, and Git.
For agents (and people who want the commands)

The toolkit is @nextcommerce/campaigns-os on npm, and the commands below name the release this page is built against. Install it in the campaign folder as an exact development dependency and run it with npx --no-install campaigns-os, so the pinned copy is the one that runs. The same steps are in llms.txt.

  1. Read the orientation contract first.

    Before installing or running anything, read AGENTS.md at the release. It sets the reading order.

  2. Set up the folder: Claude Code.

    Run this in the campaign folder. npm init -y gives the folder its own package.json, so npm installs into it and not into a project above it. The line then installs page-kit and the toolkit at exact versions, followed by the QA browser, the skills, and the project context, and it keeps any pages and instructions already there. Commit package.json and package-lock.json. When it reports restart_required, ask the person to restart Claude Code in the folder.

    setup
    npm init -y && npm install --save-exact next-campaign-page-kit@0.3.0 && npm install --save-dev --save-exact @nextcommerce/campaigns-os@1.62.0 && npx --no-install campaigns-os tooling setup --target . --platform claude

    An existing campaign keeps its reviewed versions: run npm ci, then only the last part of the line above. Changing versions is a separate update. Details: local setup.

  3. Set up the folder: Codex, Cursor, and other agents.

    The one-step setup is for Claude Code only. Install the same versions, then the skills (--platform codex, or --platform agents for Cursor and other agents that read shared skills), the context files, and the QA browser. The context files land in .campaign-runtime/agent-context/; point the project's AGENTS.md or Cursor rules at the matching file. install-skills lists each SKILL.md it wrote under Read now: read those files in the same session, because a running agent does not load skills installed after it started. Restart only if the agent cannot read them.

    setup (other agents)
    npm init -y && npm install --save-exact next-campaign-page-kit@0.3.0 && npm install --save-dev --save-exact @nextcommerce/campaigns-os@1.62.0
    npx --no-install campaigns-os install-skills --platform codex
    npx --no-install campaigns-os install-agent-context --target .
    npx --no-install campaigns-os qa install-browser
  4. Write the campaign spec.

    Without a saved Workspace plan, write campaign-spec.json from the brief, the HTML, and the campaign's real products and offers, following the local-spec entry. Give it a new spec_identity.local_spec_id once and keep it through every revision. Never guess a price, an offer, or policy text; ask. Put the HTML and images in source-html/.

  5. Run start, then follow next.

    Replace <family> with a starter template family (compare them). start writes the build files into the folder and opens a run session. By default it sends its run record to NEXT's telemetry endpoint; run npx --no-install campaigns-os telemetry off first to keep it local.

    start
    npx --no-install campaigns-os start --spec campaign-spec.json --source source-html --target . --template-family <family> --deploy-target local-serve

    Then run next after every stage and do what it names, through a localhost build to a test order with a test card. Until a stage is recorded, re-run the full start line above to redo intake. After that, start refuses to overwrite the recorded work: save a changed brief with record brief and a changed CampaignSpec with record spec, and next names the stage that is owed again.

    next
    npx --no-install campaigns-os next --packet ./campaign-runtime.build.json --json
  6. From a saved Workspace plan instead.

    The Handoff prompt names the Map ID. Create ./source for the HTML, even when every page uses the template as-is. QA for a saved plan posts its verdict to the Map unless you pass --no-post-verdict, except a run against a local address such as localhost, which keeps it local unless you pass --post-verdict or run qa publish afterwards.

    start from a Map
    npx --no-install campaigns-os start --map-id <map-id> --target . --source ./source --template-family <family>

Contributors on a toolkit checkout replace npx --no-install campaigns-os with npm run campaigns-os --.

After the local test order

Going live is a separate step.

A local test order proves the build works on your computer. Sharing a hosted preview and launching are separate steps that you approve, and a local test order is not launch approval.