Skip to content
Skillpedia
Agents280k · #4

agent-harness-construction

Makes your agent better understand how to perform tasks. It optimizes the tools and instructions the agent uses to increase its chances of success.

What it does

This tool helps organize and improve how an AI agent uses its tools to complete tasks. It ensures the agent clearly understands what to do, how to do it, and what to do if something goes wrong, so it has a better chance of success.

When to use it

  • ✓When defining or adjusting the tools an AI agent can use.
  • ✓When you want an AI agent to be more reliable and efficient in its tasks.
  • ✓If an AI agent is struggling to complete tasks or recover from errors.

Example of what to ask your AI

“How can I better organize the tools my AI agent uses so it doesn't get lost?”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/affaan-m/ECC/blob/main/pi/core/skills/agent-harness-construction/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/affaan-m/ECC/blob/main/pi/core/skills/agent-harness-construction/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

It works by setting clear rules for how the agent should name its tools, what information it should receive, and what information it should provide back. This includes specifying how to handle errors and what to include in responses.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add affaan-m/ECC --skill agent-harness-construction

Or download just the file:

curl -L https://raw.githubusercontent.com/affaan-m/ECC/main/pi/core/skills/agent-harness-construction/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Agent Harness Construction

Use this skill when you are improving how an agent plans, calls tools, recovers from errors, and converges on completion.

Core Model

Agent output quality is constrained by:

  1. Action space quality
  2. Observation quality
  3. Recovery quality
  4. Context budget quality

Action Space Design

  1. Use stable, explicit tool names.
  2. Keep inputs schema-first and narrow.
  3. Return deterministic output shapes.
  4. Avoid catch-all tools unless isolation is impossible.

Granularity Rules

  • Use micro-tools for high-risk operations (deploy, migration, permissions).
  • Use medium tools for common edit/read/search loops.
  • Use macro-tools only when round-trip overhead is the dominant cost.

Observation Design

Every tool response should include:

  • status: success|warning|error
  • summary: one-line result
  • next_actions: actionable follow-ups
  • artifacts: file paths / IDs

Error Recovery Contract

For every error path, include:

  • root cause hint
  • safe retry instruction
  • explicit stop condition

Context Budgeting

  1. Keep system prompt minimal and invariant.
  2. Move large guidance into skills loaded on demand.
  3. Prefer references to files over inlining long documents.
  4. Compact at phase boundaries, not arbitrary token thresholds.

Architecture Pattern Guidance

  • ReAct: best for exploratory tasks with uncertain path.
  • Function-calling: best for structured deterministic flows.
  • Hybrid (recommended): ReAct planning + typed tool execution.

Benchmarking

Track:

  • completion rate
  • retries per task
  • pass@1 and pass@3
  • cost per successful task

Anti-Patterns

  • Too many tools with overlapping semantics.
  • Opaque tool output with no recovery hints.
  • Error-only output without next steps.
  • Context overloading with irrelevant references.
FAQ

What are 'micro-tools', 'medium tools', and 'macro-tools'?

These are different sizes of tools. Micro-tools are for small, important tasks, medium tools for common tasks, and macro-tools for large, time-consuming tasks.

What does 'Action Space Quality' mean?

It refers to the clarity and organization of the tools available to the AI agent. A good 'Action Space' means the agent knows exactly which tools to use and how to use them.

Why is 'Error Recovery' important?

It's crucial so the AI agent can recover from failures. Knowing the root cause of an error and how to retry helps the agent not give up and complete the task.

Details

Original description by the author

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent's tool set, action space, or observation format.

repo: affaan-m/ECC

Popularity

GitHub stars
280k
Ranking position
#4
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills