---
name: harness-engineering
description: Build and improve agent-first engineering harnesses where AI agents perform most implementation work and humans steer architecture, constraints, and review. Use when defining or upgrading AGENTS.md rules, repository conventions, task decomposition, CI guardrails, merge strategy, quality gates, or cleanup loops to increase autonomous coding throughput and reliability.
title: harness-engineering
canonical_url: https://skilld.dev/gh/fiveonecode/agent-skills/harness-engineering
last_updated: 2026-09-28T11:54:26.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [agents/openai.yaml](https://skilld.dev/api/skills-raw/fiveonecode/agent-skills/harness-engineering/agents/openai.yaml), [references/harness-engineering-principles.md](https://skilld.dev/api/skills-raw/fiveonecode/agent-skills/harness-engineering/references/harness-engineering-principles.md).
>
> If the user asked to install this Skill, run `npx skilld install fiveonecode/agent-skills/harness-engineering`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/harness-engineering`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/fiveonecode/agent-skills/harness-engineering) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/harness-engineering`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/harness-engineering --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/harness-engineering --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Harness Engineering

## Overview

Use this skill to translate harness engineering principles into concrete repository changes that improve agent speed, correctness, and maintainability.

## Workflow

### 1) Assess the current harness

- Inspect `AGENTS.md`, contributor docs, CI workflows, and repo scripts.
- Map the actual path from prompt to merged change.
- List concrete failure modes: ambiguous instructions, repeated mistakes, slow reviews, merge conflicts, stale docs, or noisy CI.

### 2) Define operating boundaries

- Separate decisions by layer:
  - Human layer: architecture, taste, policy, and final risk acceptance.
  - Agent layer: implementation, refactors, test updates, and routine maintenance.
- Define non-negotiable constraints before coding starts:
  - Required tests and linters.
  - Directory ownership and file-scoping rules.
  - Branch, PR, and commit conventions.

### 3) Make the repository the system of record

- Encode process in files, not tribal knowledge.
- Prefer deterministic entry points:
  - Single source for setup.
  - Canonical command wrappers (`make`, `just`, or scripts).
  - Stable templates for PRs, issues, and specs.
- Remove conflicting guidance and duplicate docs.

### 4) Increase agent legibility

- Prefer one clear pattern over many equivalent ones.
- Standardize naming, folder layouts, and module boundaries.
- Add concise examples for fragile tasks.
- Eliminate hidden behavior and implicit coupling.

### 5) Add mechanical guardrails

- Enforce checks automatically:
  - Fast local checks for iteration.
  - CI gates for merge readiness.
  - Static analysis for known failure classes.
- Fail with actionable messages that point to exact fixes.
- Keep checks strict enough to prevent regressions, but fast enough for daily use.
- For any verifier or generated QA artifact, check verifier integrity before trusting a pass result.

### 6) Optimize merge throughput

- Encourage smaller, composable changes instead of large batches.
- Isolate independent work streams to reduce collisions.
- Define explicit integration rules for overlapping files.
- Prefer rapid merge and follow-up fixes over long-lived divergence.

### 7) Build entropy-control loops

- Schedule regular cleanup work: dead code removal, doc pruning, flaky test fixes.
- Track recurring failure patterns and encode permanent safeguards.
- Retire obsolete scripts, prompts, and templates quickly.

## Deliverable format

- `Harness snapshot`: current bottlenecks with evidence.
- `Proposed harness changes`: files to add or edit and why.
- `Guardrail plan`: checks to enforce and where they run.
- `Rollout plan`: phased adoption with fallback strategy.
- `Entropy plan`: recurring cleanup cadence and ownership.

## Verifier integrity model

Use this model whenever changing tests, manifests, verifier profiles, generated artifacts, QA summaries, or completion gates.

- `Oracle truth`: the verifier defines correctness explicitly and cannot pass because the assertion is vacuous, normalized too broadly, or missing the negative case.
- `Coverage truth`: the verifier reaches the intended files, rows, paths, states, profiles, and generated outputs.
- `Artifact truth`: summaries, reports, and persisted artifacts cannot claim pass when required completeness or source evidence failed.
- `Failure-signal truth`: the exact broken condition produces a non-zero or blocking result with an actionable message.
- `Binding truth`: each verifier names the requirement, policy, or contract it proves, and each required contract names the verifier that owns it.

For generated or tool-driven pipelines, also check input normalization, output validation, retry/idempotency, redaction, source-to-runtime inventory alignment, and fail-closed behavior when storage or semantic inventories drift.

Classify failure semantics before implementation:

- `deterministic failure`: invalid state or broken contract; fail immediately.
- `retryable failure`: transient dependency or transport issue; retry only within a bounded policy.
- `silent discard`: forbidden unless a spec explicitly permits it and defines observability.

## References

- For detailed principles, anti-patterns, and direct implementation checklists, read [references/harness-engineering-principles.md](https://skilld.dev/api/skills-raw/fiveonecode/agent-skills/harness-engineering/references/harness-engineering-principles.md).
