cas-bigdatalab/piflow/cross-field-comparison-check
Claude Code and agent skill by cas-bigdatalab/piflow
Trust tier 2
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
跨字段比较校验工具。读取结构化数据文件(CSV、TSV、Excel等),检查两个字段之间的逻辑约束关系 是否满足(如 start < end、min ≤ max、price >= cost),支持六种比较运算符,多约束可组合使用。 当用户提到跨字段校验、字段间比较、逻辑约束检查、大小关系验证等需求时使用此skill。 即使用户没有明确说出"跨字段",只要任务涉及验证两个字段值之间的逻辑关系,就应该使用此skill。
Install
npx vskill@latest install cas-bigdatalab/piflow/cross-field-comparison-checkSKILL.md
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:
- 跨字段比较校验
- 字段间逻辑约束检查
- 大小关系验证
- 字段值一致性比对
- 数据逻辑规则检查
处理逻辑
- 读取输入数据表
- 解析 constraints 字符串,拆分出每个约束(按
|分割) - 对每行数据:
a. 提取左右字段的值并转为数值(numeric) b. 按指定运算符比较 c. 违反任一约束 → 标记 qc_mark
- 非数值数据(如字符串)转为 NaN 后跳过该约束的比较
- 输出标记结果和统计摘要
支持的文件格式
- CSV (.csv)
- TSV (.tsv)
- Excel (.xls, .xlsx)
- SPSS (.sav)
使用方法
步骤1:获取用户输入输出路径及参数
向用户确认:
- 输入文件路径(需要校验的文件)
- 输出文件路径(校验结果文件)
- 约束表达式(格式:左字段,运算符,右字段|...)
- 质控标识
步骤2:执行跨字段比较校验脚本
在 scripts/ 目录下找到 cross_field_comparison_check.py,使用Python执行:
单约束(时间区间):
多约束(范围+价格):
步骤3:返回结果
脚本执行完成后,告知用户:
- 每条约束的违反行数
- 示例违反数据
- 总标记行数
参数说明
| 参数 | 必填 | 说明 | ||
|---|---|---|---|---|
--input_path | 是 | 输入文件路径(支持CSV/TSV/Excel/SPSS) | ||
--output_path | 是 | 输出文件路径 | ||
--constraints | 是 | 约束表达式,` | 分隔。格式:左字段,运算符,右字段` | |
--qc_mark | 是 | 质控标识(如QC标识) | ||
--mark_field_name | 否 | 质控标识字段名(默认QC0000) |
输出示例
发现问题
通过
注意事项
- 输入输出路径需要用户提供
- 输出文件格式会自动保持与输入文件一致
- 约束分隔符规则:
- 约束内部用半角逗号
,分隔(左字段,运算符,右字段) - 约束之间用竖线
|分隔
- 数值类型:字段值强制转为 numeric,非数值按 NaN 处理并跳过该行
- 约束之间为 AND 关系:每条约束独立判断,任一违反即标记该行
- 被比较的两个字段名在表中必须存在,否则报错退出
- 如果用户没有指定输出路径,可以建议使用原文件名加上
_checked后缀
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingworkspace/skills/cross_field_comparison_check/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cas-bigdatalab/piflow/cross-field-comparison-check)