Skip to content
wp2next, home
Skip to the page

Concepts

How wp2next is put together: and checkpoints, the three modes, the parity gate, the two config files, how secrets are handled, companion skills, playbooks, and where every report lands. Read it once before your first client build. To get going first, see Quick start. Terms are defined in the glossary.

What a build produces

wp2next is an . Your agent reads its instructions and rebuilds a WordPress site from a copy in Local as a pnpm monorepo:

FolderWhat it is
apps/webThe website: Next.js 16, React 19, Tailwind v4 used only as a token engine, CSS Modules. Deployed on Vercel
apps/studioSanity Studio, where editors change content. Hosted by Sanity
packages/sanitySchema, queries, projection types and the seed that imports WordPress content
packages/brandThe brand's single source (logos, colors, fonts) and the generated root DESIGN.md

Two private working pages ship with every site: a at /brand/ and a component library at /components/. They are never linked or indexed and are off in production unless you turn them on (WP2NEXT_BRAND_ROUTE / WP2NEXT_COMPONENTS_ROUTE; see Troubleshooting).

wp2next runs on macOS, native Windows () and Linux, with WSL2 as an advanced Windows option (Windows). Its helper scripts are Python and Node, so the agent runs the same commands on every system; where a shell step differs, the docs show each system. The docs assume the Claude desktop app's Code tab as the AI tool by default; Claude Code in a terminal, Codex and Cursor work too (AI environments).

The code rules every build follows (no inline styles, one CSS Module per component, shared components only, enforced by pnpm lint) are pasted into each project's CLAUDE.md. The copy is skills/wp2next/references/process-rules.md⁠ (external site).

Phases and checkpoints

migrate runs an interview (phase 0) and then twelve phases. Each phase ends with a , and the next phase doesn't start until it passes. Phases 1–12 are tracked in wp2next.json → phases, which is how status and a resumed session know where you are.

#PhaseWhat happensCheckpoint (short)
0InterviewSite questions; echo-back table of every name to be created; wp2next.json writtenYou said yes to the table
1InventoryRead-only look at the WordPress database and files; builder detected, playbook matchedPages, posts, menus, forms, tracking, consent banner, fonts, breakpoints and redirects listed
2SnapshotContent exported, every URL rendered to HTML, media copiedOne rendered file per URL
3ScaffoldMonorepo created (Node 24, pnpm 11.10.0, Next 16), /brand/ and /components/ routespnpm lint and pnpm typecheck pass
4Parity baselineWordPress screenshots at 390/1440/1920/2560 px, Lighthouse baseline of the old siteEvery probe resolves
5Tokens and chromeDesign tokens, fonts, header, footer, tracking wiring, brand package seeded from WordPressTokens and chrome show in /components/; /brand/ renders
6Content contractTypes and queries for the content modelpnpm typecheck passes
7SanitySanity project, schema, converter, repeatable seed, StudioStudio loads and saves; seed reruns cleanly. Asks before creating
8Blocks and routesBlocks, every WordPress URL, redirects, metadata, sitemap, forms endpointEvery old URL returns 200 or its redirect; seo parity run
9Parity loopOld vs new compared on the production build; Lighthouse on the new siteYou sign off parity (pixel, faithful)
10Mobile and qualityPhone and tablet layouts, design critique and accessibility auditDepartures approved and recorded
11InfrastructureGitHub repo, Vercel project and env, Sanity webhookPushes deploy; one real submission per form reaches every destination. Asks before each resource
12CLAUDE.md and cutover (go-live)Client CLAUDE.md and cutover checklist; tracking on in Vercel Production (still noindex); gates A (compliance), B (Lighthouse) and C (SEO parity) on the production deployment with tracking on; NEXT_PUBLIC_SITE_INDEXABLE=true; domain and DNS; post-launch compliance re-scan; then it offers handoff and reportGate A: no open high-severity compliance finding; gate B: no Accessibility/SEO Lighthouse regression vs WordPress; gate C: no unapproved seo parity regression; post-launch re-scan done

The -facing detail for each phase is in skills/wp2next/references/commands/migrate.md⁠ (external site). Plain-language version for site owners: Step 6: Rebuild your site (migrate).

. Any intentional difference from the WordPress site is a departure: it needs your approval and is recorded in the project CLAUDE.md and wp2next.json → departures, so the next developer knows it was on purpose.

The three modes

migrate asks for one mode per site; parity.defaultMode in your pre-selects it.

ModeDesktopPhones and tabletsPhase 9Parity gate
pixelMatches WordPress; probes within 0.5 px on the production buildRedesigned below the site's own breakpointAutomated pixel parity loop, then sign-offYes
faithfulSame content, structure and brand; small cleanups allowedRedesignedParity run as a visual review, then sign-offYes
faceliftNew visual designNew designContent parity (URLs, headings, links, forms)No

All modes keep the content, URLs, search signals, forms and tracking, and all follow the same code rules; in only the values (tokens, layout) change. Choosing between them: Facelift: new design, same site.

The parity gate

is always measured on a production build (next build && next start), with data-parity selectors, never on next dev.

In pixel and , nothing may change the look until you sign off parity (recorded as parity.signedOff in wp2next.json, with date and who). Until then:

  • only the marked safe before parity are loaded, and wp2next's overrides apply (no next/image, next/font, Tailwind utilities or prose);
  • optimize only reports, or applies changes with no visual effect;
  • content copy changes in pixel mode are departures.

After sign-off, the agent offers optimize: it splits findings into safe fixes (applied, then verified with a parity re-run) and design-changing ones (each proposed as a departure). A later change that moves desktop means re-running parity; if it fails, the sign-off is cleared.

The two config files

Neither file ever holds a .

FileWhereHoldsWritten by
User config~/.config/wp2next/config.json (Windows: C:\Users\<you>\.config\wp2next\config.json; $XDG_CONFIG_HOME/wp2next/config.json if set)Your defaults: role, account owners, plans, naming patterns, secret backend, form destinations, tracking, parity mode, agent, companion skills, install methodinit
Project config<repo>/wp2next.json (committed)One site: code, domain, Local slug, names, Sanity project, mode, breakpoint, form and tracking IDs, SEO and compliance choices, phase progress, departures, parity sign-off, wp2next version, report statemigrate and later commands

Precedence is project > user > built-in default, and objects deep-merge. Values from config pre-fill every question, so migrate doesn't re-ask what your defaults already settle. Both files are read and written through config.py, which validates enums and ID formats and refuses secret-looking values.

Every key: Configuration reference. The helper: Scripts.

Secrets

A build needs a handful of private values: Sanity tokens, the revalidation secret, form-sending keys (, HubSpot, monday.com, webhook). The model:

  • Two places. Your holds everything, including tokens only your machine needs. Vercel environment variables hold what the live site needs. Deploy-time values go to both, because Vercel "Secret" values can't be read back.
  • One shim. The agent goes through scripts/secrets.py (the same on macOS, Windows and Linux; the older secrets.sh now just hands over to it): put reads a value from stdin or a hidden prompt, run -- <cmd> injects values into a command, list shows names only. There is no get.
  • Never printed. No secret in chat, logs, , command arguments, .env.example, wp2next.json or the user config. The agent never displays .env files or vercel env pull output. If a value leaks by accident, it says so and asks you to rotate it.
  • Never public. Tokens never go under NEXT_PUBLIC_*, which ships to every visitor's browser.
  • Your manager. Supported backends: 1Password, Keeper, Bitwarden Secrets Manager, Doppler, Infisical, macOS Keychain (Mac only), Vercel as the source of truth, or plain .env files.

Choosing and setting up a backend: Secrets: where wp2next keeps passwords and API keys. Every variable a site uses: Environment variables.

Companion skills

Optional skills and plugins from other teams (Sanity, Vercel, the Next.js team, Microsoft's Playwright, Resend, and others) that add know-how for parts of the job. init offers them in bundles; every phase works without them.

BundleExamplesWhen
Build helpersSanity toolkit, React best practices, composition patternsDuring the build; safe before parity
Deploy helperVercel CLI skill (light) or the Vercel plugin (adds MCP, hooks and telemetry)Phase 11, cutover, handoff
After-parity reviewWeb design guidelines, Vercel optimize, Next.js skills, Next devtools MCPOnly through optimize, after sign-off
Browser checksPlaywrightLooking at the live site, visual checks
Writinghumanizercontent drafts
EmailResend skillsWhen forms send email (the default)

wp2next decides when each one is loaded, and wp2next's rules win where a companion's advice conflicts. Nothing is installed without your yes, one command at a time. Details, install commands per agent and privacy notes: Companion skills.

is separate: it powers critique, audit, polish and design work in facelift, and is switched on by quality.useImpeccable.

Playbooks

WordPress sites are built in very different ways. A holds what is specific to one builder or theme type: how to detect it, where its content lives, how to export and convert it, and the parity traps it causes. In phase 1 the agent checks the database and rendered HTML for detection signals and reads every matching playbook (a site can match two) before scaffolding.

StatusMeaning
testedTwo or more migrations
draftOne migration
stubDetection signals only, from public knowledge; unverified

Current playbooks cover , block themes (including the REST export when there is no Local copy), PHP-template themes, and stubs for Elementor, Divi, WPBakery, Beaver Builder, Bricks, Oxygen and Avada. The index with detection signals: skills/wp2next/references/playbooks/index.md⁠ (external site).

No match, or only a stub? The agent keeps notes in .wp2next/notes/<builder>.md as the build goes, and wp2next contribute later turns them into a scrubbed playbook (with a yes at each step). No client names, domains, IDs or people ever go in a playbook.

Where reports go

Everything lands inside the project .

ReportPathIn git?
Project statewp2next.jsonCommitted
Status dashboard (status --dashboard).wp2next/status.htmlIgnored (rebuilt from committed data)
Lighthouse runs.wp2next/lighthouse/<label>-<date>.jsonCommitted (baselines)
SEO parity, audit, AI search.wp2next/seo/ (parity-<date>.md, audit-<date>.md, aeo-<date>.md)Committed
Content audit, plans, rewrite ledgers.wp2next/content/Committed
Voice guidedocs/content/voice.mdCommitted
Optimize reports.wp2next/optimize/<date>-<area>.mdCommitted (*-tmp/ ignored)
Builder notes for playbooks.wp2next/notes/<builder>.mdCommitted
Compliance scans.compliance/reports/<YYYY-MM-DD>.md (+ .json)Your call; ignore .compliance/ if the repo is public
Design critique, audit, polish.impeccable/reports/<date>-<kind>-<slug>.md (polish: inside its own worktree)Not committed by the side process
Parity reportapps/web/parity/report.html—
Tracking setupdocs/analytics/README.md (+ gtm-container.json with GTM)Committed
Brand sign-offdocs/brand-signoff.mdCommitted
Handover runbook (written by handoff)HANDOFF.mdCommitted
Drafts for report, feedback, contribute.wp2next/report/, .wp2next/feedback/, .wp2next/contrib/Ignored
Upgrade scratch.wp2next/upgrade/*/Ignored

Older projects may lack the .gitignore lines; status offers to add them.

How the agent behaves

  • Asks before anything outside the repo: every account resource, change, secret-store entry, Sanity write (drafts included), install, transfer or post. One yes covers one action.
  • WordPress is read-only. It never writes to the database or the live site, and never reads personal-data tables (users, comments, form entries, orders).
  • Content is never published by the agent. content, seo fix and optimize structure write Sanity drafts; the client reviews and publishes in . It never invents claims, testimonials, numbers or prices.
  • Side processes don't block. critique, audit, polish, optimize, seo audit and content audit run as a background subagent in Claude Code, a separate session elsewhere, or inline.
  • Nothing private leaves the machine. report, feedback and contribute share only generic facts, every draft passes a scrub check, and each sends only after a yes.
  • output is not legal advice.