From e9fc763d31ec84218c5301cf9927f757059cae3d Mon Sep 17 00:00:00 2001 From: Godopu Date: Fri, 19 Jun 2026 23:27:27 +0000 Subject: [PATCH] refactor(skills): rename multi-agent-* + agent-sessions-monitor + delegate-job to tmux-agent-orchestrate-* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Renamed 6 skills directories to tmux-agent-orchestrate-* prefix: - multi-agent-create → tmux-agent-orchestrate-create - multi-agent-resume → tmux-agent-orchestrate-resume - multi-agent-delete → tmux-agent-orchestrate-delete - multi-agent-status → tmux-agent-orchestrate-status - agent-sessions-monitor → tmux-agent-orchestrate-monitor - delegate-job → tmux-agent-orchestrate-delegate-job Updated: - skills/lib.sh internal paths (delegate_submit_job etc.) - skills/tmux-agent-orchestrate-status/scripts/status.sh (monitor path) - skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh - .gitignore (HTML ignore patterns) - 6 SKILL.md frontmatter (name, related_skills, prereq_skills) and body - All script headers and Korean comments Notes: - tmux session naming convention unchanged (-creator-) — workspace identifier based, kept for backward compatibility - Existing 2 sessions in -L multi-agent-canary untouched - YAML delegate_job_id / agent-session (tmux:canary-...) preserved for log history compatibility Verified on isolated server -L agy-rename-test (kill-server after). --- .gitignore | 4 +- skills/delegate-job/README.md | 11 ------ skills/lib.sh | 14 +++---- .../SKILL.md | 18 ++++----- .../scripts/create_session.sh | 14 +++---- .../README.md | 11 ++++++ .../SKILL.md | 38 +++++++++---------- .../job-protocol.md | 2 +- .../mqtt-broker-setup.md | 4 +- .../registry.md | 0 .../requirements.txt | 0 .../scripts/job_subscriber.py | 0 .../scripts/mqtt_common.py | 2 +- .../scripts/publish_event.py | 0 .../scripts/registry.py | 6 +-- .../tmux-agent-orchestrate-delegate-job} | 4 +- .../SKILL.md | 36 +++++++++--------- .../scripts/delete_session.sh | 6 +-- .../SKILL.md | 32 ++++++++-------- .../scripts/reconcile.sh | 14 +++---- .../SKILL.md | 32 ++++++++-------- .../scripts/resolve_session_id.sh | 2 +- .../scripts/update_yaml_resumed.sh | 2 +- .../SKILL.md | 32 ++++++++-------- .../scripts/status.sh | 8 ++-- 25 files changed, 146 insertions(+), 146 deletions(-) delete mode 100644 skills/delegate-job/README.md rename skills/{multi-agent-create => tmux-agent-orchestrate-create}/SKILL.md (90%) rename skills/{multi-agent-create => tmux-agent-orchestrate-create}/scripts/create_session.sh (93%) create mode 100644 skills/tmux-agent-orchestrate-delegate-job/README.md rename skills/{delegate-job => tmux-agent-orchestrate-delegate-job}/SKILL.md (89%) rename skills/{delegate-job => tmux-agent-orchestrate-delegate-job}/job-protocol.md (98%) rename skills/{delegate-job => tmux-agent-orchestrate-delegate-job}/mqtt-broker-setup.md (97%) rename skills/{delegate-job => tmux-agent-orchestrate-delegate-job}/registry.md (100%) rename skills/{delegate-job => tmux-agent-orchestrate-delegate-job}/requirements.txt (100%) rename skills/{delegate-job => tmux-agent-orchestrate-delegate-job}/scripts/job_subscriber.py (100%) rename skills/{delegate-job => tmux-agent-orchestrate-delegate-job}/scripts/mqtt_common.py (99%) rename skills/{delegate-job => tmux-agent-orchestrate-delegate-job}/scripts/publish_event.py (100%) rename skills/{delegate-job => tmux-agent-orchestrate-delegate-job}/scripts/registry.py (97%) rename skills/{delegate-job/delegate-job => tmux-agent-orchestrate-delegate-job/tmux-agent-orchestrate-delegate-job} (98%) rename skills/{multi-agent-delete => tmux-agent-orchestrate-delete}/SKILL.md (70%) rename skills/{multi-agent-delete => tmux-agent-orchestrate-delete}/scripts/delete_session.sh (96%) rename skills/{agent-sessions-monitor => tmux-agent-orchestrate-monitor}/SKILL.md (83%) rename skills/{agent-sessions-monitor => tmux-agent-orchestrate-monitor}/scripts/reconcile.sh (96%) rename skills/{multi-agent-resume => tmux-agent-orchestrate-resume}/SKILL.md (72%) rename skills/{multi-agent-resume => tmux-agent-orchestrate-resume}/scripts/resolve_session_id.sh (93%) rename skills/{multi-agent-resume => tmux-agent-orchestrate-resume}/scripts/update_yaml_resumed.sh (97%) rename skills/{multi-agent-status => tmux-agent-orchestrate-status}/SKILL.md (73%) rename skills/{multi-agent-status => tmux-agent-orchestrate-status}/scripts/status.sh (91%) diff --git a/.gitignore b/.gitignore index f2eee57..f585d27 100644 --- a/.gitignore +++ b/.gitignore @@ -14,5 +14,5 @@ __pycache__/ *.pyc # 빌드/배포 HTML 산출물 -skills/delegate-job/USER_MANUAL.html -skills/delegate-job/mqtt-broker-setup.html \ No newline at end of file +skills/tmux-agent-orchestrate-delegate-job/USER_MANUAL.html +skills/tmux-agent-orchestrate-delegate-job/mqtt-broker-setup.html \ No newline at end of file diff --git a/skills/delegate-job/README.md b/skills/delegate-job/README.md deleted file mode 100644 index 72c6f24..0000000 --- a/skills/delegate-job/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# delegate-job 스킬 - -작업(Job)을 자율 에이전트(claude-code/codex/opencode/human)에게 위임하고 MQTT -이벤트 채널로 비동기 관찰하는 Hermes 스킬. **시작점은 [`SKILL.md`](./SKILL.md).** - -- 프로토콜/스키마: [`job-protocol.md`](./job-protocol.md) -- 브로커 PoC→운영 전환: [`mqtt-broker-setup.md`](./mqtt-broker-setup.md) -- 레지스트리 포맷/동시성: [`registry.md`](./registry.md) -- 참조 구현: [`delegate-job`](./delegate-job) (bash wrapper), [`scripts/publish_event.py`](./scripts/publish_event.py), [`scripts/job_subscriber.py`](./scripts/job_subscriber.py), [`scripts/registry.py`](./scripts/registry.py), [`scripts/mqtt_common.py`](./scripts/mqtt_common.py) -- 영구 감사 로그: `.hermes/delegate_job_logs//` (`meta.json`·`events.ndjson`·`status.json`) - — `delegate-job logs ` 또는 `delegate-job logs --list`로 조회 (SKILL.md "Audit Logs" 참조) diff --git a/skills/lib.sh b/skills/lib.sh index 94b7efb..db2a291 100644 --- a/skills/lib.sh +++ b/skills/lib.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# lib.sh — shared library for the multi-agent-* / agent-sessions-* skills. +# lib.sh — shared library for the tmux-agent-orchestrate-* skills. # # Single source of truth for the four things that were inconsistently # re-implemented across create/resume/delete/monitor (REVIEW.md §4.1): @@ -362,7 +362,7 @@ PYEOF } # --------------------------------------------------------------------------- -# delegate-job integration helpers +# tmux-agent-orchestrate-delegate-job integration helpers # # All paths are resolved relative to lib.sh's own location (BASH_SOURCE), so the # skill tree is relocatable — no hardcoded absolute paths (review item 6). @@ -381,26 +381,26 @@ _delegate_py_bin() { printf '%s\n' "python3" } -# _delegate_script — echo the path to a delegate-job script, resolved +# _delegate_script — echo the path to a tmux-agent-orchestrate-delegate-job script, resolved # relative to skills/ (lib.sh dir). Empty if not found. _delegate_script() { local name="$1" skill_dir cand skill_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - cand="$skill_dir/delegate-job/scripts/$name" + cand="$skill_dir/tmux-agent-orchestrate-delegate-job/scripts/$name" if [ -f "$cand" ]; then printf '%s\n' "$cand"; return 0; fi printf '%s\n' "$(find "$skill_dir" -name "$name" 2>/dev/null | head -n 1 || true)" } # delegate_submit_job # -# Register a job in the delegate-job registry. Prints the new JID on stdout. +# Register a job in the tmux-agent-orchestrate-delegate-job registry. Prints the new JID on stdout. delegate_submit_job() { local prompt="$1" agent="$2" session="$3" local py_bin registry_py py_bin="$(_delegate_py_bin)" registry_py="$(_delegate_script registry.py)" if [ -z "$registry_py" ] || [ ! -f "$registry_py" ]; then - echo "ERROR: delegate-job registry.py not found under skills/" >&2 + echo "ERROR: tmux-agent-orchestrate-delegate-job registry.py not found under skills/" >&2 return 1 fi "$py_bin" "$registry_py" register \ @@ -411,7 +411,7 @@ delegate_submit_job() { # delegate_publish_event [detail] # -# Publish a lifecycle event to the delegate-job registry. Consolidates the +# Publish a lifecycle event to the tmux-agent-orchestrate-delegate-job registry. Consolidates the # inline .venv-walk + publish_event.py blocks that were duplicated across # create/delete/resume (review item 7). Non-fatal by contract: an empty job id, # a missing script, or a broker failure never aborts the caller. diff --git a/skills/multi-agent-create/SKILL.md b/skills/tmux-agent-orchestrate-create/SKILL.md similarity index 90% rename from skills/multi-agent-create/SKILL.md rename to skills/tmux-agent-orchestrate-create/SKILL.md index 02bc337..d94f914 100644 --- a/skills/multi-agent-create/SKILL.md +++ b/skills/tmux-agent-orchestrate-create/SKILL.md @@ -1,5 +1,5 @@ --- -name: multi-agent-create +name: tmux-agent-orchestrate-create description: "Create a new agent session (claude, antigravity/agy) in a dedicated tmux session for context-preserving long-running work. Always creates a tmux session — never backgrounds with nohup/disown. Writes the new session to ~/PuKi/lab/agent_sessions/agent-sessions.yaml. Use when you want to start a fresh agent (no prior UUID) for a new project workspace." version: 1.0.0 author: godopu @@ -9,18 +9,18 @@ environments: [terminal, tmux] metadata: hermes: tags: [agent, tmux, claude, antigravity, agy, multi-agent, context, session] - related_skills: [multi-agent-resume, multi-agent-delete, agent-sessions-monitor, claude-code] + related_skills: [tmux-agent-orchestrate-resume, tmux-agent-orchestrate-delete, tmux-agent-orchestrate-monitor, claude-code] prereq_skills: [claude-code] --- # Multi-Agent Create — Start a Fresh Agent in a tmux Session -> **Companion skills**: `multi-agent-resume` (resume an existing UUID), `multi-agent-delete` (terminate), `agent-sessions-monitor` (live status). +> **Companion skills**: `tmux-agent-orchestrate-resume` (resume an existing UUID), `tmux-agent-orchestrate-delete` (terminate), `tmux-agent-orchestrate-monitor` (live status). > **Single source of truth**: `~/PuKi/lab/agent_sessions/agent-sessions.yaml` (this skill writes to it; never read it ad-hoc — go through this skill). ## What this skill does -Spawn a new agent (`claude` or `agy`/antigravity-cli) in a **dedicated tmux session** for context-preserving long-running work. The tmux session is the *container*; the agent's session ID is *data* inside the container. **This skill creates the container + starts the agent — but does not resume an old conversation** (use `multi-agent-resume` for that). +Spawn a new agent (`claude` or `agy`/antigravity-cli) in a **dedicated tmux session** for context-preserving long-running work. The tmux session is the *container*; the agent's session ID is *data* inside the container. **This skill creates the container + starts the agent — but does not resume an old conversation** (use `tmux-agent-orchestrate-resume` for that). For all agents: the tmux session name is produced by **`lib.sh::derive_session_name`** — the single source of truth shared by create/resume/delete/status/monitor (P0-A). The rule (verbatim from the function): @@ -103,7 +103,7 @@ SESSION_NAME="$(derive_session_name "$WORKSPACE" "$AGENT")" # 1. If session already alive, fail fast tmux has-session -t "$SESSION_NAME" 2>/dev/null && { - echo "ERROR: tmux session '$SESSION_NAME' already exists. Use multi-agent-resume to attach or multi-agent-delete first." + echo "ERROR: tmux session '$SESSION_NAME' already exists. Use tmux-agent-orchestrate-resume to attach or tmux-agent-orchestrate-delete first." exit 1 } @@ -170,7 +170,7 @@ After spawn, append a new `tmux_sessions[]` entry to `~/PuKi/lab/agent_sessions/ Use the `agent-sessions-yaml-edit` script in `scripts/` to safely append (preserves comments + format): ```bash -bash ~/PuKi/lab/agent_sessions/skills/multi-agent-create/scripts/create_session.sh \ +bash ~/PuKi/lab/agent_sessions/skills/tmux-agent-orchestrate-create/scripts/create_session.sh \ --workspace "$WORKSPACE" --agent "$AGENT" --session "$SESSION_NAME" ``` @@ -182,7 +182,7 @@ The script handles the YAML append, pane capture, and the `last_visible_status` - **Don't trust `--session-id ` flags blindly** — claude/agy may not accept a fixed session id on first spawn. The session id is *assigned* on first user message; you can read it back from `~/.claude/projects/.../session.jsonl` headers or `~/.gemini/.../cache/last_conversations.json` AFTER the first message. - **Wrapper script MUST NOT be created via `hermes profile alias`** — that command writes a `hermes -p ` wrapper that destroys the tmux behavior. Create wrappers manually (see `lab-landing-page-creator-claude` template). - **Always use the workspace-relative path** in tmux `cwd` — relative paths break when tmux respawns in a different shell context. -- **The first `claude` message generates the session id** — `multi-agent-create` only sets up the *container*. If you need a known session id for later resume, send a placeholder message (e.g. "init") and read it back, then call `multi-agent-resume` later. +- **The first `claude` message generates the session id** — `tmux-agent-orchestrate-create` only sets up the *container*. If you need a known session id for later resume, send a placeholder message (e.g. "init") and read it back, then call `tmux-agent-orchestrate-resume` later. ## Verification @@ -212,7 +212,7 @@ tmux capture-pane -t "$SESSION_NAME" -p -S -20 ## When NOT to use this skill -- **Resuming an old conversation** → `multi-agent-resume` -- **Killing an existing session** → `multi-agent-delete` +- **Resuming an old conversation** → `tmux-agent-orchestrate-resume` +- **Killing an existing session** → `tmux-agent-orchestrate-delete` - **Just attaching to an existing session** → `tmux attach -t ` (no skill needed) - **One-shot print mode (claude -p "...")** → no tmux needed; use `claude-code` skill's print mode diff --git a/skills/multi-agent-create/scripts/create_session.sh b/skills/tmux-agent-orchestrate-create/scripts/create_session.sh similarity index 93% rename from skills/multi-agent-create/scripts/create_session.sh rename to skills/tmux-agent-orchestrate-create/scripts/create_session.sh index 0a5a982..64ec0e0 100755 --- a/skills/multi-agent-create/scripts/create_session.sh +++ b/skills/tmux-agent-orchestrate-create/scripts/create_session.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# create_session.sh — multi-agent-create 의 부속 스크립트 +# create_session.sh — tmux-agent-orchestrate-create 의 부속 스크립트 # Usage: # bash create_session.sh --workspace --agent [--session ] [--wrapper] # @@ -15,7 +15,7 @@ # 0 = success # 1 = preflight failure # 2 = invalid args -# 3 = tmux session already exists (use multi-agent-resume or delete first) +# 3 = tmux session already exists (use tmux-agent-orchestrate-resume or delete first) # 4 = agent-sessions.yaml append failure set -euo pipefail @@ -32,7 +32,7 @@ Options: --wrapper force use of ~/.local/bin/ wrapper even if not present --dry-run print commands without executing --tmux-server NAME specify isolated tmux server name - --submit-job PROMPT submit a job to delegate-job registry with the given prompt + --submit-job PROMPT submit a job to tmux-agent-orchestrate-delegate-job registry with the given prompt -h, --help this help EOF } @@ -90,7 +90,7 @@ fi # 이미 살아있으면 실패 if _tmux has-session -t "$SESSION_NAME" 2>/dev/null; then - echo "ERROR: tmux session '$SESSION_NAME' already exists. Use multi-agent-resume to attach, or multi-agent-delete first." >&2 + echo "ERROR: tmux session '$SESSION_NAME' already exists. Use tmux-agent-orchestrate-resume to attach, or tmux-agent-orchestrate-delete first." >&2 exit 3 fi @@ -262,7 +262,7 @@ echo "=== created ===" echo "tmux session: $SESSION_NAME (pane pid $PANE_PID, cmd $PANE_CMD, cwd $PANE_CWD)" if [ -n "$DELEGATE_JOB_ID" ]; then echo "delegate job: $DELEGATE_JOB_ID" - delegate_publish_event "$DELEGATE_JOB_ID" started "canary session created" + delegate_publish_event "$DELEGATE_JOB_ID" started "tmux-agent-orchestrate session created" fi echo "agent-sessions.yaml updated" echo @@ -271,5 +271,5 @@ if [ -n "${TMUX_SERVER_NAME:-}" ] && [ "$TMUX_SERVER_NAME" != "default" ]; then else echo "Attach: tmux attach -t $SESSION_NAME" fi -echo "Delete: use multi-agent-delete skill" -echo "Resume: use multi-agent-resume skill (after first message creates a session id)" +echo "Delete: use tmux-agent-orchestrate-delete skill" +echo "Resume: use tmux-agent-orchestrate-resume skill (after first message creates a session id)" diff --git a/skills/tmux-agent-orchestrate-delegate-job/README.md b/skills/tmux-agent-orchestrate-delegate-job/README.md new file mode 100644 index 0000000..d860a6d --- /dev/null +++ b/skills/tmux-agent-orchestrate-delegate-job/README.md @@ -0,0 +1,11 @@ +# tmux-agent-orchestrate-delegate-job 스킬 + +작업(Job)을 자율 에이전트(claude-code/codex/opencode/human)에게 위임하고 MQTT +이벤트 채널로 비동기 관찰하는 Hermes 스킬. **시작점은 [`SKILL.md`](./SKILL.md).** + +- 프로토콜/스키마: [`job-protocol.md`](./job-protocol.md) +- 브로커 PoC→운영 전환: [`mqtt-broker-setup.md`](./mqtt-broker-setup.md) +- 레지스트리 포맷/동시성: [`registry.md`](./registry.md) +- 참조 구현: [`tmux-agent-orchestrate-delegate-job`](./tmux-agent-orchestrate-delegate-job) (bash wrapper), [`scripts/publish_event.py`](./scripts/publish_event.py), [`scripts/job_subscriber.py`](./scripts/job_subscriber.py), [`scripts/registry.py`](./scripts/registry.py), [`scripts/mqtt_common.py`](./scripts/mqtt_common.py) +- 영구 감사 로그: `.hermes/delegate_job_logs//` (`meta.json`·`events.ndjson`·`status.json`) + — `tmux-agent-orchestrate-delegate-job logs ` 또는 `tmux-agent-orchestrate-delegate-job logs --list`로 조회 (SKILL.md "Audit Logs" 참조) diff --git a/skills/delegate-job/SKILL.md b/skills/tmux-agent-orchestrate-delegate-job/SKILL.md similarity index 89% rename from skills/delegate-job/SKILL.md rename to skills/tmux-agent-orchestrate-delegate-job/SKILL.md index 4020c44..2cf660b 100644 --- a/skills/delegate-job/SKILL.md +++ b/skills/tmux-agent-orchestrate-delegate-job/SKILL.md @@ -1,6 +1,6 @@ --- -name: delegate-job -description: "Delegate a unit of work to any autonomous agent (claude-code, codex, opencode, or a human) and observe it asynchronously over an MQTT event channel. Each job gets a unique id, a registry record (prompt, broker, status, timeouts), and a single per-job topic that carries started/permission_required/progress/completed/error events as schema-versioned JSON. The delegator starts a subscriber first, runs the agent, and treats a completed/error event or a timeout as the job's terminal state. Ships a working reference implementation (publish_event.py, job_subscriber.py, registry.py, mqtt_common.py, delegate-job wrapper) plus a PoC-to-production path: validate on a public broker, then move to an authenticated TLS broker by changing config only — no code change. Use when you need fire-and-observe delegation, multi-job fan-out across tmux sessions, or a uniform completion-signal protocol shared by several agent types." +name: tmux-agent-orchestrate-delegate-job +description: "Delegate a unit of work to any autonomous agent (claude-code, codex, opencode, or a human) and observe it asynchronously over an MQTT event channel. Each job gets a unique id, a registry record (prompt, broker, status, timeouts), and a single per-job topic that carries started/permission_required/progress/completed/error events as schema-versioned JSON. The delegator starts a subscriber first, runs the agent, and treats a completed/error event or a timeout as the job's terminal state. Ships a working reference implementation (publish_event.py, job_subscriber.py, registry.py, mqtt_common.py, tmux-agent-orchestrate-delegate-job wrapper) plus a PoC-to-production path: validate on a public broker, then move to an authenticated TLS broker by changing config only — no code change. Use when you need fire-and-observe delegation, multi-job fan-out across tmux sessions, or a uniform completion-signal protocol shared by several agent types." version: 1.0.0 author: Hermes Agent license: MIT @@ -11,7 +11,7 @@ metadata: related_skills: [claude-code, codex, opencode, hermes-agent-skill-authoring] --- -# delegate-job — Async Job Delegation over MQTT +# tmux-agent-orchestrate-delegate-job — Async Job Delegation over MQTT Delegate a unit of work to an autonomous agent, then **observe** it instead of blocking on it. Every job gets a unique id and a registry record; the agent @@ -73,7 +73,7 @@ you need finer control. ```bash # 1) one line: register → start subscriber → launch agent in tmux # (uses public broker by default; last stdout line is the audit-log dir) -delegate-job submit \ +tmux-agent-orchestrate-delegate-job submit \ --agent claude-code \ --prompt "정렬 문제 10개를 만들어 sort_problems.md로 저장" \ --workdir /path/to/project \ @@ -86,12 +86,12 @@ delegate-job submit \ # /path/to/project/.hermes/delegate_job_logs/ ← audit log dir # 2) at any time, query the job or its audit log -delegate-job status --job -delegate-job logs # pretty timeline -delegate-job logs --list # every job, live status +tmux-agent-orchestrate-delegate-job status --job +tmux-agent-orchestrate-delegate-job logs # pretty timeline +tmux-agent-orchestrate-delegate-job logs --list # every job, live status # 3) run a user-supplied validator against the job's artifacts -delegate-job verify --job --validate ./validate.sh +tmux-agent-orchestrate-delegate-job verify --job --validate ./validate.sh ``` The wrapper enforces the **subscribe-before-publish** ordering and **forwards @@ -102,7 +102,7 @@ propagated to the agent"). When you need finer control, the manual flow is: ```bash # Manual 5-step (same outcome, more knobs) PY=.venv/bin/python -SKILL=./skills/delegate-job/scripts +SKILL=./skills/tmux-agent-orchestrate-delegate-job/scripts # 1) register JID=$($PY "$SKILL/registry.py" register \ @@ -194,8 +194,8 @@ never touched. **Reading them:** ```bash -delegate-job logs # pretty-print one job's timeline -delegate-job logs --list # summarise every logged job (with live status) +tmux-agent-orchestrate-delegate-job logs # pretty-print one job's timeline +tmux-agent-orchestrate-delegate-job logs --list # summarise every logged job (with live status) # or directly via the registry CLI: $PY scripts/registry.py logs [--tail N] [--json] $PY scripts/registry.py logs --list [--json] @@ -239,7 +239,7 @@ agent"). Your job_id is "$JOB_ID" (read it from the registry record for this delegation — do not reuse any job_id you saw before). - On start: $PY delegate-job/scripts/publish_event.py --job "$JOB_ID" --event started + On start: $PY tmux-agent-orchestrate-delegate-job/scripts/publish_event.py --job "$JOB_ID" --event started On permission: $PY … --job "$JOB_ID" --event permission_required --detail ":" On progress: $PY … --job "$JOB_ID" --event progress --detail "" On success: $PY … --job "$JOB_ID" --event completed --detail "" @@ -261,17 +261,17 @@ agent"). ## User Interface -The [`delegate-job`](./delegate-job) bash wrapper bundles register + +The [`tmux-agent-orchestrate-delegate-job`](./tmux-agent-orchestrate-delegate-job) bash wrapper bundles register + subscribe-first + run-agent + validate: ```bash -delegate-job submit --agent claude-code \ +tmux-agent-orchestrate-delegate-job submit --agent claude-code \ --prompt "정렬 문제 10개를 만들어 sort_problems.md로 저장" \ --workdir /path/to/project --timeout 600 [--validate ./validate.sh] -delegate-job status --job # one record, pretty-printed -delegate-job list # all jobs, one line each -delegate-job verify --job --validate ./validate.sh # runs it, reports exit code -delegate-job wait [--job ] # block until terminal (else --wait-any) +tmux-agent-orchestrate-delegate-job status --job # one record, pretty-printed +tmux-agent-orchestrate-delegate-job list # all jobs, one line each +tmux-agent-orchestrate-delegate-job verify --job --validate ./validate.sh # runs it, reports exit code +tmux-agent-orchestrate-delegate-job wait [--job ] # block until terminal (else --wait-any) ``` `submit` **always starts the subscriber before the agent** (the ordering @@ -340,7 +340,7 @@ business-logic validation — those are hooks you fill (`validate.sh` reads logging failure (e.g. read-only log dir) does not break the publish or subscribe path — only a `logger.warning` is emitted. - [ ] **end-to-end demo smoke** — run - `delegate-job submit --agent claude-code --agent-session tmux:demo-smoke + `tmux-agent-orchestrate-delegate-job submit --agent claude-code --agent-session tmux:demo-smoke --prompt "echo hello and call publish_event.py --job --event completed" --timeout 120` and confirm (a) registered job id echoed, (b) subscriber pid echoed, (c) tmux session diff --git a/skills/delegate-job/job-protocol.md b/skills/tmux-agent-orchestrate-delegate-job/job-protocol.md similarity index 98% rename from skills/delegate-job/job-protocol.md rename to skills/tmux-agent-orchestrate-delegate-job/job-protocol.md index 2fb0044..32cb0ac 100644 --- a/skills/delegate-job/job-protocol.md +++ b/skills/tmux-agent-orchestrate-delegate-job/job-protocol.md @@ -1,6 +1,6 @@ # Job Event Protocol -The wire contract every delegate-job agent (claude-code, codex, opencode, +The wire contract every tmux-agent-orchestrate-delegate-job agent (claude-code, codex, opencode, human, …) speaks. One job → one MQTT topic → JSON event payloads. Stable across the PoC (public broker) and production (own broker) stages; only transport hardening changes, never the payload shape. diff --git a/skills/delegate-job/mqtt-broker-setup.md b/skills/tmux-agent-orchestrate-delegate-job/mqtt-broker-setup.md similarity index 97% rename from skills/delegate-job/mqtt-broker-setup.md rename to skills/tmux-agent-orchestrate-delegate-job/mqtt-broker-setup.md index ab0353d..f03c1ee 100644 --- a/skills/delegate-job/mqtt-broker-setup.md +++ b/skills/tmux-agent-orchestrate-delegate-job/mqtt-broker-setup.md @@ -1,6 +1,6 @@ # MQTT Broker Setup — PoC → Production -The delegate-job scripts read **all** broker settings from environment +The tmux-agent-orchestrate-delegate-job scripts read **all** broker settings from environment variables (or a job record's `broker.*` block) through a single helper, `broker_config_from_env()` in [`./scripts/mqtt_common.py`](./scripts/mqtt_common.py). The design goal: @@ -152,7 +152,7 @@ export MQTT_PASSWORD=… # subscriber side mosquitto_sub -h "$MQTT_BROKER" -p 8883 --cafile "$MQTT_CA_CERTS" \ -u hermes -P "$MQTT_PASSWORD" -t 'python/mqtt/jobs/+/events' -v & -# 3) run the unchanged delegate-job loop +# 3) run the unchanged tmux-agent-orchestrate-delegate-job loop PY=.venv/bin/python JID=$($PY scripts/registry.py register --prompt "broker cutover smoke") $PY scripts/job_subscriber.py --job "$JID" --timeout 30 & diff --git a/skills/delegate-job/registry.md b/skills/tmux-agent-orchestrate-delegate-job/registry.md similarity index 100% rename from skills/delegate-job/registry.md rename to skills/tmux-agent-orchestrate-delegate-job/registry.md diff --git a/skills/delegate-job/requirements.txt b/skills/tmux-agent-orchestrate-delegate-job/requirements.txt similarity index 100% rename from skills/delegate-job/requirements.txt rename to skills/tmux-agent-orchestrate-delegate-job/requirements.txt diff --git a/skills/delegate-job/scripts/job_subscriber.py b/skills/tmux-agent-orchestrate-delegate-job/scripts/job_subscriber.py similarity index 100% rename from skills/delegate-job/scripts/job_subscriber.py rename to skills/tmux-agent-orchestrate-delegate-job/scripts/job_subscriber.py diff --git a/skills/delegate-job/scripts/mqtt_common.py b/skills/tmux-agent-orchestrate-delegate-job/scripts/mqtt_common.py similarity index 99% rename from skills/delegate-job/scripts/mqtt_common.py rename to skills/tmux-agent-orchestrate-delegate-job/scripts/mqtt_common.py index 72b3181..41fbff4 100644 --- a/skills/delegate-job/scripts/mqtt_common.py +++ b/skills/tmux-agent-orchestrate-delegate-job/scripts/mqtt_common.py @@ -1,4 +1,4 @@ -"""Shared MQTT + registry helpers for the delegate-job skill. +"""Shared MQTT + registry helpers for the tmux-agent-orchestrate-delegate-job skill. Single entry point for: - broker configuration (env -> dataclass), diff --git a/skills/delegate-job/scripts/publish_event.py b/skills/tmux-agent-orchestrate-delegate-job/scripts/publish_event.py similarity index 100% rename from skills/delegate-job/scripts/publish_event.py rename to skills/tmux-agent-orchestrate-delegate-job/scripts/publish_event.py diff --git a/skills/delegate-job/scripts/registry.py b/skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py similarity index 97% rename from skills/delegate-job/scripts/registry.py rename to skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py index 195ed21..4f4248a 100755 --- a/skills/delegate-job/scripts/registry.py +++ b/skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py @@ -1,4 +1,4 @@ -"""Job registry for the delegate-job skill. +"""Job registry for the tmux-agent-orchestrate-delegate-job skill. A job record is the single source of truth for one delegated unit of work: its id, prompt, owning agent session, broker connection, timeouts, and status. @@ -9,7 +9,7 @@ Concurrency is handled via the fcntl lock in :mod:`mqtt_common` (PoC). For multi-host delegation, migrate to SQLite WAL — see references/registry.md. Importable as a library and runnable as a CLI (``register``/``list``/``get``/ -``status``/``pick``) so the ``delegate-job`` bash wrapper can shell out. +``status``/``pick``) so the ``tmux-agent-orchestrate-delegate-job`` bash wrapper can shell out. """ from __future__ import annotations @@ -179,7 +179,7 @@ def _iter_records(registry_dir: str): # CLI (so the bash wrapper can shell out without inline python) # -------------------------------------------------------------------------- def _build_parser() -> argparse.ArgumentParser: - parser = argparse.ArgumentParser(description="delegate-job registry CLI") + parser = argparse.ArgumentParser(description="tmux-agent-orchestrate-delegate-job registry CLI") parser.add_argument("--registry-dir", default=DEFAULT_REGISTRY_DIR) sub = parser.add_subparsers(dest="command", required=True) diff --git a/skills/delegate-job/delegate-job b/skills/tmux-agent-orchestrate-delegate-job/tmux-agent-orchestrate-delegate-job similarity index 98% rename from skills/delegate-job/delegate-job rename to skills/tmux-agent-orchestrate-delegate-job/tmux-agent-orchestrate-delegate-job index dda55d2..f17e3c4 100755 --- a/skills/delegate-job/delegate-job +++ b/skills/tmux-agent-orchestrate-delegate-job/tmux-agent-orchestrate-delegate-job @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# delegate-job — user-facing orchestrator for the delegate-job skill. +# tmux-agent-orchestrate-delegate-job — user-facing orchestrator for the tmux-agent-orchestrate-delegate-job skill. # # Subcommands: # submit register a job, start the subscriber FIRST, then run the agent, @@ -41,7 +41,7 @@ REGISTRY_DIR_DEFAULT=".hermes/jobs" usage() { cat <<'EOF' -delegate-job [options] +tmux-agent-orchestrate-delegate-job [options] submit --agent --prompt [--workdir ] [--agent-session