[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-ef017fe0-7520-4d03-a116-81bd71e9a847":3,"$f-671olhrWX4gXCxg9TM4-XUxuFzZMz-2PbkMV61A2Hk":42},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":33},"ef017fe0-7520-4d03-a116-81bd71e9a847","multi-agent-task-orchestrator","将任务路由到具有防重复、质量关卡和30分钟心跳监控的专业AI代理","cat_prod_project","mod_productivity","sickn33,productivity","---\nname: multi-agent-task-orchestrator\ndescription: \"Route tasks to specialized AI agents with anti-duplication, quality gates, and 30-minute heartbeat monitoring\"\ncategory: agent-orchestration\nrisk: safe\nsource: community\nsource_repo: milkomida77\u002Fguardian-agent-prompts\nsource_type: community\ndate_added: \"2026-04-09\"\nauthor: milkomida77\ntags: [multi-agent, orchestration, task-routing, quality-gates, anti-duplication]\ntools: [claude, cursor, gemini]\n---\n\n# Multi-Agent Task Orchestrator\n\n## Overview\n\nA production-tested pattern for coordinating multiple AI agents through a single orchestrator. Instead of letting agents work independently (and conflict), one orchestrator decomposes tasks, routes them to specialists, prevents duplicate work, and verifies results before marking anything done. Battle-tested across 10,000+ tasks over 6 months.\n\n## When to Use This Skill\n\n- Use when you have 3+ specialized agents that need to coordinate on complex tasks\n- Use when agents are doing duplicate or conflicting work\n- Use when you need audit trails showing who did what and when\n- Use when agent output quality is inconsistent and needs verification gates\n\n## How It Works\n\n### Step 1: Define the Orchestrator Identity\n\nThe orchestrator must know what it IS and what it IS NOT. This prevents it from doing work instead of delegating:\n\n```\nYou are the Task Orchestrator. You NEVER do specialized work yourself.\nYou decompose tasks, delegate to the right agent, prevent conflicts,\nand verify quality before marking anything done.\n\nWHAT YOU ARE NOT:\n- NOT a code writer — delegate to code agents\n- NOT a researcher — delegate to research agents\n- NOT a tester — delegate to test agents\n```\n\nThis \"NOT-block\" pattern reduces task drift by ~35% in production.\n\n### Step 2: Build a Task Registry\n\nBefore assigning work, check if anyone is already doing this task:\n\n```python\nimport sqlite3\nfrom difflib import SequenceMatcher\n\ndef check_duplicate(description, threshold=0.55):\n    conn = sqlite3.connect(\"task_registry.db\")\n    c = conn.cursor()\n    c.execute(\"SELECT id, description, agent, status FROM tasks WHERE status IN ('pending', 'in_progress')\")\n    for row in c.fetchall():\n        ratio = SequenceMatcher(None, description.lower(), row[1].lower()).ratio()\n        if ratio >= threshold:\n            return {\"id\": row[0], \"description\": row[1], \"agent\": row[2]}\n    return None\n```\n\n### Step 3: Route Tasks to Specialists\n\nUse keyword scoring to match tasks to the best agent:\n\n```python\nAGENTS = {\n    \"code-architect\": [\"code\", \"implement\", \"function\", \"bug\", \"fix\", \"refactor\", \"api\"],\n    \"security-reviewer\": [\"security\", \"vulnerability\", \"audit\", \"cve\", \"injection\"],\n    \"researcher\": [\"research\", \"compare\", \"analyze\", \"benchmark\", \"evaluate\"],\n    \"doc-writer\": [\"document\", \"readme\", \"explain\", \"tutorial\", \"guide\"],\n    \"test-engineer\": [\"test\", \"coverage\", \"unittest\", \"pytest\", \"spec\"],\n}\n\ndef route_task(description):\n    scores = {}\n    for agent, keywords in AGENTS.items():\n        scores[agent] = sum(1 for kw in keywords if kw in description.lower())\n    return max(scores, key=scores.get) if max(scores.values()) > 0 else \"code-architect\"\n```\n\n### Step 4: Enforce Quality Gates\n\nAgent output is a CLAIM. Test output is EVIDENCE.\n\n```\nAfter agent reports completion:\n1. Were files actually modified? (git diff --stat)\n2. Do tests pass? (npm test \u002F pytest)\n3. Were secrets introduced? (grep for API keys, tokens)\n4. Did the build succeed? (npm run build)\n5. Were only intended files touched? (scope check)\n\nMark done ONLY after ALL checks pass.\n```\n\n### Step 5: Run 30-Minute Heartbeats\n\n```\nEvery 30 minutes, ask:\n1. \"What have I DELEGATED in the last 30 minutes?\"\n2. If nothing → open the task backlog and assign the next task\n3. Check for idle agents (no message in >30min on assigned task)\n4. Relance idle agents or reassign their tasks\n```\n\n## Examples\n\n### Example 1: Delegating a Code Task\n\n```\n[ORCHESTRATOR -> code-architect] TASK: Add rate limiting to \u002Fapi\u002Fusers\nSCOPE: src\u002Fmiddleware\u002Frate-limit.ts only\nVERIFICATION: npm test -- --grep \"rate-limit\"\nDEADLINE: 30 minutes\n```\n\n### Example 2: Handling a Duplicate\n\n```\nUser asks: \"Fix the login bug\"\nRegistry check: Task #47 \"Fix authentication bug\" is IN_PROGRESS by security-reviewer\nDecision: SKIP — similar task already assigned (78% match)\nAction: Notify user of existing task, wait for completion\n```\n\n## Best Practices\n\n- Always define NOT-blocks for every agent (what they must refuse to do)\n- Use SQLite for the task registry (lightweight, no server needed)\n- Set similarity threshold at 55% for anti-duplication (lower = too many false positives)\n- Require evidence-based quality gates (not just agent claims)\n- Log every delegation with: task ID, agent, scope, deadline, verification command\n\n## Common Pitfalls\n\n- **Problem:** Orchestrator starts doing work instead of delegating\n  **Solution:** Add explicit NOT-blocks and role boundaries\n\n- **Problem:** Two agents modify the same file simultaneously\n  **Solution:** Task registry with file-level locking and queue system\n\n- **Problem:** Agent claims \"done\" without actual changes\n  **Solution:** Quality gate checks git diff before accepting completion\n\n- **Problem:** Tasks pile up without progress\n  **Solution:** 30-minute heartbeat catches stale assignments and reassigns\n\n## Related Skills\n\n- `@code-review` - For reviewing code changes after delegation\n- `@test-driven-development` - For ensuring quality in agent output\n- `@project-management` - For tracking multi-agent project progress\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,112,1848,"2026-05-16 13:29:59",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"效率工具","productivity","mdi-lightning-bolt-outline","文档处理、数据分析、自动化工作流",4,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":25,"skillCount":32,"createdAt":26},"项目管理","project-management","mdi-view-dashboard-outline","任务管理、进度追踪、报告生成",13,[34],{"id":35,"skillId":4,"version":36,"fileName":37,"fileSize":38,"filePath":39,"fileHash":40,"manifest":41,"createdAt":19},"2bfd5afb-2060-4dd4-a375-4bf0716a1e77","1.0.0","multi-agent-task-orchestrator.zip",2881,"uploads\u002Fskills\u002Fef017fe0-7520-4d03-a116-81bd71e9a847\u002Fmulti-agent-task-orchestrator.zip","c7ca597fdeed15050effa9cdeecac9127109d6b964fc6024072f688f832c0689","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":5872}]",{"code":43,"message":44,"data":45},200,"success",{"items":46,"stats":47,"page":50},[],{"averageRating":48,"totalRatings":48,"ratingCounts":49},0,[48,48,48,48,48],{"limit":51,"offset":48,"hasMore":52,"nextOffset":51,"ratedOnly":16},15,false]