跳到正文
Skillpedia
通用编程81k · #1656

harness-similarity

它能做什么

这项技能比较两个运行框架的指纹,给出相似度评分,并细分各部分。适合决定是复制现有运行框架还是从头开始的团队。

适用场景

  • ✓当你需要决定是复制现有运行框架还是重新开始时。
  • ✓当你想根据某个仓库的特征对模板进行排序时。
  • ✓当两个团队可能做了相同的东西,而你想加以核对时。

技能链接

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-metaharness/skills/harness-similarity/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-metaharness/skills/harness-similarity/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我们的账单运行框架和客服运行框架有多相似?它们在哪些地方不同?”

每周 5 个新技能,1 分钟读完。

工作原理

这项技能以固定权重组合三项指标:数值比较、关键类别匹配,以及智能体类型的重叠程度。结果包括总体评分以及每个部分的数值。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Surfaces the production similarity function from scripts/_similarity.mjs as a callable skill. Use when an agent needs to:

  • decide whether to fork an existing harness vs scaffold a new one
  • rank candidate templates against a target repo's genome
  • diff two harnesses produced by different teams to find duplicate work
  • generate the confidence number that ADR-151 §3.2's Recommender wraps

Algorithm (from ADR-152 §Decision)

overall = 0.60·cosine + 0.25·categorical + 0.15·jaccard
  • cosine — over a 9-dim numerical vector of normalized scorecard + genome dims
  • categorical — fraction of 4 enum fields that match (repo_type, archetype, template, recommendedMode)
  • jaccard — |A ∩ B| / |A ∪ B| over the agent_topology[] array

The 3-component design is load-bearing: numerical cosine alone is too coarse (the iter-35 spike showed LEGAL vs DEVOPS at cosine=0.97 despite being unrelated verticals). Categorical + jaccard pull the composite to the correct ordering.

Reference outputs (iter-35 spike fixtures)

Pair overall cosine categorical jaccard
LEGAL × LEGAL (self) 1.0000 1.0000 1.0000 1.0000
LEGAL × SUPPORT 0.8296 0.9987 0.7500 0.2857
LEGAL × DEVOPS 0.5840 0.9734 0.0000 0.0000

Both invariants from ADR-152 §"Smallest demonstrable spike" hold:

  1. similarity(X, X) === 1 exactly
  2. similarity(LEGAL, DEVOPS) < similarity(LEGAL, SUPPORT) (vertical affinity)

Architectural constraint inheritance (ADR-150)

  • Removable — pure-TS function, zero static @metaharness/* imports.
  • Optional — no new dep in package.json.
  • Graceful — malformed inputs emit { degraded: true, reason } with exit code 2; never throws.
  • CI-gate — smoke step 17y locks the contract: module exports, spike fixtures reproduce, CLI dispatcher entry registered, MCP tool registered.

Usage

# File inputs
npx ruflo metaharness similarity --a a.json --b b.json

# Memory inputs (records persisted by oia-audit.mjs)
npx ruflo metaharness similarity --a-key harness-X --b-key harness-Y

# Per-dimension breakdown (used by ADR-151 §3.2 Recommender)
npx ruflo metaharness similarity --a a.json --b b.json --per-dimension

# Alert when too-dissimilar (used by ADR-151 §3.3 Drift Detection)
npx ruflo metaharness similarity --a a.json --b b.json --alert-below 0.5

Implementation

Production module: scripts/_similarity.mjs CLI skill: scripts/similarity.mjs MCP tool: mcp__plugin_ruflo-core_ruflo__metaharness_similarity (registered in v3/@claude-flow/cli/src/mcp-tools/metaharness-tools.ts) Spike anchor: scripts/_spike-similarity.mjs (regression suite — invariants locked here)

常见问题

总体评分如何计算?

数值比较占 60%,类别匹配占 25%,智能体重叠占 15%。

它需要额外的包吗?

不需要。来源说明它是纯代码,不需要 metaharness 包。

它能显示偏离吗?

可以。将运行框架与早期版本比较,可以显示它已偏离了多远。

详情

作者的原始描述

Weighted similarity (ADR-152) between two harness fingerprints (genome + score JSON): an overall score in [0,1] plus per-component breakdown. Use when comparing two harnesses or detecting drift between them. Pure TypeScript; needs no @metaharness package.

repo: ruvnet/ruflo

热度

GitHub 星标
81k
排名
#1656
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能