Data Compare Engine: Aligning column names and comparing two CSV/XLSX files using AI

Preface

For reconciliation, report verification, inventory or order validation, the common practice is to manually specify primary key columns, use VLOOKUP in Excel, or write joins in scripts. When column names are inconsistent, encodings are non-uniform, or the two sides are exported in different formats, upfront data cleaning often takes up most of the time. The following introduces the SkillHub community Skill Data Compare Engine (coordinate @user_26bdbd50/data-compare-engine): in Agent or command-line scenarios, it uses pandas to parse two files, optionally uses AI for column matching, and then outputs diff statistics and a Markdown report.

What Is This

Data Compare Engine is a community-published (community) Agent Skill categorized under data-analysis, currently at version 1.0.0, maintained by publisher user_26bdbd50. The SkillHub page marks requires_api_key=true: column matching and diff interpretation rely on a model API Key you provide yourself; the billing side also requires configuring a Miaoda-related Token (see below).

The core problem it solves is: how to quickly obtain matching rows, one-sided rows, monetary differences, and a readable report for two structured data files (CSV / XLSX) on the premise of aligning column semantics.

Core Features

The following capabilities all come from the SKILL.md, README.md, and implementation notes within the Skill package, and can be trimmed to use as needed.

Dual-File Parsing

  1. Supports CSV / XLSX as two input files.
  2. Uses pandas to read, with encoding detection (relies on chardet etc.).
  3. At runtime it uses the working directory /tmp/data-compare-engine/ (created if it does not exist) to store uploaded or intermediate path-related data.

AI Automatic Column Matching

  1. Pass OPENAI_API_KEY or ANTHROPIC_API_KEY via environment variables (the docs also note it can be extended to support other Key types “etc.”).
  2. AI infers semantically corresponding columns in the left and right files; you can also manually specify the Join Key via --join-key (multiple columns separated by commas).
  3. The CLI supports --ai-model to choose openai or anthropic (default openai); --skip-ai-match skips AI column matching and uses only the manual Join Key.

Data Comparison & Statistics

The comparison dimensions include: exact match, left file only, right file only, and amount difference. The output contains the number of exactly matched rows, the number of differing rows, the difference ratio, and the total amount difference when an amount column is specified (--amount-col).

Diff Analysis Report

  1. Generates a Markdown report by default (--output, default diff_report.md), containing a diff statistics summary, AI interpretation of the reasons for the differences, and details classified by group.
  2. Diff results can be exported in CSV form via --export-csv.

Typical scenarios listed in the documentation include: bank statement reconciliation, financial report comparison, inventory verification, order reconciliation, database sync verification, etc. (these are indications of applicable directions, not separate case studies).

Installation & Enablement

Install the Skill on SkillHub

First confirm that the SkillHub CLI is installed on your machine (if not, refer to the SkillHub installation documentation). When installing the Skill, you must use --dir to point to the current Agent’s skills directory, otherwise it may be installed to the default ./skills/ and not be recognized.

command -v skillhub && skillhub --version

skillhub install data-compare-engine --namespace user_26bdbd50 --dir ~/.cursor/skills/

You can also let the Agent, following the prompts on the SkillHub page, read https://skillhub.cn/install/skillhub.md and then perform the equivalent installation. Common path examples:

  • Cursor: ~/.cursor/skills/
  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project

After installation, enable or restart the Agent in a client that supports Skills so that it loads the workflow instructions in the SKILL.md within the package.

Python Dependencies & Local Execution

The quick-start example in the Skill documentation is:

pip install -r scripts/requirements.txt
python run.py --left left_file.csv --right right_file.csv

The current 1.0.0 package provides requirements.txt at the root directory (including pandas>=1.5.0, openpyxl>=3.0.0, chardet>=4.0.0, requests>=2.28.0). If there is no scripts/requirements.txt after extraction, you can run the following at the Skill root directory:

pip install -r requirements.txt
python run.py --left left_file.csv --right right_file.csv

Environment Variables

Variable Purpose
OPENAI_API_KEY OpenAI API Key (optional, for AI column matching etc.)
ANTHROPIC_API_KEY Anthropic API Key (optional)
YK_TOKEN Miaoda billing Token

Billing verification endpoint: POST https://api.yk-global.com/v1/verify. Plans (from official documentation):

Plan Price Quota Max rows per run
Free Free 10 trial runs 200 rows
Pro ¥29/month 50 runs/month 5,000 rows
Enterprise ¥99/month Unlimited Unlimited

The documentation for purchasing paid plans points to YK-Global.com.

Typical Usage

After configuring dependencies and environment variables at the Skill root directory, you can use the CLI to perform a complete comparison. The following example combines the parameter descriptions from README.md.

export OPENAI_API_KEY="your-key"
export YK_TOKEN="your-yk-token"

python run.py \
  --left ./exports/ledger_left.xlsx \
  --right ./exports/ledger_right.csv \
  --join-key order_id,sku \
  --amount-col amount \
  --output diff_report.md \
  --export-csv diff_rows.csv \
  --ai-model openai

If column names are already aligned and you only need to compare by primary key, you can skip AI matching:

python run.py \
  --left left.csv \
  --right right.csv \
  --join-key id \
  --skip-ai-match \
  --output diff_report.md

When --left / --right are not passed, run.py enters interactive path input (implemented in src/main.py).

After installing the Skill in an Agent such as Cursor, you can hand natural-language tasks (e.g., “Compare these two statements and highlight the amount differences”) and file paths to the Agent; the Agent will call the above scripts or equivalent steps according to SKILL.md.

Applicable Scenarios & Caveats

Who it’s for: Data analysts, finance operations, warehouse, or e-commerce back-office staff who frequently perform two-table reconciliation with non-uniform column names and want reports that can be archived directly (Markdown + optional CSV); also suitable for developers who want to solidify “comparison” into a repeatable workflow within Agent sessions.

Limitations & Caveats:

  1. API Key & Billing: The SkillHub tag requires an API Key; runtime also involves YK_TOKEN and row count/run count plan limits. For large files, refer to the plan table or the Enterprise plan.
  2. Data Scale: The Free plan allows at most 200 rows per run, Pro allows 5,000 rows; beyond that you need to upgrade or split the file yourself.
  3. Paths & Documentation: The official quick start mentions scripts/requirements.txt, which may not match some package layouts; defer to the directory after installation.
  4. Privacy & Compliance: Column matching and interpretation will send headers/samples to the selected AI provider; for sensitive data, please desensitize first or only use --skip-ai-match for a local join.
  5. Platform Data: SkillHub scraping info shows this Skill has a rating of 100000 and 821 downloads (page statistics may change; refer to SkillHub).

Wrapping Up

Data Compare Engine consolidates “read tables → align columns → compute diff statistics → produce report” into a pipeline that can be scripted or delegated to an Agent; semantic alignment of column names is left to AI, while primary keys and amount columns can still be handled manually as a fallback. To install or view metadata, visit the SkillHub page: Data Compare Engine; API coordinate: https://api.skillhub.cn/user_26bdbd50/data-compare-engine.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye