harness-similarity
它能做什么
这项技能比较两个运行框架的指纹,给出相似度评分,并细分各部分。适合决定是复制现有运行框架还是从头开始的团队。
适用场景
- ✓当你需要决定是复制现有运行框架还是重新开始时。
- ✓当你想根据某个仓库的特征对模板进行排序时。
- ✓当两个团队可能做了相同的东西,而你想加以核对时。
技能链接
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-metaharness/skills/harness-similarity/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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 theagent_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:
similarity(X, X) === 1exactlysimilarity(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
评论
- …
同一仓库的更多技能
agent-adaptive-coordinator
81k帮你的智能体在工作量变化时拆分和重新平衡一组 AI 智能体,并选择适合任务的分工方式。
agent-agent
81k教你的智能体把一个大目标拆成有顺序的行动计划,并在情况变化时重新规划。
agent-agentic-payments
81k帮你的智能体管理 AI 购物的消费授权,包括消费上限、时间窗口、商户规则和签名审批。
agent-analyze-code-quality
81k帮你的智能体检查代码质量,找出代码异味、技术债务和重构建议,且不改动文件。