Communitygithub.com

dmux工作流

使用dmux(AI代理的tmux窗格管理器)进行多代理编排。提供跨Claude Code、Codex、OpenCode等工具的并行代理工作流模式。适用于并行运行多个代理会话或协调多代理开发工作流的场景。

dmux工作流 是什么?

dmux工作流是一个AI代理技能,旨在通过dmux(一个基于tmux的窗格管理器)来编排并行AI代理会话。它支持多种代理工具,如Claude Code、Codex、OpenCode、Cline、Gemini和Qwen,并提供了多种工作流模式,包括研究与实现并行、多文件功能并行、测试与修复循环、跨工具协作以及代码审查流水线。该技能强调任务的独立性、清晰的边界划分以及战略性的合并策略,以避免冲突并提高效率。它还集成了Git工作树,用于隔离文件更改,并提供了一个ECC辅助脚本,用于管理带有分离工作树的tmux会话。用户可以通过简单的按键操作创建新窗格(n键)或将输出合并回主会话(m键),从而在多代理环境中实现高效的并行开发和问题解决。

兼容平台✓Claude Code✓Codex CLI~Cursor✓Gemini CLI✓OpenCode
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/dmux-workflows

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

dmux 工作流

使用 dmux(一个面向代理工具的 tmux 窗格管理器)来编排并行的 AI 代理会话。

何时激活

  • 并行运行多个代理会话
  • 协调跨 Claude Code、Codex 和其他工具的工作
  • 需要分而治之并行处理的复杂任务
  • 用户提到“并行运行”、“拆分工作”、“使用 dmux”或“多代理”

什么是 dmux

dmux 是一个基于 tmux 的编排工具,用于管理 AI 代理窗格:

  • 按 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):“为结账流程编写端到端测试”

模式 5:代码审查流水线

从不同角度并行审查:

窗格 1:“审查 src/api/ 的安全性漏洞”
窗格 2:“审查 src/api/ 的性能问题”
窗格 3:“审查 src/api/ 的测试覆盖率缺口”

# 将所有审查合并到一个报告中

最佳实践

  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

互补工具

工具功能使用时机
dmuxtmux 窗格管理,面向代理并行代理会话
Superset支持 10+ 并行代理的终端 IDE大规模编排
Claude Code Task 工具进程内子代理生成在会话内进行程序化并行
Codex multi-agent内置代理角色Codex 特定的并行工作

ECC 辅助工具

ECC 现在包含一个用于外部 tmux 窗格编排的辅助工具,支持分离的 Git 工作树:

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 工作树
  • 可选地将主仓库中的选定 seedPaths 覆盖到每个工作器的工作树中
  • 在 .orchestration/<session>/ 下为每个工作器创建 task.md、handoff.md 和 status.md 文件
  • 启动一个 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 <session>:0.<pane-index> 进行检查。
  • 合并冲突: 使用 Git 工作树隔离每个窗格的文件更改。
  • 令牌用量过高: 减少并行窗格的数量。每个窗格都是一个完整的代理会话。
  • 未找到 tmux: 使用 brew install tmux(macOS)或 apt install tmux(Linux)进行安装。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

相关技能