SuperAPI AI Directory

similar-judge

Agents & models

View repository

Updated 10-15 21:52

About this skill

Similar Judge

Quantify the difference between two texts. Input an artifact and a target, and output JSON: similarity + word-level diff source text.

Only measure differences, do not judge quality. High similarity does not mean the content is correct (it may have reversed causality or wrong orders of magnitude); leave quality judgment to the upper-level LLM.

Call

# 默认输出 JSON
{skill}/bin/similar-judge 产物.txt 目标.txt

# 调试模式(人类可读)
{skill}/bin/similar-judge 产物.txt 目标.txt --text

Parameter order is fixed:artifact first, target second. The target is the baseline. By default, whitespace differences are ignored (git -w semantics).

JSON fields

{
  "line_sim_ratio": 0.5,
  "word_sim_ratio": 0.8103,
  "target_lines": 20,
  "product_lines": 20,
  "added_lines": 10,
  "deleted_lines": 10,
  "diff_chars": 386,
  "diff": "# 用户中心\n[-用户中心提供登录注册功能。-]{+用户中心负责身份认证与会话管理。+}\n..."
}
Field Meaning
line_sim_ratio Line-level similarity, sensitive to line order misalignment
word_sim_ratio Word-level similarity, consistent with human perception,recommended primary metric
target_lines / product_lines Number of lines on both sides
added_lines / deleted_lines Number of lines that are redundant in the artifact / missing from the artifact
diff_chars diff field character length, for the LLM to estimate volume
diff git word-diff content, including [-old-]{+new+} word-level markers

Boundaries

Can do: similarity calculation, added/deleted line count statistics, word-level diff source text output

Does not do: quality assessment, fact-checking, optimization suggestions, closed-loop decisions; leave these to the LLM

Hard rules

  • Output JSON by default,--text for debugging only
  • diff field strips git metadata headers, keeping only word-diff content
  • Do not output evaluative semantic text (such as "high/low quality") to avoid misleading the upper layer
  • Do not modify the artifact or target; read-only