Works with the AI Agents you already use

    Broken CSV Repair & Fast Parser

    by Jace Reid

    1

    Repairs CSV/TSV exports that strict parsers reject — unclosed quotes, stray CRs, ragged rows, BOM and GB18030 — returning clean JSON, a normalized CSV and a line-by-line report of every repair.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Broken CSV Repair & Fast Parser

    Broken CSV Repair & Fast Parser

    Example session with this skill installed

    I exported orders.csv from an old order system and pandas won't read it: there's a missing closing quote somewhere, a couple of rows have the wrong number of columns, and I think the encoding might not be UTF-8. Clean it up for me — give me a JSON file and a normalized CSV, and tell me exactly what was wrong and where.

    • Read your context and instructions
    • Compiled the broken csv repair
    • Generated the data export

    Repair report

    examples/messy-export.csv, shipped with the skill so you can rerun it: 6 columns, 8 rows, 0.4 KB. One command, nine issues found, five of them changed data:

    node scripts/csvfix.mjs examples/messy-export.csv --json table.json --out clean.csv
    
    LineRecordCodeWhat happened
    10bom_strippedbyte-order mark removed
    32bare_quoteunquoted he said "ship it" kept as text (2 quotes)
    43short_row5 of 6 fields, padded
    75unterminated_quotefield closed at the end of its line
    75short_row5 of 6 fields, padded
    86long_row7 fields, 1 dropped: ["more"]
    108stray_crlone CR read as a line break
    119blank_lines1 empty line skipped

    The row that would have ruined the file is 1005: its opening quote is never closed. A strict parser swallows rows 1006-1008 into that one cell. Here the field was closed at line 7 and the following rows survived — and row 1004's genuine multi-line quoted note stayed intact, because only the tail from the bad line was re-read.

    Read messy-export.csv: 6 columns, 8 rows (utf-8, delimiter ',', 0.4 KB)
    Issues: 9 (5 changed data) — bom_stripped ×1, bare_quote ×2, short_row ×2, unterminated_quote ×1, long_row ×1, stray_cr ×1, blank_lines ×1
      • unterminated_quote at line 7, record 5 — closed at the end of its line
      • long_row at line 8, record 6 — 7 fields, 1 dropped: ["more"]
    Wrote table.json
    Wrote clean.csv
    First row: {"order_id":"1001","customer":"Ann Lee","email":"ann@example.com","amount":"120.50","note":"said \"looks good\"","tags":"vip,repeat"}
    

    Clean output — every row the same width, quoting preserved:

    order_id,customer,email,amount,note,tags
    1001,Ann Lee,ann@example.com,120.50,"said ""looks good""","vip,repeat"
    1002,Bob,bob@example.com,88.00,"he said ""ship it""",fragile
    1003,Cara Diaz,cara@example.com,,,
    1004,Dan,dan@example.com,45.00,"multi
    line note",new
    1005,Eve,eve@example.com,10.00,"missing closing quote, x",
    1006,Frank,frank@example.com,12.00,ok,extra
    1007,Gil,gil@example.com,7.00,ok,
    1008,Hana,hana@example.com,9.00,ok,
    

    Next steps

    • Row 1006 lost a seventh field (more); check whether it was real data or a stray comma in the source.
    • Row 1005's note ends where the missing quote was: read the original line before trusting that cell.
    • table.json is ready for the agent: rows are objects keyed by the header, all values strings.

    messy-export.csv

    CSV · data export

    Generated

    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

    Broken CSV files are where agents quietly go wrong. A strict parser throws "unexpected end of data" on one unclosed quote; an LLM asked to "just read it" invents the missing cells; a spreadsheet shifts a column without saying so.

    This skill gives your agent one deterministic program that reads the file the way a careful person would, repairs only what is broken, and reports every repair with its line number - so the table it reasons over is either correct or visibly doubtful.

    What it fixes

    • Unclosed quotes - the row-swallowing bug. The field is closed at the end of its line so the rows after it survive, and legitimate multi-line quoted cells earlier in the file are left untouched (only the tail from the bad line is re-read).
    • Bare quotes and quote junk - he said "ok" and "abc"def keep their characters instead of splitting the row.
    • Stray CR / mixed line endings - old-Mac CRs become record breaks instead of corrupting cells.
    • Ragged rows - short rows are padded to the header width, long rows are trimmed, and the dropped fields are listed in the report.
    • BOM, UTF-16, GB18030, Windows-1252 - detected from the bytes; a non-UTF-8 guess is reported, never silent.
    • Wrong delimiter - comma, semicolon, tab and pipe are scored over the first 100 lines, outside quotes, by field-count consistency.

    What you get back

    • A prose summary you can read in the terminal.
    • --json table.json: {meta, issues[], rows[]} - rows as objects keyed by header (duplicate names get _2), every cell a string.
    • --out clean.csv: RFC 4180, CRLF, one uniform width.
    • --report: the same JSON on stdout, for an agent to consume directly.

    Why buy it instead of prompting for it

    CSV repair is exactly the task where an LLM answer looks right and is wrong. This is about 700 lines of deterministic parsing with no dependencies, no network and no key: the same bytes always produce the same output, and the repair report is the audit trail that lets you check the one row you care about. On a 200,000-row / 10.8 MB export it parses and summarizes in 0.85 s (1.45 s including a 34 MB JSON).

    Honest limits

    • An unclosed quote is repaired at the end of its line: almost always right, and the line is reported so you can look.
    • Non-UTF-8 files are decoded by a heuristic; pass --encoding when correctness matters.
    • Long rows lose their extra fields (listed in the issue detail).
    • No type inference - every value stays a string.
    • The whole file is held in memory, roughly 10x its size at peak.

    Loads whole file into RAM. Closes missing quotes at line-end. No type inference. Delimiter detection uses first 100 lines. Max file size limited by Node memory.

    How to use

    1. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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 7 days ago

    Software
    Node.js 18+

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    File Scopes

    **/*.csv
    Listed7 days ago

    What's inside

    Frequently Asked Questions

    This tool is built for 'hard' CSV failures that crash standard libraries like pandas or D3, specifically handling unclosed quotes, encoding mismatches (Mojibake), and mismatched column counts that typically cause ingestion to fail.

    The skill is a standalone Node.js tool (v18+) with zero external dependencies, making it compatible with any local development environment, CI/CD pipeline, or AI agent capable of executing shell scripts.

    While the script features high-accuracy auto-detection for popular encodings like UTF-8 and Windows-1252, you can manually override the delimiter and encoding settings via CLI flags for highly non-standard files.

    Yes, the skill includes a JSON export mode that produces a structured audit log detailing every repair made, including the specific line numbers and the nature of the structural correction.

    It is deterministic: the same bytes always produce the same output, and it never invents values - it repairs quoting and structure, then lists every change with its line number. An LLM can silently fill in a plausible-looking cell; this cannot, and where a repair is a judgement call (an unclosed quote) it reports the exact line so you can check it.

    You receive the full source code for the repair script (scripts/csvfix.mjs), documentation on all CLI flags, and a license for use within your own workflows or agentic pipelines.

    New in Data & Databases

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.