AgentSkillsCN

orchestrate

监控所有工作代理,并自动引导它们顺畅流转于工作流程之中。在通过 /implement 启动工作线程后,或用于检查编排状态时,可选用此功能。

SKILL.md
--- frontmatter
name: orchestrate
description: Monitors all worker agents and automatically transitions them through the workflow. Use after spawning workers with /implement, or to check orchestration status.

Orchestration Control

ワーカーエージェントを監視し、ワークフローを自動遷移させるオーケストレーターを制御します。

Current Status

Orchestrator

!./scripts/orchestrate.sh --status 2>/dev/null || echo "not installed"

Active Agents

!./scripts/monitor-agents.sh 2>/dev/null || echo "No agents running"

Active Worktrees

!git worktree list --porcelain 2>/dev/null | grep -A1 "^worktree" | paste - - | grep -v "/search-hub$" | awk '{gsub(/.*\//, "", $2); print $2}' || echo "None"

Recent Notifications

!tail -5 /tmp/claude-orchestrator/notifications 2>/dev/null || echo "No notifications yet"

Commands

Start Orchestration

bash
# Foreground (see output)
./scripts/orchestrate.sh

# Background (recommended after worker spawn)
./scripts/orchestrate.sh --background

Check Status

bash
./scripts/orchestrate.sh --status

View Logs

bash
tail -f /tmp/claude-orchestrator/orchestrator.log

View Notifications

bash
cat /tmp/claude-orchestrator/notifications

Stop Orchestration

bash
./scripts/orchestrate.sh --stop

Workflow

code
Worker (implement)
    ↓ idle + PR created + CI pass
    ↓ [auto: kill worker, spawn reviewer]
Reviewer (review)
    ↓ idle + review posted
    ├─→ approved: notify main, kill reviewer, ready for merge
    ├─→ changes_requested: notify main, send fix instructions
    └─→ commented: notify main (no decision)

Notifications

オーケストレーターは以下の場合にメインエージェントに通知します:

  • INFO: 正常な遷移完了(reviewer開始、approve、changes_requested)
  • WARNING: CI失敗、予期しない状態
  • ERROR: エージェントエラー、遷移失敗

通知はメインエージェントのペインにコメント形式で送信されます:

code
# [ORCHESTRATOR] Branch feat/xxx: PR #123 APPROVED - Ready for merge

After Orchestration

PRがapproveされたら、メインエージェントでマージ:

bash
gh pr merge <pr-number> --squash --delete-branch
git worktree remove /workspaces/search-hub--worktrees/<branch> --force