skills/agent-workflow-builder/SKILL.md
Build multi-agent AI workflows with orchestration, tool use, and state management
npx skillsauth add jmsktm/claude-settings Agent Workflow BuilderInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
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)
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..."
)
}
| Action | Command/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" |
Start Simple: Single agent with tools before multi-agent
Design Tools Carefully: Tools are the agent's hands
Limit Agent Autonomy: Constrain the blast radius
Manage State Explicitly: Don't rely on LLM memory alone
Fail Gracefully: Agents will encounter errors
Observe Everything: Debugging agents is hard
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:
"""
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)
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
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
}
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
}
data-ai
Optimize YouTube videos for SEO, thumbnails, descriptions, and audience retention
testing
Design and facilitate effective workshops with agendas, activities, and outcomes
data-ai
Design and optimize AI-powered workflows for complex tasks
data-ai
Design and implement automated workflows to eliminate repetitive tasks and streamline processes