agentleFS
0xelitesystem0xelitesystem/claude-skills-collection/skills/csv-cleaner/SKILL.md

csv-cleaner

Skill0 starsChanged 5 months agoMITView on GitHub

Use when the user provides a CSV or TSV file that is broken, malformed, or messy. Triggers on phrases like "fix this CSV", "clean up this data", "this CSV won't import", or when a file with .csv/.tsv extension is shared and the contents show obvious problems (mixed delimiters, encoding artifacts like ÃÂ, ragged rows, headers in the middle, etc.).

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Inspect the first 200 lines: Don't load the whole file blindly.

    line 12
  2. Distinctive:

    If >95% of non-empty values fit a type, suggest that type

    line 34
  3. Distinctive:

    Never coerce silently; report the inference and let the user confirm

    line 35

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

CSV Cleaner

Detect and fix common CSV problems without losing data.

Process

  1. Inspect the first 200 lines. Don't load the whole file blindly. Look for:
    • Encoding artifacts (ÃÂ, ’, \ufffd) → likely UTF-8 read as Latin-1 or vice versa
    • Mixed delimiters (commas in some rows, tabs in others) → file is mislabeled
    • Quoted fields containing the delimiter
    • Headers appearing more than once (file is concatenated dumps)
    • Trailing commas (Excel quirk)
    • BOM at start of file
  2. State the diagnosis to the user before changing anything. "I see X, Y, Z problems. I will fix them by doing A, B, C. Confirm or tell me what to skip."
  3. Fix in this order:
    • Re-decode encoding if artifacts present (try cp1252 → utf-8, latin-1 → utf-8)
    • Strip BOM
    • Detect actual delimiter via csv.Sniffer or character-frequency analysis
    • Re-parse with the correct delimiter and quote character
    • Drop duplicate header rows (keep first)
    • Pad ragged rows with empty strings rather than dropping them; flag the row count
    • Trim whitespace from cell values but NOT from quoted strings
  4. Type inference (only if user requested):
    • For each column, sample 100 rows
    • Try int → float → date (ISO, US, EU formats) → bool → string
    • If >95% of non-empty values fit a type, suggest that type
    • Never coerce silently; report the inference and let the user confirm
  5. Output: save as a NEW file (don't overwrite the original). Default name: <original>_cleaned.csv. Always UTF-8, always LF line endings, always RFC 4180 quoting.

What NOT to do

  • MUST NOT silently drop rows. Pad them or flag them.
  • MUST NOT rename columns unless the user asks.
  • MUST NOT change cell values (other than re-encoding) unless explicitly requested.
  • MUST NOT assume the first row is a header without checking. Ask if the file has no consistent header.

Edge cases worth flagging

  • Files larger than 100MB: ask if streaming is okay before loading into memory
  • Files with no clear delimiter (likely fixed-width): say so and ask the user to confirm
  • Files where the header has fewer columns than the data: data row with the most columns sets the count

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.