跳到正文
cccskills
免费在 GitHub 公开

Agent Workflow Builder

Build multi-agent AI workflows with orchestration, tool use, and state management

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(2)

  • SKILL.md9.6 KB
  • metadata.json1.4 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Agent Workflow Builder

The Agent Workflow Builder skill guides you through designing and implementing multi-agent AI systems that can plan, reason, use tools, and collaborate to accomplish complex tasks. Modern AI applications increasingly rely on agentic architectures where LLMs act as reasoning engines that orchestrate actions rather than just generate text.

This skill covers agent design patterns, tool integration, state management, error handling, and human-in-the-loop workflows. It helps you build robust agent systems that can handle real-world complexity while maintaining safety and controllability.

Whether you are building autonomous assistants, workflow automation, or complex reasoning systems, this skill ensures your agent architecture is well-designed and production-ready.

Core Workflows

Workflow 1: Design Agent Architecture

  1. Define the agent's scope:
    • What tasks should it handle autonomously?
    • What requires human approval?
    • What is explicitly out of scope?
  2. Choose architecture pattern:
    PatternDescriptionUse When
    Single AgentOne LLM with toolsSimple tasks, clear scope
    Router AgentClassifies and delegatesMultiple distinct domains
    Sequential ChainAgents in orderPipeline processing
    HierarchicalManager + worker agentsComplex, decomposable tasks
    CollaborativePeer agents discussingRequires diverse expertise
  3. Design tool set:
    • What capabilities does the agent need?
    • How are tools defined and documented?
    • What are the safety boundaries?
  4. Plan state management:
    • Conversation history
    • Task state and progress
    • External system state
  5. Document architecture decisions

Workflow 2: Implement Agent Loop

  1. Build core agent loop:
    class Agent:
        def __init__(self, llm, tools, system_prompt):
            self.llm = llm
            self.tools = {t.name: t for t in tools}
            self.system_prompt = system_prompt
    
        async def run(self, user_input, max_steps=10):
            messages = [
                {"role": "system", "content": self.system_prompt},
                {"role": "user", "content": user_input}
            ]
    
            for step in range(max_steps):
                response = await self.llm.chat(messages, tools=self.tools)
    
                if response.tool_calls:
                    # Execute tools
                    for call in response.tool_calls:
                        result = await self.execute_tool(call)
                        messages.append({"role": "tool", "content": result})
                else:
                    # Final response
                    return response.content
    
            raise MaxStepsExceeded()
    
        async def execute_tool(self, call):
            tool = self.tools[call.name]
            return await tool.execute(call.arguments)
    
  2. Implement tools with clear interfaces
  3. Add error handling and retries
  4. Include logging and observability
  5. Test with diverse scenarios

Workflow 3: Build Multi-Agent System

  1. Define agent roles:
    agents = {
        "planner": Agent(
            llm=gpt4,
            tools=[search, create_task],
            system_prompt="You decompose complex tasks into steps..."
        ),
        "researcher": Agent(
            llm=claude,
            tools=[web_search, read_document],
            system_prompt="You gather and synthesize information..."
        ),
        "executor": Agent(
            llm=gpt4,
            tools=[code_interpreter, file_system],
            system_prompt="You execute tasks and produce outputs..."
        ),
        "reviewer": Agent(
            llm=claude,
            tools=[validate, provide_feedback],
            system_prompt="You review work for quality and correctness..."
        )
    }
    
  2. Implement orchestration:
    • How do agents communicate?
    • Who decides what runs when?
    • How is work passed between agents?
  3. Manage shared state:
    • Task board or work queue
    • Shared memory or context
    • Artifact storage
  4. Handle failures gracefully
  5. Add human checkpoints where needed

Quick Reference

ActionCommand/Trigger
Design agent"Design an agent for [task]"
Add tools"What tools for [agent type]"
Build multi-agent"Build multi-agent system for [goal]"
Handle errors"Agent error handling patterns"
Add human-in-loop"Add human approval to agent workflow"
Debug agent"Debug agent workflow"

Best Practices

  • Start Simple: Single agent with tools before multi-agent

    • Prove value with minimal complexity
    • Add agents only when necessary
    • Each agent should have clear, distinct responsibility
  • Design Tools Carefully: Tools are the agent's hands

    • Clear, descriptive names and documentation
    • Well-defined input/output schemas
    • Proper error handling and messages
    • Idempotent operations where possible
  • Limit Agent Autonomy: Constrain the blast radius

    • Define what agents cannot do
    • Require approval for high-impact actions
    • Implement spending/rate limits
    • Log all actions for audit
  • Manage State Explicitly: Don't rely on LLM memory alone

    • Persist conversation and task state
    • Summarize long contexts to fit windows
    • Track what has been tried/completed
  • Fail Gracefully: Agents will encounter errors

    • Clear error messages for the agent to reason about
    • Retry logic with backoff
    • Fallback strategies
    • Human escalation paths
  • Observe Everything: Debugging agents is hard

    • Log all LLM calls and tool invocations
    • Track reasoning chains and decisions
    • Measure success rates by task type

Advanced Techniques

ReAct Pattern (Reasoning + Acting)

Structure agent thinking explicitly:

REACT_PROMPT = """
You are an agent that solves tasks step by step.

For each step:
1. Thought: Analyze the current situation and decide what to do
2. Action: Choose a tool and provide arguments
3. Observation: Review the tool result

Continue until you can provide a final answer.

Available tools: {tool_descriptions}

Current task: {task}

Begin:
"""

Planning Agent with Task Decomposition

Break complex tasks into manageable steps:

class PlanningAgent:
    async def solve(self, task):
        # Step 1: Create plan
        plan = await self.create_plan(task)

        # Step 2: Execute each step
        results = []
        for step in plan.steps:
            result = await self.execute_step(step, context=results)
            results.append(result)

            # Replan if needed
            if result.status == "blocked":
                plan = await self.replan(task, results)

        # Step 3: Synthesize final output
        return await self.synthesize(task, results)

Reflection and Self-Correction

Let agents review and improve their work:

async def solve_with_reflection(self, task, max_attempts=3):
    for attempt in range(max_attempts):
        # Generate solution
        solution = await self.generate_solution(task)

        # Self-critique
        critique = await self.critique_solution(task, solution)

        if critique.is_acceptable:
            return solution

        # Improve based on critique
        task = f"{task}\n\nPrevious attempt issues: {critique.issues}"

    return solution  # Return best effort

Human-in-the-Loop Checkpoints

Integrate human approval into workflows:

class HumanApprovalTool:
    async def execute(self, action_description, risk_level):
        if risk_level == "low":
            return {"approved": True, "auto": True}

        # Send to approval queue
        approval_request = await self.create_request(action_description)

        # Wait for human response (with timeout)
        response = await self.wait_for_approval(
            approval_request.id,
            timeout_minutes=30
        )

        return {
            "approved": response.approved,
            "feedback": response.feedback,
            "auto": False
        }

Memory Management

Handle long conversations and context:

class AgentMemory:
    def __init__(self, max_tokens=8000):
        self.max_tokens = max_tokens
        self.messages = []
        self.summaries = []

    def add(self, message):
        self.messages.append(message)

        if self.token_count() > self.max_tokens:
            self.compress()

    def compress(self):
        # Summarize older messages
        old_messages = self.messages[:-5]  # Keep recent
        summary = summarize(old_messages)

        self.summaries.append(summary)
        self.messages = self.messages[-5:]

    def get_context(self):
        return {
            "summaries": self.summaries,
            "recent_messages": self.messages
        }

Common Pitfalls to Avoid

  • Building multi-agent systems when a single agent suffices
  • Giving agents too much autonomy without safety bounds
  • Not handling tool failures and edge cases
  • Forgetting that LLMs can hallucinate tool calls
  • Infinite loops when agents get stuck
  • Not logging enough to debug agent behavior
  • Assuming agents will follow instructions perfectly
  • Ignoring cost (token usage) in agent loops

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

[00] TnR ABSOLUTE RIGOR — Systemic Verification Doctrine. Forced cognitive exertion for high-stakes investigations. Mandates absolute deconstruction, mathematical proof chains, and ≥95% derived certainty. Zero-tolerance for heuristics or sentiment-based reasoning. Shortcuts are defined as intentional hallucinations.

中文简介正在准备中。当前显示原文说明。

diegosouzapw/awesome-omni-skill642026年3月2日 更新

2agent

免费

Configures 2-Agent workflow between PM and implementation roles. Use when user mentions 2-Agent, 2エージェント, PM連携設定, Cursor設定, Cursor連携, 2-agent運用. Do NOT load for: 単独運用, ワークフロー実行, ハンドオフ処理.

中文简介正在准备中。当前显示原文说明。

diegosouzapw/awesome-omni-skill642026年3月2日 更新

Appends relevant hashtags to journal entries based on content analysis. Intended for LLM execution.

中文简介正在准备中。当前显示原文说明。

diegosouzapw/awesome-omni-skill642026年3月2日 更新

add-agent

免费

Add a new AI coding agent to Agent Sandbox. Creates all required files (Dockerfile, templates, CI, docs) and wires the agent into the CLI, proxy, and build system.

中文简介正在准备中。当前显示原文说明。

diegosouzapw/awesome-omni-skill642026年3月2日 更新

Add a new property to the AI agents database. Use when the user wants to add, create, or introduce a new column, property, field, or feature to track across all agents in the comparison matrix. Handles all four required steps - database updates, groups.json, table display, and GitHub issue templates.

中文简介正在准备中。当前显示原文说明。

diegosouzapw/awesome-omni-skill642026年3月2日 更新

Add new Agent templates to the meta-agent-skills framework.

中文简介正在准备中。当前显示原文说明。

diegosouzapw/awesome-omni-skill642026年3月2日 更新

查看 diegosouzapw 的全部技能

报告此技能的问题