harness-similarity
できること
このスキルは、2つのハーネスの指紋を比べて類似度スコアを出し、各部分の内訳を示します。既存のハーネスをフォークするか、新しく始めるかを決めるチーム向けです。
使う場面
- ✓既存のハーネスをフォークするか、新しく始めるか決める必要があるとき。
- ✓リポジトリのプロファイルに対して、テンプレートを順位付けしたいとき。
- ✓2つのチームが同じものを作ったかもしれず、確認したいとき。
スキルのリンク
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-metaharness/skills/harness-similarity/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私たちの請求ハーネスとサポートハーネスはどれくらい似ていて、どこが違いますか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
スキルは、3つの指標を固定の重みで組み合わせます。数値の比較、主要カテゴリーの一致、エージェントの種類の重なりです。結果は、全体のスコアと各部分の値です。
技術的な内容(元の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作業量の変化に合わせて、エージェントのグループを分割し、再配分する手助けをします。作業に合った配置を選びます。
agent-agent
81k大きな目標を順番に並んだ行動計画にし、状況が変わったときに計画を立て直す方法をエージェントに教えます。
agent-agentic-payments
81kAIの買い物のために、支出の上限、期間、販売店のルール、署名付きの承認を含む支出の委任を管理する手助けをします。
agent-analyze-code-quality
81kコードの品質を確認し、コードの臭い、技術的負債、リファクタリングの案を見つける手助けをします。ファイルは変更しません。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。