360 Secure SkillHub
360 安全技能中心

Diffgate

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

分类:效率
mirni
mirni
热度 31.11
最近更新 2026-05-11 17:42:41

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add mirni/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