New to Claude Skills? Learn how to install them →

ruvnet on GitHub

Drift Detection from History

Free

Simplify drift detection with a single command.

by ruvnet67.6k stars on ruvnet/ruflo
Updated Aug 10, 2026
Get this skill

Free · Opens the source repo

What Drift Detection from History does

The Drift Detection from History skill streamlines the process of monitoring changes in your codebase by condensing multiple commands into a single, efficient operation. This skill is particularly useful for developers who regularly run audits to ensure the integrity of their projects. Instead of executing a series of commands to compare the current state of the repository with a historical audit, users can now achieve this in one step, saving time and reducing the potential for human error.

When invoked, the skill automatically retrieves the most recent audit record from the metaharness-audit namespace and performs a fresh audit of the current repository. It then compares the two audits using a similarity threshold defined by the user, alerting them if the structural distance crosses the specified limit. This allows developers to quickly identify any significant changes that may have occurred since the last audit, enabling them to take action as needed.

This skill is designed for developers who are already using the ruflo toolset and need a reliable way to monitor drift in their code. By integrating seamlessly with existing workflows, it enhances productivity and ensures that developers can maintain high standards of code quality without the overhead of managing multiple commands. Additionally, the skill is built to handle various scenarios gracefully, including cases where audit history may be absent, ensuring a smooth user experience.

Overall, the Drift Detection from History skill is an essential tool for developers looking to maintain control over their codebase and ensure consistency over time. Its ease of use and integration with the ruflo ecosystem make it a valuable addition to any developer's toolkit.

When to use it

Use this skill when you need to quickly check for structural changes in your codebase after running an audit.

When not to use it

Avoid using this skill if you are not utilizing the `ruflo` toolset or if you do not have a historical audit record available.

What you can build with it

Weekly Audit Check

Run the skill weekly to ensure no significant changes have occurred in your codebase since the last audit.

Continuous Integration

Integrate this skill into your CI pipeline to automatically check for drift after each deployment.

Historical Comparison

Use the skill to compare the current state of your repository against historical audits to track changes over time.

How to install Drift Detection from History

View source

1. Install with the skills CLI

npx skills add ruvnet/ruflo/harness-drift-from-history --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by ruvnet

The natural ops question after running oia-audit weekly is "did anything drift?" Before this skill, the answer required a three-step sequence:

npx ruflo metaharness audit-list --format json   # → pick a key by hand
npx ruflo metaharness oia-audit --format json > /tmp/curr.json
npx ruflo metaharness audit-trend \
  --baseline-key <picked-key> --current /tmp/curr.json \
  --alert-on-distance-below 0.95

This skill collapses it into one command:

npx ruflo metaharness drift-from-history --threshold 0.95

What it does

  1. Lists records from metaharness-audit namespace via audit-list.mjs
  2. Picks the most recent record by startedAt (or --baseline-since 7d skips anything newer than 7 days)
  3. Runs a fresh oia-audit against the current path
  4. Diffs the two via audit-trend, applying --alert-on-distance-below ${threshold}
  5. Returns the structured drift report

Architectural constraint inheritance (ADR-150)

ConstraintHow drift-from-history satisfies it
RemovablePure subprocess composition over existing scripts — no new @metaharness/* import
OptionalIf oia-audit reports degraded:true, this skill exits 3 with a degraded payload
GracefulEmpty audit history → exit 2 with hint to seed it; never crashes
CI-gateSmoke step 17z16 anchors the dispatcher entry + subcommand listing

Exit codes

  • 0 — similarity ≥ threshold (or threshold not crossed)
  • 1 — drift detected: similarity < threshold (alert fired)
  • 2 — config error (no history, audit-list failed)
  • 3 — upstream metaharness absent (degraded payload returned)

Example

$ npx ruflo metaharness drift-from-history --threshold 0.95
# drift-from-history

Baseline:        audit-2026-06-16T22-58-47-840Z
Current:         2026-06-16T23:05:02.231Z

Structural similarity: 1 (near-identical)
Distance:              0

✓ similarity ≥ 0.95 — OK

Implementation

scripts/drift-from-history.mjs

Frequently asked questions about Drift Detection from History

Similar skills