360 Secure SkillHub
360 安全技能中心

Diffgate

核心功能:对比两段文本,输出0-1区间的相似度得分、行级增删内容及具体变更记录。典型场景:校验LLM输出一致性、验证文档完整性、追踪技能版本变更、比对配置文件更新差异。通过API POST提交文本,返回含相似度、增删项及变更记录的JSON结果,需启动本地服务调用。

mirni
mirni
热度 40.52
最近更新 2026-05-11 17:42:41
分类:效率依赖:MCP 服务应用场景:数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add diffgate
Metadata
name
diffgate
description
Compare two texts and get a unified diff with a similarity score (0-1), line-level additions/deletions, and individual change records. Useful for comparing LLM outputs, verifying content integrity, or tracking document changes.
metadata
{"openclaw":{"emoji":"📊","requires":{"bins":["python"]},"install":[{"id":"pip","kind":"uv","packages":["fastapi","uvicorn","pydantic"]}]}}

DiffGate

Compare two texts and see exactly what changed.

Start the server

uvicorn diffgate.app:app --port 8006

Compare texts

curl -s -X POST http://localhost:8006/v1/diff \
  -H "Content-Type: application/json" \
  -d '{"text_a": "hello\nworld", "text_b": "hello\nearth"}' | jq

Returns similarity (1.0 = identical, 0.0 = completely different), additions, deletions, and changes (each with type add/delete and content).

Use cases

  • Compare two LLM outputs to check consistency
  • Verify a document hasn't been tampered with
  • Track changes between skill versions
  • Diff config files before and after an update