Messy data cleanup
Cleans a messy CSV or Excel file against rules you approve, one checked fix at a time, so it can be replayed.
What we improved
Added scripts/checks.py, a standard library checker that implements the author's checklist exactly: a scan command for contract synthesis (types, nulls, candidate keys, top values, date share, stray spaces, spelling variant clusters), a pro
Improved by YourAISkill from the original by gaasher, under its MIT licence. The download includes the author's licence and a CHANGES.md listing every change. Both Claude reviews read the improved version.
Claude's review
8/10 Auditable data-cleaning loop driven by an approved contract, deterministic checks from an included stdlib script, keep-or-revert rules, guardrails and a replayable pipeline; heavy for small jobs.
We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.
In detail
Use when the user has a messy tabular data dump (CSV/TSV/parquet/Excel/JSON) and wants it iteratively cleaned to an inferred data contract — a checklist of deterministic pass/fail checks, not a quality score. A single agent profiles the table, synthesizes a per-column contract compiled into binary checks (types, nulls, duplicates, inconsistent categories, format/range violations, outliers), then applies one targeted transform at a time, keeping it only if it reduces its target check's violations with no regression and no guardrail breach. Stops deterministically when every check passes, every remaining check is an unfixable residual, or a budget is hit; emits a replayable pipeline and an auditable ledger. Not for open-ended analysis of an already-clean dataset, diagnosing one known anomaly, or verifying a claim against sources — those are analytical loops; this rewrites the data to a contract.
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: tabular-cleanup
description: "Clean a messy table (CSV, TSV, JSON, parquet or Excel) to an explicit data contract, one verified change at a time. Profiles the raw file, drafts a per-column contract (types, required fields, keys, ranges, formats, canonical categories, cross-column rules) for the user to approve, compiles it into deterministic pass/fail checks that count violations, then applies one pandas transform per iteration and keeps it only if its target check improves with no other check getting worse and no guardrail breached (row retention, protected columns, imputation cap). Stops when every check passes or the rest are honest residuals, and delivers the cleaned file, a replayable pipeline.py, an audit ledger and a report. Includes a standard-library checker script. Use when someone wants a dirty data dump cleaned, standardised or deduplicated in an auditable, repeatable way. Not for exploring an already clean dataset or investigating one known anomaly."
compatibility: "Python 3.9+. scripts/checks.py needs only the standard library for CSV, TSV and JSON (PyYAML for a YAML contract); transforms and parquet or Excel files need pandas."
metadata:
version: "0.2.0"
---
<!-- Modified by YourAISkill (youraiskill.com) on 2 December 2026 from the original by gaasher. See CHANGES.md. -->
# Tabular Cleanup Loop
A **single agent** takes a messy data dump (`<artifact>`) to the cleanest defensible state, with **no human in the loop** once the contract is approved. The objective is a **checklist, not a score**: infer a data contract, compile it into **deterministic binary checks** (each reports a violation *count*, never a weighted float), then each iteration picks the worst open check, applies **one** pandas transform to resolve it, and keeps it only if that check's violations strictly drop with no collateral damage. Every accepted transform goes into a replayable `pipeline.py`; every attempt goes into the ledger.
The work is **structure** (parse correctly, one tidy table, sane types), then **contract synthesis** (turn every observed anomaly into a check), then **the fix loop**. Contract synthesis is where quality is won or lost: an issue the profiler notices but never compiles into a check (classically, many spellings of one category) silently survives, giving a green checklist over dirty data. Checks read the *stored* value, so canonicalisation is real work the loop must do, not a check-time trick.
`scripts/checks.py` computes every count, so the numbers are the same every time and are never LLM judgement:
```bash
python3 scripts/checks.py scan --data FILE # raw profile for contract synthesis
python3 scripts/checks.py profile --contract tcl/schema.yaml --data tcl/versions/vN.csv \
--v0 tcl/versions/v0.csv --version vN --out tcl/profiles/profile-vN.json \
[--residual tcl/residual.txt] [--imputed tcl/imputed.json]
python3 scripts/checks.py decide --before tcl/profiles/profile-vN.json \
--after tcl/profiles/profile-vN+1.json --target CHECK_ID # prints keep or revert, with reasons
```
(Paths are relative to `<sandbox_root>`; run the script from wherever the skill is installed.)
## When to use
Use it to clean a messy table to an inferred, confirmed contract, where every defect is a deterministic check driven to zero or to an honest residual. Default to strict contract inference: a lenient contract that lets dirty data go "all green" fast is the main failure mode. Not for open-ended analysis of an already clean dataset, diagnosing one known anomaly, or checking a claim against sources; this loop **rewrites the data** to match a contract.
## Setup
1. **Find the artifact and settings.** If `loop.run.yaml` exists in the working directory, load it, confirm it in one line and skip to the loop. Otherwise infer each setting and confirm them in one message (use `AskUserQuestion` if the host has it):
| setting | default | notes |
|---|---|---|
| `artifact` | data file in the working dir | **read-only**; detect delimiter, encoding, header and quoting |
| `retention_floor` | `0.95` | rows kept / unique rows in v0 |
...From gaasher's repository, MIT licence.
Related skills
-
Checked
Snowflake SQL and pipelines
Writes, reviews and debugs Snowflake SQL, pipelines and Cortex AI calls, so jobs run right and costs stay low.
8/101 credit -
Checked
dbt platform migration
Moves a dbt project from one warehouse to another and fixes SQL dialect gaps, so your models build again.
7/101 credit -
Checked
CSV and Excel merging
Merges, stacks and dedupes CSV and Excel files into one clean table, then checks the row counts add up.
7/101 credit -
Checked
dbt Mesh contracts
Checks whether a dbt model change breaks consumers and versions it, so downstream dashboards keep working.
7/101 credit -
Checked
SQL and dbt Analytics
Writes analytical SQL and dbt models tested for grain and join errors, so the numbers come out right.
7/101 credit -
Checked
D3 Animated Data Charts
Turns sourced data into honest, accessible animated D3 charts that render reliably frame by frame for video.
7/101 credit