PluginBench
Skill
Pass
Audit score 90

agent-harness-construction

affaan-m/everything-claude-code

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates.

What is agent-harness-construction?

This skill helps you architect agent harnesses by defining clear action spaces, structuring tool outputs, and implementing error recovery patterns. Use it when building or improving agents that need to reliably plan, execute tools, and converge on task completion.

  • Design stable, explicit tool definitions with schema-first inputs and deterministic outputs
  • Structure observation responses with status, summary, next_actions, and artifacts fields
  • Implement error recovery contracts with root cause hints, retry instructions, and stop conditions
  • Apply granularity rules to choose between micro-tools, medium tools, and macro-tools based on risk and overhead
  • Budget context by keeping system prompts minimal and loading large guidance on demand
  • Select architecture patterns (ReAct, function-calling, or hybrid) based on task structure

How to install agent-harness-construction

npx skills add https://github.com/affaan-m/everything-claude-code --skill agent-harness-construction
Claude Code
Cursor
Windsurf
Cline

How to use agent-harness-construction

  1. 1.Audit your current tool definitions against the action space design rules (stable names, schema-first inputs, deterministic outputs)
  2. 2.Restructure all tool responses to include status, summary, next_actions, and artifacts fields
  3. 3.Document error paths for each tool with root cause hints, safe retry instructions, and explicit stop conditions
  4. 4.Evaluate tool granularity: identify high-risk operations for micro-tools, common loops for medium tools, and overhead-heavy operations for macro-tools
  5. 5.Choose an architecture pattern (ReAct for exploration, function-calling for deterministic flows, or hybrid for both)
  6. 6.Set up metrics tracking: completion rate, retries per task, pass@1/pass@3, and cost per successful task

Use cases

Good for
  • Building a code deployment agent with high-risk operation isolation and explicit recovery paths
  • Optimizing a file search and edit loop by balancing tool granularity against round-trip overhead
  • Improving agent completion rates by restructuring tool outputs to include actionable next steps
  • Designing a multi-phase agent that compacts context at phase boundaries to stay within token limits
  • Debugging agent failures by tracking completion rate, retries, and cost metrics
Who it's for
  • AI engineers designing agent systems
  • Backend developers building tool-calling integrations
  • Teams optimizing agent reliability and cost
  • Developers implementing ReAct or function-calling patterns

agent-harness-construction FAQ

When should I use micro-tools vs. macro-tools?

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

What should every tool response include?

Every tool response should include: status (success|warning|error), summary (one-line result), next_actions (actionable follow-ups), and artifacts (file paths/IDs).

How do I structure error recovery?

For every error path, include a root cause hint, a safe retry instruction, and an explicit stop condition so the agent knows when to give up.

Should I use ReAct or function-calling?

ReAct is best for exploratory tasks with uncertain paths. Function-calling is best for structured deterministic flows. A hybrid approach (ReAct planning + typed tool execution) is recommended for most cases.

How do I manage context budget?

Keep system prompts minimal and invariant, move large guidance into skills loaded on demand, prefer file references over inlining long documents, and compact at phase boundaries rather than arbitrary token thresholds.

Full instructions (SKILL.md)

Source of truth, from affaan-m/everything-claude-code.


name: agent-harness-construction description: Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. metadata: origin: ECC

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.