- Home
- Skills
- Data & Databases
- csv import overlap preflight
Works with the AI Agents you already use
csv import overlap preflight
Audit CSV files for schema mismatches, duplicate keys, and record overlaps before importing into existing datasets.
$5
csv import overlap preflight
Example session with this skill installed
I have a transactions.csv to import into a Postgres table that already has data. I got a unique constraint error on my last attempt. Here is the schema and a sample of the CSV and table.
- Read your context and instructions
- Compiled the csv import overlap
- Generated the data export
The analysis identifies a partial import state where 12 records from the source file already exist in the destination table, causing the unique constraint violation on the tx_ref_id field.
CSV Preflight Report: transactions.csv
Status: BLOCKED
Scope and coverage:
- Source:
transactions.csv(1,000 rows examined). - Destination: Postgres
ledger_entriesschema (provided). - Evidence: Full source file and redacted destination export (50 rows) provided.
Risk summary:
1.
Partial Import State: 12 rows in the source file share a tx_ref_id with records already in the destination. A simple retry will continue to fail.
2.
Type Mismatch: The amount column in the CSV uses a comma separator (e.g., "1,200.50") which may fail standard DECIMAL ingestion without pre-processing.
3. Timezone Ambiguity: Source dates lack offset metadata; destination expects UTC.
Field map:
| Source Column | Destination Field | Type | Notes |
|---|---|---|---|
tx_ref_id | uuid_key | UUID | Primary Key; 12 collisions found. |
date_str | created_at | TIMESTAMPTZ | Assumption: Source is UTC. |
amount | val_numeric | DECIMAL | Needs comma stripping. |
Collision findings:
- Within-file duplicates: 0.
- Confirmed stable-ID overlaps: 12 (matching on
tx_ref_id). - Constraint conflicts: unique_violation on
uuid_key.
Match rule:
Matches are verified via tx_ref_id, which is a documented stable provider ID. This key is sufficient to identify duplicates.
Staging plan:
- Filter source: Extract the 12 identified overlapping IDs into a
skip_list.csv. - Dry run: Attempt a staged import of the remaining 988 rows into a temporary table
ledger_entries_stg. - Verify counts: Ensure
SELECT count(*)matches 988 before merging into production. - Transformation: Apply
replace(',', '')to the amount field during the copy command.
Next steps:
- Confirm if the 12 overlapping rows in the destination contain identical data to the source or if they are different records sharing an ID.
- Verify if the source timezone is indeed UTC before proceeding with the
TIMESTAMPTZmapping.
transactions.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
Importing data into an existing system often leads to duplicate records, primary key collisions, or partial-run corruption. This skill provides a read-only audit of your CSV files against destination schemas to identify risks before you commit any changes. It helps you map fields, catch within-file duplicates, and verify idempotency for retries.
What it does
- Source profiling analyzes headers, row counts, null values, and data types to ensure compatibility.
- Collision detection separates within-file duplicates from potential cross-source matches and constraint violations.
- Schema mapping identifies required fields, type conversions, and ambiguous timezone or currency formats.
- Risk assessment flags lossy data coercion and potential false-positive matches in fuzzy identifiers.
- Staging planning generates a human-controlled dry run strategy including rollback points and skip behaviors.
How it works
- Provide context by describing the destination system, schema constraints, and the intent of the import.
- Submit evidence using redacted samples or files for both the incoming data and existing record exports.
- Review report to see the readiness status, field mappings, and specific collision findings.
- Execute plan by following the generated staging steps in a non-production environment.
Frameworks & tools
This tool is platform-agnostic and works with any CSV-based data flow, including SQL databases, CRM imports like Salesforce or HubSpot, and financial systems. It utilizes local file-reading capabilities to process data without external API calls.
Why this beats prompting it yourself
Generic prompts often overlook the difference between a within-file duplicate and a destination constraint violation. This skill enforces a strict evidence-based review that prevents the agent from guessing schema rules or assuming a retry is safe without an idempotency check.
Use cases
- History reconciliation when merging legacy CSV records into a populated production database.
- Failed import recovery to determine which rows were successfully inserted before a crash.
- Provider syncing to audit incoming third-party transaction files for overlapping IDs.
- Schema validation for complex mappings where date formats or currencies might cause silent failures.
Known limitations
This is a read-only tool and cannot execute imports, delete records, or connect to live databases. It requires manual provision of destination schema rules and existing record samples to detect overlaps.
How to use
Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed 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 scanned
Verified clean 14 days ago
- Passed all security checks, Safe to install