orchestrate

A command that breaks a complex request into steps, assigns suitable agents, runs the steps, checks their results, and retries failed steps up to five times.

In plain words
What is it for?
Use it for requests involving several related tasks that need planning, ordered execution, success checks, and automatic retries.
Why use it?
It provides a structured way to coordinate multi-part coding work instead of handling every dependency and retry manually.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/classmethod/tsumiki/orchestrate
Clone the repo
git clone --depth 1 https://github.com/classmethod/tsumiki
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,127 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00042 $0.04127
Opus 5 $0.00021 $0.02063
Sonnet 5 $0.00008 $0.00825
Haiku 4.5 $0.00004 $0.00413

Measured yesterday against content hash a716d96eef2a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

orchestrate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/orchestrate.md · 382 lines

How it starts

The opening of the file, as written. The whole thing — 382 lines — stays where its author put it; the contents beside it link to each section on GitHub.

このコマンドは、ユーザからの複雑な依頼を自動的に分析し、必要な作業をステップに分割し、適切なエージェントチームを編成して実行します。各ステップの成功条件を自動判定し、失敗時は原因を分析して最大5回まで自動再試行を行います。

context

user_request: {{args}} (ユーザからの依頼内容)
team_name: orchestrate-{{timestamp}} (チーム名)
max_retry_per_step: 5 (1ステップあたりの最大再試行回数)
steps: [] (実行ステップのリスト)
current_step_index: 0 (現在実行中のステップ番号)

steps

step1: 依頼内容の分析とプランニング

ユーザの依頼内容を詳細に分析し、以下を決定する:

  1. 作業の洗い出し: 依頼を達成するために必要な具体的な作業をリストアップ
  2. ステップ分割の判定:
    • シンプルな依頼(1つの明確な作業): 1ステップで実行
    • 中規模の依頼(2-3の関連作業): 2-3ステップに分割
    • 大規模な依頼(4つ以上の作業): 論理的なまとまりでステップに分割
  3. 各ステップの定義:
    • ステップ名: 何をするステップか
    • 作業内容: 具体的に何を実行するか
    • 成功条件: どうなれば成功か(自動判定可能な条件)
    • 推奨エージェント: どのエージェントタイプが適切か

ステップ分割ルールに従って分析を行い、結果を構造化してメモする。

step2: チームとタスクリストの準備

  1. チーム作成:

    • TeamCreate でオーケストレーションチームを作成
    • チーム名: orchestrate-{現在時刻のタイムスタンプ}
  2. タスク作成:

    • step1で定義した各ステップに対して TaskCreate でタスクを作成
    • subject: ステップ名
    • description: 作業内容 + 成功条件
    • activeForm: 実行中の表示メッセージ
  3. 依存関係の設定:

    • 前のステップに依存する場合は TaskUpdate で blockedBy を設定

step3: ステップの順次実行

各ステップを順番に実行する(並列実行は行わない):

  1. タスクの取得: TaskGet で次の実行対象タスクを取得
  2. タスクを進行中に更新: TaskUpdate で status を in_progress
  3. エージェント選定: エージェント選定ルールに従って最適なエージェントタイプを選択
  4. エージェント起動: Task ツールで選定したエージェントを起動し、作業を依頼
    • prompt: 作業内容を明確に指示 + 成功条件を伝える
    • team_name: 作成したチーム名
    • name: わかりやすいエージェント名(例: step1-explorer, step2-implementer)
  5. 実行待機: エージェントからの完了報告を待つ

step4: 結果の検証と判定

エージェントの実行結果を検証する:

  1. 成功条件の確認: 成功条件判定ルールに従って判定

    • エージェントの報告内容を確認
    • 必要に応じてファイルの状態、テスト結果等を確認
  2. 判定結果の処理:

    • 成功の場合:
      • TaskUpdate で status を completed に更新
      • step3に戻り次のステップを実行(全ステップ完了ならstep5へ)
    • 失敗の場合:
      • 再試行カウンタをチェック
      • 最大再試行回数未満なら step5(再試行)へ
      • 最大再試行回数到達なら step6(エスカレーション)へ

step5: 失敗時の原因分析と再試行

再試行ルールに従って再試行を実施:

  1. 原因分析:

    • エージェントの実行結果とエラーログを分析
    • 何が原因で成功条件を満たせなかったかを特定
    • 改善方法を検討(例: 指示の明確化、別のエージェントタイプの選択、前提条件の修正)
  2. 改善策の適用:

    • エージェントへの指示を改善
    • 必要に応じてエージェントタイプを変更
    • 前提条件が不足していれば追加の準備作業を実施

Read the full file on GitHub · 382 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 382 lines · 42 tokens per session scan A a716d96eef2a

Subscribe to this mod's changes

orchestrate is a command published in the GitHub repository classmethod/tsumiki (974 stars, last pushed 25d ago), licensed MIT. It adds 42 tokens to every session and 4,127 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.