Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates.
git clone https://github.com/affaan-m/ECC.git--- 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.
["Identify the agent's primary task and list required tools (e.g., APIs, databases, or external services).","Define the observation format by listing the minimum data needed for the agent to make decisions (e.g., user_id, current_step, error_logs).","Design the action space by breaking the task into atomic actions (avoid verbs like 'manage' or 'process').","Validate the design by testing edge cases (e.g., missing data, tool failures) and refining the action space.","Use the output to configure your agent framework (e.g., LangChain, AutoGen) with strict tool schemas and observation parsers."]
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/affaan-m/ECC/tree/main/skills/agent-harness-constructionCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Design an optimized action space and tool definitions for an AI agent tasked with [TASK_DESCRIPTION]. The agent should use [LIST_OF_TOOLS] to achieve its goal. Define the observation format to include [KEY_METRICS_OR_STATES]. Ensure the action space supports [SPECIFIC_CAPABILITIES] while minimizing ambiguity. Provide a rationale for each design choice.
For a customer support agent resolving billing disputes, the optimized action space includes 6 actions: {verify_account, retrieve_invoice, adjust_charge, escalate_to_manager, send_refund, log_dispute}. Tools are defined with strict input/output schemas (e.g., retrieve_invoice requires customer_id and invoice_number, returns JSON with line_items and payment_status). Observations are formatted as a structured object with {customer_id, dispute_reason, invoice_status, agent_notes, urgency_score}. The action space avoids ambiguous commands like 'handle_dispute' by splitting into granular actions. This design reduced resolution time by 32% in testing by eliminating tool misuse (e.g., agents no longer attempted to 'adjust_charge' without retrieving the invoice first).skills-collection
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan