catalog-import-and-migration
Skill1 starsChanged 18 days agoMITView on GitHub
Import, export, and migrate product catalogs with stable SKU keys, a dry run, parent-before-variation order, batched writes, and URL redirects. Use when moving a store between platforms, bulk importing CSV or JSON products, or exporting a catalog for another system.
In this repository28 other files it gives its agents.
- b2b-pricingSkill
- checkout-ux-and-conversionSkill
- conversion-event-trackingSkill
- ecommerce-seo-structured-dataSkill
- fraud-and-risk-basicsSkill
- google-merchant-product-feedsSkill
- headless-nextjs-storefrontSkill
- inventory-and-multi-warehouseSkill
- iranian-payment-gatewaysSkill
- marketplace-search-and-rankingSkill
- mcp-store-toolingSkill
- multi-vendor-payoutsSkill
- order-and-webhook-reliabilitySkill
- payment-gateway-integrationSkill
- product-catalog-modelingSkill
- product-description-guardrailsSkill
- returns-and-refundsSkill
- rtl-and-persian-localizationSkill
- shopify-app-developmentSkill
- storefront-accessibilitySkill
- storefront-performanceSkill
- stripe-paymentsSkill
- subscription-billingSkill
- tax-and-shippingSkill
- vector-product-searchSkill
- woocommerce-plugin-developmentSkill
- woocommerce-rest-apiSkill
- wordpress-plugin-securitySkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
Check every row before writing anything: node scripts/check-import-rows.mjs rows.json reports duplicate SKUs, variations without a parent, …
- Distinctive: line 21
Do a dry run that reports creates, updates, and skips per row without writing.
- Distinctive: line 22
Import in order: categories and attributes, then parent products, then variations, then images and relations (upsells, bundles).
- Distinctive: line 23
Write in batches (the WooCommerce batch endpoint takes up to 100 items per request) and record the target id for every source key, so a …
- Distinctive: line 24
Create 301 redirects from every old product and category URL to the new one.
- Very specific: line 29
Look up each row by its key before deciding create or update.
- Distinctive: line 53
Every old URL in a sample returns 301 to the right new page.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Catalog import and migration
An import is a repeatable job, not a one-off script. Run it against a copy first, make it safe to run twice, and keep a report of every row. Column maps between platforms are in the field mapping notes.
Procedure
- Export the source with every field you need: products, variations, attributes, categories, images, stock, prices, SEO fields, and old URLs. Keep the raw export unchanged.
- Map fields to the target in one file. Normalize units, currencies, decimals, and booleans there, not in ad hoc fixes.
- Choose a stable key. Use the SKU when every sellable unit has a unique one; otherwise keep the source id in a dedicated field such as
meta:source_id. Never key on the product name. - Check every row before writing anything:
node scripts/check-import-rows.mjs rows.jsonreports duplicate SKUs, variations without a parent, invalid prices, and negative stock. - Do a dry run that reports creates, updates, and skips per row without writing.
- Import in order: categories and attributes, then parent products, then variations, then images and relations (upsells, bundles). A variation needs its parent's id.
- Write in batches (the WooCommerce batch endpoint takes up to 100 items per request) and record the target id for every source key, so a rerun updates instead of duplicating.
- Create 301 redirects from every old product and category URL to the new one.
- Compare counts and totals: products, variations, stock units, and a sample of prices.
Idempotent runs
Look up each row by its key before deciding create or update. Store source key -> target id after every batch. A crash halfway through then resumes without duplicates.
Images
Download source images once, deduplicate by content hash, and upload them to the target media library before linking them. Hotlinking to the old store breaks when it shuts down.
Exports
Export with a documented column set and UTF-8. Include ids, SKUs, and parent references so the file can be imported back. Use . as the decimal separator and ISO 8601 dates. Escape fields with quotes according to RFC 4180 when writing CSV.
Gotchas
- Spreadsheet programs strip leading zeros from SKUs and barcodes and turn long numbers into scientific notation. Treat them as text.
- Importing variations before their parent creates orphans or fails. Sort parents first.
- Prices with a comma decimal (
19,90) parse as 1990 or fail in some importers. - Running the import twice without a key creates every product twice.
- Missing redirects lose search rankings and break links in old emails.
- Customer passwords usually cannot move between platforms. Plan a reset email instead of copying hashes the target cannot read.
Verification
- The row checker reports no errors before the real run.
- A second run of the same file updates rows and creates nothing.
- Product, variation, and stock totals match the source.
- Every old URL in a sample returns 301 to the right new page.
- A variable product shows the same options and per-variation prices as the source.
Evaluation
Worked examples and the checks they must satisfy are in evals/tasks.json.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

