Communitygithub.com

代理工具架構建構

設計並優化AI代理的行動空間、工具定義與觀察格式化,以提高任務完成率。在定義或修改代理時使用此技能。

代理工具架構建構 是什麼?

這項技能旨在提升AI代理的規劃、工具呼叫、錯誤恢復及任務完成效率。它基於一個核心模型,該模型指出代理輸出品質受到行動空間、觀察回饋、錯誤恢復以及上下文預算這四個關鍵品質的約束。對於行動空間設計,技能強調使用穩定且明確的工具名稱、簡潔的輸入結構,並確保工具回傳確定性的輸出形狀。為了平衡風險與效率,它引入了微工具、中工具與巨工具三種粒度規則,分別適用於高風險操作、常見編輯/讀取/搜尋循環,以及往返開銷主導的場景。觀察設計要求每次工具回應都包含狀態、摘要、後續行動與產出物。錯誤恢復合約則確保每個錯誤路徑都提供根本原因提示、安全重試指令與明確的停止條件。此外,技能還提供了上下文預算策略、架構模式指引(推薦ReAct規劃結合型別工具執行的混合模式)、基準測試指標以及常見的反模式清單,幫助開發者全面優化AI代理的效能與可靠性。

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

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

代理工具架構建構 是做什麼的?

當您正在改善代理如何規劃、呼叫工具、從錯誤中恢復以及收斂至完成時,請使用此技能。

核心模型

代理輸出品質受到以下因素限制:

  1. 行動空間品質
  2. 觀察回饋品質
  3. 恢復品質
  4. 上下文預算品質

行動空間設計

  1. 使用穩定且明確的工具名稱。
  2. 保持輸入結構以 schema 為優先,並盡量窄化。
  3. 回傳確定性的輸出形狀。
  4. 除非無法隔離,否則避免使用萬用工具。

粒度規則

  • 對高風險操作(部署、遷移、權限)使用微工具。
  • 對常見的編輯/讀取/搜尋循環使用中工具。
  • 僅在往返開銷是主要成本時使用巨工具。

觀察設計

每個工具回應應包含:

  • status: success|warning|error
  • summary: 一行結果
  • next_actions: 可操作的後續步驟
  • artifacts: 檔案路徑 / ID

錯誤恢復合約

對於每個錯誤路徑,應包含:

  • 根本原因提示
  • 安全重試指令
  • 明確的停止條件

上下文預算

  1. 保持系統提示精簡且不變。
  2. 將大型指引移至按需載入的技能中。
  3. 優先使用檔案參考,而不是內嵌長文件。
  4. 在階段邊界進行壓縮,而非依據任意 token 門檻。

架構模式指引

  • ReAct:最適合探索性任務,路徑不確定。
  • 函式呼叫:最適合結構化確定性流程。
  • 混合模式(推薦):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

相關技能