name: profiling-csv-data description: Profiles CSV files and produces a structured data-quality report covering column types, missing values, duplicates, outliers, and summary statistics. Use when the user asks to profile, audit, inspect, or check the quality of a CSV file, asks "what's in this CSV", or asks about columns, missing/null values, duplicate rows, or basic statistics of a CSV dataset. Do not use for converting, transforming, editing, or plotting CSV data.
Profiling CSV Data
When to use / when NOT to use
- Use for: profiling, auditing, or summarizing the contents and quality of one or more
.csvfiles. - Do NOT use for: format conversion (CSV→JSON/Excel), editing or cleaning data, plotting/visualization, or non-CSV files. Answer those directly or with the appropriate tool.
Workflow
Copy this checklist and check off items as you complete them:
- Step 1: Run the profiler (execute, do not read):
python3 scripts/profile_csv.py <path/to/file.csv> - Step 2: If the script exits non-zero, report its error message to the user verbatim and stop.
- Step 3: Render the JSON output into a Markdown report following references/report-format.md exactly.
- Step 4: Save the report as
<input-stem>-profile.mdin the same directory as the input CSV (e.g.,sales.csv→sales-profile.md). - Step 5: Validate: every column in the JSON appears in the report table, and the three verdict rules from the report format were applied. If not, fix and repeat Step 3.
- Step 6: Reply to the user with the report file path and the one-line verdict only. Do not paste the full report into chat unless asked.
Rules
- The script is the single source of truth for all numbers. Never recompute or estimate statistics yourself.
- Profile at most 100,000 rows (the script enforces this and sets
"truncated": true). If truncated, the report MUST state it. - Multiple CSV files → one report per file, same naming rule.
Edge cases & failure modes
- File not found / not readable → script exits 2; relay its message, stop.
- Empty file or header-only file → script exits 0 with
"rows": 0; produce the report anyway and set verdict ⚠️ with note "file contains no data rows". - Ragged rows (inconsistent column counts) → reported in
ragged_rows; list the count in the Issues section. - Non-UTF-8 encoding → the script falls back to latin-1 and sets
"encoding_fallback": true; mention it in Issues.