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
Ready-to-paste message
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-constructionOr download just the file:
curl -L https://raw.githubusercontent.com/affaan-m/ECC/main/pi/core/skills/agent-harness-construction/SKILL.md -o SKILL.mdTechnical 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
- #4
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
accessibility
Helps 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.
affaan-m/ECC
agent-architecture-audit
Makes your agent check if everything is working correctly. It finds and fixes problems in AI systems, ensuring they perform as expected.
affaan-m/ECC
agent-eval
Helps your agent compare different AI coding tools. It measures which one is faster, cheaper, and more reliable for specific tasks.
affaan-m/ECC
agent-introspection-debugging
Helps your agent fix itself when something goes wrong. It investigates failures to understand the cause and find a solution, rather than just trying again.
affaan-m/ECC
Similar skills
mcp-builder
Helps your agent create servers that connect LLMs to external services. Essential for integrating APIs and services using Python or Node/TypeScript.
anthropics/skills
prepare-mcp-integration
Prepares vendor (MCP) integrations through research and human approval. It follows a guided process for new integrations.
paperclipai/paperclip
first-task
Guides the agent on the user's first task. It interprets the initial answer, clarifies the goal, and proposes a plan or single task for approval.
paperclipai/paperclip