npx skills add https://github.com/am-will/swarms --skill parallel-task-tmux运行依赖关系排序的计划执行,类似于 parallel-task,但通过 tmux 窗格内的 codex exec 路由每个工作器,以便实时查看进度。
在以下情况下使用此技能:
depends_on 计算未阻塞的任务。scripts/tmux_spawn_worker.sh 为每个任务启动一个 tmux 窗格。scripts/tmux_reap_completed.sh 监控状态/日志并回收已完成的窗格。在启动工作器之前运行这些检查:
command -v tmux >/dev/null
command -v codex >/dev/null
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
解析一次技能目录,以便辅助脚本路径稳定:
SKILL_ROOT="$(fd -td -p 'parallel-task-tmux' "$PWD" "$HOME/.codex/skills" "$HOME/.agents/skills" 2>/dev/null | head -n 1)"
如果 SKILL_ROOT 为空,则快速失败。
每次执行初始化一个运行目录:
PLAN_FILE="./plan.md"
PLAN_BASE="$(basename "$PLAN_FILE" .md)"
RUN_ID="$(date +%Y%m%d-%H%M%S)"
SESSION_NAME="swarms-${PLAN_BASE}-${RUN_ID}"
RUN_ROOT=".swarms/tmux/${SESSION_NAME}"
mkdir -p "$RUN_ROOT/prompts" "$RUN_ROOT/logs"
: > "$RUN_ROOT/status.tsv"
: > "$RUN_ROOT/task_map.tsv"
: > "$RUN_ROOT/reaped.tsv"
镜像 parallel-task 行为:
### T1:)。depends_on、位置、描述、验收标准、验证。为每个任务在以下位置创建一个提示文件:
$RUN_ROOT/prompts/<TASK_ID>.md使用与 parallel-task 相同的任务上下文和完成要求:
tdd_test_writer 子代理进入 TDD RED 阶段,或者使用替代验证契约明确记录 reason_not_testable。在 tmux 内部运行时,首选就地分割,以便用户可以在当前 Codex 窗格中继续聊天,同时工作器出现在其旁边。
就地模式(推荐在 tmux 内部使用):
"$SKILL_ROOT/scripts/tmux_spawn_worker.sh" \
--split-current \
--workspace "$PWD" \
--task-id "$TASK_ID" \
--prompt-file "$RUN_ROOT/prompts/${TASK_ID}.md" \
--log-file "$RUN_ROOT/logs/${TASK_ID}.log" \
--status-file "$RUN_ROOT/status.tsv" \
--map-file "$RUN_ROOT/task_map.tsv"
分离会话模式(用于非 tmux shell):
"$SKILL_ROOT/scripts/tmux_spawn_worker.sh" \
--session "$SESSION_NAME" \
--workspace "$PWD" \
--task-id "$TASK_ID" \
--prompt-file "$RUN_ROOT/prompts/${TASK_ID}.md" \
--log-file "$RUN_ROOT/logs/${TASK_ID}.log" \
--status-file "$RUN_ROOT/status.tsv" \
--map-file "$RUN_ROOT/task_map.tsv"
行为:
codex exec 输出,同时将日志写入 logs/<TASK_ID>.log。task_map.tsv 中跟踪窗格 ID,以便进行确定性清理。在分离模式下,如果尚未附加,则打印:
tmux attach -t "$SESSION_NAME"
在每个波次期间,监控活动窗格:
tmux list-panes -t "${SESSION_NAME}:workers" -F '#{pane_id} #{pane_current_command} #{pane_dead}'
收集已完成的工作器并关闭其窗格:
"$SKILL_ROOT/scripts/tmux_reap_completed.sh" \
--session "$SESSION_NAME" \
--status-file "$RUN_ROOT/status.tsv" \
--map-file "$RUN_ROOT/task_map.tsv" \
--seen-file "$RUN_ROOT/reaped.tsv"
这就是实现扩展/收缩行为的原因:
在接受任务前检查日志:
tail -n 80 "$RUN_ROOT/logs/${TASK_ID}.log"
对于每个已完成的任务:
reason_not_testable 加上具体的替代验证输出。仅当当前波次中的所有任务都验证完成时,才启动下一个波次。
所有任务完成后:
默认情况下保持 tmux 会话存活以便审计。仅在用户要求时终止它:
tmux kill-session -t "$SESSION_NAME"
tmux 不可用:停止并指导用户安装 tmux。/parallel-task-tmux plan.md
/parallel-task-tmux ./plans/auth-plan.md T1 T2 T4
/parallel-task-tmux user-profile-plan.md --tasks T3 T7
每周安装
0
仓库
GitHub 星标
132
首次出现
1 天前
安全审计
Run dependency-ordered plan execution like parallel-task, but route each worker through codex exec inside tmux panes so progress is visible in real time.
Use this skill when you want:
depends_on.scripts/tmux_spawn_worker.sh.scripts/tmux_reap_completed.sh.Run these checks before launching workers:
command -v tmux >/dev/null
command -v codex >/dev/null
Resolve the skill directory once so helper script paths are stable:
SKILL_ROOT="$(fd -td -p 'parallel-task-tmux' "$PWD" "$HOME/.codex/skills" "$HOME/.agents/skills" 2>/dev/null | head -n 1)"
Fail fast if SKILL_ROOT is empty.
Initialize one run directory per execution:
PLAN_FILE="./plan.md"
PLAN_BASE="$(basename "$PLAN_FILE" .md)"
RUN_ID="$(date +%Y%m%d-%H%M%S)"
SESSION_NAME="swarms-${PLAN_BASE}-${RUN_ID}"
RUN_ROOT=".swarms/tmux/${SESSION_NAME}"
mkdir -p "$RUN_ROOT/prompts" "$RUN_ROOT/logs"
: > "$RUN_ROOT/status.tsv"
: > "$RUN_ROOT/task_map.tsv"
: > "$RUN_ROOT/reaped.tsv"
Mirror parallel-task behavior:
### T1:).depends_on, location, description, acceptance criteria, validation.Create one prompt file per task at:
$RUN_ROOT/prompts/<TASK_ID>.mdUse the same task context and completion requirements as parallel-task:
tdd_test_writer subagent, or explicitly record reason_not_testable with an alternative verification contract.When running inside tmux, prefer in-place splits so the user can keep chatting in the current Codex pane while workers appear beside it.
In-place mode (recommended inside tmux):
"$SKILL_ROOT/scripts/tmux_spawn_worker.sh" \
--split-current \
--workspace "$PWD" \
--task-id "$TASK_ID" \
--prompt-file "$RUN_ROOT/prompts/${TASK_ID}.md" \
--log-file "$RUN_ROOT/logs/${TASK_ID}.log" \
--status-file "$RUN_ROOT/status.tsv" \
--map-file "$RUN_ROOT/task_map.tsv"
Detached session mode (for non-tmux shells):
"$SKILL_ROOT/scripts/tmux_spawn_worker.sh" \
--session "$SESSION_NAME" \
--workspace "$PWD" \
--task-id "$TASK_ID" \
--prompt-file "$RUN_ROOT/prompts/${TASK_ID}.md" \
--log-file "$RUN_ROOT/logs/${TASK_ID}.log" \
--status-file "$RUN_ROOT/status.tsv" \
--map-file "$RUN_ROOT/task_map.tsv"
Behavior:
codex exec output live in each pane while also writing logs to logs/<TASK_ID>.log.task_map.tsv for deterministic cleanup.In detached mode, if not already attached, print:
tmux attach -t "$SESSION_NAME"
During each wave, monitor active panes:
tmux list-panes -t "${SESSION_NAME}:workers" -F '#{pane_id} #{pane_current_command} #{pane_dead}'
Collect completed workers and close their panes:
"$SKILL_ROOT/scripts/tmux_reap_completed.sh" \
--session "$SESSION_NAME" \
--status-file "$RUN_ROOT/status.tsv" \
--map-file "$RUN_ROOT/task_map.tsv" \
--seen-file "$RUN_ROOT/reaped.tsv"
This is what gives the expand/shrink behavior:
Inspect logs before accepting a task:
tail -n 80 "$RUN_ROOT/logs/${TASK_ID}.log"
For each completed task:
reason_not_testable plus concrete alternative verification output.Launch the next wave only when all tasks in the current wave are verified complete.
After all tasks are complete:
Leave the tmux session alive by default for auditability. Only kill it if the user asks:
tmux kill-session -t "$SESSION_NAME"
tmux unavailable: stop and instruct user to install tmux./parallel-task-tmux plan.md
/parallel-task-tmux ./plans/auth-plan.md T1 T2 T4
/parallel-task-tmux user-profile-plan.md --tasks T3 T7
Weekly Installs
0
Repository
GitHub Stars
132
First Seen
1 day ago
Security Audits
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
114,200 周安装