オプション
家家 Skill DevOps と CI/CD dmux-workflows

dmux-workflows

affaan-m/ECC affaan-m/ECC

Claude Code や Codex といったエージェント・ハーネス向けの tmux ペインマネージャーである dmux を使用して、並列 AI エージェント・セッションを調整します。

...すべて拡張します
0
更新された時間 2026年10月2日

dmux のワークフロー

エージェント・ハーネス向けの tmux ペインマネージャーである dmux を使用して、並列 AI エージェント・セッションをオーケストレーションします。

有効にするタイミング

  • 複数のエージェントセッションを並行して実行する場合
  • Claude Code、Codex、その他のハネス間での作業を調整する場合
  • 「分割統治」型の並列処理が有効な複雑なタスク
  • ユーザーが「並列実行」「この作業を分割」「dmuxを使用」「マルチエージェント」と指定した場合

dmuxとは

dmuxは、AIエージェントのペインを管理するtmuxベースのオーケストレーションツールです:

  • n キーを押すと、プロンプト付きの新しいペインが作成されます
  • mキーを押すと、ペインの出力をメインセッションにマージします
  • 対応モデル:Claude Code、Codex、OpenCode、Cline、Gemini、Qwen

インストール:パッケージを確認した後、リポジトリから dmux をインストールしてください。詳細は github.com/standardagents/dmux を参照してください

クイックスタート

# dmux セッションを開始
dmux

# エージェントペインを作成(dmux で 'n' を押して、プロンプトを入力)
# ペイン 1: 「src/auth/ に認証ミドルウェアを実装する」
# ペイン 2: 「ユーザーサービスのテストを作成する」
# ペイン 3: 「API ドキュメントを更新する」

# 各ペインは独自のエージェントセッションを実行します
# 「m」キーを押すと、結果をメインセッションに統合します

ワークフローのパターン

パターン 1: 調査 + 実装

調査と実装を並行して進める:

ペイン 1(調査):「Node.js におけるレート制限のベストプラクティスを調査する。
  既存のライブラリを確認し、アプローチを比較し、調査結果を
  /tmp/rate-limit-research.md に記述する」

ペイン 2(実装):「Express API 用のレート制限ミドルウェアを実装する。
  まずは基本的なトークンバケットから始め、調査完了後に改良する。」

# ペイン 1 が完了したら、調査結果をペイン 2 のコンテキストにマージする

パターン 2: マルチファイル機能

独立したファイル間で作業を並行化します:

ペイン1:「課金機能用のデータベーススキーマとマイグレーションを作成する」
ペイン2:「src/api/billing/ に課金APIエンドポイントを構築する」
ペイン3:「課金ダッシュボードのUIコンポーネントを作成する」

# すべてをマージし、メインペインで統合を行う

パターン 3: テスト + 修正のループ

あるペインでテストを実行し、別のペインで修正を行う:

ペイン 1(ウォッチャー):「テストスイートをウォッチモードで実行する。テストが失敗した場合は、
  失敗内容を要約する。」

ペイン 2(フィクサー):「ペイン 1 からのエラー出力に基づいて、失敗したテストを修正する」

パターン4:クロスハーネス

タスクごとに異なるAIツールを使用する:

ペイン1(Claude Code):「認証モジュールのセキュリティをレビューする」
ペイン2(Codex):「パフォーマンス向上のためにユーティリティ関数をリファクタリングする」
ペイン3(Claude Code):「チェックアウトフローのE2Eテストを作成する」

パターン5:コードレビューパイプライン

並行したレビューの視点:

ペイン1:「src/api/ におけるセキュリティ脆弱性をレビューする」
ペイン2:「src/api/ におけるパフォーマンス上の問題をレビューする」
ペイン3:「src/api/ におけるテストカバレッジの不足をレビューする」

# すべてのレビュー結果を1つのレポートに統合する

ベストプラクティス

  1. 独立したタスクのみ。互いの出力に依存するタスクを並行処理しないでください。
  2. 境界を明確にする。各ペインは、異なるファイルまたは異なる関心事に対処する。
  3. 戦略的に統合する。競合を避けるため、統合前に各ペインの出力を確認する。
  4. Gitのワークツリーを使用する。ファイルの競合が発生しやすい作業では、ペインごとに個別のワークツリーを使用する。
  5. リソースの適切な管理。各ペインはAPIトークンを使用するため、ペインの総数を5~6個以内に抑えてください。

Gitワークツリーの統合

重複するファイルに関わるタスクの場合:

# 分離のためにワークツリーを作成
git worktree add -b feat/auth ../feature-auth HEAD
git worktree add -b feat/billing ../feature-billing HEAD

# 別々のワークツリーでエージェントを実行
# ペイン1: cd ../feature-auth && claude
# ペイン2: cd ../feature-billing && claude

# 完了後にブランチをマージ
git merge feat/auth
git merge feat/billing

補完ツール

ツール 機能 使用場面
dmux エージェント向けの tmux ペイン管理 エージェントの並列セッション
Superset 10以上の並列エージェントに対応したターミナルIDE 大規模オーケストレーション
Claudeコードタスクツール プロセス内でのサブエージェントの生成 セッション内でのプログラムによる並列処理
Codexマルチエージェント 組み込みエージェントロール Codex固有の並列処理

ECCヘルパー

ECCには、個別のGitワークツリーを用いた外部tmux-paneのオーケストレーションを行うためのヘルパーが追加されました:

node scripts/orchestrate-worktrees.js plan.json --execute

plan.json の例:

{
  "sessionName": "skill-audit",
  "baseRef": "HEAD",
  "launcherCommand": "codex exec --cwd {worktree_path} --task-file {task_file}",
  "workers": [
    { "name": "docs-a", "task": "スキル1~4を修正し、引き継ぎメモを作成する。" },
    { "name": "docs-b", "task": "スキル5~8を修正し、引き継ぎメモを作成する。" }
  ]
}

ヘルパー:

  • ワーカーごとに、ブランチをバックエンドとするGitワークツリーを1つ作成する
  • オプションで、メインのチェックアウトから選択されたseedPaths を各ワーカーのワークツリーにオーバーレイする
  • .orchestration//配下に、ワーカーごとのtask.md、handoff.md、status.mdファイルを書き込みます
  • ワーカーごとに1つのペインを持つtmuxセッションを開始する
  • 各ワーカーのコマンドをそれぞれのペインで起動する
  • メインペインはオーケストレーター用に空けておく

ローカルのオーケストレーションスクリプト、計画案のドラフト、ドキュメントなど、まだHEAD に含まれていない変更済みまたは追跡対象外のローカルファイルにワーカーがアクセスする必要がある場合は、seedPathsを使用します:

{
  "sessionName": "workflow-e2e",
  "seedPaths": [
    "scripts/orchestrate-worktrees.js",
    "scripts/lib/tmux-worktree-orchestrator.js",
    ".claude/plan/workflow-e2e-test.json"
  ],
  "launcherCommand": "bash {repo_root}/scripts/orchestrate-codex-worker.sh {task_file} {handoff_file} {status_file}",
  "workers": [
    { "name": "seed-check", "task": "作業開始前に、シードファイルが存在することを確認する。" }
  ]
}

トラブルシューティング

  • ペインが応答しない場合:直接そのペインに切り替えるか、tmux capture-pane -pt:0 を使用して確認してください。 。
  • マージの競合:git worktrees を使用して、ペインごとにファイルの変更を分離してください。
  • トークン使用量が高い:並列で開いているペインの数を減らしてください。各ペインは完全なエージェントセッションとなります。
  • tmuxが見つからない場合:`brew install tmux` (macOS) または`apt install tmux` (Linux) でインストールしてください。
GitHubで見る
---
name: dmux-workflows
description: Orchestrate parallel AI agent sessions using dmux, a tmux pane manager for agent harnesses like Claude Code and Codex.
---

# dmux Workflows

Orchestrate parallel AI agent sessions using dmux, a tmux pane manager for agent harnesses.

## When to Activate

- Running multiple agent sessions in parallel
- Coordinating work across Claude Code, Codex, and other harnesses
- Complex tasks that benefit from divide-and-conquer parallelism
- User says "run in parallel", "split this work", "use dmux", or "multi-agent"

## What is dmux

dmux is a tmux-based orchestration tool that manages AI agent panes:
- Press `n` to create a new pane with a prompt
- Press `m` to merge pane output back to the main session
- Supports: Claude Code, Codex, OpenCode, Cline, Gemini, Qwen

**Install:** Install dmux from its repository after reviewing the package. See [github.com/standardagents/dmux](https://github.com/standardagents/dmux)

## Quick Start

```bash
# Start dmux session
dmux

# Create agent panes (press 'n' in dmux, then type prompt)
# Pane 1: "Implement the auth middleware in src/auth/"
# Pane 2: "Write tests for the user service"
# Pane 3: "Update API documentation"

# Each pane runs its own agent session
# Press 'm' to merge results back
```

## Workflow Patterns

### Pattern 1: Research + Implement

Split research and implementation into parallel tracks:

```
Pane 1 (Research): "Research best practices for rate limiting in Node.js.
  Check current libraries, compare approaches, and write findings to
  /tmp/rate-limit-research.md"

Pane 2 (Implement): "Implement rate limiting middleware for our Express API.
  Start with a basic token bucket, we'll refine after research completes."

# After Pane 1 completes, merge findings into Pane 2's context
```

### Pattern 2: Multi-File Feature

Parallelize work across independent files:

```
Pane 1: "Create the database schema and migrations for the billing feature"
Pane 2: "Build the billing API endpoints in src/api/billing/"
Pane 3: "Create the billing dashboard UI components"

# Merge all, then do integration in main pane
```

### Pattern 3: Test + Fix Loop

Run tests in one pane, fix in another:

```
Pane 1 (Watcher): "Run the test suite in watch mode. When tests fail,
  summarize the failures."

Pane 2 (Fixer): "Fix failing tests based on the error output from pane 1"
```

### Pattern 4: Cross-Harness

Use different AI tools for different tasks:

```
Pane 1 (Claude Code): "Review the security of the auth module"
Pane 2 (Codex): "Refactor the utility functions for performance"
Pane 3 (Claude Code): "Write E2E tests for the checkout flow"
```

### Pattern 5: Code Review Pipeline

Parallel review perspectives:

```
Pane 1: "Review src/api/ for security vulnerabilities"
Pane 2: "Review src/api/ for performance issues"
Pane 3: "Review src/api/ for test coverage gaps"

# Merge all reviews into a single report
```

## Best Practices

1. **Independent tasks only.** Don't parallelize tasks that depend on each other's output.
2. **Clear boundaries.** Each pane should work on distinct files or concerns.
3. **Merge strategically.** Review pane output before merging to avoid conflicts.
4. **Use git worktrees.** For file-conflict-prone work, use separate worktrees per pane.
5. **Resource awareness.** Each pane uses API tokens — keep total panes under 5-6.

## Git Worktree Integration

For tasks that touch overlapping files:

```bash
# Create worktrees for isolation
git worktree add -b feat/auth ../feature-auth HEAD
git worktree add -b feat/billing ../feature-billing HEAD

# Run agents in separate worktrees
# Pane 1: cd ../feature-auth && claude
# Pane 2: cd ../feature-billing && claude

# Merge branches when done
git merge feat/auth
git merge feat/billing
```

## Complementary Tools

| Tool | What It Does | When to Use |
|------|-------------|-------------|
| **dmux** | tmux pane management for agents | Parallel agent sessions |
| **Superset** | Terminal IDE for 10+ parallel agents | Large-scale orchestration |
| **Claude Code Task tool** | In-process subagent spawning | Programmatic parallelism within a session |
| **Codex multi-agent** | Built-in agent roles | Codex-specific parallel work |

## ECC Helper

ECC now includes a helper for external tmux-pane orchestration with separate git worktrees:

```bash
node scripts/orchestrate-worktrees.js plan.json --execute
```

Example `plan.json`:

```json
{
  "sessionName": "skill-audit",
  "baseRef": "HEAD",
  "launcherCommand": "codex exec --cwd {worktree_path} --task-file {task_file}",
  "workers": [
    { "name": "docs-a", "task": "Fix skills 1-4 and write handoff notes." },
    { "name": "docs-b", "task": "Fix skills 5-8 and write handoff notes." }
  ]
}
```

The helper:
- Creates one branch-backed git worktree per worker
- Optionally overlays selected `seedPaths` from the main checkout into each worker worktree
- Writes per-worker `task.md`, `handoff.md`, and `status.md` files under `.orchestration/<session>/`
- Starts a tmux session with one pane per worker
- Launches each worker command in its own pane
- Leaves the main pane free for the orchestrator

Use `seedPaths` when workers need access to dirty or untracked local files that are not yet part of `HEAD`, such as local orchestration scripts, draft plans, or docs:

```json
{
  "sessionName": "workflow-e2e",
  "seedPaths": [
    "scripts/orchestrate-worktrees.js",
    "scripts/lib/tmux-worktree-orchestrator.js",
    ".claude/plan/workflow-e2e-test.json"
  ],
  "launcherCommand": "bash {repo_root}/scripts/orchestrate-codex-worker.sh {task_file} {handoff_file} {status_file}",
  "workers": [
    { "name": "seed-check", "task": "Verify seeded files are present before starting work." }
  ]
}
```

## Troubleshooting

- **Pane not responding:** Switch to the pane directly or inspect it with `tmux capture-pane -pt <session>:0.<pane-index>`.
- **Merge conflicts:** Use git worktrees to isolate file changes per pane.
- **High token usage:** Reduce number of parallel panes. Each pane is a full agent session.
- **tmux not found:** Install with `brew install tmux` (macOS) or `apt install tmux` (Linux).

すべてのファイル

1件のファイル

dmux-workflowsをインストール

スキルファイルをダウンロードし、.claude/skills/ ディレクトリに解凍してください。

ZIPをダウンロード

リポジトリをクローンし、スキルファイルをプロジェクトにコピーしてください。

git clone https://github.com/affaan-m/ECC/tree/main/skills/dmux-workflows # Copy SKILL.md to your .claude/skills/ directory

コピー コピー
クイックセットアップ: スキルフォルダを .claude/skills/ にコピーしてください。 Claude が自動的にそのスキルを検出して使用します。
リポジトリ affaan-m/ECC

関連スキル

klingai-upgrade-migration
更新された時間 2026年7月3日
Verification &amp; Quality Assurance
更新された時間 2026年6月29日
base44-cli
更新された時間 2026年6月29日
Railway CLI Management
更新された時間 2026年7月2日
OR