agentsclimarketplace

Data cleaner

Skill TheWatcher01/skills/.claude/skills/data-cleaner

Agent Skills collection — Reusable capabilities for AI coding agents. Install: npx skills add TheWatcher01/skills

Install
npx -y skills add TheWatcher01/skills --skill data-cleaner

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Agent expert en nettoyage, normalisation et structuration de données brutes. Spécialisé PostgreSQL, pandas, SQL batch, déduplication, validation Zod/Pydantic. Use when: nettoyer des données, dédupliquer, normaliser, standardiser des formats, corriger des incohérences, valider la qualité, structurer du JSON/CSV brut, mapper des référentiels (NAF, INSEE, région→département), détecter des anomalies. Triggers: nettoyage, data quality, déduplication, normalisation, ETL, mapping, standardisation, anomalie, incohérence, données sales, import CSV, structuration.

SKILL.md

5.1 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it

Data Cleaner Agent — Nettoyage & Structuration

Principes fondamentaux

  1. Jamais modifier en place — créer colonne/table temporaire, valider, puis remplacer
  2. Idempotent — chaque opération relançable sans effet de bord
  3. Traçable — loguer chaque transformation (avant/après, nb lignes)
  4. Batch first — jamais de row-by-row, toujours UPDATE ... FROM ou COPY
  5. Valider avant d'écrire — Zod (TS) ou Pydantic (Python) sur chaque output

Workflow en 6 étapes

1. Audit de qualité (diagnostic)

Avant toute action, mesurer l'état actuel. Voir references/audit-template.md.

2. Déduplication

Ordre de priorité :

  1. Doublons exacts — GROUP BY toutes colonnes, garder min(id)
  2. Doublons sémantiques — normaliser puis dédupliquer ("Assoc." = "Association")
  3. Doublons fuzzy — pg_trgm similarity seuil 0.8
DELETE FROM table a USING table b
WHERE a.col1 = b.col1 AND a.col2 = b.col2 AND a.id > b.id;

3. Normalisation textuelle

Appliquer dans cet ordre :

  1. trim(both from col)
  2. regexp_replace(col, '\s+', ' ', 'g') (collapse spaces)
  3. NFD unicode normalization (pour index de recherche)
  4. upper() pour codes, initcap() pour noms propres
  5. regexp_replace(col, '[\x00-\x1F]', '', 'g') (caractères de contrôle)

4. Mapping référentiels

Toujours via tables de mapping statiques. Voir references/referentiels.md.

5. Validation des formats

ChampPatternExemple
SIREN^\d{9}$813065398
SIRET^\d{14}$81306539800016
RNA^W\d{9}$W831003504
NAF^\d{2}\.\d{2}[A-Z]$88.99B
Code postal^\d{5}$83300
Email^[^\s@]+@[^\s@]+\.[^\s@]+$-
-- Identifier invalides AVANT correction
SELECT siren, count(*) FROM table WHERE siren !~ '^\d{9}$' GROUP BY siren;

6. Enrichissement croisé

Après nettoyage, croiser les sources pour combler les trous. Voir references/enrichissement.md.

Anti-patterns

  • UPDATE sans WHERE
  • DELETE sans backup (CREATE TABLE backup AS SELECT * FROM ...)
  • Regex trop permissives — valider sur échantillon 100 lignes
  • Normalisation destructive — garder colonne originale, créer colonne _clean
  • Import sans staging table temporaire

Métriques à reporter

[CLEAN] table.col : X lignes modifiées / Y total (Z%)
[DEDUP] table : X doublons supprimés (Y restants)
[VALID] table.col : X invalides (patterns: ...)
[ENRICH] table.col : X valeurs comblées depuis source Y

Libs déterministes (pallier l'imprévisibilité LLM)

Toujours préférer un script déterministe à une réponse LLM pour les transformations de données.

Validation (exécuter scripts/validate_column.py)

# Valider SIREN
python3 scripts/validate_column.py dl_entities siren --type siren

# Valider avec regex custom
python3 scripts/validate_column.py dl_entities "nafCode" --pattern '^\d{2}\.\d{2}[A-Z]$'

Python — libs fiables (pip install)

LibUsagePourquoi
ftfyFix encoding (mojibake, BOM)Déterministe, gère 99% des cas d'encoding
unidecodeTranslittération unicode → ASCIIPour les index de recherche sans accents
phoneticsSoundex/Metaphone noms propresMatching fuzzy déterministe (pas de LLM)
pandasBatch transforms DataFrameVectorisé, 100x plus rapide que row-by-row
great_expectationsData quality assertionsPipeline de validation reproductible
pydanticSchema validation PythonRejet strict des données non conformes
email-validatorValidation email RFC 5321Plus fiable que regex
stdnumValidation SIREN/SIRET/TVALib officielle, checksums inclus

TypeScript — libs fiables (pnpm add)

LibUsage
zodSchema validation (déjà installé)
validatorisEmail, isSIRET, isPostalCode...

PostgreSQL — extensions utiles

ExtensionUsage
pg_trgmFuzzy matching trigram (similarity > 0.8)
unaccentRecherche sans diacritiques
fuzzystrmatchLevenshtein, Soundex, Metaphone

Pattern : script > LLM

Pour chaque opération de nettoyage, l'agent doit :

  1. Écrire un script Python/SQL déterministe
  2. Le tester sur un échantillon (LIMIT 100)
  3. Vérifier le résultat avec validate_column.py
  4. Appliquer en batch sur la table complète
  5. Reporter les métriques [CLEAN] [DEDUP] [VALID] [ENRICH]

Ne jamais laisser le LLM "deviner" une transformation — toujours coder un script reproductible.

What ships with it: 2 files

3.1 KB alongside SKILL.md, 1 of them executable

references/

scripts/

Gives 0 of the 12 instructions most databases sql skills give in ~1.4k tokens

Counted across 589 of the 662 authors here whose files we hold, read 2026-08-07

  • Use parameterized queriesin 37 of 589, across 34 files
  • Use timestamptz for timestampsin 30 of 589, across 14 files
  • Index foreign keysin 29 of 589, across 18 files
  • Create indexes concurrentlyin 29 of 589, across 24 files
  • Use numeric type for moneyin 25 of 589, across 8 files
  • Use cursor pagination instead of offsetin 24 of 589, across 17 files
  • Select only required columnsin 24 of 589, across 20 files
  • Add indexes manually on foreign key columnsin 22 of 589, across 12 files
  • Normalize to third normal formin 19 of 589, across 10 files
  • Configure connection poolingin 19 of 589, across 17 files
  • Put equality columns before range columns in indexesin 18 of 589, across 10 files
  • Read individual rule files for detailed explanationsin 18 of 589, across 4 files

Said here and by no other author read

  • use temporary columns or tables before replacing data
  • log every transformation with before and after counts
  • process data in batches
  • validate each output with schema validation
  • audit data quality before any action
  • keep original columns during normalisation

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 327,069. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.