Agent SkillsA-EVO-Lab/a-evolve › data-formats

data-formats

GitHub

提供CSV、Excel、JSON、YAML等数据格式的读写与转换指南,涵盖编码处理、类型转换及公式计算等常见陷阱的解决方案。

seed_workspaces/skillbench/skills/data-formats/SKILL.md A-EVO-Lab/a-evolve

Trigger Scenarios

需要读取或写入CSV/Excel/JSON/YAML文件 处理数据格式转换中的编码或类型问题

Install

npx skills add A-EVO-Lab/a-evolve --skill data-formats -g -y
More Options

Non-standard path

npx skills add https://github.com/A-EVO-Lab/a-evolve/tree/main/seed_workspaces/skillbench/skills/data-formats -g -y

Use without installing

npx skills use A-EVO-Lab/a-evolve@data-formats

指定 Agent (Claude Code)

npx skills add A-EVO-Lab/a-evolve --skill data-formats -a claude-code -g -y

安装 repo 全部 skill

npx skills add A-EVO-Lab/a-evolve --all -g -y

预览 repo 内 skill

npx skills add A-EVO-Lab/a-evolve --list

SKILL.md

Frontmatter
{
    "name": "data-formats",
    "description": "Reading, writing, and converting common data formats (CSV, Excel, JSON, YAML) with correct handling of encoding, types, and edge cases."
}

Data Formats Skill

Excel (.xlsx) Files

Reading Excel

import pandas as pd
df = pd.read_excel('input.xlsx', engine='openpyxl')
# Check what you got
print(df.columns.tolist())
print(df.dtypes)
print(df.head())

Writing Excel

df.to_excel('output.xlsx', index=False, engine='openpyxl')

CRITICAL: Excel Formula Evaluation

openpyxl writes formula strings but does NOT compute them. Verifiers read VALUES, not formulas.

Problem: Cell with =SUM(A1:A3) shows as 0 or #N/A when read back.

Solutions (in order of preference):

  1. Compute values in Python and write computed values directly
  2. Use gnumeric to recalculate: ssconvert --recalc file.xlsx file.xlsx
  3. Use LibreOffice: libreoffice --headless --calc --convert-to xlsx file.xlsx

Common Excel Pitfalls

  • Type mismatch: Number 2025 vs string "2025" breaks MATCH/VLOOKUP
  • Missing packages: pip3 install --break-system-packages openpyxl xlsxwriter
  • Sheet names: Check with pd.ExcelFile('input.xlsx').sheet_names
  • Multiple sheets: pd.read_excel('input.xlsx', sheet_name='Sheet2')

CSV Files

import pandas as pd
# Always specify encoding
df = pd.read_csv('input.csv', encoding='utf-8')
# Check for issues
print(f"Shape: {df.shape}")
print(f"Columns: {df.columns.tolist()}")
print(df.head())

# Write
df.to_csv('output.csv', index=False, encoding='utf-8')

CSV Pitfalls

  • Delimiter: Some files use ; or \t — check with head -2 file.csv
  • Encoding: Try encoding='latin-1' if utf-8 fails
  • Header: Some files have no header — use header=None
  • Mixed types: Use dtype=str to read everything as strings first

JSON Files

import json
with open('input.json', encoding='utf-8') as f:
    data = json.load(f)

# Write with proper formatting
with open('output.json', 'w', encoding='utf-8') as f:
    json.dump(data, f, indent=2, ensure_ascii=False)

YAML Files

# Install: pip3 install --break-system-packages pyyaml
import yaml
with open('input.yaml') as f:
    data = yaml.safe_load(f)

General Tips

  • Always check output file exists and has content before finishing
  • Verify column names match exactly what the task expects
  • Watch for NaN values: df.fillna(0) or df.dropna()
  • Numeric precision: use round(value, N) for expected decimal places

Version History

  • c9d4789 Current 2026-07-25 07:28

Same Skill Collection

artifacts/tb2_clawcode_opus46/skills/build-compiled-extensions/SKILL.md
artifacts/tb2_clawcode_opus46/skills/debug-and-fix/SKILL.md
artifacts/tb2_clawcode_opus46/skills/environment-discovery/SKILL.md
artifacts/tb2_clawcode_opus46/skills/python-data-analysis/SKILL.md
artifacts/tb2_clawcode_opus46/skills/scientific-computing/SKILL.md
artifacts/tb2_clawcode_opus46/skills/self-verification/SKILL.md
artifacts/tb2_clawcode_opus46/skills/systematic-exploration/SKILL.md
seed_workspaces/mcp_mh/.claude/skills/harness-optimizer/SKILL.md
seed_workspaces/osworld/skills/application-shortcuts/SKILL.md
seed_workspaces/osworld/skills/gui-click-over-keyboard/SKILL.md
seed_workspaces/osworld/skills/gui-navigation/SKILL.md
seed_workspaces/osworld/skills/screenshot-analysis/SKILL.md
seed_workspaces/osworld/skills/self-verification/SKILL.md
seed_workspaces/osworld/skills/web-access-strategies/SKILL.md
seed_workspaces/skillbench/skills/environment-discovery/SKILL.md
seed_workspaces/skillbench/skills/python-packages/SKILL.md
seed_workspaces/skillbench/skills/skill-usage/SKILL.md
seed_workspaces/terminal/skills/build-compiled-extensions/SKILL.md
seed_workspaces/terminal/skills/debug-and-fix/SKILL.md
seed_workspaces/terminal/skills/environment-discovery/SKILL.md
seed_workspaces/terminal/skills/scientific-computing/SKILL.md
seed_workspaces/terminal/skills/self-verification/SKILL.md

Metadata

Files
0
Version
88190c6
Hash
f0b75423
Indexed
2026-07-25 07:28

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 10:15
浙ICP备14020137号-1 $Гость$