Community编程与开发github.com

文档演化追踪器

追踪文档家族在不同版本间的变化,包括段落差异和概念谱系(引入、保留、修改、丢弃)。触发词:"追踪文档变更"、"版本历史"、"草稿间变化"、"概念谱系"、"文档演化"。输出 Markdown + JSON 时间线。

文档演化追踪器 是什么?

该技能是一个独立的文档演化追踪工具,适用于需要分析一系列版本化文档(如按时间戳或顺序命名的文件)如何随时间变化的场景。它通过计算连续版本之间的段落级差异,并追踪一组命名概念或自动检测的标题的谱系(引入、保留、修改、丢弃),帮助开发者或AI代理用户快速理解文档的演变历史。该技能支持Markdown和JSON格式输出时间线,便于阅读和程序化处理。它能在任何Python环境中运行,核心依赖仅为标准库,可选支持YAML配置(需要PyYAML),优先尊重用户确认后再安装可选依赖。触发关键词包括“追踪文档变更”、“版本历史”、“草稿间变化”和“概念谱系”,适用于文档审核、版本对比和内容演进分析等场景。

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

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

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

文档

文档演化追踪器 是做什么的?

一个独立的技能,用于追踪文档在不同版本之间的演化。

给定一个版本家族(例如包含 v1.md, v2.md, ... 或时间戳文件的目录), 它会计算连续版本之间的段落级差异,并追踪概念谱系(引入、保留、修改、 丢弃)。

强制流程

依赖引导(首次运行时)

在首次运行前,探测该技能的运行时依赖:

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

如果缺少 PyYAML 且配置文件为 YAML 格式,则告知用户并询问 是否要 pip install pyyaml;仅在用户确认后才安装。切勿 在未经明确同意的情况下安装到全局环境中。

  1. 加载一个配置(参考 config/examples/family.json;当 PyYAML 已安装时 也支持 YAML 配置)。

  2. 确认 versions_dir 至少包含两个版本文件。

  3. python -m src.cli run --config <路径> [--concepts "A,B"]。

  4. 报告过渡次数并引导用户查看 ./evolution/evolution_<跟踪ID>.{md,json}。

适用场景

  • 有一系列文档版本(按时间戳或顺序命名)需要 随时间进行比较。
  • 用户提出“追踪文档变更”、“版本历史”、“ 草稿间变化”或“概念谱系”。
  • 需要跨草稿追踪一个命名概念(术语、标题、 定义)的引入、修改或丢弃时间。
  • 需要以时间线而非单一端到端差异的形式 报告草稿的演化。

使用示例

# 验证配置并查看发现的版本文件。
python -m src.cli validate --config config/examples/family.json
python -m src.cli versions --config config/examples/family.json

# 运行追踪器;可选指定要追踪的概念。
python -m src.cli run --config config/examples/family.json --concepts "entropy,partition function"

报告写入 ./evolution/evolution_<跟踪ID>.{md,json}; Markdown 时间线供读者阅读,JSON 供程序化使用。

故障处理

  • 配置无效(validate 退出码非零)——修复报告指出的字段 并重新验证;命名方案和 versions_dir 通常是 问题所在。
  • 发现少于两个版本——运行中止;检查 version_naming 规则与实际文件名是否匹配,然后重试。
  • 某个概念从未出现——它会被报告为在所有版本中 缺失,这是有效结果,而非错误。
  • 意外退出码——逐字报告错误信息;不要回退 到手动比较文件。

差异粒度

粒度分割规则
line非空行
paragraph(默认)空行分隔的块
sentence标点分隔的句子

限制

  • 差异对比是结构性的(通过 difflib 进行块对齐),而非语义性的。 一个概念仅在版本的文本中出现其精确短语(不区分大小写)时才 “存在”。
  • 不支持 sequential / timestamp 之外的自定义命名方案。

Individual skills in this repo

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

JiamingShi-JsPhys/agent-skills

Cross-document conflict detector. Use when the user has two or more documents, datasets, or extracted fact tables and wants to find contradictions between them. Triggers on "detect conflicts", "find contradictions", "do these documents agree", "cross-check claims", "inconsistency check", or when comparing a claim across multiple sources. Runs three detection levels: entity (numeric / boolean mismatch on the same key), clause (categorical mismatch), and argument (free-text disagreement). Emits a machine-readable conflict report in JSON / CSV / Markdown.

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).

相关技能