affaan-m avatar

Agent Harness Construction

If you're building or debugging AI agents and frustrated by low completion rates or endless retry loops, this is the checklist you need. It covers the four constraint areas that actually matter: action space design, observation formatting, error recovery, and context budgeting. The guidance is opinionated and specific, like using micro-tools for risky operations and always including next_actions in tool responses. It also pushes a hybrid ReAct plus function-calling pattern as the sweet spot for most workflows. Honestly, this reads like hard-won lessons from someone who's shipped agents in production and watched them fail in predictable ways.

skills.sh installs
5.5K
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --skill agent-harness-construction --agent claude-code

Installs into .claude/skills of the current project.

Files

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

Sponsors

Details

Repository
github.com/affaan-m/everything-claude-code
Category
AI & Agent Building

More from affaan-m/everything-claude-code

All 256
1affaan-m avataragent-payment-x402affaan-m/eccAdd x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer t5.5Kskills.sh installs
2affaan-m avatarcost-aware-llm-pipelineaffaan-m/everything-claude-codecost aware llm pipeline5.4Kskills.sh installs
3starchild-ai-agent avatarproject-builderstarchild-ai-agent/official-skillsEnd-to-end project engineering: design, incremental build, verify, debug systematically. Use when building software, dashboards, scheduled jobs, or web apps the5.2Kskills.sh installs
4skills-collective avatarai-musicskills-collective/skillsai music5.2Kskills.sh installs
5langchain-ai avatarlangsmith-evaluatorlangchain-ai/langsmith-skillsINVOKE THIS SKILL when building evaluation pipelines for LangSmith. Covers three core components: (1) Creating Evaluators - LLM-as-Judge, custom code; (2) Defin5.1Kskills.sh installs
6claude-office-skills avatarai-slidesclaude-office-skills/skillsGenerate complete presentations with AI - from outline to polished slides5Kskills.sh installs