返回顶部
o

orchestrix-guideOrchestrix工作流指南

Orchestrix multi-agent workflow guide for OpenClaw. Defines two operational phases: (1) Planning Phase — sequential agent orchestration in a single tmux window from project-brief through PRD, UX spec, architecture, to PO shard; (2) Development Phase — automated multi-window tmux collaboration via HANDOFF. Includes tmux send-keys protocol, task completion detection, and supplementary flows (bug fix, iteration, brownfield, change management).

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 3.0.0
安全检测
已通过
287
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

orchestrix-guide

Orchestrix Guide — OpenClaw 操作手册

本文档是 OpenClaw 操控 Orchestrix Agent 的唯一操作手册。 严格按照本文档的阶段和协议执行,不得跳步。


一、架构与原理

OpenClaw (自动化控制层,接收用户指令: Telegram / WhatsApp / Slack)

tmux (终端复用层) ← OpenClaw 通过 tmux send-keys 发送命令

Claude Code - cc (AI 编码助手,交互式 CLI,无 HTTP API)
↓ 通过 /o 激活 Agent
Orchestrix MCP Server → 返回 Agent 配置和工作流

Claude Code 执行 Agent 工作流 → 输出文档/代码/HANDOFF

关键约束:Claude Code (cc) 只接受终端标准输入。OpenClaw 唯一的操控方式是 tmux send-keys。



二、tmux 操作协议(铁律)

2.1 指令发送三步模式(MANDATORY)

向 Claude Code 发送任何内容时,必须严格执行三步。违反此规则会导致内容卡在输入框中不被提交。

bash
WIN={session}:{window}

Step 1: 发送内容(粘贴到 Claude Code 输入框)

tmux send-keys -t $WIN 内容

Step 2: 等待 TUI 处理粘贴(必须!)

sleep 1

Step 3: 提交输入

tmux send-keys -t $WIN Enter

绝对禁止:tmux send-keys -t $WIN 内容 Enter(合并写法)。Claude Code 的 TUI 需要 1 秒来处理粘贴文本,如果 Enter 到达时 TUI 还没准备好,内容会卡在输入框里。

多行内容发送

bash

使用 heredoc 发送多行内容


tmux send-keys -t $WIN $(cat < 这里是多行内容
第二行
第三行
EOF
)
sleep 1
tmux send-keys -t $WIN Enter

2.2 /clear 使用规则

不要每次切换 Agent 都 /clear。只在以下场景使用:

场景是否需要 /clear
同一 Agent 连续对话中追加指令❌ 不需要
切换到新 Agent(跨阶段重新激活)
✅ 需要 |
| Agent 加载失败,需要重试 | ✅ 需要 |
| Agent 卡住超过 5 分钟无输出 | ✅ 需要 |
| 错误恢复 | ✅ 需要 |

执行 /clear 的三步模式
bash
tmux send-keys -t $WIN /clear
sleep 1
tmux send-keys -t $WIN Enter
sleep 2 # 等待上下文清空

2.3 Agent 激活序列

当需要切换到新 Agent 时的完整流程:

bash
WIN={session}:{window}

Step 1: 清空上下文(仅在跨 Agent 切换时)

tmux send-keys -t $WIN /clear sleep 1 tmux send-keys -t $WIN Enter sleep 2

Step 2: 激活目标 Agent

tmux send-keys -t $WIN /o {agent} sleep 1 tmux send-keys -t $WIN Enter sleep 10 # Agent 加载需要更长时间(MCP 通信)

Step 3: 发送任务指令

tmux send-keys -t $WIN *{command} sleep 1 tmux send-keys -t $WIN Enter

2.4 等待时间参考

操作等待时间原因
cc 启动后12s等待 Claude Code 初始化 + 信任对话框
/clear 后
2s | 等待上下文清空 | | /o {agent} 后 | 10-15s | 等待 Agent 通过 MCP 加载配置 | | *command 后 | 按完成检测 | 见下方 §2.5 |

2.5 任务完成检测(四级优先级)

Agent 任务执行时间不确定。按优先级依次尝试

P1:检测完成消息(最高优先级)

bash

Claude Code 执行完毕后显示 Xxxed for (如 Baked for 31s, Worked for 2m)


tmux capture-pane -t {session}:{window} -p -S -10 | grep -qE [A-Z][a-z]*ed for [0-9]

这是最可靠的完成信号。

P2:检测预期输出文件

bash
test -f $PROJECTDIR/{expectedfile}

适用于有文件产出的任务(create-doc draft、shard、*develop-story)。

P3:检测审批提示(自动处理)

bash

Claude Code 等待审批时显示 ◐


tmux capture-pane -t {session}:{window} -p -S -10 | grep -q ◐

检测到时自动发送 y + Enter:
bash
tmux send-keys -t {session}:{window} y
sleep 1
tmux send-keys -t {session}:{window} Enter
sleep 2

P4:终端内容稳定性(兜底)

bash
PREV_HASH=
STABLE_COUNT=0
while [ $STABLE_COUNT -lt 3 ]; do
HASH=$(tmux capture-pane -t {session}:{window} -p -S -200 | md5)
if [ $HASH = $PREV_HASH ]; then
STABLECOUNT=$((STABLECOUNT + 1))
else
STABLE_COUNT=0
fi
PREV_HASH=$HASH
sleep 30
done

连续 3 次 hash 不变即判定完成(轮询间隔 30 秒,总计 90 秒稳定期)。

使用 monitor-agent.sh 脚本

项目内置了完成检测脚本,封装了以上 4 级检测:

bash
RESULT=$(bash .orchestrix-core/scripts/monitor-agent.sh $SESSION $WINDOW $EXPECTED_FILE 30 30)

返回: COMPLETE | IDLE | STABLE_IDLE | TIMEOUT

参数: [expectedfile] [timeoutmin] [poll_sec]

检测优先级总结

优先级方法模式可靠性
P1完成消息 [A-Z][a-z]*ed for [0-9]所有场景最高
P2
预期输出文件存在 | 有文件产出的任务 | 高 | | P3 | 审批提示 ◐ → 自动 y | 权限请求 | 高 | | P4 | 内容 hash 稳定(3×30s) | 兜底 | 中 |

建议组合:规划阶段用 P1 + P2 双重确认(或 monitor-agent.sh);开发阶段由 handoff-detector.sh 自动处理。

2.6 信任对话框处理

Claude Code 在进入新项目目录时会弹出 Do you trust this folder? 确认框。

start-orchestrix.sh 和 ensure-session.sh 已内置自动检测和接受逻辑:在 Claude Code 启动倒计时期间,每 2 秒扫描 pane 输出,检测到 trust this folder 或 safety check 时自动发送 Enter 接受。



三、全局流程总览

┌─────────────────────────────────────────────────────────┐
│ Phase A: 规划阶段 │
│ (单窗口模式,逐个切换 Agent) │
│ │
│ 前提条件: 项目已通过 /create-project 创建 │
│ docs/project-brief.md 已存在(初版) │
│ │
│ Step 0: Analyst → *create-doc project-brief (可选深化) │
│ Step 1: PM → *create-doc prd │
│ Step 2: UX Expert → *create-doc front-end-spec (可选) │
│ Step 3: Architect → *create-doc fullstack-architecture │
│ Step 4: PO → execute-checklist + shard │
│ │
│ ✅ 规划完成标志: PO *shard 执行完毕 │
└─────────────────────┬───────────────────────────────────┘

┌─────────────────────────────────────────────────────────┐
│ Phase B:

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 orchestrix-guide-1776122222 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 orchestrix-guide-1776122222 技能

通过命令行安装

skillhub install orchestrix-guide-1776122222

下载

⬇ 下载 orchestrix-guide v3.0.0(免费)

文件大小: 8.79 KB | 发布时间: 2026-4-15 13:48

v3.0.0 最新 2026-4-15 13:48
**Major update: tmux command protocol and completion detection fully revised, plus new test phase.**

- Standardized tmux command protocol to a strict 3-step pattern (send content → wait 1s → Enter) for all Claude Code CLI interactions.
- Added detailed handling and timing for multi-line content, agent switching, /clear usage, and trust dialog auto-accept.
- Reworked task completion detection rules: now uses Claude Code’s “Xxxed for ” message as primary signal, plus enhanced polling scripts and approval automation.
- New global workflow adds Phase C (Testing): epic smoke test, fix, and retest loop until all pass.
- Scripts like monitor-agent.sh and ensure-session.sh are now referenced for robust automation.
- Documentation clarified, edge cases and error handling explictly described.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部