トレンドトピック
#
Bonk Eco continues to show strength amid $USELESS rally
#
Pump.fun to raise $1B token sale, traders speculating on airdrop
#
Boop.Fun leading the way with a new launchpad on Solana.
私は、いくつかのtmuxの魔法を使ってエージェントのワークフローをさらに自動化する方法を見つけました。
mcp エージェント メール プロジェクトを使用して、多数のエージェントに計画の実装について互いに話し合ってもらう (また、タスク管理に beads プロジェクトを使用して調整する) ので、コーデックスで大量のメッセージをキューに入れてエージェントを「フィード」してエージェントを忙しくする必要があります。
これには、さまざまな tmux ペイン (コーデックス インスタンスごとに 1 つずつ) を 1 つずつ移動し、定型メッセージを貼り付けるか、上矢印を数回押して、次のような過去のメッセージを再利用することが含まれます。
「今実際に役に立つ次のビーズを選んで、すぐにコーディングを始めましょう。エージェントメールで他のエージェントに自分のやっていることを伝えてください。」
各エージェントに 1 時間以上忙しくさせるのに十分な指示を与えるのにそれほど時間はかからないにもかかわらず、これを行うのは少しばかげていて非効率に感じます。
しかし今、私はこれをコピーしてtmuxセッションの外側のコンソールに貼り付けるだけで、関連するすべてのtmuxペインに一度にたくさんのメッセージを自動的にキューに入れることができることに気づきました(これはzshでテストされ、動作しています)。
---
PANES=(${(f)"$(tmux list-panes -a -F '#S:#I.#P' | tail -n +3 | head -n -2)"})
$PANESのペイン用。する
tmux send-keys -t $pane -l '今実際に役に立つ次のビーズを選び、すぐにコーディングを開始します。エージェントメールで他のエージェントに自分のことを伝えてください。
睡眠 0.1
tmux 送信キー -t $pane Enter
{1..4}のiの場合;する
tmux send-keys -t $pane -l '役に立つ仕事をして、続けてください!そしてコミュニケーションをとってください!」
睡眠 0.1
tmux 送信キー -t $pane Enter
完成です
tmux send-keys -t $pane -l '素晴らしい、今、私はあなたが書いたばかりのすべての新しいコードと、あなたが修正したばかりの他の既存のコードを注意深く読んで、明らかなバグ、エラー、問題、問題、混乱などを非常に注意深く調べてほしいと思います。」
睡眠 0.1
tmux 送信キー -t $pane Enter
tmux send-keys -t $pane -l 'エージェントのメールを必ず確認し、メッセージに必要に応じて迅速に応答してください。その後、計画を細心の注意を払って進め、残りの未完了のタスクをすべて体系的に実行し、計画文書にインライン、ビーズ、およびエージェントのメールメッセージを介して進捗状況を記録し続けます。何も行われていない「コミュニケーションの煉獄」にはまり込まないでください。実行する必要があるタスクを積極的に開始しますが、その場合はメッセージで仲間のエージェントに通知し、計画文書にインラインで記載してください。どうしたらいいのか本当にわからない場合は、次のビーズを選んで、役に立って始めてください。
睡眠 0.1
tmux 送信キー -t $pane Enter
tmux send-keys -t $pane -l 'OK 今、仲間のエージェントが書いたコードをレビューし、問題、バグ、エラー、問題、非効率性、セキュリティの問題、信頼性の問題などをチェックし、第一原理分析を使用して根本的な根本原因を注意深く診断し、その後、必要に応じて修正または修正することに注意を向けることができますか?最新のコミットに限定せず、より広い網を張って、超深く掘り下げてください!」
睡眠 0.1
tmux 送信キー -t $pane Enter
完成です
---
このスクリプトは、次のことを行います。
ペインの取得: 最初の 2 つと最後の 2 つを除くすべての tmux ペインを検索します
選択した各ペインに 8 つのメッセージを送信します。
「次のビーズを選んで...」
- エージェントに次のタスクに取り組むように指示します
「続けてください...」× 4 - 働き続けるよう繰り返し励まします
"注意深く読んでください..." - 新しいコードレビューを指示します
"Check agent mail..." - 調整、コミュニケーション麻痺の回避、生産性の維持に関する長いメッセージ
"仲間のエージェントが書いたコードをレビュー..." - バグ/問題のピアコードレビュー
各メッセージは、Codex CLI が適切に処理されるように、Enter の前に 0.1 秒の遅延で文字通り (-l フラグ) 送信されます。

Actually, this is a better way to do it, by filtering on the name of the pane (in my case, it's "node" for the codex panes), and it has the initial 0.1 second sleep, without which it skips the first matching pane without sending the messages correctly:
PANES=(${(f)"$(tmux list-panes -a -F '#S:#I.#P #{pane_current_command}' | rg ' node$' | cut -d' ' -f1)"})
for pane in $PANES; do
sleep 0.1 # Initial sleep to ensure pane is ready
tmux send-keys -t $pane -l 'pick the next bead you can actually do usefully now and start coding on it immediately; communicate what you'"'"'re doing to the other agents via agent mail.'
sleep 0.1
tmux send-keys -t $pane Enter
for i in {1..4}; do
tmux send-keys -t $pane -l 'keep going, doing useful work! and communicate!'
sleep 0.1
tmux send-keys -t $pane Enter
done
tmux send-keys -t $pane -l 'great, now I want you to carefully read over all of the new code you just wrote and other existing code you just modified with "fresh eyes" looking super carefully for any obvious bugs, errors, problems, issues, confusion, etc.'
sleep 0.1
tmux send-keys -t $pane Enter
tmux send-keys -t $pane -l 'Be sure to check your agent mail and to promptly respond if needed to any messages; thereafter proceed meticulously with the plan, doing all of your remaining unfinished tasks systematically and continuing to notate your progress in-line in the plan document, via beads, and via agent mail messages. Don'"'"'t get stuck in "communication purgatory" where nothing is getting done; be proactive about starting tasks that need to be done, but inform your fellow agents via messages when you do so and notate that in-line in the plan document. When you'"'"'re really not sure what to do, pick the next bead that you can usefully work on and get started.'
sleep 0.1
tmux send-keys -t $pane Enter
tmux send-keys -t $pane -l 'ok can you now turn your attention to reviewing the code written by your fellow agents and checking for any issues, bugs, errors, problems, inefficiencies, security problems, reliability issues, etc. and carefully diagnose their underlying root causes using first-principle analysis and thereafter fix or revise them if necessary? Dont restrict yourself to the latest commits, cast a wider net and go super deep!'
sleep 0.1
tmux send-keys -t $pane Enter
done
マシンの速度が遅い場合は、スリープ時間を増やす必要がある場合があります。私はそれがどれほど気難しいかが嫌いです。これを行うためのより信頼できる方法を見つけるつもりです。
25.9K
トップ
ランキング
お気に入り

