- Home
- Skills
- APIs & Backend
- Plan-Then-Commit CSV Import
Plan-Then-Commit CSV Import
A customer moving off paper or off another system hands you a spreadsheet, and typing it in by hand is how errors get into billing.
$29
Works with the AI Agents you already use
Plan-Then-Commit CSV Import
Example session with this skill installed
Use the CSV importer to plan an import for 'users.csv' using 'user_schema.json'. The system should check for existing users by email and validate that each row has a valid subscription tier.
- Read your context and instructions
- Compiled the plan-then-commit csv import
- Generated the data export
I have parsed 'users.csv' against your schema. No records have been written to the database yet. The planning phase identified 127 valid operations and 3 rows with validation errors.
Import Plan Summary
| Metric | Value |
|---|---|
| Total Rows | 130 |
| Fingerprint | 8f2a1b3c...e5d7 |
| Actions | 85 Creates, 42 Updates |
| Errors | 3 (Validation Failed) |
| Status | BLOCKED (Resolve errors before commit) |
Identified Issues
- Line 14:
emailis missing a required value. - Line 44:
subscription_tiervalue "PremiumPlus" is not in the allowed ENUM (Basic, Pro, Enterprise). - Line 102:
user_id"USR-999" already exists in this file (Duplicate).
Recognized Columns
user_id (Mapped to: id), Full Name (Mapped to: name), Email Address (Mapped to: email), Tier (Mapped to: subscription_tier).
Next steps
- Fix the validation errors in
users.csvfor lines 14, 44, and 102. - Re-run the plan command to generate a new fingerprint.
- Call
importer.commit()with the new plan to execute the transaction.
users.csv
CSV · data export
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
A customer moving off paper or off another system hands you a spreadsheet, and typing it in by hand is how errors get into billing. Importing it directly is only safe under two rules: nothing is written until the operator has seen exactly what will happen, row by row; and the write is all or nothing, because a half-imported list produces duplicate records nobody can explain.
Parser and writer (csv.mjs): RFC 4180 (quoted commas, embedded newlines, doubled quotes), BOM stripped, CRLF and LF alike, trailing blank lines dropped; toCsv quotes what must be quoted and neutralizes formula injection so an export of customer data cannot execute in a spreadsheet.
Importer (importer.mjs): declare your fields with synonyms (headers are matched ignoring case, spaces and punctuation), required, unique, type number or date with min/max, enum, pattern, normalize, validate, requireOneOf groups and cross-field rowRules. plan(text, { find, exists }) returns every row as create, update or error with every reason at once (missing values, bad formats, duplicates within the file and against the store), the unknown columns, a summary and a SHA-256 fingerprint of the parsed content; it writes nothing. commit(text, plan, store) refuses a plan with error rows, refuses when the file changed since approval, runs every create and update inside your begin/commit/rollback and rolls back on any throw. formatPlan renders the operator's preview; schemaFromJson builds a schema from JSON without functions.
CLI (import-cli.mjs): preview a file against a JSON schema and an optional existing-records file, exit 0 only when every row is importable.
7 tests covering the parser edge cases, formula-safe output, synonym mapping, a fixture with eight kinds of row problems, empty and keyless files, commit refusal and rollback with an ordered write log, and the CLI. Node 18+, no packages, no network.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.
Supports only UTF-8 comma-separated files. Memory-bound parsing is limited to tens of thousands of rows. Requires a transactional database wrapper for atomicity.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 17 days ago
- Software
Node.js 18+