Skip to content
Skillpedia
Agents29k Β· #9524

agent-harness

What it does

This skill makes the agent work through a goal in small verified steps, with a controller deciding when the work is done. It is for people who want an AI agent to finish multi-step work reliably rather than just claim it did.

When to use it

  • βœ“When you give an agent a multi-step goal and need it to verify each step.
  • βœ“When an agent keeps claiming tasks are done without evidence.
  • βœ“When a long task needs to be resumed from a saved state in a new session.

Skill link

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/agent-harness/skills/agent-harness/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/alirezarezvani/claude-skills/blob/main/engineering/agent-harness/skills/agent-harness/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œAudit our payments service and design an SLO with an error budget, and make sure each step is verified before you call it done.”

5 new skills a week. 1 minute to read.

How it works

The agent turns the goal into a task plan with checks, runs one task at a time, and lets a controller verify each result. Retries are capped, and if a budget runs out the work is escalated rather than marked done.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Agent Harness

You are a harness operator, not a hero. The loop β€” not your optimism β€” decides when work is done. Your job: compile the goal into tasks with checks, execute one task at a time, let the controller adjudicate verification, and stop when the state machine says stop.

The contract

GOAL β†’ goal_compiler β†’ PLAN β†’ loop_controller: [execute β†’ verify]* β†’ CLOSE
                                     ↑______retry (≀ max_attempts, changed approach)
                                     └── ESCALATE on exhausted budgets β€” never fake success

Three layers, all JSON: a committed per-domain manifest (what skills/tools/checks exist), a per-goal plan (which tasks, which verifications, what "done" means), and a per-run state file (the single source of truth; a fresh session resumes from it alone).

Quick start

# 0. Pick the domain manifest (20 committed under assets/harnesses/, e.g. engineering-team.json)
ls assets/harnesses/

# 1. Compile the goal (refuses vague goals with exit 3 + forcing questions)
python3 scripts/goal_compiler.py \
  --goal "audit the payments service and design an SLO with an error budget" \
  --manifest assets/harnesses/engineering.json --out plan.json

# 2. Initialize the loop state
python3 scripts/loop_controller.py init --plan plan.json --state .agent-harness/state.json

# 3. Drive the loop β€” repeat until directive is "close" or "escalate"
python3 scripts/loop_controller.py next --state .agent-harness/state.json
#    β†’ {"action": "execute", "task": "T1", ...}: open the task's skill (SKILL.md at
#      skill_path), do the work with its tools, then:
python3 scripts/loop_controller.py record --state .agent-harness/state.json \
  --task T1 --phase execute --exit-code 0
#    β†’ the controller runs the task's checks ITSELF (subprocess, timeout, evidence log):
python3 scripts/loop_controller.py verify --state .agent-harness/state.json --task T1 --cwd <repo-root>

# 4. Close β€” refused (exit 4) while any task is unverified and unwaived
python3 scripts/loop_controller.py close --state .agent-harness/state.json

Regenerate a manifest after skills change (diff-stable, CI-checkable):

python3 scripts/harness_manifest_builder.py --domain engineering-team \
  --repo-root <repo-root> --out-dir assets/harnesses --no-timestamp

Hard rules

  1. Never adjudicate your own verification. verify runs the checks via subprocess; a passing record --phase verify without --evidence is rejected (exit 6). You do not get to declare a task verified.
  2. Never modify a gate you are judged by. Check commands come from the manifest/plan. Editing a check to make it pass is the reward-hacking failure mode (see references/verification_discipline.md) β€” same invariant as autoresearch-agent's locked evaluator.
  3. One task at a time, writes serialized. Parallelize reading and judging, never two tasks writing the same artifact (references/agentic_loop_canon.md).
  4. Retry means a changed approach. Same command + same input = same failure. The retry directive says so; honor it.
  5. Budgets are terminal states, not suggestions. max_attempts_per_task β†’ escalated (exit 2); max_loop_iterations β†’ escalate (exit 5). Exhausted budgets are never reported as success β€” a human waives (close --waive T3 --reason "..."), you don't.
  6. Fresh context beats long context. Every next directive is executable by a new session reading only the plan + state files. Long-running goals: run each iteration as its own session against the durable state.
  7. State lives in .agent-harness/ β€” never in .agenthub/, .autoresearch/, or docs/TC/ (those belong to sibling skills).
  8. Plan and state files are a trust boundary. verify shell-executes each task's check command; only run the harness on plan/state files you or goal_compiler.py produced, never on files from untrusted input (see references/verification_discipline.md).

Forcing questions (ask before compiling; one per turn, with a recommended answer)

# Question Recommended answer Why (canon)
1 What single observable outcome means DONE? A named artifact + a command that exits 0 against it Verifier's law: invest in verifiability first
2 Which domain harness applies? The domain whose skills name the deliverable;
FAQ

What happens when a task keeps failing?

The controller limits retries and escalates, so the agent does not fake success.

Can a new session pick up where it stopped?

Yes. The state file holds progress, so a fresh session can resume from it alone.

Does a vague goal work?

No. The goal compiler refuses vague goals and asks forcing questions first.

Details

Original description by the author

Use when an agent should drive a goal in one of this repo's domains to a verified close, before starting the work. Compiles the goal into a task plan with goal_compiler.py and runs it through loop_controller.py, which verifies each task, caps retries and escalates.

repo: alirezarezvani/claude-skills

Popularity

GitHub stars
29k
Ranking position
#9524
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills