New to Claude Skills? Learn how to install them →

Aalirezarezvani on GitHub

Agent Harness

Free

Automate goal-driven workflows with verifiable task management.

Get this skill

Free · Opens the source repo

What Agent Harness does

Agent Harness is a tool designed for orchestrating complex workflows across various domains by transforming goals into structured task plans. It enables users to compile a goal into a verifiable task plan, execute tasks using domain-specific tools, and ensure that each task is verified through machine-run checks. This skill is particularly useful for teams looking to implement rigorous task management processes, ensuring that every step of a project is accounted for and verified before closure.

The harness operates through a defined contract where a goal is processed into a plan, and tasks are executed in a controlled loop. Each task is executed one at a time, and the verification process is automated, allowing the system to determine if a task is complete based on pre-defined criteria. If a task fails to meet its verification checks, the system can retry with a different approach or escalate the issue to a human reviewer, ensuring that the workflow is never falsely reported as complete.

This skill is beneficial for teams in engineering, finance, marketing, and other domains that require a structured approach to project management. By using the Agent Harness, teams can maintain a high level of accountability and transparency in their workflows, as the system enforces strict rules regarding task verification and budget management. This is particularly important in environments where accuracy and compliance are critical.

However, it is essential to note that the Agent Harness is not suitable for all scenarios. It is not designed for authoring Claude Code Workflow-tool .js scripts or for use in single-file metric optimization tasks. Users should also be aware that the system's strict adherence to verification and escalation protocols may not be ideal for projects requiring rapid iteration or flexibility in task management.

When to use it

Use this skill when you need to manage complex projects that require clear task verification and accountability.

When not to use it

This tool is not suitable for simpler tasks or projects that require rapid iteration without strict verification processes.

What you can build with it

Engineering Project Management

Use Agent Harness to manage engineering tasks, ensuring that each task is verified before moving on to the next.

Marketing Campaign Execution

Implement structured workflows for marketing initiatives, allowing for clear accountability and verification of campaign tasks.

Financial Audits

Utilize Agent Harness to automate the auditing process, ensuring that each financial task is executed and verified according to compliance standards.

How to install Agent Harness

View source

1. Install with the skills CLI

npx skills add alirezarezvani/claude-skills/agent-harness --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 alirezarezvani

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 (18 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)

#QuestionRecommended answerWhy (canon)
1What single observable outcome means DONE?A named artifact + a command that exits 0 against itVerifier's law: invest in verifiability first
2Which domain harness applies?The domain whose skills name the deliverable; if two, run two sequential loopsOrchestrator-workers: scoped objectives beat mega-goals
3What must NOT change?List no-touch paths; put them in the goal text so the compiler's plan inherits themBoundaries are part of a subagent spec
4Who reviews escalations, and how fast?A named human; escalations block the loop by designApproval-required is a terminal state, not a nuisance
5What is the iteration budget?Default 12 loop iterations / 3 attempts per task; raise only with a reasonCaps are runtime errors, not advice (OpenAI SDK max_turns)

Exit codes (branch on these mechanically)

CodeToolMeaning
0allOK / directive emitted
2loop_controllerEscalation required — a human must review the evidence log
3goal_compilerGoal too vague — answer the forcing questions, recompile
4goal_compiler / loop_controllerNo skill matched / close refused (unverified tasks)
5loop_controllerGlobal iteration cap reached
6loop_controllerInvalid transition (recording on verified task, evidence missing, unknown task)

Verifiable success

  • python3 scripts/harness_manifest_builder.py --sample, scripts/goal_compiler.py --sample, and scripts/loop_controller.py --sample all exit 0.
  • A vague goal (--goal "make it better") exits 3 and prints forcing questions.
  • loop_controller.py close on a state with an unverified task exits 4.
  • The demo loop in loop_controller.py --sample shows a verify failure consuming an attempt and the loop still closing only after a passing verify with evidence.

Related skills

  • workflow-builder: authoring deterministic .js scripts for Claude Code's Workflow tool. NOT for goal-to-close loop state (this skill).
  • agenthub: N parallel agents competing on ONE task in git worktrees. Use it inside a harness task that wants competing attempts.
  • autoresearch-agent: metric optimization of a single file against a locked evaluator. Use it when a task's done_when is "metric improves".
  • tc-tracker: per-code-change lifecycle records. Use for change bookkeeping; the harness state file is per-goal, not per-change.
  • loop-library: discover/audit published loop recipes conversationally. This skill is the executable enforcement of that vocabulary.
  • ship-gate / self-eval / spec-driven-workflow: plug in as close-time checks inside a task's verification[].

See references/domain_harness_design.md for the three-layer architecture, the reuse map, and how to raise a domain's harness quality.

Frequently asked questions about Agent Harness

Similar skills