360 Secure SkillHub
360 安全技能中心

Diffgate

DiffGate 是一个基于 FastAPI 的本地服务型 Skill:先用 uvicorn 启动本地端口服务,再向 8006 端口的 /v1/diff 接口提交两段文本,返回相似度(0-1)、新增/删除行数与逐条变更记录,可用于对比 LLM 输出、校验内容一致性或跟踪文档改动。

mirni
mirni
热度 40.58
最近更新 2026-05-11 17:42:41
分类:效率依赖:代码执行应用场景:数据处理 / 工作流

安装技能

复制下面的话术发给你的 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