agent-harness-construction
它能做什么
这个工具可以帮助你整理并优化 AI 智能体使用工具完成任务的方式。它能确保智能体清楚地知道该做什么、怎么做,以及出错时该怎么办,从而更有可能成功完成任务。
适用场景
- ✓在定义或调整 AI 智能体可以使用的工具时。
- ✓当你希望 AI 智能体在任务中更加可靠、高效时。
- ✓当 AI 智能体在完成任务或从错误中恢复时遇到困难时。
技能链接
https://github.com/affaan-m/ECC/blob/main/pi/core/skills/agent-harness-construction/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“怎样才能更好地组织我的 AI 智能体所使用的工具,让它不会迷失方向?”
每周 5 个新技能,1 分钟读完。
工作原理
它的做法是为智能体制定清晰的规则,包括如何命名工具、应接收哪些信息、应返回哪些信息。其中也包括如何处理错误,以及回复中应包含哪些内容。
技术内容(原始 SKILL.md)
作者在 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.
常见问题
“微型工具”“中型工具”和“宏观工具”是什么?
这是不同规模的工具。微型工具用于小而关键的任务,中型工具用于常见任务,宏观工具用于大型、耗时较长的任务。
“动作空间质量”是什么意思?
指 AI 智能体可用工具的清晰度和组织程度。良好的“动作空间”意味着智能体确切知道该用哪些工具,以及如何使用它们。
为什么“错误恢复”很重要?
它对 AI 智能体从失败中恢复至关重要。了解错误的根本原因以及如何重试,能帮助智能体不轻易放弃,最终完成任务。
详情
作者的原始描述
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
热度
- GitHub 星标
- 280k
- 排名
- #129
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
accessibility
280k帮你的智能体创建人人都能使用的界面。确保网站和应用对残障人士友好,比如失明或行动不便的用户也能顺畅使用。
agent-architecture-audit
280k让你的智能体检查一切是否正常运行。它能找出并修复 AI 系统中的问题,确保系统按预期工作。
agent-eval
280k帮你的智能体比较不同的 AI 编程工具。它能衡量哪个工具在特定任务上更快、更便宜、更可靠。
agent-introspection-debugging
280k帮你的智能体在出错时自我修复。它会排查失败的原因并找到解决方案,而不是简单地重试。