valkryhx/google_adk_agent / skills/agent_team_to_be_update
Agent 团队协作(去中心化拉模型)
Flagged赋予 Agent 作为集群指挥官(Leader)的能力,通过去中心化任务队列将子任务派发给 Worker 节点并发执行。
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 17.9 KB |
| decentralized_tools.py | script | 36.2 KB |
| dependency_analyzer.py | script | 10.9 KB |
| inbox_watcher.py | script | 8.5 KB |
| loop_executor.py | script | 16.4 KB |
| mailbox.py | script | 15.3 KB |
| models.py | script | 9.1 KB |
| path_guard.py | script | 13.3 KB |
| planner.py | script | 14.6 KB |
| polling_daemon.py | script | 7.7 KB |
| self_claim_loop.py | script | 20.1 KB |
| task_queue.py | script | 24.1 KB |
| team_config.py | script | 7.5 KB |
| test/__init__.py | script | 40 B |
| test/test_blog_system_develop.py | script | 12.0 KB |
| test/test_dag_create_validation.py | script | 2.7 KB |
| test/test_decentralized_arch.py | script | 36.9 KB |
| test/test_deepresearch.py | script | 14.6 KB |
| test/test_loop_dag.py | script | 17.0 KB |
| test/test_real_training.py | script | 9.2 KB |
| test/test_tdd_gate.py | script | 4.5 KB |
| tools.py | script | 85.8 KB |
| verification_hooks.py | script | 10.7 KB |
| worktree_manager.py | script | 12.8 KB |
test/test_dag_create_validation.py
View on GitHub#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Regression tests for dag_create input validation and atomic behavior."""
import asyncio
import os
import shutil
import sys
import tempfile
import uuid
import pytest
# Add skill root to import path
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from decentralized_tools import dag_create
from task_queue import TaskQueue
@pytest.fixture
def isolated_coord_root():
"""Provide an isolated coordination root via ADK_COORDINATION_DIR."""
local_tmp_root = tempfile.gettempdir()
tmpdir = os.path.join(local_tmp_root, f"dag_create_validation_{uuid.uuid4().hex}")
os.makedirs(tmpdir, exist_ok=False)
old_coord_root = os.environ.get("ADK_COORDINATION_DIR")
os.environ["ADK_COORDINATION_DIR"] = tmpdir
try:
yield tmpdir
finally:
if old_coord_root is None:
os.environ.pop("ADK_COORDINATION_DIR", None)
else:
os.environ["ADK_COORDINATION_DIR"] = old_coord_root
shutil.rmtree(tmpdir, ignore_errors=True)
def _build_queue(team_id: str, coord_root: str) -> TaskQueue:
return TaskQueue(team_id=team_id, base_dir=os.path.join(coord_root, team_id))
def test_dag_create_missing_name_fails_without_partial_tasks(isolated_coord_root):
team_id = "test-team"
tasks = [
{"name": "Task A", "description": "valid"},
{"description": "missing name field"},
]
with pytest.raises(ValueError, match=r"tasks\[2\]\.name is required"):
asyncio.run(dag_create(team_id=team_id, tasks=tasks, broadcast=False))
queue = _build_queue(team_id, isolated_coord_root)
assert queue.list_tasks() == []
def test_dag_create_unknown_dependency_fails_without_partial_tasks(isolated_coord_root):
team_id = "test-team"
tasks = [
{"name": "Task A"},
{"name": "Task B", "blocked_by": ["Task C"]},
]
with pytest.raises(ValueError, match="unknown or future task name: Task C"):
asyncio.run(dag_create(team_id=team_id, tasks=tasks, broadcast=False))
queue = _build_queue(team_id, isolated_coord_root)
assert queue.list_tasks() == []
def test_dag_create_valid_tasks_creates_expected_dependency(isolated_coord_root):
team_id = "test-team"
tasks = [
{"name": "Task A"},
{"name": "Task B", "blocked_by": ["Task A"]},
]
result = asyncio.run(dag_create(team_id=team_id, tasks=tasks, broadcast=False))
queue = _build_queue(team_id, isolated_coord_root)
created = queue.list_tasks()
assert len(created) == 2
by_name = {task.name: task for task in created}
assert by_name["Task B"].blocked_by == [by_name["Task A"].id]
assert "[DAG CREATED]" in result
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |