[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EW3W5CDF7DAT9HR66HPYA4":3,"skill-same:01M7EW3W5CDF7DAT9HR66HPYA4":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7EW3W5CDF7DAT9HR66HPYA4","swarm-pattern",null,"Orchestrate lightweight multi-agent workflows where agents hand off to each other with routines and context variables.","TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-swarm-pattern\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: swarm-pattern\ndescription: Orchestrate lightweight multi-agent workflows where agents hand off to each other with routines and context variables.\ncategory: ai-research\n---\n\n## Overview\n\nThe swarm pattern structures multi-agent work as handoffs between small,\nsingle-purpose agents. Each agent has a name, instructions, a narrow toolset, and\nthe ability to transfer control to another agent — returning which agent should\nact next, optionally with updated context variables. There's no central\norchestrator reasoning over everything; the workflow emerges from the handoff\ngraph. A triage agent routes to a specialist, the specialist does its job and\nhands back or onward.\n\nThe power is in the constraints: agents are routines, not general intelligences.\nEach does one thing with the minimal tools it needs, which makes behavior\npredictable, debuggable, and cheap. The pattern fits workflows that are naturally\nstaged — intake → specialist → review — better than it fits open-ended\ncollaboration, where richer orchestration earns its complexity.\n\nSwarm is the multi-agent pattern for people who've been burned by multi-agent\ncomplexity: it trades emergent cleverness for legibility. You can always draw the\nhandoff graph on a whiteboard and explain exactly what will happen.\n\n## When to use\n\n- Customer-support style routing: triage the request, hand to the right\n  specialist, escalate as needed.\n- Staged pipelines where each stage needs different tools and instructions\n  (research → draft → review).\n- When you want agent behavior auditable as \"who did what\" — handoffs create a\n  clean trace.\n- Workflows where a single agent's prompt would become an unmanageable grab-bag\n  of roles and tools.\n- Lightweight orchestration without a heavy framework — the pattern is\n  implementable in ~100 lines.\n- Teams that need non-engineers to understand and modify the workflow — the graph\n  is the documentation.\n\n## Core concepts\n\n- **Agents as routines**: each agent = instructions + functions + allowed\n  handoffs. Keep instructions short and role-specific. An agent that does one\n  thing well beats a generalist that does five things confusingly.\n- **Handoffs**: an agent returns control to another agent (or itself for another\n  step). Implement as a function the agent can call, e.g.,\n  `transfer_to_refund_agent()`. The handoff graph is your workflow diagram — draw\n  it before coding it.\n- **Context variables**: a shared dict passed through the handoff chain (customer\n  id, collected info, decisions so far). Agents read and update it. This is how\n  state survives across agents without dumping full histories everywhere.\n- **No central brain**: unlike planner-executor or supervisor patterns, no agent\n  sees the whole workflow. Each agent only knows its job and its handoff options.\n  Simplicity is the feature — but it means no one is optimizing globally.\n- **Triage\u002Fentry agent**: the front door. Its whole job is classification and\n  routing. Invest in its accuracy — every misroute costs a full specialist cycle.\n- **Termination**: define which agents can end the conversation and what \"done\"\n  looks like. Handoff loops (A→B→A→B) are the characteristic failure; detect\n  repeated handoff cycles and break them.\n- **Handoff conditions**: each handoff should have a trigger condition, not just\n  an option. \"Hand to billing when the issue involves charges\" beats \"you may hand\n  to billing.\"\n- **Conversation scoping**: decide what history each agent sees. Full history is\n  simplest; scoped history (relevant context variables + recent turns) is cheaper\n  and keeps specialists focused.\n\n## Practical workflow\n\n1. **Map the workflow as a handoff graph.** Nodes = agents, edges = handoffs. If\n   the graph has more than ~6 nodes, you probably need hierarchy, not a flat\n   swarm.\n2. **Write one-paragraph instructions per agent.** Role, what it handles, what it\n   must collect before handing off, who it can hand to. Include 1–2 example\n   handoffs.\n3. **Define handoff triggers.** For each edge, write the condition that fires it.\n   Vague handoff options produce arbitrary routing; triggered handoffs produce\n   predictable flow.\n4. **Define context variables.** Name the shared state explicitly (don't let agents\n   improvise keys). Document which agent writes each variable.\n5. **Implement the loop.** While not done: run current agent with conversation +\n   context → get response + optional handoff → update context → switch agent. Cap\n   total turns.\n6. **Test the triage first.** Feed the entry agent a battery of representative\n   inputs; misroutes are the most expensive failure. Aim for high routing accuracy\n   before testing specialists.\n7. **Trace and tune.** Log every handoff with the reason. Common fixes: an agent\n   handing off too eagerly (needs a \"finish it yourself if...\" rule) or too\n   reluctantly (needs an explicit escalation trigger).\n\nChecklist for a swarm deployment:\n- Handoff graph drawn and reviewed; cycles identified and guarded.\n- Handoff triggers written as conditions, not vague options.\n- Context variable schema defined and documented.\n- Triage accuracy measured on representative inputs.\n- Turn cap and handoff-cycle detection in place.\n- Each agent's tools are the minimal set for its role.\n\n## Common pitfalls\n\n- **Handoff ping-pong.** Two agents bounce the task back and forth, each thinking\n  the other should handle it. Fix with clear ownership rules and cycle detection.\n- **Context variable chaos.** Agents inventing keys or overwriting each other's\n  state. Schema the variables; validate updates.\n- **Triage as an afterthought.** A weak entry agent misroutes everything\n  downstream. It's the highest-leverage agent in the swarm — treat it that way.\n- **Agents with overlapping mandates.** If two agents could both handle a request,\n  the handoff decision becomes arbitrary. Carve responsibilities so they don't\n  overlap.\n- **No global view when you need one.** The swarm can't optimize across stages. If\n  your workflow needs global planning (resource allocation, ordering), add a\n  supervisor or switch patterns.\n- **Over-decomposition.** Five agents where two would do adds latency, cost, and\n  handoff failures. Merge agents until each one earns its existence.\n- **Handoff without handover.** Transferring control without transferring the\n  relevant context — the next agent re-asks what was already established. Pack\n  context variables at handoff time.\n- **Untested edge routing.** The triage handles common cases; weird inputs fall\n  through. Test adversarial and ambiguous inputs explicitly, with a defined\n  fallback agent.\n","## Overview\n\nThe swarm pattern structures multi-agent work as handoffs between small,\nsingle-purpose agents. Each agent has a name, instructions, a narrow toolset, and\nthe ability to transfer control to another agent — returning which agent should\nact next, optionally with updated context variables. There's no central\norchestrator reasoning over everything; the workflow emerges from the handoff\ngraph. A triage agent routes to a specialist, the specialist does its job and\nhands back or onward.\n\nThe power is in the constraints: agents are routines, not general intelligences.\nEach does one thing with the minimal tools it needs, which makes behavior\npredictable, debuggable, and cheap. The pattern fits workflows that are naturally\nstaged — intake → specialist → review — better than it fits open-ended\ncollaboration, where richer orchestration earns its complexity.\n\nSwarm is the multi-agent pattern for people who've been burned by multi-agent\ncomplexity: it trades emergent cleverness for legibility. You can always draw the\nhandoff graph on a whiteboard and explain exactly what will happen.\n\n## When to use\n\n- Customer-support style routing: triage the request, hand to the right\n  specialist, escalate as needed.\n- Staged pipelines where each stage needs different tools and instructions\n  (research → draft → review).\n- When you want agent behavior auditable as \"who did what\" — handoffs create a\n  clean trace.\n- Workflows where a single agent's prompt would become an unmanageable grab-bag\n  of roles and tools.\n- Lightweight orchestration without a heavy framework — the pattern is\n  implementable in ~100 lines.\n- Teams that need non-engineers to understand and modify the workflow — the graph\n  is the documentation.\n\n## Core concepts\n\n- **Agents as routines**: each agent = instructions + functions + allowed\n  handoffs. Keep instructions short and role-specific. An agent that does one\n  thing well beats a generalist that does five things confusingly.\n- **Handoffs**: an agent returns control to another agent (or itself for another\n  step). Implement as a function the agent can call, e.g.,\n  `transfer_to_refund_agent()`. The handoff graph is your workflow diagram — draw\n  it before coding it.\n- **Context variables**: a shared dict passed through the handoff chain (customer\n  id, collected info, decisions so far). Agents read and update it. This is how\n  state survives across agents without dumping full histories everywhere.\n- **No central brain**: unlike planner-executor or supervisor patterns, no agent\n  sees the whole workflow. Each agent only knows its job and its handoff options.\n  Simplicity is the feature — but it means no one is optimizing globally.\n- **Triage\u002Fentry agent**: the front door. Its whole job is classification and\n  routing. Invest in its accuracy — every misroute costs a full specialist cycle.\n- **Termination**: define which agents can end the conversation and what \"done\"\n  looks like. Handoff loops (A→B→A→B) are the characteristic failure; detect\n  repeated handoff cycles and break them.\n- **Handoff conditions**: each handoff should have a trigger condition, not just\n  an option. \"Hand to billing when the issue involves charges\" beats \"you may hand\n  to billing.\"\n- **Conversation scoping**: decide what history each agent sees. Full history is\n  simplest; scoped history (relevant context variables + recent turns) is cheaper\n  and keeps specialists focused.\n\n## Practical workflow\n\n1. **Map the workflow as a handoff graph.** Nodes = agents, edges = handoffs. If\n   the graph has more than ~6 nodes, you probably need hierarchy, not a flat\n   swarm.\n2. **Write one-paragraph instructions per agent.** Role, what it handles, what it\n   must collect before handing off, who it can hand to. Include 1–2 example\n   handoffs.\n3. **Define handoff triggers.** For each edge, write the condition that fires it.\n   Vague handoff options produce arbitrary routing; triggered handoffs produce\n   predictable flow.\n4. **Define context variables.** Name the shared state explicitly (don't let agents\n   improvise keys). Document which agent writes each variable.\n5. **Implement the loop.** While not done: run current agent with conversation +\n   context → get response + optional handoff → update context → switch agent. Cap\n   total turns.\n6. **Test the triage first.** Feed the entry agent a battery of representative\n   inputs; misroutes are the most expensive failure. Aim for high routing accuracy\n   before testing specialists.\n7. **Trace and tune.** Log every handoff with the reason. Common fixes: an agent\n   handing off too eagerly (needs a \"finish it yourself if...\" rule) or too\n   reluctantly (needs an explicit escalation trigger).\n\nChecklist for a swarm deployment:\n- Handoff graph drawn and reviewed; cycles identified and guarded.\n- Handoff triggers written as conditions, not vague options.\n- Context variable schema defined and documented.\n- Triage accuracy measured on representative inputs.\n- Turn cap and handoff-cycle detection in place.\n- Each agent's tools are the minimal set for its role.\n\n## Common pitfalls\n\n- **Handoff ping-pong.** Two agents bounce the task back and forth, each thinking\n  the other should handle it. Fix with clear ownership rules and cycle detection.\n- **Context variable chaos.** Agents inventing keys or overwriting each other's\n  state. Schema the variables; validate updates.\n- **Triage as an afterthought.** A weak entry agent misroutes everything\n  downstream. It's the highest-leverage agent in the swarm — treat it that way.\n- **Agents with overlapping mandates.** If two agents could both handle a request,\n  the handoff decision becomes arbitrary. Carve responsibilities so they don't\n  overlap.\n- **No global view when you need one.** The swarm can't optimize across stages. If\n  your workflow needs global planning (resource allocation, ordering), add a\n  supervisor or switch patterns.\n- **Over-decomposition.** Five agents where two would do adds latency, cost, and\n  handoff failures. Merge agents until each one earns its existence.\n- **Handoff without handover.** Transferring control without transferring the\n  relevant context — the next agent re-asks what was already established. Pack\n  context variables at handoff time.\n- **Untested edge routing.** The triage handles common cases; weird inputs fall\n  through. Test adversarial and ambiguous inputs explicitly, with a defined\n  fallback agent.\n",{"name":5,"category":24,"description":7},"ai-research","main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-swarm-pattern",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill swarm-pattern",{"tool":39,"command":40},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill swarm-pattern",{"tool":42,"command":43},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill swarm-pattern","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-swarm-pattern\u002FSKILL.md",true,[],[48,55,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":59,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]