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

data-transformer

Skill78 starsChanged 23 days agoMITView on GitHub

Derive analysis variables from cleaned data under an explicit, reversible transformation ledger. No silent recoding, no leakage.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When the analysis needs a derived variable (log transform, ratio, binning, unit conversion, date parts) that is not already a column.

    line 17
  2. Very specific:

    Every derived column has a ledger record and a stated inverse (or reversible: false with the reason).

    line 42
  3. Distinctive:

    do not derive a variable inside the statistical script and forget to record it.

    line 58
  4. Distinctive:

    do not transform the grouping variable into the outcome.

    line 59
  5. Distinctive:

    do not transform a column the cleaning plan withheld.

    line 60

≈ “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

data-transformer

Stage 2b 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

When the analysis needs a derived variable (log transform, ratio, binning, unit conversion, date parts) that is not already a column. Optional: a run with no derived variables skips this skill and records that it did.

Inputs

  • cleaned data (manifest replayed)
  • an explicit transformation spec: source columns, operation, parameters, output name

Outputs

  • analysis/transformed.csv (or an in-memory frame recorded in the ledger)
  • analysis/transform_ledger.json: one record per derived column with {output, operation, inputs, parameters, reversible, rule_source, alternative_considered, rejected_reason}

Commands

# transformations are declared in the run spec, not typed at a prompt
python -c "import json,sys; print(json.dumps(json.load(open('outputs/analysis/transform_ledger.json')), indent=2))

Gate (default FAIL)

Every derived column has a ledger record and a stated inverse (or reversible: false with the reason). A derived column may not be created from the outcome it will later predict -- that is leakage, and it is the single most common way a clean pipeline produces an impressive, meaningless result.

Failure modes seen in real runs

  • Target leakage. A feature computed from the outcome inflates the effect to implausibility; the ledger makes the input columns visible so the leak can be caught.
  • Silent recoding. M/F -> 0/1 without a mapping record makes the direction of the effect unrecoverable.
  • Transforming after cleaning. A log transform applied to the raw column while the cleaned column keeps its original scale produces two incompatible reports.

Do not

  • do not derive a variable inside the statistical script and forget to record it;
  • do not transform the grouping variable into the outcome;
  • do not transform a column the cleaning plan withheld.

Upstream / downstream

  • previous: ../data-cleaner/SKILL.md
  • next: ../statistical-analyzer/SKILL.md
  • contract: ../../references/workflow-contract.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.

Reviews can't be read right now.

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.