---
name: csv-quality-triage
description: Profile small CSV datasets while preserving missing values, duplicate keys and currency boundaries.
---

# CSV quality triage

Use this skill when a user requests a quality review of CSV data before analysis, import, or reporting. It profiles the supplied data and proposes repairs; it does not silently clean rows or replace the source file.

## Inputs and parsing
Identify the expected columns, candidate key, required fields, and the meaning of amounts. Use a CSV parser that respects quoted delimiters and embedded newlines; do not split raw text on commas. Number data records starting at one, excluding the header, and use those record numbers consistently. If no schema is given, label inferred requirements as assumptions.

## Workflow
Count records and inspect each relevant column for blanks, parse failures, and unexpected values. Distinguish missing numeric values from zero. Group duplicate candidate keys and compare their complete records: identical duplicates and conflicting duplicates need different remediation. Preserve the original strings for evidence.

For amounts, use decimal arithmetic where available, retaining the currency column. Report totals separately by currency and identify exactly which records entered each total. Do not add unlike currencies or invent exchange rates. Negative values may be refunds rather than errors; interpret them only against the supplied contract. When duplicate keys exist, label totals that include them as raw totals and do not present them as settled business metrics.

## Output contract
Return the parsed record count, field assumptions, findings with record references, per-currency arithmetic where requested, and proposed next actions. State how blanks and duplicates affect each calculation. Produce a cleaned dataset only when requested and when the repair rule is explicit; otherwise retain ambiguous records. Before delivery, reconcile accepted, missing, and invalid amounts with the record count and show enough arithmetic for a reviewer to reproduce the results without relying on a pass label.
