harness-drift-from-history

Detects structural drift by diffing a fresh repository audit against the most recent stored audit.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Answering "did anything drift?" in a repository previously required manually chaining three separate commands: listing past audits, running a fresh audit, and diffing them with a similarity threshold. This Skill collapses that sequence into a single command that automatically picks the baseline, runs the comparison, and alerts when structural distance crosses a threshold.

Core Features & Use Cases

  • One-command drift detection: Composes audit-list, oia-audit, and audit-trend into a single primitive that finds the most recent audit in the metaharness-audit namespace and diffs it against a fresh audit.
  • Configurable baseline and threshold: Use --baseline-since to skip records newer than a given window (e.g. 7d) and --threshold to set the similarity alert level (e.g. 0.95).
  • Structured exit codes for CI: Returns 0 when similarity meets the threshold, 1 on detected drift, 2 on missing history, and 3 when the upstream metaharness is degraded, making it suitable for pipeline gates.
  • Use Case: Run weekly in CI to compare the current repository structure against last week's audit and fail the build when structural similarity drops below 0.95.

Quick Start

Ask the AI to run a drift check against the most recent stored audit with a similarity threshold of 0.95 and report whether the repository structure has drifted.

Frequently Asked Questions about harness-drift-from-history

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

FAQPage Schema
How do I detect structural drift in a repository over time?

Run the drift-from-history command with a similarity threshold, for example npx ruflo metaharness drift-from-history --threshold 0.95. It automatically finds the most recent stored audit, runs a fresh audit, and diffs the two, exiting with code 1 when similarity falls below the threshold.

How to compare a current audit against a historical baseline?

The command lists records in the metaharness-audit namespace and picks the most recent one by startedAt as the baseline. Use --baseline-since 7d to skip any records newer than seven days when selecting the baseline.

Can drift detection run in a CI pipeline?

Yes, the command is designed for CI gates with structured exit codes: 0 means similarity meets the threshold, 1 signals detected drift, 2 indicates missing audit history, and 3 means the upstream metaharness is degraded. A smoke test anchors the dispatcher entry.

What happens when there is no audit history to compare against?

When the audit history is empty, the command exits with code 2 and returns a hint to seed the history rather than crashing. This graceful behavior follows the ADR-150 constraint inheritance for optional and removable composition.

What output formats does the drift report support?

The command accepts --format json or --format table for the structured drift report. It also supports --dry-run and --path flags to control execution and target directory.