Community研究与数据分析github.com

JiamingShi-JsPhys/agent-skills

跨文档冲突检测器。当用户有两个或多个文档、数据集或提取的事实表,并希望发现它们之间的矛盾时使用。触发关键词包括“检测冲突”、“发现矛盾”、“这些文档是否一致”、“交叉核对声明”、“不一致检查”,或跨多个来源比较某一声明。运行三个检测级别:实体(相同键的数字/布尔值不匹配)、条款(分类不匹配)和论点(自由文本分歧)。输出机器可读的冲突报告,格式为 JSON / CSV / Markdown。

agent-skills 是什么?

这个技能(skill)是一个自包含的跨文档冲突检测工具,旨在自动化识别多个文档、数据集或事实表之间的不一致之处。开发者可以利用它进行数据质量审核、文档一致性验证或交叉核对声明。该技能支持通过文件路径(path)、内联文本(inline text)或内联 JSON(inline JSON)加载文档,并内置一个规则引擎,根据规范化的键将各文档中的声明配对,然后通过三个检测层次——实体级(数值/布尔值冲突)、条款级(分类冲突)和论点级(自由文本分歧)——来识别矛盾。它提供命令行界面(CLI)操作,包括配置验证、文档列表预览以及运行检测,并支持 JSON、CSV 和 Markdown 格式的报告输出,其中 JSON 为机器可读的标准格式。该技能在多种 AI 代理平台(如 Claude Code、Cursor、Codex)上均可使用,但要求运行时环境中已安装 Python(以及可选的 PyYAML 来处理 YAML 配置)。用户只需通过自然语言指令(如“检测这些文档中的冲突”)即可触发运行,技能会自动加载配置、提取事实并生成报告。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/JiamingShi-JsPhys/agent-skills/tree/HEAD/skills/conflict-detector

Installed? Explore more 研究与数据分析 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

conflict-detector

一个自包含的技能,用于查找一组文档中的矛盾。每个文档被加载(通过路径/内联文本/内联 JSON),提取其事实,然后跨文档规则引擎按规范化键将声明配对并标记不匹配。

强制工作流程

依赖引导(首次使用时)

在首次运行前,检查该技能的运行时依赖:

  • 核心:纯标准库——无需安装。
  • 可选:PyYAML(仅在配置/输入为 .yaml 时需要;JSON 输入仅使用标准库即可工作)。

如果缺少 PyYAML 且输入为 YAML,则告知用户并询问是否要 pip install pyyaml;仅在用户确认后安装。未经明确同意,绝不安装到全局环境中。

  1. 加载 YAML 配置(以 config/examples/two_docs.yaml 为参考)。
  2. 验证每个 documents[].value / documents[].path 是否可达。
  3. 运行 python -m src.cli run --config <path> [--format json,csv,md]。
  4. 报告每个级别的冲突数量,并指向用户查看 ./conflicts/conflicts_<run_id>.*。

何时使用

  • 需要检查两个或多个文档、数据集或提取的事实表之间是否存在矛盾。
  • 用户要求“检测冲突”、“发现矛盾”、“交叉核对声明”或询问“这些文档是否一致”。
  • 单个声明(一个数字、一个状态、一个命名事实)出现在多个来源中,需要跨来源进行比较。
  • 从文档中提取的事实表在使用前需要审核其内部一致性。

使用示例

# 验证配置(快速,不写入报告)
python -m src.cli validate --config config/examples/two_docs.yaml

# 列出配置中解析出的文档来源
python -m src.cli list-docs --config config/examples/two_docs.yaml

# 运行检测;选择输出格式(默认:json)
python -m src.cli run --config config/examples/two_docs.yaml --format json,csv,md

报告会写入 ./conflicts/conflicts_<run_id>.{json,csv,md};JSON 是机器可读的合同格式。

故障处理

  • 配置无效(validate 退出码非零)——修复报告中指出的字段并重新验证;不要手动绕过模式违反。
  • 文档来源不可达——运行中止并指明出错的 documents[] 条目;检查路径或内联值,然后重试。
  • 未发现冲突——有效且可报告的结果(空报告),不是错误;明确说明,而不是重新运行。
  • 意外的退出码——逐字报告消息;不要手动比较文档。

检测级别

级别类型严重性示例
entitynumeric_mismatch, boolean高speed = 10 对比 speed = 20
clausecategorical中status = "active" 对比 status = "archived"
argumentcategorical(文本)低存在分歧的自由文本行

限制

  • 提取基于键值对;自由文本段落仅在 argument 级别(行级比较)参与。
  • 单位规范化通过表驱动(unit_map);自定义单位规则必须通过配置提供。

Individual skills in this repo

This repo contains 3 individual skills — each has its own dedicated page.

JiamingShi-JsPhys/agent-skills

Document evolution tracker. Use when the user has a family of document versions (timestamped or sequentially named files) and wants to see how the document changed over time -- which paragraphs / lines / sentences were added, removed, or modified between consecutive versions, and how a set of named concepts (or auto-detected headings) evolved (introduced / retained / modified / dropped). Triggers on "track document changes", "version history", "what changed between drafts", "concept lineage", "document evolution". Emits a Markdown + JSON timeline.

JiamingShi-JsPhys/agent-skills

Longitudinal statistical analysis pipeline. Use when the user has panel / repeated-measures data (one or more sessions per subject, with between-subject conditions) and wants to run a reproducible analysis: descriptive stats, a manipulation check, a linear mixed model, a lagged mediator, or a sensitivity analysis over random-effects / covariance structures. Triggers on any of the phrases "LMM", "mixed model", "repeated measures", "longitudinal analysis", "mediation over time", "lagged mediator", "sensitivity analysis of RE structure". When fired, load the YAML config that lists the enabled steps, run the pipeline, and report the per-step results plus the generated CSVs.

JiamingShi-JsPhys/agent-skills

State manager for multi-dimensional computational experiments. Iterate a parameter grid over many rounds, snapshot declared critical files each round, audit every round (params, hashes, timestamps, status), and roll back to any round non-destructively. Use it when a workflow runs hundreds of rounds across multiple parameter dimensions and needs per-round snapshots, full audit trail, and arbitrary rollback - e.g. longitudinal studies, parameter scans, or symbolic/ numerical sweeps calling external solvers (Mathematica, GAP, SymPy, custom scripts).

相关技能