本文へ移動
cccskills
無料GitHub で公開

csv-cleaner

Clean and normalize messy CSV/TSV files - fix malformed rows, inconsistent headers, mixed encodings, stray delimiters, and duplicated records - and deliver a valid, verified file. Use when the user mentions a broken, messy, or malformed CSV, a file a spreadsheet tool refuses to open, or asks to deduplicate or normalize tabular data. Do not use when the deliverable is analysis or a chart rather than a cleaned file, or for Excel-native features like formulas and pivot tables.

日本語の概要は準備中です。原文の説明を表示しています。

連携ツールExcel
インストール方法を見る

含まれるファイル(1)

  • SKILL.md3.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

CSV Cleaner

Repair a malformed delimited file into one that parses cleanly, without silently losing data.

Core principle

Never destroy data silently. Every dropped row, merged duplicate, or coerced value must be counted and reported to the user at the end.

Workflow

1. Diagnose before touching anything

file -i input.csv          # encoding
head -5 input.csv          # delimiter, header shape
wc -l input.csv            # row count baseline

Then attempt a strict parse (e.g. Python csv with strict=True) and record every failure with its line number. Common findings:

SymptomLikely cause
Field count varies by rowunquoted delimiter inside a value
� replacement charswrong encoding assumption (try cp1252, latin-1)
Header repeats mid-fileconcatenated exports
Rows of only commastrailing padding from export tool

2. Fix in this order

  1. Encoding → convert to UTF-8 first; everything downstream assumes it.
  2. Structural repairs → re-quote fields containing delimiters, remove repeated header rows, drop fully-empty rows.
  3. Header normalization → trim whitespace, deduplicate column names (name, name_2), only rename beyond that if the user asked.
  4. Value normalization → only what the user requested (date formats, casing, whitespace). Do not "improve" values unprompted.
  5. Deduplication → only if requested. Ask which columns define identity if it is ambiguous; exact-full-row duplicates may be merged without asking.

3. Verify — this step is not optional

Re-parse the output strictly. The job is done only when all of these hold:

  • Strict parse succeeds with zero errors
  • Every row has the same field count as the header
  • rows_in == rows_out + rows_dropped (and each dropped row is accounted for)
  • Spot-check 3 rows against the original file — values survived intact

If verification fails, fix and re-verify. Never hand over a file that did not pass.

4. Report

Tell the user: what was wrong, what was changed, exact counts (rows in / out / dropped / merged), and anything that needs their judgment. Write the result to a new file — never overwrite the original.

Edge cases

  • Huge files (>100 MB): stream row-by-row; never load into memory at once.
  • Ambiguous delimiter (commas and semicolons present): count candidate delimiters per line across a sample; the one with a consistent count wins. If neither is consistent, ask the user.
  • No header row: confirm with the user before inventing column names.
  • Numeric-looking IDs with leading zeros: treat as strings; flag if asked to convert to numbers.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

Diagnose failing HTTP API calls - 4xx/5xx responses, timeouts, TLS errors, and auth failures - by isolating the fault layer and producing a minimal reproduction. Use when the user reports an API request failing, pastes an HTTP error response or status code, or asks why a request works in one client but not another. Do not use for designing new APIs or for performance tuning of requests that already succeed.

日本語の概要は準備中です。原文の説明を表示しています。

Krusty84/SKILL.md-Inspector432026年8月1日 更新

Reduce a failing test case, script, or input file to the smallest version that still reproduces a bug. Use when the user has a large reproduction and asks to minimize, bisect, or isolate it, or says things like "it stops failing when I remove half the file". Do not use when there is no reliable reproduction yet - help build one first, then minimize it.

日本語の概要は準備中です。原文の説明を表示しています。

Krusty84/SKILL.md-Inspector432026年8月1日 更新

Generate or update a CHANGELOG.md from merged commits and pull requests, grouped by change type and written for end users. Use when the user asks to write release notes, update the changelog, or summarize what changed between two versions or tags. Do not use for writing individual commit messages or for API-reference documentation.

日本語の概要は準備中です。原文の説明を表示しています。

Krusty84/SKILL.md-Inspector432026年8月1日 更新

Apply the team style guide to source files - naming conventions, comment style, and file organization. Use when the user asks to align code with the style guide or clean up naming.

日本語の概要は準備中です。原文の説明を表示しています。

Krusty84/SKILL.md-Inspector432026年8月1日 更新

Run the project's configured formatter (prettier, black, gofmt, rustfmt) on changed files and fix formatting-only CI failures. Use when the user asks to format code, fix a lint/format CI step, or normalize whitespace and import order. Do not use for logic changes or refactoring.

日本語の概要は準備中です。原文の説明を表示しています。

Krusty84/SKILL.md-Inspector432026年8月1日 更新

Does data things.

日本語の概要は準備中です。原文の説明を表示しています。

Krusty84/SKILL.md-Inspector432026年8月1日 更新

Krusty84 のスキルをすべて見る

このスキルの問題を報告する