data-intake-normalizer
Skill1 starsChanged 7 months agoMITView on GitHub
Global data intake, validation, and normalization layer for ALL skills in the Agency Growth OS. ALWAYS trigger before any science or analytics skill when input arrives as CSV, XLSX, XLS, TSV, or JSON. Detects target skill from file structure, maps client columns to OS schema, coerces types, handles encoding issues, imputes nulls, and produces a validation report (OK / WARN / BLOCK). Also generates standardized input templates (XLSX) for any OS skill on demand. Trigger when user says: "aquí está el archivo", "te paso el CSV", "valida este Excel", "necesito la plantilla para", "el archivo no carga", "dame el template de", or uploads any data file before running a science skill. BLOCK execution of downstream skill if critical columns are missing.
In this repository35 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agency-request-intake-routerSkill
- analyzing-marketing-campaignSkill
- audience-segmentation-briefSkill
- campaign-launch-qaSkill
- change-order-generatorSkill
- client-memory-synthesizerSkill
- creative-supply-plannerSkill
- crm-journey-architectSkill
- customer-lifetime-valueSkill
- customer-segmentation-clusteringSkill
- executive-growth-memoSkill
- fte-capacity-sizingSkill
- margin-simulationSkill
- market-basket-analysisSkill
- measurement-incrementalitySkill
- media-procurement-benchmarkSkill
- media-routing-plannerSkill
- mmm-modelingSkill
- performance-diagnosisSkill
- ppa-assortment-diagnosisSkill
- ppa-continuous-optimizationSkill
- ppa-financial-modelSkill
- ppa-pack-size-leverageSkill
- ppa-value-perceptionSkill
- price-demand-optimizationSkill
- price-elasticity-modelingSkill
- price-threshold-detectionSkill
- qbr-generatorSkill
- recommender-systemsSkill
- response-uplift-modelingSkill
- rfp-submissionSkill
- scope-auditSkill
- survival-analysis-marketingSkill
- weekly-control-towerSkill
The file
Files
Data Intake Normalizer
Pre-requisito global. Corre antes de cualquier science skill cuando el input es
un archivo del cliente. Produce data_normalized.csv + validation_report.json.
Si el reporte tiene nivel BLOCK → no ejecutar el skill downstream.
Cuándo activar
Cliente sube CSV/XLSX/XLS/TSV/JSON
↓
data-intake-normalizer ← SIEMPRE primero
↓
validation_report.json
OK → ejecutar skill downstream con data_normalized.csv
WARN → mostrar advertencias, ejecutar con caveats
BLOCK → mostrar errores, solicitar corrección, ofrecer templateTambién activa cuando el usuario pide:
- "Dame la plantilla para [skill]"
- "¿Qué formato necesita el archivo?"
- "El script falla con mi CSV"
Schemas por skill — columnas requeridas / opcionales
Lee references/schemas.md para el schema completo de cada skill.
Resumen ejecutivo:
| Skill destino | Columnas requeridas | Columnas opcionales clave |
customer-segmentation-clustering | customer_id, transaction_date, amount | category, brand, channel |
customer-lifetime-value | customer_id, period, revenue, cost | retention_flag, channel, cohort |
survival-analysis-marketing | customer_id, event_date, censored | discount, emails_sent, segment |
response-uplift-modeling | customer_id, treatment, response | score, segment, spend, ltv |
market-basket-analysis | transaction_id, item_id | amount, category, timestamp |
price-demand-optimization | price, quantity | period, competitor_price, promotion |
recommender-systems | user_id, item_id, rating | timestamp, context, category |
mmm-modeling | date, kpi + ≥1 spend_[channel] | price_index, promo, seasonality |
audience-segmentation-brief | customer_id, segment, ltv | channel, rfm_score, persona |
media-routing-planner | channel, spend, impressions, conversions | cpm, cpa, roas, period |
weekly-control-tower | date, kpi, actual, target | channel, campaign, segment |
measurement-incrementality | date, group (test/control), kpi | spend, impressions, conversions |
crm-journey-architect | customer_id, event, timestamp | channel, segment, value |
scope-audit | Texto libre (RFP/SOW) — no normalización | — |
margin-simulation | fee, fte_cost, vendor_cost, hours | segment, client, period |
Workflow
Step 1 — Detectar archivo
python scripts/schema_detector.py \
--file /mnt/user-data/uploads/[filename] \
--output results/detection.jsonOutput: { target_skill, confidence, detected_columns, file_info }
Step 2 — Mapear columnas
python scripts/column_mapper.py \
--file /mnt/user-data/uploads/[filename] \
--target-skill [skill_name] \
--output results/column_map.jsonOutput: { mappings: { client_col → os_col }, unmapped, missing_required }
Step 3 — Normalizar tipos + encoding
python scripts/type_coercer.py \
--file /mnt/user-data/uploads/[filename] \
--column-map results/column_map.json \
--output results/data_typed.csvHandles: fechas (≥15 formatos), montos (comas, símbolos), encodings (UTF-8/latin-1/CP1252/UTF-16)
Step 4 — Manejar nulos
python scripts/null_handler.py \
--file results/data_typed.csv \
--target-skill [skill_name] \
--output results/data_normalized.csvEstrategias por columna: drop / median / mode / forward-fill / flag
Step 5 — Reporte de validación
python scripts/validation_report.py \
--normalized results/data_normalized.csv \
--target-skill [skill_name] \
--column-map results/column_map.json \
--output results/validation_report.jsonStep 6 — Mostrar resultado al usuario
[show_widget] validation dashboard — siempre antes de ejecutar skill downstreamGenerar plantilla (modo alternativo)
python scripts/template_generator.py \
--skill [skill_name] \
--output /mnt/user-data/outputs/template_[skill_name].xlsxNiveles de validación
| Nivel | Condición | Acción |
OK | Todas las columnas requeridas presentes, tipos correctos, nulos < 5% | Ejecutar skill downstream |
WARN | Columnas opcionales faltantes, nulos 5–20%, mapeo fuzzy aplicado | Ejecutar con caveats visibles |
BLOCK | Columnas requeridas faltantes, nulos > 20% en columna crítica, encoding irrecuperable | Detener. Mostrar errores. Ofrecer plantilla. |
Output format — Visualization First
Dashboard panels (ver references/intake_dashboard_template.html):
- Status banner — OK / WARN / BLOCK con color
- File info — filas, columnas, encoding, tamaño, skill detectado
- Column mapping table — cliente col → OS col, con status por columna
- Issues list — errores y advertencias con descripción accionable
- Preview — primeras 5 filas del archivo normalizado
- Next step — botón sendPrompt() al skill downstream si OK/WARN
Marketer Insights Layer
Siempre incluir después del dashboard:
- Qué columnas se renombraron automáticamente y por qué
- Qué nulos se imputaron con qué estrategia
- Cuántas filas quedaron disponibles vs total original
- Si hay BLOCK: mensaje claro + "Descarga la plantilla correcta" + botón
Reglas de orquestación (OS rules)
Rule #19: ALWAYS run data-intake-normalizer before any science skill
when input is CSV/XLSX. BLOCK if validation_report = BLOCK.
Rule #20: If client provides data in Google Drive → use Google Drive MCP
read directly (no upload needed), still run normalization.
Rule #21: If normalization fails 2+ times on same file → offer template
download for that specific skill automatically.Reference files
references/schemas.md— Schema completo por skill (columnas, tipos, constraints)references/type_rules.md— Reglas de coerción por tipo de datoreferences/null_strategies.md— Estrategia de imputación por columna y skillreferences/intake_dashboard_template.html— Dashboard HTML; injectSKILL_DATA_JSONtemplates/— Plantillas XLSX pre-generadas por skill (generadas con template_generator.py)
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
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.

