Preview Csv
by veelenga
Render and preview CSV files in browser with interactive sorting, filtering, and column statistics
Skill Details
Repository Files
12 files in this skill directory
name: preview-csv description: Render and preview CSV files in browser with interactive sorting, filtering, and column statistics user-invocable: true commands:
- preview
- preview-csv
Preview CSV Skill
Interactive CSV file viewer that generates HTML visualizations with sorting, filtering, and statistical analysis.
Usage
# Preview a CSV file
/preview data.csv
# Pipe CSV data (preferred for temporary content)
cat data.csv | /preview
echo "name,age\nAlice,30\nBob,25" | /preview
# With custom background color
/preview data.csv --background "#1e1e1e"
Best Practice: For temporary or generated content, prefer piping over creating temporary files. This avoids cluttering your filesystem and the content is automatically cleaned up.
Options
The script works with sensible defaults but supports these flags for flexibility:
-o, --output PATH- Custom output path--no-browser- Skip browser, output file path only
Features
- Interactive table with sortable columns (click headers)
- Search and filter across all data in real-time
- Column statistics including:
- Min/Max values
- Average for numeric columns
- Unique value counts
- Data type detection
- Export to JSON functionality
- Large file support with automatic pagination (10,000+ rows)
- Responsive design adapts to screen size
- Keyboard navigation for accessibility
When to Use This Skill
Use this skill when the user wants to:
- View and explore CSV data files
- Analyze data with sorting and filtering
- Inspect column statistics quickly
- Share formatted data views
- Debug or verify CSV file contents
Examples
Natural language requests:
- "preview this CSV file"
- "show me the data in customers.csv"
- "open the employee data"
- "visualize this CSV"
- "let me see what's in sales.csv"
Technical Details
File Requirements
- File extension:
.csv - Maximum size: 10MB (configurable)
- Encoding: UTF-8
Features in Detail
Sortable Columns
- Click any column header to sort
- Click again to reverse sort order
- Visual indicators show current sort direction
Search and Filter
- Live search across all columns
- Case-insensitive matching
- Instant results as you type
Column Statistics
- Automatically calculated for each column
- Numeric columns show: min, max, average
- All columns show: unique value count, data type
- Statistics update with filtered data
Export
- One-click export to JSON format
- Preserves all data and structure
- Downloads directly to browser
Browser Compatibility
- Modern browsers (Chrome, Firefox, Safari, Edge)
- Requires JavaScript enabled
- No external dependencies (all assets bundled)
Output
The skill generates a standalone HTML file at:
/tmp/preview-skills/preview-csv-{filename}.html
The file is self-contained and can be:
- Opened directly in any browser
- Shared with others (no dependencies)
- Archived for later viewing
Troubleshooting
CSV doesn't display correctly
- Ensure file is valid CSV format
- Check that delimiters are commas
- Verify UTF-8 encoding
File too large
- Files over 10MB may fail to load
- Consider filtering data before preview
- Use pagination for very large files
Missing columns or data
- Check for empty lines at end of file
- Verify header row is present
- Ensure consistent column counts per row
Development
This skill is standalone and includes all dependencies:
- Shared libraries bundled in
lib/ - Templates bundled in
templates/ - No external CDN requirements
To modify the skill:
- Edit
config.shfor configuration - Edit
templates/scripts/csv-renderer.jsfor behavior - Edit
templates/styles/csv.cssfor styling - Run
run.shto test changes
Related Skills
Attack Tree Construction
Build comprehensive attack trees to visualize threat paths. Use when mapping attack scenarios, identifying defense gaps, or communicating security risks to stakeholders.
Grafana Dashboards
Create and manage production Grafana dashboards for real-time visualization of system and application metrics. Use when building monitoring dashboards, visualizing metrics, or creating operational observability interfaces.
Matplotlib
Foundational plotting library. Create line plots, scatter, bar, histograms, heatmaps, 3D, subplots, export PNG/PDF/SVG, for scientific visualization and publication figures.
Scientific Visualization
Create publication figures with matplotlib/seaborn/plotly. Multi-panel layouts, error bars, significance markers, colorblind-safe, export PDF/EPS/TIFF, for journal-ready scientific plots.
Seaborn
Statistical visualization. Scatter, box, violin, heatmaps, pair plots, regression, correlation matrices, KDE, faceted plots, for exploratory analysis and publication figures.
Shap
Model interpretability and explainability using SHAP (SHapley Additive exPlanations). Use this skill when explaining machine learning model predictions, computing feature importance, generating SHAP plots (waterfall, beeswarm, bar, scatter, force, heatmap), debugging models, analyzing model bias or fairness, comparing models, or implementing explainable AI. Works with tree-based models (XGBoost, LightGBM, Random Forest), deep learning (TensorFlow, PyTorch), linear models, and any black-box model
Pydeseq2
Differential gene expression analysis (Python DESeq2). Identify DE genes from bulk RNA-seq counts, Wald tests, FDR correction, volcano/MA plots, for RNA-seq analysis.
Query Writing
For writing and executing SQL queries - from simple single-table queries to complex multi-table JOINs and aggregations
Pydeseq2
Differential gene expression analysis (Python DESeq2). Identify DE genes from bulk RNA-seq counts, Wald tests, FDR correction, volcano/MA plots, for RNA-seq analysis.
Scientific Visualization
Meta-skill for publication-ready figures. Use when creating journal submission figures requiring multi-panel layouts, significance annotations, error bars, colorblind-safe palettes, and specific journal formatting (Nature, Science, Cell). Orchestrates matplotlib/seaborn/plotly with publication styles. For quick exploration use seaborn or plotly directly.
