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

harness

Skill15 starsChanged 5 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".

35 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use retro, verify and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AWSSkill

    retro

    Conduct a retrospective on a coding session.

    Also in 3 projects that use this

  • Microsoft AzureSkill

    verify

    End-to-end app testing pipeline for browser-based web apps on cloud browsers via Azure Playwright Workspaces: verify the live app, author tests for working flows, heal failing tests, then re-run with video and produce one consolidated report. Three phases (app verification, test authoring, test healing) plus a scoped final sanity run; each phase emits a sub-report. Use when asked to "verify my app", "make sure my app works and has good test coverage", "do a full QA pass", "add tests where I'm missing coverage", "fix failing tests and add new ones", "smoke test before deploy", "QA my deployment", or any combined verify-and-test ask. Requires Azure CLI (`az login`) and a Playwright Workspace resource ID — bootstraps configs on first invocation. Browser-based web apps with Playwright only — not for unit/API tests, native mobile/desktop, load/perf, or full accessibility audits.

    Also in 3 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 4 projects that use this

  • GoogleSkill

    grill-me

    A relentless interview to sharpen a plan or design.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 2 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 24 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Non-Interference Rule: Never assume a green status from do-harness means xtask checks ran, or vice versa.

    line 35
  2. Distinctive:

    When a computational sensor fires:

    line 40
  3. Very specific:

    Treat snapshot changes as behavior changes.

    line 65
  4. Distinctive:

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

    line 69
  5. Very specific:

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

    line 71
  6. Very specific:

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

    line 72
  7. Very specific:

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

    line 74

“Common” is measured: kept by at least 6 in 10 of the 24 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.

Tool Ownership & Quality Verification

  • Canonical Project Quality Command: ./scripts/quality-gates.sh (or cargo run -p xtask -- quality run). xtask is the single source of truth for project quality tiers (pull-request, protected-branch, scheduled, release) and quality telemetry (.agents/ci/quality-run.json).
  • Optional Agent Harness Tooling: do-harness (scripts/setup-harness.sh) provides agent diagnostics (do-harness doctor) and PR readiness checks (do-harness pr review, do-harness pr ready). do-harness.toml delegates quality checks to ./scripts/quality-gates.sh to prevent running redundant duplicate Cargo passes.
  • Non-Interference Rule: Never assume a green status from do-harness means xtask checks ran, or vice versa. If do-harness is absent or PR context is unavailable, fall back directly to ./scripts/quality-gates.sh and ./scripts/doctor.sh.
  • Sensor Applicability Rule: The quality-gates sensor's when-changed globs in do-harness.toml decide whether do-harness verify --changed runs it. Manifest edits need both "Cargo.toml" (workspace root manifest) and "**/Cargo.toml" (workspace member manifests, inside and outside crates/). Rust sources and lockfiles match on file shape ("**/*.rs", "**/Cargo.lock") so a file in an unknown directory still selects the sensor. "Cargo.toml" alone skips member manifests, and bare wildcards like "**" fire on Markdown-only edits. Keep the same rule in config/xtask.json when_changed.

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.