[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EE9PKH02V91Q61M8MDDCFF":3,"skill-same:01M6EE9PKH02V91Q61M8MDDCFF":49},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":22,"linkOnly":23,"markdownContent":24,"markdownBody":24,"frontMatter":25,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M6EE9PKH02V91Q61M8MDDCFF","agent-swarm-orchestration",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fagent-swarm-orchestration\u002FSKILL.md",[],[18,19,20,21],"orchestration","swarm","Swarm Orchestration","agent swarm orchestration","2026-11-10 10:12:30",false,"# Agent Swarm Orchestration\n\n## Overview\n\nCoordinate multiple AI agents working together on complex tasks. Design topologies, implement routing, handle handoffs, share memory, and enforce quality gates.\n\n## Instructions\n\n### Why multi-agent?\n\nSingle-agent limitations: context window fills up, generalist performance degrades on specialist tasks, no parallel execution, single point of failure. Multi-agent benefits: focused expertise per agent, parallel subtasks, quality agents review others' work, failed agents retry without losing all progress.\n\n### Topologies\n\n```\nPipeline (sequential):\nTask → Agent A → Agent B → Agent C → Result\nBest for: Linear workflows (Spec → Code → Test → Deploy)\n\nHierarchical (manager + workers):\n         Orchestrator\n        \u002F     |      \\\n   Coder  Tester  Reviewer\nBest for: Complex tasks decomposing into independent subtasks\n\nHub-and-spoke (router):\n       ┌→ Specialist A\nRouter → Specialist B\n       └→ Specialist C\nBest for: Task classification and routing to the right expert\n```\n\n### Orchestrator pattern\n\n```python\n# orchestrator.py — Central coordinator managing agent pipeline\n\nfrom dataclasses import dataclass, field\nfrom enum import Enum\n\nclass AgentRole(Enum):\n    PLANNER = \"planner\"\n    CODER = \"coder\"\n    REVIEWER = \"reviewer\"\n    TESTER = \"tester\"\n\n@dataclass\nclass AgentTask:\n    id: str\n    role: AgentRole\n    input_data: dict\n    output_data: dict = field(default_factory=dict)\n    status: str = \"pending\"\n    retries: int = 0\n    max_retries: int = 3\n\nclass Orchestrator:\n    def __init__(self, agents: dict[AgentRole, 'Agent']):\n        self.agents = agents\n        self.tasks: list[AgentTask] = []\n        self.context: dict = {}  # Shared memory\n\n    async def run_pipeline(self, spec: str) -> dict:\n        plan = await self._run_agent(AgentRole.PLANNER, {\"spec\": spec})\n        self.context[\"plan\"] = plan\n\n        for subtask in plan.get(\"subtasks\", []):\n            result = await self._run_agent(AgentRole.CODER, {\n                \"task\": subtask, \"plan\": plan\n            })\n            review = await self._run_agent(AgentRole.REVIEWER, {\n                \"code\": result, \"requirements\": subtask\n            })\n            retries = 0\n            while not review.get(\"approved\") and retries \u003C 3:\n                result = await self._run_agent(AgentRole.CODER, {\n                    \"task\": subtask, \"previous_attempt\": result,\n                    \"feedback\": review.get(\"feedback\")\n                })\n                review = await self._run_agent(AgentRole.REVIEWER, {\n                    \"code\": result, \"requirements\": subtask\n                })\n                retries += 1\n            self.context[f\"subtask_{subtask['id']}\"] = result\n\n        tests = await self._run_agent(AgentRole.TESTER, {\"code\": self.context})\n        return {\"plan\": plan, \"results\": self.context, \"tests\": tests}\n\n    async def _run_agent(self, role: AgentRole, input_data: dict) -> dict:\n        agent = self.agents[role]\n        task = AgentTask(id=f\"{role.value}_{len(self.tasks)}\", role=role, input_data=input_data)\n        self.tasks.append(task)\n        try:\n            task.status = \"running\"\n            result = await agent.execute(input_data)\n            task.output_data = result\n            task.status = \"completed\"\n            return result\n        except Exception:\n            task.status = \"failed\"\n            if task.retries \u003C task.max_retries:\n                task.retries += 1\n                return await self._run_agent(role, input_data)\n            raise\n```\n\n### Router pattern\n\n```python\n# router.py — Classify and route tasks to specialists\n\nclass TaskRouter:\n    ROUTING_PROMPT = \"\"\"Classify this task and select the best agent:\nTask: {task}\nAvailable agents: {agents}\nReturn JSON: {{\"agent\": \"name\", \"confidence\": 0.0-1.0, \"reasoning\": \"why\"}}\"\"\"\n\n    def __init__(self, agents: dict[str, 'Agent']):\n        self.agents = agents\n\n    async def route(self, task: str) -> dict:\n        agent_descriptions = \"\\n\".join(\n            f\"- {name}: {agent.description}\" for name, agent in self.agents.items()\n        )\n        routing = await self._classify(task, agent_descriptions)\n        return await self.agents[routing[\"agent\"]].execute({\"task\": task})\n```\n\n### Shared memory\n\n```python\n# shared_memory.py — Inter-agent communication layer\n\nclass SharedMemory:\n    def __init__(self):\n        self.facts: list[dict] = []\n        self.decisions: list[dict] = []\n        self.artifacts: dict = {}\n\n    def add_fact(self, agent: str, fact: str, confidence: float = 1.0):\n        self.facts.append({\"agent\": agent, \"fact\": fact, \"confidence\": confidence})\n\n    def add_decision(self, agent: str, decision: str, reasoning: str):\n        self.decisions.append({\"agent\": agent, \"decision\": decision, \"reasoning\": reasoning})\n\n    def get_context_for_agent(self, agent_role: str, max_items: int = 20) -> str:\n        parts = []\n        for f in self.facts[-max_items:]:\n            parts.append(f\"[{f['agent']}] {f['fact']}\")\n        for d in self.decisions[-max_items:]:\n            parts.append(f\"[{d['agent']}] {d['decision']}: {d['reasoning']}\")\n        return \"\\n\".join(parts)\n```\n\n### Quality gates\n\nEnforce quality between pipeline stages:\n\n```python\n# quality_gate.py — Validate agent output before handoff\n\n@dataclass\nclass QualityCheck:\n    name: str\n    passed: bool\n    details: str\n    severity: str  # \"blocking\" or \"warning\"\n\nclass QualityGate:\n    async def check(self, stage: str, output: dict) -> list[QualityCheck]:\n        checks = []\n        if stage == \"code\":\n            checks.append(self._check_syntax(output.get(\"code\", \"\")))\n            checks.append(self._check_tests_present(output))\n            checks.append(self._check_no_secrets(output.get(\"code\", \"\")))\n        elif stage == \"review\":\n            checks.append(self._check_review_depth(output.get(\"review\", \"\")))\n        elif stage == \"test\":\n            checks.append(self._check_tests_pass(output.get(\"test_results\", {})))\n        return checks\n\n    def gate_passed(self, checks: list[QualityCheck]) -> bool:\n        return all(c.passed for c in checks if c.severity == \"blocking\")\n```\n\n## Examples\n\n### Build a code review pipeline\n\n```prompt\nBuild a multi-agent pipeline for automated code review. Agent 1 (Analyzer) reads the PR diff and identifies potential issues. Agent 2 (Security Reviewer) checks for security vulnerabilities. Agent 3 (Style Checker) verifies coding standards. The Orchestrator collects all findings, deduplicates, prioritizes by severity, and produces a structured review. Include retry logic for when agents produce low-quality reviews.\n```\n\n### Create a research swarm\n\n```prompt\nBuild a research swarm where 4 agents each search different sources (web, academic papers, news, social media) for information about a topic, then a Synthesizer agent combines their findings into a comprehensive brief. Use shared memory so agents can see what others have found and avoid duplication. Include confidence scores and source citations.\n```\n\n### Design a customer support routing system\n\n```prompt\nBuild a support ticket routing system with 5 specialist agents: Billing, Technical, Account, Feature Requests, and Escalation. The Router agent classifies incoming tickets and routes to the right specialist. If confidence is below 70%, route to a generalist. Track routing accuracy and retrain the classifier weekly based on resolution data.\n```\n\n## Guidelines\n\n- Start with the simplest topology (pipeline) and only add complexity when needed\n- Always include quality gates between pipeline stages — never pass unchecked output forward\n- Use shared memory to prevent agents from duplicating work or contradicting each other\n- Set retry limits (typically 3) to prevent infinite loops when agents fail repeatedly\n- Route to a generalist or escalate to human when classifier confidence is below 70%\n- Log every agent decision and handoff for debugging and optimization\n- Keep individual agent contexts small and focused — specialist agents outperform generalists\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Fagent-swarm-orchestration",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill agent-swarm-orchestration",{"tool":41,"command":42},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill agent-swarm-orchestration",{"tool":44,"command":45},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill agent-swarm-orchestration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fagent-swarm-orchestration\u002FSKILL.md",true,[],[50,59,68,77,83,89],{"skillNo":51,"name":52,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":22},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[56,57,58],"model","model hierarchy","model hierarchy skill",{"skillNo":60,"name":61,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":22},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[65,66,67],"MCP","zoom","zoom mcp",{"skillNo":69,"name":70,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":22},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[74,75,76,66],"sdk","zoom apps sdk","apps",{"skillNo":78,"name":79,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":22},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[79],{"skillNo":84,"name":85,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":22},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[85],{"skillNo":90,"name":91,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":22},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[91]]