Last updated

Skill: Import From File

Reads a product, price, inventory, or supplier file, maps it to the Norce data model, and imports the data in the correct sequence across the relevant MCP servers. For known vendor formats, the import runs with minimal questions. For unknown formats, the skill asks what it needs before proceeding, then offers to save the mapping for next time.

Required MCP servers: Depends on the file content — Product MCP, Pricing MCP, Inventory MCP, and/or Supplier MCP. Config MCP recommended for reference data lookup.

Who it is for: PIM managers, pricing managers, and operators importing product data, prices, or stock from external systems or vendor files.


The skill

This skill has two parts: a vendor profiles section at the top that you fill in over time, and the import logic below it. Start with the vendor profiles empty — the skill will build them up as you import from new vendors.

---
name: import-from-file
description: Reads a product, price, inventory, or supplier file and imports it into Norce in the correct order. Asks clarifying questions for unknown formats and saves mappings for recurring vendor imports.
---

## Vendor profiles
<!-- Add a profile block here for each recurring vendor after the first import.
     The skill will use the saved mapping and skip the setup questions. -->

<!-- Example profile (remove the comment markers and fill in your values):
VENDOR: Acme Electronics
  File format: CSV, semicolon-delimited
  Content type: supplier products + cost prices
  PartNo source: use from file (column: ArticleNo)
  Field mappings:
    ArticleNo → PartNo
    ProductName → Name
    Description → Description (sv-SE)
    CostPrice → price (price list: ACME-COST)
    StockQty → on-hand (warehouse: ACME-STANDARD)
  Supplier code: ACME
  Price list code: ACME-COST
  Warehouse code: ACME-STANDARD
  Import order: supplier products → prices → stock
  Notes: Always skip rows where ArticleNo is empty.
-->

---

## Import logic

You are running a file import into Norce Commerce.

Application ID: Use the application ID from your session instructions. If no
application ID is available, ask the user which storefront to import into
before proceeding.
File to import: $ARGUMENTS

**Step 1 — Identify the vendor and format**

Check the vendor profiles section above. If the file matches a known vendor
profile, confirm this with the user and proceed directly to Step 3 using the
saved mapping.

If no matching profile exists, this is an unknown format. Proceed to Step 2.

**Step 2 — Gather information (unknown formats only)**

Before touching any data, ask the user the following questions. Wait for all
answers before proceeding.

1. What is the name of this vendor or data source? (Used to save the mapping
   for next time.)

2. What does this file contain? (Select all that apply)
   - New or updated products (product master data)
   - Product content (descriptions, names, images)
   - Retail prices
   - Cost prices (supplier)
   - Stock / on-hand quantities

3. For products: should the PartNo (product identifier) come from the file,
   or should Norce generate a new PartNo for each product?
   - Use PartNo from file — which column?
   - Let Norce generate PartNo

4. Show the user the column headers from the file and ask them to confirm or
   correct the following mapping. Propose your best guess for each column
   based on the column name and sample values, and ask the user to confirm,
   correct, or mark as "skip":
   - [column] → [proposed Norce field] — correct?

5. Are there any rows in the file that should be skipped? (e.g. rows where a
   specific column is empty, or rows flagged as inactive)

6. Which Norce price list, warehouse, or supplier code should the data be
   imported to? If unsure, offer to look them up using the Config or Pricing MCP.

Once all questions are answered, summarise the confirmed mapping and ask for
explicit approval before importing:

"I am about to import [N] records from [vendor name] using the following
mapping: [summary]. Products will be created/updated in [scope]. Shall I
proceed?"

**Step 3 — Import in the correct order**

Follow this sequence exactly. Do not start a later step until all jobs in the
previous step have completed successfully.

If the file contains content, prices, or stock but no product master data, the
products must already exist in Norce. Verify this by calling
norce_product_lookup_products with a filter on PartNo for a sample of the
PartNos in the file. Do NOT use norce_product_preview_product — that tool only
shows published products and will miss products that are in progress or not yet
active. If products are not found, stop and report which PartNos are missing
before attempting any import.

1. **Product master data** — if the file contains product master data, import
   first using norce_product_upsert_products. Poll for job completion before
   continuing. Products must exist in Norce before any subsequent step can run.

2. **Product content and supplier data in parallel** — once product master data
   is confirmed, run the following in parallel if present:
   - Product content (norce_product_update_content) — requires products to exist
   - Supplier product mappings and cost prices (norce_supplier_import_products)
     — requires products to exist; must complete before retail prices in step 3
   Poll both jobs for completion before continuing.

3. **Retail prices and stock in parallel** — once step 2 is confirmed, run the
   following in parallel if present:
   - Retail prices (norce_pricing_import_sku_prices) — import after supplier
     cost prices are in place, as retail price rules may reference supplier cost
   - On-hand stock quantities (norce_inventory_import_onhands)
   Poll both jobs for completion.

Report the result of each job as it completes. If any job fails or returns
errors, pause and report the failure before continuing to the next step.

**Step 4 — Verify a sample**

After all imports are complete, verify that the data landed correctly by
spot-checking 3–5 records from the file against what is now stored in Norce.
Use norce_product_lookup_products to retrieve the products — not
norce_product_preview_product, which only returns published products.
Flag any discrepancies between the file and the imported data.

**Step 5 — Save the mapping (unknown formats only)**

If this was an unknown vendor format, first ask:

"Is this a file format you expect to import again — for example a recurring
vendor feed? Or is this a one-off file?"

If the user confirms it is a recurring format, generate a vendor profile block
in the format shown in the Vendor profiles section above, using the confirmed
mapping from this session. Then:

- **Claude Code users:** Offer to add the profile block directly to this skill
  file (`.claude/commands/import-from-file.md`) so it is available next time
  without any manual steps.
- **Claude Desktop users:** Display the profile block and instruct the user
  to paste it into the Vendor profiles section of `SKILL.md` and re-upload
  the zip file to keep the mapping for next time.
- **Other clients:** Display the profile block and ask the user to save it
  somewhere accessible for the next import session.

If the user says it is a one-off file, skip this step entirely.

How to install

Save this skill using the filename import-from-file and follow the installation instructions for your client.

ClientWhat to do
Claude DesktopCreate SKILL.md inside an import-from-file/ folder, zip it, upload via Settings → Skills. After importing from a new vendor, update SKILL.md with the saved vendor profile and re-upload.
Claude CodeSave as .claude/commands/import-from-file.md, invoke with /import-from-file filename.csv. The skill can update its own vendor profiles directly after new vendor imports.
VS Code / CursorCopy the skill content, replace $ARGUMENTS with a reference to the file, paste into chat and attach the file

What to customise

The application ID is read from your session instructions — no placeholder to fill in. If you want this skill to always target a specific storefront regardless of your default instructions, add Application ID: [the ID] directly after the description block.

The main customisation is filling in vendor profiles as you import from recurring sources. The skill guides you through building these profiles — you do not need to create them manually.

Pre-filling known vendor profiles. If you already know the field mapping for a vendor, add a profile block to the vendor profiles section before your first import. Use the example block in the skill file as a template. This skips all the setup questions and lets the import run immediately.

Adjusting the verification sample size. The skill spot-checks 3–5 records by default. For high-stakes imports, increase this: add to the skill Verify 10 records after import, including the first, last, and 3 random records from the middle of the file.


Example usage

/import-from-file acme-weekly-update.csv (Known vendor — imports immediately with no questions)

/import-from-file techsupply-catalogue-june.xlsx (Unknown vendor — skill asks mapping questions, then imports, then saves mapping)

"Import this file. It contains products and retail prices from our Swedish distributor."

"Run the weekly Acme import — the file is attached."


About recurring imports and mapping memory

For vendors you import from regularly, the vendor profile is the key mechanism. Once a profile is saved, the skill recognises the vendor's file format and imports without asking questions. Over time, the skill file becomes a record of all your vendor mappings — a configuration asset that reflects exactly how your team handles each data source.

For vendors with irregular or one-off files, the skill always asks what it needs and produces a clean import without requiring any pre-configuration.

If your team uses Claude Code, the skill can maintain its own vendor profiles by editing the skill file directly after each new vendor import. For Claude Desktop users, this requires a manual update to the zip file — a small overhead that is worth it for vendors you import from frequently.