agent-harness-construction
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.
Skill link
https://github.com/affaan-m/ECC/blob/main/pi/core/skills/agent-harness-construction/SKILL.mdCopy 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
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“How can I better organize the tools my AI agent uses so it doesn't get lost?”
5 new skills a week. 1 minute to read.
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.
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:
- Action space quality
- Observation quality
- Recovery quality
- Context budget quality
Action Space Design
- Use stable, explicit tool names.
- Keep inputs schema-first and narrow.
- Return deterministic output shapes.
- 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|errorsummary: one-line resultnext_actions: actionable follow-upsartifacts: file paths / IDs
Error Recovery Contract
For every error path, include:
- root cause hint
- safe retry instruction
- explicit stop condition
Context Budgeting
- Keep system prompt minimal and invariant.
- Move large guidance into skills loaded on demand.
- Prefer references to files over inlining long documents.
- 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
- #129
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
accessibility
280kHelps your agent create interfaces that everyone can use. Ensures websites and apps work well for people with disabilities, like those who are blind or have reduced mobility.
agent-architecture-audit
280kMakes your agent check if everything is working correctly. It finds and fixes problems in AI systems, ensuring they perform as expected.
agent-eval
280kHelps your agent compare different AI coding tools. It measures which one is faster, cheaper, and more reliable for specific tasks.
agent-introspection-debugging
280kHelps your agent fix itself when something goes wrong. It investigates failures to understand the cause and find a solution, rather than just trying again.
Similar skills
add-model-provider
394kLets your agent connect a new AI model provider to OpenClaw using safe setup commands, keep API keys out of plain text, and run a live test.
acp-router
394kHelps your agent send a task to a coding assistant such as Claude Code or Cursor through OpenClaw, so the work runs in that tool.
browser-automation
394kTeaches your agent to control web pages step by step, including logins, tabs, and recovery when a page stops responding.