agentleFS
d-oitd-oit/rust-2026-template/.agents/skills/harness/SKILL.md

harness

Skill11 starsChanged 6 months agoMITView on GitHub

Harness engineering guide — maps all sensors and feedforward guides, teaches self-correction protocol when a CI sensor fires. Use when a sensor fires, before making code changes, or when setting up agent context for a new task. Triggers: "harness", "sensor fire", "CI failure", "self-correction".

21 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When a computational sensor fires:

    line 33
  2. Very specific:

    Treat snapshot changes as behavior changes.

    line 58
  3. Distinctive:

    When any sensor fires repeatedly (>2 times in one sprint):

    line 62
  4. Very specific:

    Run ./scripts/distill-strikes.sh --threshold 3 to cluster repeated failure signatures from .agents/ci/regression-matrix.json and recent …

    line 64
  5. Very specific:

    If the fail-fast threshold is reached and no guide exists, distill-strikes.sh drafts a starter skill skeleton …

    line 65
  6. Very specific:

    Update the corresponding feedforward guide to prevent recurrence and document the update in CHANGELOG.md.

    line 67

“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: harness

What Is the Harness

Agent = Model + Harness. The harness is the system of feedforward guides (what to do before coding) and feedback sensors (what catches violations after coding). It has two axes:

  • Feedforward (guides): Context, constraints, conventions that prevent errors before they happen.
  • Feedback (sensors): Automated checks that fire after code changes, providing structured error output.

The harness has two modes:

  • Computational: Deterministic checks (fmt, clippy, deny) — always trust the output.
  • Inferential: LLM-based guidance (skill docs, agent context) — direction, not commands.

Sensor Response Protocol

When a computational sensor fires:

  1. Read the full error message — it includes a fix hint.
  2. Classify the error: fmt / lint / test / arch / security.
  3. Check historical regression signatures: Consult .agents/ci/regression-matrix.json to see if the failure matches a known historical pattern (e.g. MD001 heading jumps, cargo-deny policy violations, or gitleaks findings).
  4. Apply the minimal fix — do not refactor unrelated code.
  5. Re-run the specific sensor — cargo fmt, cargo clippy, etc.
  6. Only commit when the sensor is green.
  7. Write a metrics event to .agents/events/YYYY/MM/DD/ per the metrics-reporter skill.

Sensor Quick Reference

SensorCommandConfigStage
fmtcargo fmt --all -- --check.pre-commit-config.yamlpre-commit
clippycargo clippy --workspace --all-targets --all-features -- -D warnings.clippy.toml, .pre-commit-config.yamlpre-commit + CI
denycargo deny checkdeny.tomlpre-commit + CI
nextestcargo nextest runCargo.tomlCI
mutantscargo mutants[workspace.metadata.cargo-mutants] in Cargo.tomlCI weekly
arch_fitnesscargo test --test arch_fitnesstests/arch_fitness.rsCI
insta snapshotsmake insta-test / cargo insta reviewcrates/workspace-tests/tests/behaviour_harness.rsCI
gitleaksgitleaks detect.gitleaks.tomlCI

Snapshot Contract

Treat snapshot changes as behavior changes. Inspect them with cargo insta review; accept only intentional, deterministic output changes. Never update snapshots solely to make a failing test pass. CI runs the normal test suite without snapshot updates enabled, so pending snapshots fail rather than being accepted automatically.

Steering Loop

When any sensor fires repeatedly (>2 times in one sprint):

  1. Run ./scripts/distill-strikes.sh --threshold 3 to cluster repeated failure signatures from .agents/ci/regression-matrix.json and recent quality history.
  2. If the fail-fast threshold is reached and no guide exists, distill-strikes.sh drafts a starter skill skeleton (.agents/skills/drafts/<subsystem>/SKILL.md) with verbatim HARNESS VIOLATION hints and a red fixture sample. If an existing skill exists, distill-strikes.sh refuses to overwrite and points to it instead.
  3. Review and refine the draft skill with skill-creator principles. Draft promotion requires a green sensor verification run.
  4. Update the corresponding feedforward guide to prevent recurrence and document the update in CHANGELOG.md.

The steering loop closes the harness: sensors fire → distill-strikes.sh drafts starter skills → humans and agents update guides → sensors fire less.

Rationalizations

RationalizationReality
"The sensor is just being pedantic, I'll bypass it."Computational sensors exist to prevent regressions. Never suppress without approval.
"I'll fix this CI failure after committing."Committing broken code breaks peers and pipelines. Always verify sensors pass before commit.
"I don't need to check the regression matrix."Checking .agents/ci/regression-matrix.json saves time by identifying known failure patterns.

Red Flags

  • Committing code while computational sensors are red
  • Suppressing sensor errors rather than fixing root causes
  • Ignoring repeated sensor strikes instead of running distill-strikes.sh

References

  • Full harness map: HARNESS.md at repo root.
  • Historical CI Regression Matrix: .agents/ci/regression-matrix.json
  • Matrix test suite: tests/ci_regression_matrix_test.sh
  • Agent-optimised error output: scripts/harness-check.sh runs each sensor and emits structured error output with HARNESS VIOLATION prefix.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.