An intelligent CSV quality checking and validation system I made powered by Claude with effective use of skill and subagent. This tool automatically detects data quality issues and generates an interactive visual dashboard so that anyone can follow the visual dashboard to fix the data in CSV files at ease.
I have also included sales_messy.csv file in this repository, which is a very simple sample CSV file that can be used to test the skill and subagent for CSV data quality check and data cleaning:
- ✨ Features
- ⚙️ Usage
- 📊 Dashboard Components
- Quality Checks in Detail
- 📁 File Structure
- 🎯 Why Skill + Subagent Architecture?
- Benefits of Subagent Integration
- Real-World Example
- Integration with Subagents
- Example Output
- Dashboard Screenshots & Visual Example
- Next Steps
The CSV Quality Checker validates your data against multiple criteria:
- Missing Values - Identifies empty cells in required columns
- Duplicate Rows - Detects and highlights identical row duplicates
- Invalid Dates - Validates dates are in YYYY-MM-DD format with correct month/day values
- Negative Quantities/Prices - Flags negative values in numeric columns
- Invalid Data Types - Detects non-numeric values in number-only columns
Generates a beautiful, interactive dashboard with:
-
Summary Statistics
- Total row count and column count
- Issue count breakdown by severity (High/Medium)
-
Issues Summary Table
- Row number and affected column
- Issue description
- Severity level (HIGH/MEDIUM/LOW)
-
Data Preview with Visual Highlights
- Complete CSV data displayed in an interactive table
- Yellow cells = Missing values (empty cells)
- Red cells = Invalid or problematic values (wrong format, negative numbers, invalid types)
- Colored rows = Duplicate rows (same color indicates same duplicate group)
- Color legend for easy reference
The skill uses dedicated agents for:
- csv-quality-agent - For multi-step data analysis and cleanup operations
- Automatic judgment - Subagents are invoked automatically for file modification tasks without requiring manual approval
# Via Claude Code skill
/csv-quality-checker
# Or directly with Python
python .claude/skills/csv-quality-checker/csv_quality_checker.py <csv_file>- Analyze - The skill reads your CSV file and checks for all quality issues
- Report - Issues are summarized in a text report with row numbers and severity levels
- Visualize - An HTML dashboard is automatically generated showing:
- Statistical summary cards
- Detailed issues table
- Complete data preview with visual highlights
- Publish - Dashboard is published as an interactive Artifact for easy viewing
Shows at-a-glance metrics:
- Total Rows - Number of data rows (excluding header)
- Columns - Number of columns
- Issues Found - Total count of quality issues
- High Severity - Critical issues that must be fixed
- Medium Severity - Issues that should be reviewed
Detailed breakdown of each issue:
- Row number where issue occurs
- Column affected
- Issue description with specific values
- Severity classification
The complete CSV data with intelligent highlighting:
- Yellow highlighting - Immediately spot missing data
- Red highlighting - Quickly identify invalid or problematic values
- Color groups - Duplicate rows are highlighted in matching colors, making it obvious which rows are duplicates
- Row numbers on the left for easy reference
Clear color coding explanation:
- Yellow = Missing value
- Red = Invalid or problematic value
- Colored rows = Duplicate rows (same color = same duplicate group)
The dashboard is generated as a self-contained HTML file with:
- Responsive design that works on all screen sizes
- Fully styled tables with hover effects
- Professional color scheme for easy scanning
- No external dependencies
Any empty cell is flagged as HIGH severity. These represent incomplete data that may cause issues in downstream processing.
When two or more rows contain identical data, they are marked as MEDIUM severity. The dashboard visually groups duplicates using matching colors.
Date columns must follow YYYY-MM-DD format:
- Wrong format (e.g., "05/01/2026" instead of "2026-05-01") = HIGH severity
- Invalid month values (e.g., "2026-13-01") = HIGH severity
- Invalid day values are also caught
In columns named "quantity", "qty", "price", "unit_price", "cost", or "amount":
- Negative values are flagged as HIGH severity
- Non-numeric values (e.g., "abc" instead of a number) are flagged as HIGH severity
.claude/skills/csv-quality-checker/
├── SKILL.md # Skill definition and instructions
├── csv_quality_checker.py # Main Python script for analysis
└── agents/
└── csv-quality-agent.md # Subagent definition for cleanup
A skill alone provides instructions to Claude, but leaves execution in the main session:
- Contaminated Context - Intermediate file reads, validations, and errors fill up the conversation context
- Complex Multi-Step Tasks - Sequential operations (read → analyze → modify → validate) generate heavy output
- Context Limits - Large CSV files or many issues create verbose output that crowds the session
- Manual Overhead - User must ask each time to proceed to the next step
- Inefficient Iteration - Fixing multiple rows requires repeated context switching
A dedicated csv-quality-agent Subagent solves these problems:
Skill (Instruction Layer)
↓
CSV Quality Checker runs analysis
↓
[Decision Point]
├─ Simple case → Report here, keep in main session
└─ Complex case → Spawn csv-quality-agent for cleanup
↓
[Subagent handles multi-step work in isolation]
├─ Read original CSV
├─ Apply fixes
├─ Validate cleaned data
├─ Generate new CSV
└─ Return only final results
- Heavy file I/O happens in the Subagent, not the main session
- Your conversation stays clean and focused
- No context waste on intermediate debugging steps
With Subagent auto-judgment enabled:
User: "Fix the CSV file"
↓
[No manual approval needed]
↓
csv-quality-agent automatically spawned and executes
↓
"🤖 Subagent: csv-quality-agent - Data cleaning task"
CSV cleanup is inherently multi-step:
- ✅ Read and parse the file
- ✅ Apply validation rules
- ✅ Make corrections (fill defaults, remove rows, fix formats)
- ✅ Validate cleaned data
- ✅ Write clean CSV
- ✅ Generate quality report
Subagents handle this elegantly without polluting the main conversation.
If you have multiple CSVs:
csv_file_1.csv → csv-quality-agent (in background)
csv_file_2.csv → csv-quality-agent (in background)
csv_file_3.csv → csv-quality-agent (in background)
All process simultaneously while you work on something else
Subagents can:
- Retry failed operations automatically
- Handle edge cases without interrupting the main session
- Report only the final outcome, not every intermediate error
- Provide detailed logs if needed
As your CSV files grow:
- No context overload - Subagent uses its own context budget
- Handles large files - No risk of exceeding main session limits
- Memory efficient - Each Subagent processes independently
The Subagent approach means:
- Same cleaning rules apply consistently across all CSVs
- Can be scheduled or batched without manual intervention
- Results are predictable and reproducible
With the CLAUDE.md settings you configured:
### Subagent Auto-Judgment
Use Subagents automatically when:
- Task involves multiple sequential steps
- File modifications or cleanup work
- Complex analysis requiring intermediate outputThis means:
- ✅ No "Do you want me to fix this?" prompt needed
- ✅ Subagent automatically chosen if task requires it
- ✅ Results reported with transparency statement:
🤖 Subagent: csv-quality-agent
Reason: Multi-step file modification (read → validate → clean → write)
I have also included sales_messy.csv file in this repository, which is a very simple sample CSV file that can be used to test the skill and subagent for CSV data quality check and data cleaning:
Without Subagent (Skill-only):
You: "Fix the CSV"
Claude: "I'll read the file..." [verbose output]
Claude: "Found 8 issues..." [more output]
Claude: "Fixing row 1..." [more output]
Claude: "Fixing row 2..." [more output]
... [context gets crowded]
With Subagent (Current approach):
You: "Fix the CSV"
🤖 Subagent: csv-quality-agent
Reason: Multi-step file modification needed
[... processing happens in background ...]
✅ Fixed 8 issues
- Filled missing customer names
- Corrected date formats
- Removed duplicate rows
Output: sales_clean.csv
The Subagent approach keeps your main session focused while powerful work happens in the background.
This skill integrates seamlessly with Subagent workflows:
- Analysis Phase - Runs in the main session for immediate feedback
- Cleanup Phase - Can spawn csv-quality-agent for automated data fixes
- Transparency - When Subagents are used, they're clearly announced:
🤖 Subagent: csv-quality-agent Reason: Multi-step file modification (read → validate → clean → write)
When run on a messy CSV file, the dashboard displays:
-
Summary: 8 data rows, 7 columns, 8 issues found (7 high, 1 medium)
-
Issues Listed:
- Row 3: Missing customer name (HIGH)
- Row 3: Invalid date format (HIGH)
- Row 4: Negative quantity (HIGH)
- Row 5: Missing unit price (HIGH)
- Row 6: Invalid month in date (HIGH)
- Row 7: Duplicate of row 2 (MEDIUM)
- Row 8: Missing region (HIGH)
- Row 9: Non-numeric quantity (HIGH)
-
Data Table: All 8 rows visible with color-coded highlighting showing exactly where each issue is located
After reviewing the quality dashboard, you can:
- Manually Fix - Edit specific cells based on the highlighted issues
- Bulk Clean - Use the csv-quality-agent for automated cleanup
- Delete Problematic Rows - Remove rows that fail quality checks
- Fill Defaults - Insert sensible default values for missing data
The dashboard makes it easy to decide which approach is best for your use case.
The generated dashboard displays issues with intelligent color highlighting:
┌─────────────────────────────────────────────────────────────┐
│ 📊 CSV Quality Dashboard │
├─────────────────────────────────────────────────────────────┤
│ │
│ Statistics Cards: │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Total Rows │ │ Columns │ │ Issues Found │ │
│ │ 8 │ │ 7 │ │ 8 │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │High Severity │ │Med. Severity │ │
│ │ 7 │ │ 1 │ │
│ └──────────────┘ └──────────────┘ │
│ │
├─────────────────────────────────────────────────────────────┤
│ ⚠️ Issues Summary │
├─────────────────────────────────────────────────────────────┤
│ Row │ Column │ Issue │ Severity │
├─────┼─────────────┼────────────────────────────┼───────────┤
│ 3 │ customer │ Missing value │ HIGH │
│ 3 │ order_date │ Invalid format: 05/01/2026│ HIGH │
│ 4 │ quantity │ Negative value: -1 │ HIGH │
│ 5 │ unit_price │ Missing value │ HIGH │
│ 6 │ order_date │ Invalid month: 2026-13-01 │ HIGH │
│ 7 │ All │ Duplicate of row 2 │ MEDIUM │
│ 8 │ region │ Missing value │ HIGH │
│ 9 │ quantity │ Invalid value: abc │ HIGH │
├─────────────────────────────────────────────────────────────┤
│ 📋 Data Preview with Issues │
├─────────────────────────────────────────────────────────────┤
│ │
│ Legend: │
│ 🟡 Yellow = Missing value │
│ 🔴 Red = Invalid or problematic value │
│ 🟣 Colored = Duplicate rows (same color = same group) │
│ │
│ Row │ order_id │ customer │ product │ ... │
├─────┼──────────┼─────────────┼────────────┼── │
│ 2 │ 1001 │ Asha Rao │ Laptop │ ... [PURPLE] │
│ 3 │ 1002 │[🟡 empty] │ Mouse │ ... [🔴 ERR] │
│ 4 │ 1003 │ Vikram Shah │ Keyboard │ ... [🔴 ERR] │
│ 5 │ 1004 │ Meera Nair │ Monitor │ ... [🟡 empty] │
│ 6 │ 1005 │ Rohan Das │ Laptop │ ... [🔴 ERR] │
│ 7 │ 1001 │ Asha Rao │ Laptop │ ... [PURPLE] │
│ 8 │ 1006 │ Anita Joshi │ Headset │ ... [🟡 empty] │
│ 9 │ 1007 │ Kiran Patel │ Mouse │ ... [🔴 ERR] │
│ │
└─────────────────────────────────────────────────────────────┘
-
Color-Coded Cells
- Yellow highlighting immediately draws attention to missing data
- Red highlighting shows invalid values or formatting errors
- Matching colors on duplicate rows make it obvious which rows are identical
-
Interactive Elements
- Hover effects on table rows for better readability
- Responsive layout that adapts to different screen sizes
- Clear section separations for easy navigation
-
Professional Styling
- Green headers for data table to distinguish from issues table
- Red headers for issues table to emphasize problems
- Consistent color scheme throughout
When you run the skill, a live interactive dashboard is generated and can be viewed in Claude Code's Artifact viewer. The dashboard includes:
- Fully clickable and scrollable tables
- Dynamic color highlighting based on issue type
- Professional typography and spacing
- Mobile-responsive design
When using the Subagent for CSV cleanup:
🤖 Subagent: csv-quality-agent
Reason: Multi-step file modification and validation required
The agent will:
- Read the original CSV file
- Apply data cleaning rules
- Generate the quality dashboard
- Create a cleaned output file (if needed)
- Report all changes made
Version: 1.0
Last Updated: 2026-11-03

