mcpField
T
team-tasks

team-tasks

github.com/win4rエージェントワークフロー44771 回インストール37 週間前に更新
リポジトリ

team-tasks について

team-tasksは、共有タスクファイルとAGIによるディスパッチで開発エージェントを調整するスキルです。順次パイプラインと依存関係に基づくDAGに対応し、タスクを並列で割り当てられます。

主な機能

  1. 01順次エージェントパイプライン
  2. 02依存関係付きDAGタスク
  3. 03実行可能タスクの並列割り当て
  4. 04状態・ログ・結果の管理
  5. 05依存関係グラフと失敗処理

活用シーン

  1. 01コーディング、テスト、ドキュメントの工程管理
  2. 02独立した開発タスクの並列実行
  3. 03失敗したエージェントタスクの追跡と再試行

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/win4r/team-tasks --skill team-tasks

インストール後、Claude Code で/team-tasksを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

README.md
SPEC.md
docs/
GAP_ANALYSIS.md
AGENT_TEAMS_OFFICIAL_DOCS.md
scripts/
task_manager.py

詳細

チームタスク — マルチエージェントパイプラインの調整

概要

共有 JSON タスクファイルと AGI のディスパッチを通じて、開発チームのエージェントを調整します。 AGI がコマンドセンターとなり、エージェント同士が直接やり取りすることはありません。

2 つのモード:

  • モード A(線形): code → test → docs → monitor の固定パイプライン順
  • モード B(DAG): タスクで依存関係を宣言し、依存関係が満たされると並列ディスパッチ

タスクマネージャー CLI

すべてのコマンドは次の形式です:python3 <skill-dir>/scripts/task_manager.py <command> [args]

<skill-dir> は、この SKILL.md が含まれるディレクトリです。

クイックリファレンス
コマンドモード使用方法説明
init両方init <project> -g "goal" [-m linear|dag]プロジェクトを作成
adddagadd <project> <task-id> -a <agent> -d <deps>依存関係を指定してタスクを追加
status両方status <project> [--json]進捗を表示
assign両方assign <project> <task> "desc"タスクの説明を設定
update両方update <project> <task> <status>ステータスを変更
nextlinearnext <project> [--json]次のステージを取得
readydagready <project> [--json]ディスパッチ可能なタスクをすべて取得
graphdaggraph <project>依存関係ツリーを表示
log両方log <project> <task> "msg"ログエントリを追加
result両方result <project> <task> "output"出力を保存
reset両方reset <project> [task] [--all]保留中にリセット
list両方listすべてのプロジェクトを一覧表示
ステータス値
  • pending — ディスパッチ待ち
  • in-progress — エージェントが作業中
  • done — ステージ完了
  • failed — ステージ失敗(パイプラインは停止)
  • skipped — 意図的にスキップ

パイプラインのワークフロー(モード A:線形)

ステップ 1:プロジェクトを初期化
python3 scripts/task_manager.py init my-project \
  -g "Build a REST API with tests and docs" \
  -p "code-agent,test-agent,docs-agent,monitor-bot"

デフォルトのパイプライン順:code-agent → test-agent → docs-agent → monitor-bot

ステップ 2:すべてのステージにタスクを割り当て
python3 scripts/task_manager.py assign my-project code-agent "Implement REST API with Flask: GET/POST/DELETE /items"
python3 scripts/task_manager.py assign my-project test-agent "Write pytest tests for all endpoints, target 90%+ coverage"
python3 scripts/task_manager.py assign my-project docs-agent "Write README.md with API docs, setup guide, examples"
python3 scripts/task_manager.py assign my-project monitor-bot "Verify code quality, check for security issues, validate deployment readiness"
ステップ 3:エージェントを順次ディスパッチ

各ステージで、AGI は次のループに従います。

1. Check next stage:   task_manager.py next <project> --json
2. Mark in-progress:   task_manager.py update <project> <agent> in-progress
3. Dispatch agent:     sessions_send(sessionKey="agent:<agent>:telegram:group:<id>", message=<task>)
4. Wait for reply      (sessions_send returns the agent's response)
5. Save result:        task_manager.py result <project> <agent> "<summary>"
6. Mark done:          task_manager.py update <project> <agent> done
7. Repeat from 1       (currentStage auto-advances)
ステップ 4:失敗に対処

エージェントが失敗した場合:

python3 scripts/task_manager.py update my-project code-agent failed
python3 scripts/task_manager.py log my-project code-agent "Failed: syntax error in main.py"

再試行するには:

python3 scripts/task_manager.py reset my-project code-agent
python3 scripts/task_manager.py update my-project code-agent in-progress
# Re-dispatch...
ステップ 5:進捗をいつでも確認
python3 scripts/task_manager.py status my-project

出力:

📋 Project: my-project
🎯 Goal: Build a REST API with tests and docs
📊 Status: active
▶️  Current: test-agent

  ✅ code-agent: done
     Task: Implement REST API with Flask
     Output: Created /home/ubuntu/projects/my-project/app.py
  🔄 test-agent: in-progress
     Task: Write pytest tests for all endpoints
  ⬜ docs-agent: pending
  ⬜ monitor-bot: pending

  Progress: [██░░] 2/4

エージェントのディスパッチ詳細

セッションキー(開発チーム)
エージェントセッションキー
code-agentagent:code-agent:telegram:group:-5189558203
test-agentagent:test-agent:telegram:group:-5218382533
docs-agentagent:docs-agent:telegram:group:-5253138320
monitor-botagent:monitor-bot:telegram:group:-5193935559
ディスパッチテンプレート

エージェントにディスパッチするときは、次の内容を含めます。

  1. プロジェクトの背景 — プロジェクトの概要
  2. 具体的なタスク — このエージェントが行う作業
  3. 作業ディレクトリ — ファイルを作成または検索する場所
  4. 前のステージの出力 — 該当する場合(例:test-agent が code-agent の実装内容を把握する必要がある場合)

ディスパッチメッセージの例:

Project: my-project
Goal: Build a REST API with tests and docs
Your task: Write pytest tests for all endpoints in /home/ubuntu/projects/my-project/app.py
Target: 90%+ coverage, test GET/POST/DELETE /items
Working directory: /home/ubuntu/projects/my-project/
Previous stage (code-agent) output: Created app.py with Flask REST API, 3 endpoints
配信コンテキストの修正

⚠️ エージェントのセッションが最初に sessions_send 経由で作成された場合、その deliveryContext は telegram ではなく webchat になります。エージェントからの返信は Telegram グループに表示されません。

回避策:sessions_send 経由でエージェントの返信を受け取った後、message ツールを使用して主要な結果をグループに転送します。

message(action="send", channel="telegram", target="-5189558203", message="✅ code-agent 完成: Created app.py")

モード B:DAG ワークフロー(並列依存関係)

ステップ 1:DAG プロジェクトを初期化
python3 scripts/task_manager.py init my-project -m dag -g "Build REST API with parallel workstreams"
ステップ 2:依存関係を指定してタスクを追加
TM="python3 scripts/task_manager.py"
# Root tasks (no deps — can run in parallel)
$TM add my-project design     -a docs-agent  --desc "Write API spec"
$TM add my-project scaffold   -a code-agent  --desc "Create project skeleton"

# Tasks with dependencies (blocked until deps are done)
$TM add my-project implement  -a code-agent  -d "design,scaffold" --desc "Implement API"
$TM add my-project write-tests -a test-agent -d "design"          --desc "Write test cases from spec"

# Fan-in: depends on multiple tasks
$TM add my-project run-tests  -a test-agent  -d "implement,write-tests" --desc "Run all tests"
$TM add my-project write-docs -a docs-agent  -d "implement"             --desc "Write final docs"

# Final gate
$TM add my-project review     -a monitor-bot -d "run-tests,write-docs"  --desc "Final review"
ステップ 3:DAG グラフを表示
$TM graph my-project
├─ ⬜ design [docs-agent]
│  ├─ ⬜ implement [code-agent]
│  │  ├─ ⬜ run-tests [test-agent]
│  │  │  └─ ⬜ review [monitor-bot]
│  │  └─ ⬜ write-docs [docs-agent]
│  └─ ⬜ write-tests [test-agent]
└─ ⬜ scaffold [code-agent]
   └─ ⬜ implement (↑ see above)
ステップ 4:準備完了のタスクをディスパッチ
$TM ready my-project    # Shows all tasks whose deps are met

準備完了の各タスクで、AGI は次のループに従います。

1. Get ready tasks:     task_manager.py ready <project> --json
2. For each ready task (can dispatch in parallel):
   a. Mark in-progress: task_manager.py update <project> <task> in-progress
   b. Dispatch agent:   sessions_send(sessionKey=..., message=<task + dep outputs>)
3. When agent replies:
   a. Save result:      task_manager.py result <project> <task> "<summary>"
   b. Mark done:        task_manager.py update <project> <task> done
   c. Check newly unblocked tasks (printed automatically)
4. Repeat until all done
DAG の主な機能
  • 並列ディスパッチ:ready は依存タスクがすべて完了したタスクをすべて返します。これらを同時にディスパッチしてください
  • 依存タスクの出力の受け渡し:ready --json には depOutputs が含まれます。エージェントに渡す前のステージの結果です
  • 自動ブロック解除通知:タスクが完了すると、新たにブロック解除されたタスクが表示されます
  • 循環検出:add は、循環依存を引き起こすタスクを拒否します
  • 部分的な失敗:あるタスクが失敗しても、無関係なブランチは続行されます。ブロックされるのは、その下流のタスクのみです
  • グラフの可視化:graph はステータスアイコンと重複排除マーカー付きのツリービューを表示します

カスタムパイプライン

リニア(モード A)
# Code + test only
python3 scripts/task_manager.py init quick-fix -g "Hotfix" -p "code-agent,test-agent"

# Docs first, then code
python3 scripts/task_manager.py init spec-driven -g "Spec-driven dev" -p "docs-agent,code-agent,test-agent"
DAG(モード B)
# Diamond pattern: 2 parallel branches merge for review
$TM init diamond -m dag -g "Parallel dev"
$TM add diamond code -a code-agent --desc "Write code"
$TM add diamond test -a test-agent --desc "Write tests"
$TM add diamond integrate -a code-agent -d "code,test" --desc "Integration"
$TM add diamond review -a monitor-bot -d "integrate" --desc "Final review"

モードの選択

モード A(リニア)モード B(dag)
用途順次実行するタスク、シンプルなフロー並列の作業ストリーム、複雑な依存関係
ディスパッチ一度に 1 つ、自動で次に進む複数を同時に、依存関係に基づいて実行
セットアップinit -p agents(1 つのコマンド)init -m dag + タスクごとに add
最適な用途バグ修正、シンプルな機能大規模な機能、仕様主導の開発

データの保存場所

タスクファイル:/home/ubuntu/clawd/data/team-tasks/<project>.json

⚠️ よくある落とし穴

モード A:ステージ ID はエージェント名であり、番号ではありません

リニアモードでは、ステージ ID は数値インデックス(1、2、3 など)ではなく、エージェント名(例:code-agent)です。

# ❌ WRONG — will error "stage '1' not found"
python3 scripts/task_manager.py assign my-project 1 "Build API"
python3 scripts/task_manager.py update my-project 1 done

# ✅ CORRECT — use agent name as stage ID
python3 scripts/task_manager.py assign my-project code-agent "Build API"
python3 scripts/task_manager.py update my-project code-agent done
python3 scripts/task_manager.py result my-project code-agent "Created main.py"

これは、ステージを参照するすべてのコマンド(assign、update、result、log、reset)に当てはまります。

パイプラインの順序は init 時の -p で定義します(例:-p "code-agent,test-agent,docs-agent")。next はその順序に従って自動的に次へ進みますが、ステージは常にエージェント名で指定します。

ヒント

  • タスクごとにプロジェクトを 1 つ — 範囲を絞り、並列作業には複数のプロジェクトを作成してください
  • 意味のあるプロジェクトスラッグ — rest-api-v2、bug-fix-auth、refactor-db(project1 は避けてください)
  • 結果を保存する — update done の前に必ず result を実行してください。これはエージェント間で共有するコンテキストです
  • ログを積極的に記録する — log は手軽に使え、失敗したパイプラインのデバッグに役立ちます
  • リセットして再試行する — クリーンな状態で再実行するには reset --all、対象を絞って再試行するには reset <stage> を使います
  • DAG のファンアウト — 1 つのルートタスクで、多数のタスクを並列にブロック解除できます
  • DAG のファンイン — 1 つのタスクは複数の先行タスクに依存できます(すべて完了する必要があります)

コメント