harness-similarity

Computes weighted similarity scores between two harness fingerprints using cosine, categorical, and jaccard metrics.

70.1k|8.4k|Updated Jun 2, 2025
One-click install
npx skills add https://github.com/ruvnet/claude-flow --skill harness-similarity
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: harness-similarity
Source: https://github.com/ruvnet/claude-flow/tree/main/plugins/ruflo-metaharness/skills/harness-similarity
Command: npx skills add https://github.com/ruvnet/claude-flow --skill harness-similarity

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When deciding whether to fork an existing harness, rank candidate templates, or detect duplicate work across teams, you need an objective similarity score between two harness fingerprints (genome + score JSON) rather than relying on intuition.

Core Features & Use Cases

  • Weighted composite scoring: Combines cosine similarity over 9 numeric dimensions (0.60), categorical agreement over 4 enum fields (0.25), and jaccard over agent_topology (0.15) into an overall score in [0,1].
  • Flexible inputs: Compare fingerprints from JSON files or from persisted memory records via keys, with optional per-dimension breakdowns and drift alerts below a configurable threshold.
  • Use Case: An agent evaluating whether to scaffold a new harness or fork an existing one runs the similarity function against candidate templates and uses the per-dimension breakdown to feed the ADR-151 Recommender's confidence number.

Quick Start

Compare two harness fingerprint files by running npx ruflo metaharness similarity --a a.json --b b.json to get the overall score and component breakdown.

Frequently Asked Questions about harness-similarity

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compare two harness fingerprints for similarity?โ–ผ

Run npx ruflo metaharness similarity with --a and --b pointing to two fingerprint JSON files, or use --a-key and --b-key for records persisted in memory. The command returns an overall score in [0,1] plus cosine, categorical, and jaccard components.

What algorithm does harness fingerprint similarity use?โ–ผ

It uses a weighted composite: 0.60 times cosine similarity over a 9-dimension numeric vector, 0.25 times categorical agreement over 4 enum fields, and 0.15 times jaccard over the agent_topology array. This design prevents high cosine scores from masking unrelated verticals.

How do I detect drift between two harness configurations?โ–ผ

Use the --alert-below flag with a threshold such as 0.5 to emit an alert when two harnesses are too dissimilar. The --per-dimension flag shows which components (cosine, categorical, jaccard) drive the difference.

What happens when similarity inputs are malformed or missing?โ–ผ

Malformed inputs never throw an exception. The function returns an object with degraded set to true and a reason field, and the CLI exits with code 2, preserving the graceful-degradation constraint from ADR-150.

Does harness-similarity require external npm dependencies?โ–ผ

No. It is a pure TypeScript/JavaScript module with zero static @metaharness/* imports and adds no new entries to package.json, keeping it removable and optional per the ADR-150 architectural constraints.