Cross Field Comparison Check logo

Cross Field Comparison Check

Organization
cas-bigdatalab
cross_field_comparison_check

跨字段比较校验工具。读取结构化数据文件(CSV、TSV、Excel等),检查两个字段之间的逻辑约束关系 是否满足(如 start < end、min ≤ max、price >= cost),支持六种比较运算符,多约束可组合使用。 当用户提到跨字段校验、字段间比较、逻辑约束检查、大小关系验证等需求时使用此skill。 即使用户没有明确说出"跨字段",只要任务涉及验证两个字段值之间的逻辑关系,就应该使用此skill。

Overview

Publishercas-bigdatalab
Repositorypiflow
Skill namecross_field_comparison_check
Stars
541
Forks
172
Bundled files
3
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by cas-bigdatalab on GitHub. Read the source before you install it.

Installation

Install the Cross Field Comparison Check AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/cas-bigdatalab/piflow/tree/master/workspace/skills/cross_field_comparison_check
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/cas-bigdatalab/piflow.git /tmp/piflow
mkdir -p .claude/skills
cp -r /tmp/piflow/workspace/skills/cross_field_comparison_check .claude/skills/cross_field_comparison_check
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Cross Field Comparison Check in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Cross Field Comparison Check on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Cross Field Comparison Check is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

cross_field_comparison_check 跨字段比较校验Skill

功能概述

本skill用于逐行验证两个字段值之间的逻辑关系是否成立。典型应用场景:

  • 时间区间校验:start_time < end_time
  • 数值范围校验:min_value <= max_value
  • 价格逻辑校验:cost < price
  • 库存校验:sold <= total

支持运算符

运算符含义示例
<小于start,<,end
<=小于等于min,<=,max
>大于end,>,start
>=大于等于current,>=,baseline
==等于computed,==,expected
!=不等于status,!=,deleted

约束格式

  • 每个约束:左字段,运算符,右字段
  • 多个约束用 | 分隔
  • 约束之间为 AND 关系(任一违反即标记)
  • 示例:start,<,end|min,<=,max 表示同时满足 start<end 且 min≤max

触发条件

当用户请求以下任务时,应使用此skill:

  • 跨字段比较校验
  • 字段间逻辑约束检查
  • 大小关系验证
  • 字段值一致性比对
  • 数据逻辑规则检查

处理逻辑

  1. 读取输入数据表
  2. 解析 constraints 字符串,拆分出每个约束(按 | 分割)
  3. 对每行数据: a. 提取左右字段的值并转为数值(numeric) b. 按指定运算符比较 c. 违反任一约束 → 标记 qc_mark
  4. 非数值数据(如字符串)转为 NaN 后跳过该约束的比较
  5. 输出标记结果和统计摘要

支持的文件格式

  • CSV (.csv)
  • TSV (.tsv)
  • Excel (.xls, .xlsx)
  • SPSS (.sav)

使用方法

步骤1:获取用户输入输出路径及参数

向用户确认:

  1. 输入文件路径(需要校验的文件)
  2. 输出文件路径(校验结果文件)
  3. 约束表达式(格式:左字段,运算符,右字段|...)
  4. 质控标识

步骤2:执行跨字段比较校验脚本

在 scripts/ 目录下找到 cross_field_comparison_check.py,使用Python执行:

单约束(时间区间):

bash
python scripts/cross_field_comparison_check.py \
    --input_path data.csv \
    --output_path checked.csv \
    --constraints "start_time,<,end_time" \
    --qc_mark QCFLAG

多约束(范围+价格):

bash
python scripts/cross_field_comparison_check.py \
    --input_path data.csv \
    --output_path checked.csv \
    --constraints "start,<,end|min,<=,max|cost,<=,price" \
    --qc_mark QCFLAG

步骤3:返回结果

脚本执行完成后,告知用户:

  • 每条约束的违反行数
  • 示例违反数据
  • 总标记行数

参数说明

参数必填说明
--input_path是输入文件路径(支持CSV/TSV/Excel/SPSS)
--output_path是输出文件路径
--constraints是约束表达式,`
--qc_mark是质控标识(如QC标识)
--mark_field_name否质控标识字段名(默认QC0000)

输出示例

发现问题

[OK] Using encoding UTF-8 successfully read CSV file
Successfully read file: /path/to/data.csv, shape: (500, 8)
Constraints: start < end | min <= max
[QC FAIL] 跨字段比较校验未通过 (2 项问题):
  [start < end] 3 行违反 (示例: 行42 start=100 > end=80)
  [min <= max] 5 行违反 (示例: 行126 min=50 > max=30)
已标记 8 行
Successfully written file: /path/to/checked.csv

通过

[OK] Using encoding UTF-8 successfully read CSV file
Successfully read file: /path/to/data.csv, shape: (300, 6)
Constraints: start < end | cost <= price
[QC PASS] 跨字段比较校验通过
Successfully written file: /path/to/checked.csv

注意事项

  1. 输入输出路径需要用户提供
  2. 输出文件格式会自动保持与输入文件一致
  3. 约束分隔符规则:
    • 约束内部用半角逗号 , 分隔(左字段,运算符,右字段)
    • 约束之间用竖线 | 分隔
  4. 数值类型:字段值强制转为 numeric,非数值按 NaN 处理并跳过该行
  5. 约束之间为 AND 关系:每条约束独立判断,任一违反即标记该行
  6. 被比较的两个字段名在表中必须存在,否则报错退出
  7. 如果用户没有指定输出路径,可以建议使用原文件名加上 _checked 后缀

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Cross Field Comparison Check AI skill do?

跨字段比较校验工具。读取结构化数据文件(CSV、TSV、Excel等),检查两个字段之间的逻辑约束关系 是否满足(如 start < end、min ≤ max、price >= cost),支持六种比较运算符,多约束可组合使用。 当用户提到跨字段校验、字段间比较、逻辑约束检查、大小关系验证等需求时使用此skill。 即使用户没有明确说出"跨字段",只要任务涉及验证两个字段值之间的逻辑关系,就应该使用此skill。

Why use Cross Field Comparison Check on TypingMind?

Because you install it once and use it with any model. Cross Field Comparison Check is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Cross Field Comparison Check in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/cas-bigdatalab/piflow/tree/master/workspace/skills/cross_field_comparison_check. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Cross Field Comparison Check?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Cross Field Comparison Check?

As many as you like. As long as a model supports skills, you can use Cross Field Comparison Check with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Cross Field Comparison Check AI skill free?

It is published on GitHub by cas-bigdatalab. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇