Index of every page on this site: llms.txt
All skills
newdee avatar

/csv-cleaner

@38ad486
by newdeenewdee/lamarck-skill16 stars
2
Run it yourself

Clean and normalize messy CSV files - encoding detection, header validation, date normalization, deduplication, quarantine of malformed rows. Use when the user asks to clean, fix, normalize, or deduplicate a CSV file.

  • 9 files
  • 16.7 KB
  • Updated 3 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/newdee/lamarck-skill/csv-cleaner

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈58 tokens for metadata: the name and description. ≈466 when used: this file. ≈3.6k more on demand in 7 files.

Description uses 2.9% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈231 characters, or 2.9%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

csv-cleaner

Workflow

  1. Sniff encoding and delimiter. Try, in order: utf-8-sig, utf-8, gbk, cp1252. Use csv.Sniffer on the first 4KB for the delimiter; if sniffing fails, fall back to comma and say so in the summary.
  2. Validate the header. Compare against the expected columns the user named (or infer from the first row). If a required column is missing, STOP and report expected vs actual header verbatim — do not guess column meanings from position.
  3. Clean rows, applying in order:
    • trim surrounding whitespace in every cell
    • normalize dates to ISO-8601 (YYYY-MM-DD); accept D/M/Y, M/D/Y, YYYY年M月D日; if a date is ambiguous (e.g. 03/04/2021), keep the original value and flag the row in the summary
    • deduplicate by the user-named key column; when the user names no key, deduplicate only fully identical rows
  4. Quarantine, never guess. A row that fails parsing goes to <name>.errors.csv with a reason column; processing continues. If more than 20% of rows are quarantined, ABORT and report the count — the file likely has a structural problem the user must see first.
  5. Write output to <name>.clean.csv. NEVER overwrite the input file. End with a summary: rows in / rows out / quarantined / deduplicated / dates normalized / dates flagged ambiguous.

Failure modes

  • Empty or header-only file → report it, produce no output file.
  • Mixed delimiters across lines → quarantine affected lines, note pattern.
  • Unknown encoding after all four attempts → stop, ask the user; do not transcode lossily.

Never do

  • Never silently drop a row: every removed row is either in the errors file or counted as a deduplicate in the summary.
  • Never reorder columns unless the user asks.
  • Never guess what a column means from its values.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 38ad486. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 3 months ago

README badge

README badge for newdee/lamarck-skill/csv-cleaner