fast-csv-import

Parses and validates bulk product CSV files for import into a multi-tenant catalog database.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/gengirish/dropflow --skill fast-csv-import-gengirish
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fast-csv-import
Source: https://github.com/gengirish/dropflow/tree/main/.cursor/skills/fast-csv-import
Command: npx skills add https://github.com/gengirish/dropflow --skill fast-csv-import-gengirish

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @fast-csv/parse, zod.

What problem does it solve? Manually entering hundreds of products into a catalog is slow and error-prone. This Skill implements a stream-based CSV bulk import pipeline that validates every row, upserts products by SKU, and returns a detailed per-row error report. ## Core Features & Use Cases - Stream-Based CSV Parsing: Uses @fast-csv/parse to process files without loading the entire CSV into memory. - Row-Level Zod Validation: Validates SKU, HSN code, prices in paise, GST rates, and stock quantities before any database write. - Idempotent Upserts: Upserts on the (tenantId, sku) composite key so re-importing the same file updates products instead of duplicating them. - Use Case: A supplier sends a 5,000-row product catalog CSV. Upload it through the bulk import API route, and receive a report showing 4,950 imported rows plus 50 rows with specific validation errors and their row numbers. ## Quick Start Ask the AI to implement the bulk product CSV import API route using fast-csv with Zod validation and upsert logic for the catalog feature.

Frequently Asked Questions about fast-csv-import

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I import products from a CSV file in Next.js?▼

Use @fast-csv/parse to stream-parse the uploaded file in an API route, validate each row with a Zod schema, then upsert products into the database. Return a result object with imported count, skipped count, and per-row error details.

How to validate CSV rows with Zod before database insert?▼

Define a Zod schema matching your CSV columns using z.coerce.number() for numeric strings, then call safeParse on each row in the parser's data event. Failed rows are collected into an errors array with row number, SKU, and issue messages instead of being inserted.

Does fast-csv handle large CSV files without memory issues?▼

Yes, @fast-csv/parse supports stream-based parsing via Node.js Readable streams, processing rows incrementally rather than loading the entire file into memory. Pipe the buffer through Readable.from() into the parse stream for constant memory usage.

How do I prevent duplicate products when re-importing a CSV?▼

Use a database upsert keyed on a composite unique constraint of tenantId and SKU. Re-importing the same file updates existing product rows with new prices and stock instead of creating duplicates.

Why does my CSV import fail on numeric price columns?▼

CSV parsers return all values as strings, so numeric columns fail strict number validation. Use z.coerce.number() in the Zod schema to convert string values, and store prices as integer paise to avoid floating-point rounding errors.