Imported from wix/skills (
skills/wix-replatform/resources/rp-execute-import/SKILL.md). Install upstream withnpx skills add wix/skills --skill rp-execute-import. Copyright stays with the author.
rp-execute-import
Execute the generated migration pipeline and capture import results.
Use mapper-authored operation assessments and temporary deferrals through the shared runtime. Do not decide new mappings during execution. An unanswered field returns to mapping; eligible optional fields stay visibly pending, and required-field records remain held. Keep their pinned source data and membership until verified repair. Every interrupted or all-held run still writes completion and cutover handoff; source/evidence loss is an actionable unknown, never success. Rebuild these artifacts after repairs. The existing journal and crosswalk distinguish landed parents from uncertain writes and records never created; repair never recreates a landed parent.
Purpose
This skill runs the generated extract/import pipeline for the active project once setup and code generation are complete.
Required inputs
- generated code under
migrations/<project>/src/ migrations/<project>/execution/execution-manifest.jsonmigrations/<project>/execution/llm-handoff.jsonmigrations/<project>/execution/review/import-plan.mdmigrations/<project>/execution/review/code-safety-review.mdwhenDRY_RUN=truemigrations/<project>/setup/setup-verification.json
Every task builds on the site locale entity
An import task starts only when import-site-locale passed for this site, setup plan, source file and
owner decision (the receipt in setup/setup-verification.json). Missing, stale, failed or incomplete locale
state blocks every task with SITE_LOCALE_NOT_READY. After that universal check, a kept currency or time zone
holds only explicitly classified money-bearing or wall-clock refs with SITE_LOCALE_KEPT; neutral refs import.
The check reads files only — no read of the site at task time. A held task is a blocked dependency in
execution/dependency-readiness.json and an operator action in the completion report; a catch-up run imports
it once the cause is fixed and setup re-ran. Money is written in the store's base currency only and is never
converted.
Preconditions
Do not proceed until:
- setup verification shows required items are passed or accepted; an unrecovered blocker halts to needs-user
- reader, transform, and writer code exist for the intended entities
- execution artifacts define batching, retries, checkpoints, and write order clearly
- when
DRY_RUN=true, the post-codegen code-safety review exists and has been accepted before execution approval is sought - the execution plan report has been presented and the user has accepted it (see
below). In explicit user-requested
1-click mode(automationMode=one_click,source=user), the same report is still required, but it is recorded as accepted by the agent once all blockers/gaps are surfaced and no unresolved hard stop remains.
Prefer the machine-readable execution artifacts above. execution/review/import-plan.md
is a human-facing review artifact, not the primary execution contract.
Before live import and again before final reporting, validate
execution/review/import-plan.freshness.json with the deterministic freshness helper:
node skills/wix-replatform/scripts/artifact-freshness.js check migrations/<project> \
--domains-dir skills/wix-replatform/resources/rp-target-wix/domains \
--delta execution/review/import-plan-delta.md
The approval precedes setup and binds the setup-plan hash and the configured WIX_SITE_ID.
A receipt-less approval stays fresh only for the first valid receipt the approved, unchanged
setup plan produces on the approved site after approval: the receipt's siteId and the
current config both equal the approved site, its generatedAt and every check's
checkedAt are at or after the approval, and it replaced no receipt from after the
approval (replaces). A retry after a failed setup attempt is still that first receipt.
Stale: a changed setup plan, a different site, an invalid receipt, a receipt predating the
approval (for example a restored older one), a re-run that replaces a post-approval
receipt, or legacy metadata without the setup-plan or site binding.
If the check is stale, do not silently continue from the old approval text. Regenerate
execution/review/import-plan.md or append and present
execution/review/import-plan-delta.md; completion reports must reference the latest
accepted plan or delta.
Execution plan & user acceptance (required gate)
This gate precedes all writes to the user's site — both rp-execute-setup
provisioning and this import. Before writing anything, produce a human-readable
execution plan report and obtain explicit user acceptance. Do not write anything until
the user accepts. The report must show:
-
Setup changes to be made first: apps to install (Blog / Members / Wix-Data enabler), Wix Data enablement, and collections to create — so the user sees the site changes, not just the content writes.
-
What will be imported and where: each source entity → its Wix target (app or collection) with record counts — e.g. posts → Wix Blog (1088); episodes →
PodcastEpisodes(86); categories/tags → Blog taxonomies; media → Media Manager (~1499). Make media reporting explicit:- referenced media imported through entity-native background ingestion
- referenced media imported through Media Manager first
- unattached media skipped by default unless explicitly in scope
-
What will NOT migrate cleanly / needs manual action: the lossy and blocked items, drawn from the mapping plan's faithfulness ledger and any
setup/setup-verification.jsonitems still manual or blocked — e.g. category hierarchy flattened, comments anonymized, drafts absent without auth, storage-plan upgrade required. This must also include any target with no verified Wix primitive — state whether it falls back to a generic CMS collection, to anunverified/best-effort runtime-derived call, or is skipped. Nothing unverified or lossy may be written without first appearing here for consent. Coupons follow the same native-first rule as other native Wix entities: prefer native Wix Coupons, and mention CMS fallback only for truly unsupported coupon semantics.- Always state the analytics-data exclusion explicitly. Historical analytics data — traffic / visitor stats accumulated on the source — is out of scope and is not imported (see "Out of scope" below). Call this out in the plan so the user knows before accepting that analytics data will not migrate; do not let it pass silently.
-
Order & idempotency: the write order and how re-runs dedupe. Be explicit that source IDs are the stable migration key, while many native Wix target IDs are server-assigned. The plan must state whether each entity re-run resolves via a client-controlled source-id field on the target or via the durable local
sourceId -> targetIdcrosswalk. Localstate/crosswalk/crosswalk.ndjsonis the sole runtime authority for resume/idempotency — never CMS. The plan must state the crosswalk authority (local) and the mapper-selected CMS mirror mode (none,download,upload, ordownload-and-upload); CMSImportCrosswalkis OPTIONAL by design, not a default, because Wix CMS quotas are plan-based and shared across every custom collection on the site — a large migration's full crosswalk can be many times a lower-tier plan's total item quota, so treating the mirror as mandatory risks spending site data capacity the migration has no business claiming by default. Only enable a mirror mode when the user opted into site-local reference data (seerp-execute-setup→ "Import crosswalk CMS mirror"). When a mirror mode other thannoneIS selected: provisioning the collection is not the same thing as keeping it in sync — a run can provision the collection at setup time and then never write to it again during import, leaving every entity's crosswalk invisible on the site itself until a one-time backfill catches it up.rp-target-wix/lib/wix-writers.js'ssyncImportCrosswalk(batches of up to 1000 throughbulkSaveDataItems, item id the row's ownsourceStableKey, matching the approved download-side dedupe contract exactly — see the KNOWN, UNRESOLVED LIMITATION comment onbuildImportCrosswalkItem: sourceStableKey is only unique within one migration, so two different projects against the same source system that happen to import the same entityType+sourceId still collide, and closing that gap needs its own approved identity/schema decision, not an ad hoc id prefix) is the primitive that keeps it current, andrp-import-codegenwires it in: a generated run with a mirror mode ofuploadordownload-and-uploadperforms exactly one snapshot pass, after the last entity write, projecting the finished local crosswalk throughlocal-state.js'scrosswalkRowsToMirrorItemInputsand uploading it withsyncImportCrosswalk. The pass is never inline per entity and never a per-batch checkpoint: a mirror write riding alongside each record multiplies the calls the site absorbs during the run and makes a slow collection a drag on the import it only describes. Withnoneordownloadthe generated run touches the collection zero times — no reads, no writes, no empty pass reported as success — because site storage is a shared plan-based allowance and a large ledger can be a meaningful fraction of a smaller plan's whole quota. Never make native-entity import correctness depend on the mirror succeeding: a non-zerototalFailures, or a thrown transport error, marks the mirror step failed and is reported as a shortfall in the execution artifacts, while every imported record stays imported and the run itself is not failed. -
Destination and collisions — required whenever
WIX_SITE_STRATEGY=existing. Name the destination site, and say plainly that it is a site the user already owns and that this import will change it. Then quantify the overlap: for each entity type, how many source records match something already on the site (by crosswalk, then by the mapping's natural key), and what will happen to each — skipped or augmented, never replaced and never deleted. A user accepting "Migrate" on their live store is accepting these specific writes; a plan that reports only "120 products" is asking them to consent to something they cannot see. If the overlap cannot be computed before writing, say that too, and say what the import will do when it meets one. -
URL preservation: for public routed entities, state that source URL artifacts will be captured locally under
state/url-preservation/. List the public entity types whose base paths and slugs will be tracked, any entity whose target route is deferred to the website-builder phase, and whether redirects will be recorded as plans. The current import phase must say that redirects and site routing are not applied. Backend import stays plan-only: it records source URLs and source-authored redirect definitions (node skills/wix-replatform/scripts/url-redirects.js sources), then runs the offlineurl-redirects.js reportand passes its projection (execution/url-preservation-report.json, statuspending_website_builduntil final routes exist) ascompletion-report.json.urlPreservation. It never runsapplyorverify, never probes the public website and never changes DNS; those are post-build helper operations the cutover step schedules. -
Notification mute. State that site notifications will be muted before import when required by the resolved site strategy/config, and how the owner can later ask for an unmute. State that site notifications will be muted before migration writes begin when mute is in effect. For a new site this is a one-line factual disclosure (the mute is unconditional). For an existing site whose operator answered mute at intake (
notificationMute=on) the disclosure is mandatory and prominent and must state all three points:- all site notifications will be muted before migration writes begin;
- visitor activity during the migration window (e.g. contact-form submissions, Back in Stock alerts) will not generate notifications;
- the flow does not unmute automatically — after the migration the owner must re-enable notifications themselves, or simply ask the agent to unmute at any point.
The mute answer itself was given at intake; this report restates it, it does not ask again. For an existing site that answered don't mute, state plainly that customers and the owner may get emails for imported records (orders, bookings, forms, RSVPs). If the owner changes their answer here, record it with
decide --key notificationMuteand regenerate the setup plan before any write — never after writes began.
In explicit user-requested 1-click mode, do not skip this report. Generate it, make sure it
reflects the real setup changes / data writes / blockers, record it as accepted by the agent,
and continue without waiting for a human response. A missing mode or a non-user-authored
one_click value must follow the normal user-approval path.
Persist this in execution/review/import-plan.md (or a sibling report). This is the defined approval
checkpoint: the job pauses, surfaces the plan to the user, and resumes only on
accept. Nothing is written before acceptance.
If DRY_RUN=true, this execution-plan approval gate comes only after
the separate post-codegen code-safety review checkpoint has passed. Do not merge the two
checkpoints into one prompt.
Out of scope — analytics (future enhancement)
Do not attempt to import analytics data. Historical traffic / visitor statistics — the accumulated analytics records on the source (page views, sessions, visitor counts, time-series reports) — are not part of the migration. Do not generate readers, transforms, or writers for them. (This is about the data, not analytics configuration/setup such as tracking tags — that is a separate concern and not what this exclusion covers.)
- Surface it before execute. This exclusion must appear in the execution-plan report's "What will NOT migrate" list (see the gate above) so the user is told before they accept and we begin writing — not discovered afterward.
- Future enhancement. Analytics migration is a deferred scope item, not a permanent limitation. If/when a faithful source→Wix analytics path exists, revisit and lift this exclusion. Until then, treat analytics as explicitly skipped.
Execute the generated scripts — never an agentic MCP flow (required)
The import is performed by running the generated artifact (node the project's
entrypoint under migrations/<project>/src/), which writes to Wix via its own transport
(fetch + injected credentials to www.wixapis.com, or the Wix client SDK). The agent
must not perform the import writes itself by issuing per-record Wix MCP calls
(CallWixSiteAPI) and hand-translating shapes.
(Scope: this rule is import-specific. Setup execution (rp-execute-setup) may
currently use the agent+MCP for provisioning writes — an interim decision, with other
options still under discussion.)
Why the import must run the artifact:
- Reproducibility & idempotency. Re-runs, resume-from-checkpoint, write ordering, and
dedup keyed by source ID live in the artifact. For native Wix entities whose target IDs
are server-assigned, that means the artifact must maintain and consult the local
state/crosswalk/crosswalk.ndjsonauthority. An agent reconstructing writes ad hoc bypasses all of it — a bulk, restartable data pipeline can't be driven by hand per record. - Verified shapes. The artifact calls
rp-target-wix's verified primitives. An agent rebuilding request bodies live re-opens the exact shape-bug class we eliminated (Ricos plugin enum case, oversized-HTML tag body,heroImage.id). - MCP may be absent at runtime. Interactively-authenticated MCP servers can be missing in headless/cron runs, so MCP can't be depended on as the write transport regardless of whether the runtime is a pure script-runner or an agent. Either way the writes should flow through the tested artifact, not be reconstructed by the model.
- Validation honesty. Writing by hand via MCP leaves the artifact's own auth, request
execution, async-media polling, retry, and checkpoint code unexercised — a green test
then says nothing about the path real users get. The Wix MCP's role here is
grounding/verification at codegen time and the one-time live contract test in
rp-target-wix, not the import transport.
Consequence for credentials: the artifact needs real Wix write credentials to run. If they are absent, halt to needs-user — do not substitute the agent's MCP account auth to "get the writes done." Missing credentials is a blocker to surface, not a path to route around.
This skill should execute the machine import artifacts and generated entrypoints. It
should not re-decide write strategy live when execution/execution-manifest.json
already defines the ordered task graph and write contract.
Toolkit bugs: patch the project copy, list it, continue
A bug in toolkit code is not a halt. If a vendored toolkit file in the project (src/lib,
src/resources, src/vendor, src/toolkit) has a bug that blocks the import, fix that copy,
add an entry to execution/toolkit-patches.md (## <project path>, then - reason:,
- unblocks: naming the records, and a ```diff block), and continue. Never edit the installed
toolkit (.agents/skills, .claude/skills); the runner restores it. Every check (read-back,
canary, verification) still runs after the patch. Each listed patch becomes a
toolkit-patched-in-run action in the completion report; an unlisted change to a vendored copy
is restored. A listed copy also survives the next codegen round. If the toolkit file
itself changed since the copy was made, the codegen stage entry copies in the new toolkit file,
saves the patched copy under execution/codegen-scaffold-replaced/, and lists a notice in
stagePrepared.notices on every codegen entry until you re-apply the patch (if still needed)
or remove its entry.
Config files
Before running the generated entrypoint, verify the project-local config files exist and contain required values:
-
migrations/<project>/config/wix.envWIX_SITE_STRATEGYWIX_SITE_IDWIX_AUTH_TOKENor another generated-code-supported Wix auth keyDRY_RUN
Destination creation writes
WIX_SITE_STRATEGY=newandDRY_RUN=falsewhen they are absent. Record the owner'sDRY_RUNchoice withnode scripts/wix-env.js set --project-dir migrations/<project> --key DRY_RUN --value true|false; never hand-edit or shell-appendwix.env. -
migrations/<project>/config/source.<platform>.env- platform-specific source values, for example WordPress:
WP_BASE_URL;WP_USERNAMEandWP_APPLICATION_PASSWORDfor authenticated REST andwix-wp-plugin-v2bridge reads
- platform-specific source values, for example WordPress:
The generated script should load these files and then allow process env to override them.
WIX_SITE_STRATEGY is always required. WIX_SITE_ID is required before execution writes
begin; if the strategy is new and the site has not been created yet, halt to needs-user
and return to the site-creation step rather than assuming an existing-site flow. Never
print secret values.
WIX_AUTH_TOKEN is the canonical Wix auth key in project-local config. It may have been
used earlier for account-level site creation and may also power site-level writes when
the generated runtime supports that same key. If the generated import path needs a
different Wix credential, name that key explicitly in the generated artifacts.
If execution is blocked because a RePlatform new site + headless target was never
created, route back to resources/rp-destination/, which scaffolds via
npm create @wix/new@latest headless. The account-level Projects API is deprecated for
this workflow (it produced non-headless sites).
When the accepted next run is dry-run, missing or blank WIX_AUTH_TOKEN and
WIX_SITE_ID are not blockers unless a local artifact requires the site ID as a stable
namespace. Report them as would_block_live, do not mint a Wix CLI token for dry-run, and
make the execution plan state that a later live run needs separate acceptance and valid
credentials.
If DRY_RUN=true, do not override it with --no-dry-run for setup probes, setup
provisioning, extraction-side verification against Wix, or import
writes unless the user has explicitly approved leaving dry-run for that step or phase.
Prefer to avoid that override when a dry-run artifact or report can be produced instead.
The upstream new-site creation exception does not authorize this skill to make any other
live Wix API call.
Treat migrations/<project>/config/*.env as secret-bearing once they may contain real
values. Do not inspect them with whole-file reads that print contents into tool output;
check only existence and required-key status (present, blank, missing).
For CLI-scaffolded headless sites, acquire the site write token from the scaffolded frontend folder with:
npx --no-install wix token --site "$WIX_SITE_ID"
Persist the returned token as WIX_AUTH_TOKEN and send it as a Bearer token. The same Wix
CLI account should create the site and mint this token. Mint it through scripts/mint-token.sh; the
import renews it from there while it runs (see wix_auth_expired below).
Workflow
-
Resolve the active project.
-
Review the machine execution artifacts and generated code; present the execution plan report and obtain acceptance (see above) before any write. 2b. Precondition, not a step you can skip by not reading this line. The import path checks that execution state was prepared and refuses to write without it. Prepare deterministic local execution state before any setup/import write:
node skills/wix-replatform/scripts/execution-state-prepare.js migrations/<project>This validates
execution/execution-manifest.json, initializes or validatesstate/crosswalk/crosswalk.ndjson, rebuilds crosswalk indexes, initializesstate/attempts/write-attempts.ndjson, initializesstate/url-preservation/artifacts when URL preservation is enabled, and blocks CMS mirror download flows unless local state is absent and explicit CMS mirror rows have been provided to seed it. 2d. Verify the generated import entrypoints satisfy the entry contract, before any entity write:node skills/wix-replatform/scripts/import-contract-verify.js migrations/<project>For a filtered run, pass its identical selection after
--(for example-- --entity <entity> --failed-only). For selected bridge-backed entities/dependants, the verifier first checks actual generated wiring and helper versions against the committed emitter, before running any generated entrypoint. An unrelated native-only selection does not check another plugin's artifact readiness. Source preparation/full manifests are checked by the shared runtime at selected dispatch; missing preparation holds only affected scopes with existing Import Operator tasks. Followrp-source-wordpress/PLUGIN-READ-PLANS.md; do not bypass those wrappers.This then spawns each generated import entrypoint with
--describe, parses the single JSON object it prints, checks it against the generated-importer contract, and runs the declared isolated--migration-review-probe. It verifies committed capture/publication evidence, selected and held mapping-scope registration and an injected failing write's recovery capture in a temporary folder, cleans that folder, and touches no target. It also refuses stale dependency edge modes and generated code that bypasses shared DRY_RUN reading (a bounded text check over comment-strippedsrc/, not a proof; broader analysis is deferred). A non-zero exit aborts the import and routes back to codegen — no degraded mode, no skip flag — naming every missing selection mode and every misplaced ledger path at once. The descriptor also declares themigration-review/1capture boundary at before-write, write-outcome and recovery phases, with all five required evidence categories. A missing declaration routes back to codegen before any target write.The selective modes (
--entity,--source-type,--missing-only,--failed-only,--deferred-only,--unresolved-only) are a requirement on the generated importer, not an operator option: an importer that cannot offer targeted recovery is one whose only recovery is an unfiltered full re-pass, which is how a journal ends up with several rows per record. The importer also checks itself, as the first statement of itsmain(); this step is what catches an importer that never emitted that check at all.
2c. Resolve every request under state/blocked-data-requests/ with the shared
lib/blocked-data-requests.js helper before normal extraction. Reuse a current immutable
snapshot within fulfillment.freshnessWindowHours without probing the source. After the
window, attempt exactly one refresh: write the next version on success; on failure keep the
prior snapshot and mark it stale: true. With no snapshot, csv-upload checks and parses
expectedInputPath, while bridge-plugin probes the live /wp-json namespace list and then
calls extractionRoute; never check a local path for a bridge request. Reconciled data is
merged into that capability's extraction input. Present-but-invalid or partial data is
discarded and marked invalid; missing data uses the target entity's existing default.
Never create declined unless a human explicitly declined during an interactive review.
Stamp every write attempt using real blocked data with the snapshot version, extraction
timestamp, and checksum it actually consumed.
3. Run a safe validation path first when possible, such as dry-run, sample batch, or read-only validation.
For dry-run, invoke the same generated setup/import entrypoints with DRY_RUN=true or
--dry-run. Do not use an agent/MCP hand-built substitute. The shared Wix runtime must
skip Wix calls at wix.send, write state/attempts/wix-request-captures.ndjson, and
keep placeholder target IDs out of state/crosswalk/crosswalk.ndjson.
Do not switch to --no-dry-run unless the user explicitly approves leaving dry-run for
that phase.
If media import is in scope and source media URLs are local/private (localhost,
127.0.0.1, Docker-only hosts, etc.), do not treat a successful dry-run as proof that
live media import can work. Wix Media import fetches URLs from Wix servers, so the user
must either expose the source through a public HTTPS tunnel or skip/defer media. This
is optional and, as far as we know today, only affects media import.
For Stores products carrying subscriptionDetails, the generated dry-run must execute
the same transform path as live import and call the vendored
validateStoresProductSubscriptionDetails helper before writes. Known contract
failures such as missing cadence or an invalid required nested field are record-level
preflight failures/deferred outcomes; they must be counted and reported without sending
that record to Wix.
If the run needs live Stores evidence during setup or recovery, use the shared
verification CLI and persist its JSON artifact:
node skills/wix-replatform/resources/rp-target-wix/scripts/verify-stores.js stores product-count --project migrations/<project> --artifact migrations/<project>/execution/stores-product-count-verification.json (it reports baseline and runOwned when setup recorded a catalog baseline)
or stores product-by-source-marker --marker-path <path> --marker-value <value>.
Do not write migration-local verification snippets for Stores product counts,
source-marker lookups, subscription probes, or probe cleanup.
3b. Never delete the demo catalog here — setup already handled it. Installing Wix
Stores adds sample products and categories. rp-execute-setup reads the catalog just
before and just after its own Stores install, deletes exactly the items the install
added (keeping the built-in All Products category), and records everything in
setup/destination-catalog-baseline.json. This stage deletes nothing: it
cannot tell a sample from the owner's product or an earlier turn's import.
- Every item still in the baseline (pre-existing, or a seeded item a delete missed) is
protected. The importers never take one over by slug or marker; a match is held as
TARGET_BASELINE_COLLISION, recorded inexecution/target-baseline-collisions.jsonand reported as an operator action. - Count with
verify-stores.js stores product-count, which splitstotalintobaselineandrunOwnedwhen the baseline exists. A clean 100-product import reads as 100 run-owned, not 112. - No baseline file (setup did not install Stores) means there is nothing to protect. Never write one by hand.
-
Run source extraction first using the generated extraction entrypoint (for example
node src/extract/run-extract.js). This step writes durable source files under the project and must complete before the write phase unless the extraction artifacts are already present and accepted for resume. -
Execute the import by running the generated import entrypoint (for example
node src/import/run-import.js) with credentials injected via config/env, underimport-supervise.jsfrom the top-level agent ("Run the import under the supervisor"). The import must read from the extracted files on disk — not by re-reading the source into memory, and not by issuing writes through the agent/MCP. For targeted recovery, run the generated main import entrypoint with its selective resume flags rather than writing a migration-local one-off script:--entity <entity>--source-type <subtype>--missing-only--failed-only--deferred-only
--missing-only,--failed-only, and--deferred-onlyare mutually exclusive. The runner must print or persist the selected record set summary before writes begin. For native Wix entities, a local crosswalk hit must skip the create idempotently even if the record was selected earlier. If the execution manifest enables CMS mirror download, fetch CMS rows before this step and pass them to the deterministic state-preparation layer; the generated import may use only local crosswalk state after preparation succeeds. 5b. App routes and internal links. After relevant apps are installed, inspect/configure only the schema-backed per-family routes supported byrp-target-wixcapability knowledge; store saved-state read-back understate/url-preservation/app-page-routes.json. After backend import, run the generatedinternal-link-audit.js planinput over the complete captured inventory. It performs local counting with no destination request or model call and writesstate/url-preservation/link-audit.json. A backend-only run leaves destinations pending and unresolved occurrences without invented paths. Do not call the post-frontendverifyentrypoint until the frontend exists. That step first makes at most 20 read-only calibration checks inside a two-minute sub-cap, records the estimate against the approved 30-minute live-work and 100,000 exception-review-token ceilings, then checks samples and destinations and invokes only compatible non-blog writers. Unknown or incompatible writer ownership blocks affected writes before mutation, while disjoint safe fields may proceed. Blog-post link writes remain pending until a dedicated writer can consume verified destinations through its checkpointed post-frontend lifecycle. Supply planned destination content revisions with containing record identities. The shared verifier applies structured patches once per logical record and field through its durable write journal; adapter callbacks supply revisioned read/write and rendered checks, not direct per-link repair. A budget hold survives re-planning and resumes only after the plan records the owner's decision reference and approved ceilings. Refresh the audit, completion report and website handoff after the post-frontend step and after affected source catch-up. Keep incomplete writer integration and unverified link coverage pending in those artifacts. -
Use
lib/dependency-readiness.jsimmediately before each dependent batch, including selective recovery. The generated importer binds its task, evaluates current readiness, and callsgateBatch; only itssendpayloads may reach a task-capability Wix client, carryingsourceStableKeyand the currentreadinessGrant. A task-level unknown or unapproved exclusion stops before its first batch. A permitted partial per-record dependency defers only records whose required references are unresolved. Setup is all-or-nothing: every bound step must pass on the current destination before any setup-derived reference can resolve. An empty dependency passes only with a current complete zero-row extract and full task-pass evidence. Never infer readiness from task order, a success count, a crosswalk row alone, dry-run state, or prose best-effort consent. Capture compact reports, audit-log references, errors, retries, skipped records, and checkpoint information from the shared runtime outputs. Do not print email addresses or phone numbers from the recovery ledger. 6b. Reconcile bearer-voucher drift against a fresh source read — required, before cutover. Run this after every write pass has finished and before anything declares the run complete. It is required whenever the accepted scope included coupons and the source carried at least one coupon with a usage limit. When neither holds, recordvoucherReconciliation: "not-applicable"in the completion report and do nothing else — a source with no usage-limited coupons still answers out loud, because silence and success look identical in a report.Deadline: before cutover, while the source is still the system of record. Two reasons, and together they are why running it late is the same as never running it:
- the step compares a fresh read of the source against the target, and once the source stops being the system of record that fresh source read stops existing; and
- the target exposes no redemption count for a coupon on any surface, so the question cannot be answered from the target alone afterwards.
Miss the deadline and which codes were already spent becomes permanently unknowable, on an instrument made of money.
Use the shipped module,
rp-target-wix/lib/coupon-redemption-drift.js. A migration-local reimplementation of the classification, the plan, the request builder or the verification is forbidden: each one carries a trap that stays invisible until it costs money.- Re-read the source coupon rows now — never the discovery snapshot, which is precisely what went stale — and read each imported coupon back from the target.
- Per import receipt:
classifyPostImportDrift({ receipt, freshCoupon, targetCoupon }). It returns exactly five post-import outcomes:voucher-drift-reconciled,voucher-drift-remedy-pending,voucher-source-row-missing,voucher-target-row-missingandvoucher-target-state-unreadable. An unsupported face-value precision is the booleanverdict.facePrecisionUnsupportedriding alongside whichever of those five applies — wire on that flag; it is neververdict.outcome, so a branch for it in aswitch (verdict.outcome)is a branch nothing can ever reach. buildVoucherDriftPlan({ verdicts, ordersByCouponCode, currency })turns the verdicts into the owner-approval plan:counts, onerowsentry per code carrying its face value, the orders that reference it and the proposed remedy, andliability— the money still live. The plan isreadOnly: trueand has no apply path, by construction. Run twice on the same inputs it produces the same plan.- The owner rules per code, including in one-click mode. One-click is a promise about how little the operator has to decide, never a licence to decide on the merchant's behalf about their money: deactivating a code a customer legitimately holds destroys value too, and the merchant might already have honoured a voucher off-system. Nothing in this step writes without an explicit per-code decision.
- Build an approved remedy only with
buildRemedyRequest({ couponId, remedy, setTags }). It emits the one request shape that actually writes — a specification carrying only the changed fields plus the matching field mask. Never build the body from the coupon you just read: the full specification alongside a narrow field mask is accepted with200, an empty body, and no write at all. Record the response status; do not interpret it. - Wait a settle, read the coupon back, and let
verifyRemedyApplied({ remedy, responseStatus, readBackAfterSettle, settleMs })decide. A 2xx is not evidence. No read-back, a read-back that still shows the coupon live, and a read-back with no readableactiveflag are eachremedy-unverified— reported unknown, never applied. For a deactivation, a coupon that does not read back at all is unknown too, never success.
⚠️ This is not the coupon pass and must not be folded into it. The coupon pass writes coupons; this step re-reads the source afterwards, which is the entire point. Run inside the import, it returns the answer the import already had.
⚠️ It is not the rerun pass either (see "Rerunning an import for new and modified records"). A rerun covers new and changed records; a voucher spent since the write is neither — nothing the rerun compares changed. They are separate obligations at an agreed cutover.
⚠️ Expect to run this step more than once. It is idempotent and safe at the end of every execution, but its deadline is cutover, so re-invoke it close to actual cutover. The completion record from the last invocation before cutover is the authoritative answer; an earlier
not-runorplan-pending-owneris a warning that the obligation is still open, not a verdict that it was skipped.Record the result in
execution/completion-report.jsonasvoucherReconciliation, one ofnot-applicable | reconciled | plan-pending-owner | remedied | not-run(see "Completion report contract"). -
Save durable execution artifacts, including the authoritative completion artifact and deterministic user-facing completion summary.
Contacts/Members disposition (live at the destination)
Contacts and members are written with the source's real email and phone (safe mode was
removed; notifications rely on the site mute). What that means for login
identity depends on whether members/member is itself a generated import target for this
run, per rp-import-codegen's member pass:
members/memberNOT in the generated scope: the contact-import pass alone builds no Wix Members (memberCrosswalkis stubbed to always returnnullso order/blog author resolution has something safe to call), so no customer gets a login identity from this run. Creating the Member is then a distinct, separate, later write (ensureMemberwith the contact's email as loginEmail, so the Member lands on that same contact rather than a duplicate).members/memberIS in the generated scope: the generated member pass runsensureMemberagainst each registered customer's email in its own loop before order history, so customers get a Member from the entity-import pass itself.
Do not state either version as the migration's blanket behavior without checking which one
this run's actual generated scope produces. Every completion/status summary that touches
contacts reports by count how many contacts have a Member and how many do not. A contact
written while safe mode existed may still carry a mock replatform+...@wix.com email; report those
separately, since they need their real email PATCHed before a Member is created for them.
Email marketing consent
When the source records a real per-record consent signal for marketing email (e.g. a
WooCommerce order's checkout consent-checkbox meta, not mere presence as a customer), import
it to Wix Email Subscriptions with crm/email-subscription's bulkUpsertEmailSubscriptions
writer (rp-target-wix/lib/wix-writers.js). It is live-verified: keyed by email address,
covers guest-checkout consent with no Contact behind it, and sets a status only, with no
confirmation or marketing email. Only write a subscribed state when there is consent evidence
(consent-proof-required). Per email: every order ticked → write SUBSCRIBED; no order
ticked → write nothing (an absent tick is not a decline and not consent); ticked and unticked
orders mixed → do not pick a rule: keep that email's subscription pending with its order
evidence, so it reaches cutover for the operator to decide
(order-scoped-consent-has-no-decided-fold-rule). Write to Email Subscriptions, the
entity's current writer (email-subscriptions-vs-marketing-consent-api-unresolved).
Rerunning an import for new and modified records
The source keeps trading after an import finishes: newer records arrive, earlier records change, earlier failures are still missing. A rerun reuses the same project, destination, mapping, generated importer and crosswalk — it is not a fresh migration, and any mapping or scope change goes back through the existing gates.
Catch-up may extend the end of the range to the new capture time. It does not pull older history the accepted scope excluded, and it does not propagate deletions.
⚠️ A rerun does not cover bearer-voucher drift, and must never be reported as having done
so. A voucher spent at source since the import is neither a new record nor a changed one in
anything selectRerunRecords compares. That obligation is workflow step 6b, it is separate,
and it is deadlined at cutover.
Selection. Refresh the agreed scope and bucket it against the crosswalk with
lib/import-recovery.js's selectRerunRecords — create missing, skip unchanged, update
changed, and report unknown where there is no usable comparison evidence. The pre-existing
--missing-only and --failed-only filters are not a delta between them: missing-only
excludes every crosswalk hit, so a changed record is never seen, and failed-only only revisits
what was already attempted. Read refreshed files covering the whole agreed scope; a
modified-since optimization is allowed only when it still includes boundary records, older
retries and unresolved decisions.
The version pair. Every confirmed write records the source's version (sourceVersionField
sourceVersion, or a declaredsourceHashfallback) and the WixtargetRevisionreturned by that write, vianextCrosswalkBaseline. A confirmed write that returns no revision does not advance the pair at all — including a first create. Half a pair is not a baseline: a source version saying "applied" with no revision leaves the next update with no concurrency guard, and on a re-write it would pair a new source version with a pre-write revision and self-conflict. Both reconcile instead. A linked record with no saved revision is likewise reportedunknownrather than updated, which also covers legacy rows written before the pair existed. Treat both as opaque; never increment a revision locally. A failed, conflicted, dry-run or skipped write must not advance the pair — that is what keeps the record eligible for recovery instead of recorded as applied. Missing metadata on an old row isunknown, never "unchanged".
Conflicts are a user decision, including in one-click mode. When Wix rejects an update
because its revision moved, stop updating that record and show the user the error, the record,
and the source changes proposed for it — lib/rerun-conflicts.js builds that review and
classifies the error. Ask once per record, not per field. Never silently fetch a newer
revision and retry; there is deliberately no such helper. Unrelated records continue; work
depending on the unresolved update stays blocked.
⚠️ The conflict-code list is incomplete by design. Only INVALID_REVISION has been
observed live (on a delivery profile). Products v3 and Contacts v5 conflict codes
are not known, so they are absent rather than guessed. Two things keep that safe: the
accepted mapping can declare an entity's real codes (entityConflictCodes), and an
unrecognized 409 on a revision-carrying update classifies as possible_revision_conflict —
which goes to a human, never to an auto-retry and never silently into an ordinary failure. When
a real conflict code is observed, record it in the entity's declared codes and in
OBSERVED_REVISION_CONFLICT_CODES with its evidence.
On override, read the latest Wix record, show which values would be replaced, and write
against the revision the user actually reviewed. A further conflict is another decision. On
keep, leave Wix alone and record the choice against that exact source version and reviewed
revision in the recovery log — never as a crosswalk baseline, because the source version was
never applied — persist it through the recovery entry's conflictDecisions[] and read it back
with latestConflictDecisionFor, so a later rerun does not re-ask a question the user already
answered or silently overwrite what they chose to keep. loadRecoveryLog returns an array;
pass it straight in. Do not report a kept change as imported,
and do not retry it silently later.
Dependencies and safety. Resolve contacts, products and other dependencies before their
dependants. A record with an uncertain prior attempt (deferred, needs_verification,
succeeded_unverified, started) is reconciled before it is written — selectRerunRecords
routes it to needsReconciliation whether it is linked or not. Unlinked, an unconfirmed earlier
write may already exist and creating again would duplicate it. Linked, the danger is subtler:
if the previous write landed and the process died before saving its baseline, the saved revision
is already stale, so re-sending it makes the importer collide with its own write and report that
to the user as a merchant edit.
Updates touch only the fields the accepted mapping covers and preserve unrelated Wix values.
Each entity needs a verified update operation and conflict protection; without both,
updateSupportFor returns report_for_review and the record is reported rather than pushed
through a create/import operation. This is enforced in code, not only documented: the
accepted mapping declares { writerId, revisionParam } per entity, and an entity missing
either is refused. It fails closed — a rerun that does not declare targetEntityRef at all
gets report_for_review for every changed record, because an absent declaration is not evidence
that an update is safe. The order family (ecom/order and its child entities) is denied outright
with neverFallBackToCreate — Update Order exposes a restricted field set and no general
revision parameter, and a same-id Import Order is an unguarded whole-body replacement that
clears omitted fields.
Scope and deletions. Pass the accepted scope as inScope; excluded records are reported
outOfScope and never actioned. Deletions need no rule beyond the refreshed set: a record
absent from the source is never iterated, so absence can never become a delete instruction.
Reporting. Before writes, show the selected scope with counts of new, changed, unchanged and unresolved. Afterwards report created, updated, unchanged, kept-in-Wix-by-user-choice, conflicted, failed, blocked and out-of-scope, with errors and affected records. Unknown counts are not zero. Name the source capture time: a trading source may need another rerun or an agreed cutover.
Required final report contents
When execution finishes, the deterministic completion outputs must explicitly include:
- the destination site's dashboard URL
- the destination site's editor URL only when editor work was actually performed or the next required step is explicitly in the editor
- the current preview URL only when public route/site verification is relevant to the completed work
- whether store routes such as product/cart/checkout were verified or still unverified
- URL preservation counts: base paths captured, URL ledger rows written, redirect plans recorded, unresolved public URLs, and manual-review URL rows
- do not include email addresses or phone numbers.
- dry-run counts when
dryRun: true: requests built, Wix calls skipped, would create, would update, would delete, would require live lookup, and local validation failures. Do not report dry-run rows as created, updated, imported, installed, published, or verified in Wix. - blocked-data request outcomes from
completion-report.json, including every dependent entity/field outcome, the worst-severity aggregate, whether a used snapshot is stale, and the exact snapshot version/extraction timestamp/checksum. A 1-clickmissingrequest must say the run did not pause to ask; an invalid input that fell back successfully is a warning, not a write failure. - an explicit statement that URL redirects/site routing were not applied in the current
import phase when
urlPreservation.applyRedirectsisfalse, the old-link status fromcompletion-report.json.urlPreservation, and that old emails and bookmarks may fail until redirects are applied and verified on the public domain - a plain-language distinction between:
- catalog/data imported successfully
- website/homepage built successfully
- the voucher-reconciliation answer — in every terminal report of a run whose accepted
scope included coupons (workflow step 6b). State in plain language which of
not-applicable,reconciled,plan-pending-owner,remediedornot-runthe run recorded, and say what it means:plan-pending-ownermeans money is still redeemable a second time on the merchant's live store and the owner has decisions outstanding per code;not-runmeans the step was due and did not happen, and that the answer expires at cutover because the fresh source read stops existing and the target exposes no redemption count. Never infer this from the coupon write counts — report the recorded field, and report a missing field asnot-run. - notification-mute state — in every terminal report (completed, halted
to needs-user, or aborted; an aborted run is exactly the case where the owner is least
likely to remember the mute happened). Derive "was muted" only from recorded state
— the
mute-site-notificationsitem insetup/setup-verification.jsonand the import run's preflight log entries — never from strategy/config inference. When a successful mute is recorded, state in plain language that all site notifications are currently muted and stay muted until re-enabled; that the owner can simply ask the agent to unmute them (on request the agent callsunmuteSiteNotificationsand confirmsmuted: falseviagetSiteMuteState); and how to re-enable manually. For existing sites this line is mandatory and prominent. The completion report carries this asnotificationMuteplus thenotifications-mutedoperator action (the unmute reminder for cutover); report it from there. If no successful mute is recorded, do not claim the site is muted — for a run where mute was in effect, that is a blocker that should already have stopped the import at the preflight.
Do not report a successful catalog import as if it automatically means a finished website. If the homepage/root preview is still blank or no site shell has been built, say that explicitly in the final report.
State the delivery mode explicitly (see wix-replatform → "Delivery mode"):
managementmode (default): report that the deliverable is a Wix-managed headless backend — data migrated and manageable from the dashboard, with no customer-facing website built (by design). Do not frame the missing storefront as an incomplete result. You may note that a storefront can be generated on request (website mode, viawix-headless), but do not build one unless the user asks.websitemode: report the storefront URL produced bywix-headlessand confirm the released site serves the migrated catalog (not demo data).
Inventory completion and resume
Run the generated inventory reconciliation for new AND previously crosswalked products. Require the current inventory setup/canary receipt before stock writes, retaining the run's notification guard. After each batch persist stock outcomes separately from product success. If stock failed, resume only stock using existing product/variant IDs; never recreate a product or increment a quantity to recover it.
Include state/inventory-report.json in the completion inputs: intended variant denominator,
reconciled/created/updated, failed/unverified, and source decision-needed counts. Unknown stock
and missing variants remain visible. Any unresolved inventory makes catalog completion partial;
a product count or HTTP 200 cannot clear it. Compare source versus verified target availability
per variant and summarize out-of-stock counts. A source with available variants cannot pass
with an entirely unavailable target. Dry-run inventory outcomes are simulated, never live proof.
Completion artifact authority
At the end of the run, artifact authority should be explicit:
execution-log.mdis authoritative for chronology and operator/debug context onlyexecution/completion-report.jsonis authoritative for final outcomeexecution/review/completion-summary.mdis the deterministic user-facing rendering ofexecution/completion-report.json
This skill should not treat execution-log.md as the canonical source for final
imported/skipped/failed counts when completion-report.json exists.
That ordering is unchanged. What changed is that all four artifacts now actually get written, by shipped code, rather than being required by this document and produced by nothing:
execution-log.md—appendExecutionLog(projectDir, entry)inlib/execution-log.js. Append-only: a resumed or recovery pass adds entries and never truncates or regenerates the file, and every entry carries its ownrunIdso a later pass's entries are distinguishable from the first pass's without reading timestamps. Append one entry per lifecycle event: each import step started and finished, every batch flush, every recovery pass, the completion write, and the handoff generation.execution/completion-report.jsonandexecution/review/completion-summary.md—writeCompletionReport(projectDir, report)inlib/completion-report.js. The summary is rendered from the report object, never composed independently and never derived fromexecution-log.md. The writer itself joins source coverage (below); pass it the report fromcreateCompletionReportunchanged and never addsourceCoverageyourself — it refuses that.execution/live-import-summary.json—writeLiveImportSummaryinlib/import-recovery.js, called after every batch, not once at the end. See "Per-batch accounting" below.
For order history, use the generated accounting block from rp-import-codegen: collect the
final per-order stage outcomes with collectOrderStageResiduals and pass its rows to
createCompletionReport before calling writeCompletionReport. Omitted stage accounting is
refused for order reports. Persist these compact outcomes with batch accounting and restore
them on resume; a retry is not a second imported order, and a recovered stage must replace
its earlier failure. Check the saved report and summary for both the incomplete status and
the affected source keys when any payment, refund, or invoice stage failed.
appendExecutionLog is not a heartbeat. Liveness and progress output for watching a running
script is lib/progress-log.js, writes to a caller-supplied path, and is a separate contract.
Run the import under the supervisor — the agent is woken only on events
The top-level agent runs the long import (or extract) itself, never a subagent: a subagent cannot end its turn while it waits, so it polls, and every poll re-sends its whole context. A Developer prepares and tests the code, then returns; it does not launch the full import.
node skills/wix-replatform/scripts/import-supervise.js --project <projectDir> \
[--entry src/import/run-import.js] [--max-resumes 3] [-- <entrypoint flags>]
Run it in the host's background mode and end your turn. The host wakes you once, when it
exits. Do not poll: no sleep loops, pgrep, kill -0, tail of logs or health checks while
it runs. The import runs detached from your command, so the host's tool-call time limit does not
stop it. If the call is stopped (for example at the host's background time limit) or prints
still_running (exit 12, after --wait-max, default 100m), the import is still running: run the
same command again and end your turn. On a host without background mode (for example Codex),
run it in the foreground and stay in the same turn: on still_running or a stopped call, run the
same command again right away; do not end your turn while the import runs. It never starts a
second import. To stop the import, run it with --stop; the next normal call resumes.
It sends the entrypoint's output to logs/import-supervise.log, watches
execution-health-check.js itself, and after a crash or a stalled verdict re-runs the same
entrypoint with the same flags (a resume from the attempt journal and crosswalk). It kills on
stalled only when the generated code under src/ has heartbeats (withHeartbeat /
startHeartbeat). Without them it reports heartbeatMissing: true, and stops the run with
resume_limit / stalled_without_heartbeat after six stale windows in a row; a Developer then
adds the heartbeats as rp-import-codegen describes. It prints one JSON line and exits:
| Exit | outcome |
What you do |
|---|---|---|
| 0 | complete |
Continue to the completion report and entity-by-entity QA. |
| 10 | needs_decision |
reason is auth_stop, pending_user_action or awaiting_user_action; handle the listed userActionIds as this resource already says, then run the supervisor again. |
| 11 | resume_limit |
--max-resumes failures in a row with no new settled progress (more records imported, more crosswalk rows), or --max-launches launches in this call (reason: launch_cap). See reason and lastError. Dispatch a fresh Developer with a handoff (`subagent- |
Truncated - read the full file at https://github.com/wix/skills/blob/HEAD/skills/wix-replatform/resources/rp-execute-import/SKILL.md.
