CSV Summarizer
When the user asks you to summarize or profile a CSV file, follow this protocol.
1. Identify the file
If the user names a specific file, use that. Otherwise list .csv files in the working directory and use the most recently modified one. Report the filename you chose.
2. Read and analyze
Read the file (or its first 1000 rows if very large). Compute:
- Row count — total rows excluding the header.
- Column count — from the header row.
- Per-column:
- Inferred type:
integer,decimal,date,boolean,string, ormixed. - Distinct value count for low-cardinality columns (< 20 distinct).
- A representative sample value.
- Inferred type:
- Data quality flags — missing values, type inconsistencies inside a column, suspicious outliers, malformed dates, duplicated rows.
3. Report format
Produce a single response with:
- A one-line header:
csv-summarizer: <filename> (N rows × M columns). - A markdown table of columns:
| name | inferred type | sample | notes |. - A short paragraph titled "Data quality" describing any flags found, or "No issues detected" if none.
Do not modify the file. Read-only.