AgentSkillsCN

example-data-processor

通过清理、转换和分析 CSV 数据文件来处理 CSV 数据。当用户需要处理 CSV 文件、清理数据或执行基本数据分析任务时使用此技能。

SKILL.md
--- frontmatter
name: example-data-processor
description: Process CSV data files by cleaning, transforming, and analyzing them. Use this when users need to work with CSV files, clean data, or perform basic data analysis tasks.

Example Data Processor

This skill demonstrates a complete skill structure with scripts, references, and proper documentation.

What This Skill Does

Processes CSV data files with these capabilities:

  • Clean and validate data
  • Transform columns
  • Generate summary statistics
  • Export results

Usage

Process a CSV file

To process a CSV file:

code
Process the data in myfile.csv

The skill will:

  1. Read the CSV file
  2. Clean the data (remove nulls, fix formats)
  3. Generate statistics
  4. Output a summary report

Custom Processing

For custom processing options:

code
Process sales.csv and group by region

Scripts

scripts/process_csv.py - Main data processing script

  • Reads CSV files
  • Applies transformations
  • Generates output

scripts/fetch_data.py - API data fetcher (demonstrates uv dependencies)

  • Fetches data from APIs using requests
  • Beautiful output formatting with rich
  • Auto-installs dependencies via uv inline metadata (PEP 723)
  • No manual pip install needed!

scripts/validate.py - Data validation script

  • Checks data quality
  • Reports issues

Configuration

The scripts use these environment variables:

  • OUTPUT_DIR - Where to save processed files (optional)
  • MAX_ROWS - Maximum rows to process (optional)

Set them using:

code
Set OUTPUT_DIR to /path/to/output

Reference Documentation

For detailed information:

Troubleshooting

"File not found" error:

  • Ensure the CSV file exists
  • Provide the full path to the file

"Invalid data" error:

  • Check the CSV format matches expected schema
  • See Data Formats for requirements