Communitygithub.com

智能体任务构建指南

设计和优化AI智能体的行动空间、工具定义及观察格式化,以提升任务完成率。适用于定义或修订智能体时使用。

智能体任务构建指南 是什么?

该技能专注于提高AI智能体在规划、工具调用、错误恢复及收敛至完成方面的性能。它提供了一套核心模型,强调行动空间质量、观察质量、恢复质量和上下文预算质量的重要性。通过遵循行动空间设计原则(如使用稳定明确的工具名称、保持输入模式优先且狭窄)、粒度规则(高风险操作使用微工具,常见循环使用中等工具,轮次开销主导时使用宏工具)以及观察设计标准(每个工具响应包含状态、摘要、后续行动和构件),可以显著提升智能体的任务执行效率。此外,该技能还覆盖了错误恢复合同(为每个错误路径提供根因提示、安全重试指令和显式停止条件)、上下文预算策略、架构模式指导(推荐ReAct规划+类型化工具执行的混合模式)以及监控基准(完成率、每任务重试次数、pass@1/pass@3和每成功任务成本)。最后,它列出了一些常见反模式,如过多语义重叠的工具、缺乏恢复提示的不透明输出、仅输出错误无下一步行动以及过度加载无关参考的上下文。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/agent-harness-construction

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Agent Harness Construction

当您正在改进智能体的规划、工具调用、错误恢复和达成完成的方式时,使用此技能。

核心模型

智能体输出质量受以下因素制约:

  1. 行动空间质量
  2. 观察质量
  3. 恢复质量
  4. 上下文预算质量

行动空间设计

  1. 使用稳定、明确的工具名称。
  2. 保持输入Schema优先且范围狭窄。
  3. 返回确定性的输出形状。
  4. 除非无法隔离,否则避免使用覆盖所有情况的工具。

粒度规则

  • 高风险操作(部署、迁移、权限)使用微工具。
  • 常见编辑/读取/搜索循环使用中等工具。
  • 仅当往返开销是主要成本时使用宏工具。

观察设计

每个工具响应应包含:

  • status: success|warning|error
  • summary: 一行结果
  • next_actions: 可操作的后续步骤
  • artifacts: 文件路径/ID

错误恢复合同

对于每个错误路径,包括:

  • 根本原因提示
  • 安全重试指令
  • 显式停止条件

上下文预算管理

  1. 保持系统提示最小且不变。
  2. 将大量指导转移到按需加载的技能中。
  3. 优先引用文件而非内联长文档。
  4. 在阶段边界紧凑处理,而非任意Token阈值。

架构模式指导

  • ReAct:最适合探索性任务,路径不确定。
  • Function-calling:最适合结构化确定流程。
  • 混合模式(推荐):ReAct规划 + 类型化工具执行。

基准测试

跟踪:

  • 完成率
  • 每任务重试次数
  • pass@1 和 pass@3
  • 每成功任务成本

反模式

  • 工具过多,语义重叠。
  • 工具输出不透明,无恢复提示。
  • 仅输出错误,无下一步行动。
  • 上下文过载,加载不相关的参考信息。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

api-connector-builder

Build a new API connector or provider by matching the target repo

相关技能