agentleFS
MAGA2010MAGA2010/data-master/skills/data-cleaner/SKILL.md

data-cleaner

Skill78 starsChanged 23 days agoMITView on GitHub

Turn profile.json into a deterministic cleaning plan, execute only the planned operations, and prove byte-for-byte reproducibility. Additive-only.

10 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All five must hold, or the run freezes to audit/:

    line 46
  2. Distinctive:

    no conversion ran unless every non-null value parsed (no parse-rate threshold).

    line 49
  3. Very specific:

    every never-automatic item is recorded in withheld with its evidence.

    line 50
  4. Distinctive:

    do not modify, move, or delete the raw file.

    line 65
  5. Distinctive:

    do not impute, deduplicate, or merge datasets automatically.

    line 66
  6. Distinctive:

    do not add a parse-rate threshold -- the only safe threshold is 100%%.

    line 67

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “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

data-cleaner

Stage 1c of the data-master pipeline. The router in ../../SKILL.md owns the end-to-end run; this skill owns one stage and one gate. Read the parent contract before changing anything here: the invariants in ../../SKILL.md (additive-only, types decided once, default-FAIL gates, three-part provenance) are not restated, they are inherited.

When to invoke

Whenever profile.json exists. Cleaning is never ad hoc: the plan is the gate, and only plan["auto_actions"] may execute.

Inputs

  • analysis/profile.json
  • references/cleaning-rule-catalog.md
  • references/never-automatic-list.md

Outputs

  • cleaning_plan.json -- auto_actions, never_automatic_flags, principle
  • cleaned/cleaned.csv
  • cleaned/clean_<slug>.py -- standalone, re-runnable
  • cleaned/cleaning_run.json -- applied_ops, withheld, failed, dtype_manifest, columns_touched_by_ops, untouched_column_audit, reproducibility_check, case_variant_merge_map
  • cleaned/cleaning_report.md

Commands

python scripts/cleaning_plan.py --profile outputs/analysis/profile.json --out outputs/cleaning_plan.json
python scripts/execute_cleaning.py --in <raw.csv> --plan outputs/cleaning_plan.json --out outputs/cleaned
python scripts/validate_clean.py --raw <raw.csv> --clean outputs/cleaned/cleaned.csv --profile outputs/analysis/profile.json --out outputs/cleaned/validation.json

Gate (default FAIL)

All five must hold, or the run freezes to audit/:

  1. reproducibility_check.passed -- the generated script reproduces the cleaned hash;
  2. untouched_column_audit.passed -- no unnamed column changed;
  3. no conversion ran unless every non-null value parsed (no parse-rate threshold);
  4. every never-automatic item is recorded in withheld with its evidence;
  5. dtype_manifest exists and is replayed by the analysis stage.

Failure modes seen in real runs

  • A 96%% parse rate looks like a green light. Converting the remaining 4%% turns recorded sentinels (--, unknown) into missing values, which are then indistinguishable from values that were never collected. Hold the whole conversion.
  • Case variants split a group. Setosa / setosa halves both n and narrows every interval without losing information; merge with an explicit case_variant_merge_map.
  • A rule rewrites a column it did not name. The untouched-column audit compares raw and cleaned in text space, so this is caught rather than shipped.

Do not

  • do not modify, move, or delete the raw file;
  • do not impute, deduplicate, or merge datasets automatically;
  • do not add a parse-rate threshold -- the only safe threshold is 100%%.

Upstream / downstream

  • previous: ../data-profiler/SKILL.md
  • next: ../data-explorer/SKILL.md, ../statistical-analyzer/SKILL.md
  • rules: ../../references/cleaning-rule-catalog.md

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.