From 30e447189e8a4914414ff8f5b0e5a0735a4a0cae Mon Sep 17 00:00:00 2001 From: Godopu Date: Sun, 21 Jun 2026 14:42:12 +0000 Subject: [PATCH] refactor: migrate skills/ directory to .agents/skills/ --- {skills => .agents/skills}/lib.sh | 12 ++++++------ .../skills}/tmux-agent-orchestrate-create/SKILL.md | 4 ++-- .../scripts/create_session.sh | 0 .../tmux-agent-orchestrate-delegate-job/README.md | 0 .../tmux-agent-orchestrate-delegate-job/SKILL.md | 2 +- .../job-protocol.md | 0 .../mqtt-broker-setup.md | 0 .../registry.md | 0 .../requirements.txt | 0 .../scripts/job_subscriber.py | 0 .../scripts/mqtt_common.py | 0 .../scripts/publish_event.py | 0 .../scripts/registry.py | 0 .../tmux-agent-orchestrate-delegate-job | 0 .../tmux-agent-orchestrate-monitor/SKILL.md | 14 +++++++------- .../scripts/reconcile.sh | 2 +- .../scripts/watchdog.sh | 4 ++-- .../skills}/tmux-agent-orchestrate-resume/SKILL.md | 6 +++--- .../scripts/resolve_session_id.sh | 0 .../scripts/update_yaml_resumed.sh | 0 .../skills}/tmux-agent-orchestrate-status/SKILL.md | 2 +- .../scripts/status.sh | 4 ++-- .../skills}/tmux-agent-orchestrate-stop/SKILL.md | 6 +++--- .../scripts/stop_session.sh | 0 .gitignore | 4 ++-- BOOTSTRAP.ko.md | 12 ++++++------ BOOTSTRAP.md | 12 ++++++------ MESSAGING.md | 4 ++-- 28 files changed, 44 insertions(+), 44 deletions(-) rename {skills => .agents/skills}/lib.sh (98%) rename {skills => .agents/skills}/tmux-agent-orchestrate-create/SKILL.md (98%) rename {skills => .agents/skills}/tmux-agent-orchestrate-create/scripts/create_session.sh (100%) rename {skills => .agents/skills}/tmux-agent-orchestrate-delegate-job/README.md (100%) rename {skills => .agents/skills}/tmux-agent-orchestrate-delegate-job/SKILL.md (99%) rename {skills => .agents/skills}/tmux-agent-orchestrate-delegate-job/job-protocol.md (100%) rename {skills => .agents/skills}/tmux-agent-orchestrate-delegate-job/mqtt-broker-setup.md (100%) rename {skills => .agents/skills}/tmux-agent-orchestrate-delegate-job/registry.md (100%) rename {skills => .agents/skills}/tmux-agent-orchestrate-delegate-job/requirements.txt (100%) rename {skills => .agents/skills}/tmux-agent-orchestrate-delegate-job/scripts/job_subscriber.py (100%) rename {skills => .agents/skills}/tmux-agent-orchestrate-delegate-job/scripts/mqtt_common.py (100%) rename {skills => .agents/skills}/tmux-agent-orchestrate-delegate-job/scripts/publish_event.py (100%) rename {skills => .agents/skills}/tmux-agent-orchestrate-delegate-job/scripts/registry.py (100%) rename {skills => .agents/skills}/tmux-agent-orchestrate-delegate-job/tmux-agent-orchestrate-delegate-job (100%) rename {skills => .agents/skills}/tmux-agent-orchestrate-monitor/SKILL.md (93%) rename {skills => .agents/skills}/tmux-agent-orchestrate-monitor/scripts/reconcile.sh (98%) rename {skills => .agents/skills}/tmux-agent-orchestrate-monitor/scripts/watchdog.sh (84%) rename {skills => .agents/skills}/tmux-agent-orchestrate-resume/SKILL.md (97%) rename {skills => .agents/skills}/tmux-agent-orchestrate-resume/scripts/resolve_session_id.sh (100%) rename {skills => .agents/skills}/tmux-agent-orchestrate-resume/scripts/update_yaml_resumed.sh (100%) rename {skills => .agents/skills}/tmux-agent-orchestrate-status/SKILL.md (98%) rename {skills => .agents/skills}/tmux-agent-orchestrate-status/scripts/status.sh (96%) rename {skills => .agents/skills}/tmux-agent-orchestrate-stop/SKILL.md (97%) rename {skills => .agents/skills}/tmux-agent-orchestrate-stop/scripts/stop_session.sh (100%) diff --git a/skills/lib.sh b/.agents/skills/lib.sh similarity index 98% rename from skills/lib.sh rename to .agents/skills/lib.sh index 69de449..fd26161 100644 --- a/skills/lib.sh +++ b/.agents/skills/lib.sh @@ -15,7 +15,7 @@ # atomic_dump_yaml. Never `open(yaml_path, 'w')` anywhere else. SKILL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -WORKSPACE_ROOT="$(cd "$SKILL_DIR/.." && pwd)" +WORKSPACE_ROOT="$(cd "$SKILL_DIR/../.." && pwd)" AGENT_SESSIONS_YAML="${AGENT_SESSIONS_YAML:-$WORKSPACE_ROOT/.hermes/agent-sessions.yaml}" # Workspace-relative defaults with environment overrides (Phase Z) @@ -28,7 +28,7 @@ LOCAL_BIN="${LOCAL_BIN:-$HOME/.local/bin}" # --------------------------------------------------------------------------- # Paths to exclude when resolving the real tmux binary (shim/wrapper dirs). _TMUX_SHIM_DIR_PATTERN="${_TMUX_SHIM_DIR_PATTERN:-/multi-agent-tmux-shim/}" -_TMUX_SKILLS_BIN_PATTERN="${_TMUX_SKILLS_BIN_PATTERN:-/skills/.bin}" +_TMUX_SKILLS_BIN_PATTERN="${_TMUX_SKILLS_BIN_PATTERN:-/.agents/skills/.bin}" TMUX_SERVER_NAME="${TMUX_SERVER_NAME:-default}" @@ -652,7 +652,7 @@ PYEOF # skill tree is relocatable — no hardcoded absolute paths (review item 6). # --------------------------------------------------------------------------- -# _delegate_py_bin — echo the virtualenv python (walk up from skills/), else python3. +# _delegate_py_bin — echo the virtualenv python (walk up from .agents/skills/), else python3. _delegate_py_bin() { # Return cached result if available (shell variable, not exported — avoids cross-workspace pollution) if [ -n "${AGENT_PYTHON_BIN:-}" ] && [ -x "$AGENT_PYTHON_BIN" ]; then @@ -672,7 +672,7 @@ _delegate_py_bin() { } # _delegate_script — echo the path to a tmux-agent-orchestrate-delegate-job script, resolved -# relative to skills/ (lib.sh dir). Empty if not found. +# relative to .agents/skills/ (lib.sh dir). Empty if not found. _delegate_script() { local name="$1" skill_dir cand skill_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -690,7 +690,7 @@ delegate_submit_job() { py_bin="$(_delegate_py_bin)" registry_py="$(_delegate_script registry.py)" if [ -z "$registry_py" ] || [ ! -f "$registry_py" ]; then - echo "ERROR: tmux-agent-orchestrate-delegate-job registry.py not found under skills/" >&2 + echo "ERROR: tmux-agent-orchestrate-delegate-job registry.py not found under .agents/skills/" >&2 return 1 fi "$py_bin" "$registry_py" register \ @@ -723,7 +723,7 @@ delegate_publish_event() { start_watchdog() { local job_id="$1" local workdir="${2:-$PWD}" - local watchdog_script="$workdir/skills/tmux-agent-orchestrate-monitor/scripts/watchdog.sh" + local watchdog_script="$workdir/.agents/skills/tmux-agent-orchestrate-monitor/scripts/watchdog.sh" local log_file="$workdir/.hermes/jobs/${job_id}.watchdog.log" if [ ! -x "$watchdog_script" ]; then diff --git a/skills/tmux-agent-orchestrate-create/SKILL.md b/.agents/skills/tmux-agent-orchestrate-create/SKILL.md similarity index 98% rename from skills/tmux-agent-orchestrate-create/SKILL.md rename to .agents/skills/tmux-agent-orchestrate-create/SKILL.md index 9145f79..050d32a 100644 --- a/skills/tmux-agent-orchestrate-create/SKILL.md +++ b/.agents/skills/tmux-agent-orchestrate-create/SKILL.md @@ -98,7 +98,7 @@ tmc ls # Lists only your multi-agent sessions ```bash WORKSPACE=/path/to/project AGENT=claude # or agy -source skills/lib.sh +source .agents/skills/lib.sh SESSION_NAME="$(derive_session_name "$WORKSPACE" "$AGENT")" # 1. If session already alive, fail fast @@ -172,7 +172,7 @@ After spawn, append a new `tmux_sessions[]` entry to `.hermes/agent-sessions.yam Use the `agent-sessions-yaml-edit` script in `scripts/` to safely append (preserves comments + format): ```bash -bash skills/tmux-agent-orchestrate-create/scripts/create_session.sh \ +bash .agents/skills/tmux-agent-orchestrate-create/scripts/create_session.sh \ --workspace "$WORKSPACE" --agent "$AGENT" --session "$SESSION_NAME" ``` diff --git a/skills/tmux-agent-orchestrate-create/scripts/create_session.sh b/.agents/skills/tmux-agent-orchestrate-create/scripts/create_session.sh similarity index 100% rename from skills/tmux-agent-orchestrate-create/scripts/create_session.sh rename to .agents/skills/tmux-agent-orchestrate-create/scripts/create_session.sh diff --git a/skills/tmux-agent-orchestrate-delegate-job/README.md b/.agents/skills/tmux-agent-orchestrate-delegate-job/README.md similarity index 100% rename from skills/tmux-agent-orchestrate-delegate-job/README.md rename to .agents/skills/tmux-agent-orchestrate-delegate-job/README.md diff --git a/skills/tmux-agent-orchestrate-delegate-job/SKILL.md b/.agents/skills/tmux-agent-orchestrate-delegate-job/SKILL.md similarity index 99% rename from skills/tmux-agent-orchestrate-delegate-job/SKILL.md rename to .agents/skills/tmux-agent-orchestrate-delegate-job/SKILL.md index 06e40a4..84e71e2 100644 --- a/skills/tmux-agent-orchestrate-delegate-job/SKILL.md +++ b/.agents/skills/tmux-agent-orchestrate-delegate-job/SKILL.md @@ -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/tmux-agent-orchestrate-delegate-job/scripts +SKILL=./.agents/skills/tmux-agent-orchestrate-delegate-job/scripts # 1) register JID=$($PY "$SKILL/registry.py" register \ diff --git a/skills/tmux-agent-orchestrate-delegate-job/job-protocol.md b/.agents/skills/tmux-agent-orchestrate-delegate-job/job-protocol.md similarity index 100% rename from skills/tmux-agent-orchestrate-delegate-job/job-protocol.md rename to .agents/skills/tmux-agent-orchestrate-delegate-job/job-protocol.md diff --git a/skills/tmux-agent-orchestrate-delegate-job/mqtt-broker-setup.md b/.agents/skills/tmux-agent-orchestrate-delegate-job/mqtt-broker-setup.md similarity index 100% rename from skills/tmux-agent-orchestrate-delegate-job/mqtt-broker-setup.md rename to .agents/skills/tmux-agent-orchestrate-delegate-job/mqtt-broker-setup.md diff --git a/skills/tmux-agent-orchestrate-delegate-job/registry.md b/.agents/skills/tmux-agent-orchestrate-delegate-job/registry.md similarity index 100% rename from skills/tmux-agent-orchestrate-delegate-job/registry.md rename to .agents/skills/tmux-agent-orchestrate-delegate-job/registry.md diff --git a/skills/tmux-agent-orchestrate-delegate-job/requirements.txt b/.agents/skills/tmux-agent-orchestrate-delegate-job/requirements.txt similarity index 100% rename from skills/tmux-agent-orchestrate-delegate-job/requirements.txt rename to .agents/skills/tmux-agent-orchestrate-delegate-job/requirements.txt diff --git a/skills/tmux-agent-orchestrate-delegate-job/scripts/job_subscriber.py b/.agents/skills/tmux-agent-orchestrate-delegate-job/scripts/job_subscriber.py similarity index 100% rename from skills/tmux-agent-orchestrate-delegate-job/scripts/job_subscriber.py rename to .agents/skills/tmux-agent-orchestrate-delegate-job/scripts/job_subscriber.py diff --git a/skills/tmux-agent-orchestrate-delegate-job/scripts/mqtt_common.py b/.agents/skills/tmux-agent-orchestrate-delegate-job/scripts/mqtt_common.py similarity index 100% rename from skills/tmux-agent-orchestrate-delegate-job/scripts/mqtt_common.py rename to .agents/skills/tmux-agent-orchestrate-delegate-job/scripts/mqtt_common.py diff --git a/skills/tmux-agent-orchestrate-delegate-job/scripts/publish_event.py b/.agents/skills/tmux-agent-orchestrate-delegate-job/scripts/publish_event.py similarity index 100% rename from skills/tmux-agent-orchestrate-delegate-job/scripts/publish_event.py rename to .agents/skills/tmux-agent-orchestrate-delegate-job/scripts/publish_event.py diff --git a/skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py b/.agents/skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py similarity index 100% rename from skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py rename to .agents/skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py diff --git a/skills/tmux-agent-orchestrate-delegate-job/tmux-agent-orchestrate-delegate-job b/.agents/skills/tmux-agent-orchestrate-delegate-job/tmux-agent-orchestrate-delegate-job similarity index 100% rename from skills/tmux-agent-orchestrate-delegate-job/tmux-agent-orchestrate-delegate-job rename to .agents/skills/tmux-agent-orchestrate-delegate-job/tmux-agent-orchestrate-delegate-job diff --git a/skills/tmux-agent-orchestrate-monitor/SKILL.md b/.agents/skills/tmux-agent-orchestrate-monitor/SKILL.md similarity index 93% rename from skills/tmux-agent-orchestrate-monitor/SKILL.md rename to .agents/skills/tmux-agent-orchestrate-monitor/SKILL.md index 6d79daa..93ab512 100644 --- a/skills/tmux-agent-orchestrate-monitor/SKILL.md +++ b/.agents/skills/tmux-agent-orchestrate-monitor/SKILL.md @@ -79,7 +79,7 @@ If the user comments `stop` or `stop monitoring` on this card, call `kanban_bloc If you find that a Claude session's `claude_session_id_own` is null but there's a new *.jsonl in the project dir, read the sessionId from the first line and update the YAML. -Use the helper script at skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh for the YAML updates — it handles all the merge logic and writes a structured comment to this card. +Use the helper script at .agents/skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh for the YAML updates — it handles all the merge logic and writes a structured comment to this card. EOF )" ``` @@ -94,17 +94,17 @@ The worker calls this script every 30s. It: ```bash # Reconcile + auto-update YAML (atomic, flock-guarded). Emits JSON drift to stdout. -bash skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh --once --emit-diff +bash .agents/skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh --once --emit-diff # Read-only: compute drift WITHOUT writing the YAML (use for "what's running?" checks). -bash skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh --once --emit-diff --dry-run +bash .agents/skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh --once --emit-diff --dry-run # Push-based MQTT Monitor: listen to delegated job events on the broker and update the YAML instantly. # Bounded run that exits after 5 min idle, or 1 h wall-clock; falls back to polling if the broker is down. -bash skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh --subscribe --idle-timeout 300 --timeout 3600 +bash .agents/skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh --subscribe --idle-timeout 300 --timeout 3600 # Persistent monitor (no timeouts): runs until interrupted; still polls if the broker is unreachable. -bash skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh --subscribe --idle-timeout 0 +bash .agents/skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh --subscribe --idle-timeout 0 ``` Flags: `--once` (single pass), `--emit-diff` (print JSON), `--dry-run` (P1-E — no mutation), `--subscribe` (push-based MQTT subscription monitoring). `--subscribe` sub-flags: `--timeout N` (exit after N seconds of wall-clock; `0` = no limit, default), `--idle-timeout N` (exit after N seconds with no message; default `3600`, `0` = never idle-out). On a broker connection failure (connect error **or** non-zero CONNACK), `--subscribe` falls back to a polling loop that re-runs `--once --emit-diff` every `RECONCILE_POLL_INTERVAL` (default 15) seconds until `--timeout`. Terminal-event YAML updates are written through `lib.sh::atomic_dump_yaml` (flock + schema-validate + `.bak`). There are **no** `--workspace` / `--agent` / `--comment-card` flags; the worker turns the emitted JSON `drifts[]` into `kanban_comment` calls itself. @@ -180,7 +180,7 @@ The `--body` of the dispatched task IS the worker's behavior spec. Here's a test ## Loop (every 30s) 1. Read agent-sessions.yaml -2. Bash: `bash skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh --emit-diff` +2. Bash: `bash .agents/skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh --emit-diff` 3. Parse the JSON diff from stdout 4. If `drifts` is non-empty: - For each drift, call `kanban_comment` with the diff message @@ -226,7 +226,7 @@ When using `--subscribe` with the default PoC public broker ```bash # Run reconcile once and inspect output -bash skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh --emit-diff --once \ +bash .agents/skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh --emit-diff --once \ | python3 -m json.tool ``` diff --git a/skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh b/.agents/skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh similarity index 98% rename from skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh rename to .agents/skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh index d91ca20..3a9d97f 100755 --- a/skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh +++ b/.agents/skills/tmux-agent-orchestrate-monitor/scripts/reconcile.sh @@ -74,7 +74,7 @@ else: d = os.getcwd() while d and d != '/': hit = None - for sub in (('skills', 'tmux-agent-orchestrate-delegate-job', 'scripts'), ('tmux-agent-orchestrate-delegate-job', 'scripts')): + for sub in (('.agents', 'skills', 'tmux-agent-orchestrate-delegate-job', 'scripts'), ('skills', 'tmux-agent-orchestrate-delegate-job', 'scripts'), ('tmux-agent-orchestrate-delegate-job', 'scripts')): p = os.path.join(d, *sub) if os.path.isdir(p): hit = p diff --git a/skills/tmux-agent-orchestrate-monitor/scripts/watchdog.sh b/.agents/skills/tmux-agent-orchestrate-monitor/scripts/watchdog.sh similarity index 84% rename from skills/tmux-agent-orchestrate-monitor/scripts/watchdog.sh rename to .agents/skills/tmux-agent-orchestrate-monitor/scripts/watchdog.sh index 3c26e1c..ca9b358 100755 --- a/skills/tmux-agent-orchestrate-monitor/scripts/watchdog.sh +++ b/.agents/skills/tmux-agent-orchestrate-monitor/scripts/watchdog.sh @@ -24,7 +24,7 @@ log "watchdog started for JOB=$JOB_ID workdir=$WORKDIR" while true; do # 1) Get current job status with robust Python parsing - STATUS=$(cd "$WORKDIR" && .venv/bin/python skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py get --job "$JOB_ID" 2>/dev/null | python3 -c ' + STATUS=$(cd "$WORKDIR" && .venv/bin/python .agents/skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py get --job "$JOB_ID" 2>/dev/null | python3 -c ' import sys, json try: data = json.load(sys.stdin) @@ -48,7 +48,7 @@ except Exception: log "starting subscriber (2min hard limit, log: $LOG_FILE)" ( - cd "$WORKDIR" && timeout 120 .venv/bin/python skills/tmux-agent-orchestrate-delegate-job/scripts/job_subscriber.py \ + cd "$WORKDIR" && timeout 120 .venv/bin/python .agents/skills/tmux-agent-orchestrate-delegate-job/scripts/job_subscriber.py \ --job "$JOB_ID" --timeout 120 --idle-timeout 999999 --registry-dir .hermes/jobs > "$LOG_FILE" 2>&1 echo "[$(date -u +'%Y-%m-%dT%H:%M:%SZ')] subscriber exited" >> "$LOG_FILE" ) & diff --git a/skills/tmux-agent-orchestrate-resume/SKILL.md b/.agents/skills/tmux-agent-orchestrate-resume/SKILL.md similarity index 97% rename from skills/tmux-agent-orchestrate-resume/SKILL.md rename to .agents/skills/tmux-agent-orchestrate-resume/SKILL.md index 0eae167..e0405de 100644 --- a/skills/tmux-agent-orchestrate-resume/SKILL.md +++ b/.agents/skills/tmux-agent-orchestrate-resume/SKILL.md @@ -65,7 +65,7 @@ AGENT=claude # or agy or hermes SESSION_NAME=-creator- # same convention as tmux-agent-orchestrate-create # 1. Resolve the session id -UUID=$(bash skills/tmux-agent-orchestrate-resume/scripts/resolve_session_id.sh \ +UUID=$(bash .agents/skills/tmux-agent-orchestrate-resume/scripts/resolve_session_id.sh \ --workspace "$WORKSPACE" --agent "$AGENT") if [ -z "$UUID" ]; then @@ -74,7 +74,7 @@ if [ -z "$UUID" ]; then fi # Resolve the isolated tmux server name -source skills/lib.sh +source .agents/skills/lib.sh export TMUX_SERVER_NAME="$(resolve_tmux_server "$SESSION_NAME")" # 2. If tmux is alive, attach. Done. @@ -108,7 +108,7 @@ esac # 4. Update agent-sessions.yaml: status running, last_visible_status # (Also automatically publishes a `progress --detail "resumed"` event to the tmux-agent-orchestrate-delegate-job registry if a delegate_job_id exists) -bash skills/tmux-agent-orchestrate-resume/scripts/update_yaml_resumed.sh \ +bash .agents/skills/tmux-agent-orchestrate-resume/scripts/update_yaml_resumed.sh \ --session "$SESSION_NAME" --uuid "$UUID" # 5. Attach diff --git a/skills/tmux-agent-orchestrate-resume/scripts/resolve_session_id.sh b/.agents/skills/tmux-agent-orchestrate-resume/scripts/resolve_session_id.sh similarity index 100% rename from skills/tmux-agent-orchestrate-resume/scripts/resolve_session_id.sh rename to .agents/skills/tmux-agent-orchestrate-resume/scripts/resolve_session_id.sh diff --git a/skills/tmux-agent-orchestrate-resume/scripts/update_yaml_resumed.sh b/.agents/skills/tmux-agent-orchestrate-resume/scripts/update_yaml_resumed.sh similarity index 100% rename from skills/tmux-agent-orchestrate-resume/scripts/update_yaml_resumed.sh rename to .agents/skills/tmux-agent-orchestrate-resume/scripts/update_yaml_resumed.sh diff --git a/skills/tmux-agent-orchestrate-status/SKILL.md b/.agents/skills/tmux-agent-orchestrate-status/SKILL.md similarity index 98% rename from skills/tmux-agent-orchestrate-status/SKILL.md rename to .agents/skills/tmux-agent-orchestrate-status/SKILL.md index d0c445c..4cb1a02 100644 --- a/skills/tmux-agent-orchestrate-status/SKILL.md +++ b/.agents/skills/tmux-agent-orchestrate-status/SKILL.md @@ -38,7 +38,7 @@ If `agent-sessions.yaml` doesn't exist or is malformed → print clear error, ex ## Workflow ```bash -bash skills/tmux-agent-orchestrate-status/scripts/status.sh [--json] +bash .agents/skills/tmux-agent-orchestrate-status/scripts/status.sh [--json] ``` The script: diff --git a/skills/tmux-agent-orchestrate-status/scripts/status.sh b/.agents/skills/tmux-agent-orchestrate-status/scripts/status.sh similarity index 96% rename from skills/tmux-agent-orchestrate-status/scripts/status.sh rename to .agents/skills/tmux-agent-orchestrate-status/scripts/status.sh index 053a8a8..3ff17d9 100755 --- a/skills/tmux-agent-orchestrate-status/scripts/status.sh +++ b/.agents/skills/tmux-agent-orchestrate-status/scripts/status.sh @@ -24,9 +24,9 @@ if [ "$JSON" = "1" ]; then exit 0 fi -# Project root (parent of skills/) holds the tmux-agent-orchestrate-delegate-job .hermes registry. +# Project root (parent of .agents/) holds the tmux-agent-orchestrate-delegate-job .hermes registry. # Resolved relative to this script — no hardcoded absolute path (review item 6). -PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" +PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../../" && pwd)" DRIFT_JSON="$DRIFT_JSON" env_python "$AGENT_SESSIONS_YAML" PROJECT_ROOT="$PROJECT_ROOT" <<'PYEOF' import os, json, glob diff --git a/skills/tmux-agent-orchestrate-stop/SKILL.md b/.agents/skills/tmux-agent-orchestrate-stop/SKILL.md similarity index 97% rename from skills/tmux-agent-orchestrate-stop/SKILL.md rename to .agents/skills/tmux-agent-orchestrate-stop/SKILL.md index eeeab9e..85dd1c9 100644 --- a/skills/tmux-agent-orchestrate-stop/SKILL.md +++ b/.agents/skills/tmux-agent-orchestrate-stop/SKILL.md @@ -65,16 +65,16 @@ fi ```bash # 1. Stop gracefully (default — captures ID, shuts down safely, status=stopped) -bash skills/tmux-agent-orchestrate-stop/scripts/stop_session.sh \ +bash .agents/skills/tmux-agent-orchestrate-stop/scripts/stop_session.sh \ --session "$SESSION_NAME" # 2. Stop gracefully + record a custom stop reason -bash skills/tmux-agent-orchestrate-stop/scripts/stop_session.sh \ +bash .agents/skills/tmux-agent-orchestrate-stop/scripts/stop_session.sh \ --session "$SESSION_NAME" --reason api_error # 3. Stop gracefully + clean up on-disk conversation (DANGEROUS) # — this prevents any future resume (status=terminated, resumable=false). -bash skills/tmux-agent-orchestrate-stop/scripts/stop_session.sh \ +bash .agents/skills/tmux-agent-orchestrate-stop/scripts/stop_session.sh \ --session "$SESSION_NAME" --purge-conversation ``` diff --git a/skills/tmux-agent-orchestrate-stop/scripts/stop_session.sh b/.agents/skills/tmux-agent-orchestrate-stop/scripts/stop_session.sh similarity index 100% rename from skills/tmux-agent-orchestrate-stop/scripts/stop_session.sh rename to .agents/skills/tmux-agent-orchestrate-stop/scripts/stop_session.sh diff --git a/.gitignore b/.gitignore index fca3481..9bf0092 100644 --- a/.gitignore +++ b/.gitignore @@ -19,5 +19,5 @@ __pycache__/ !.env.example # 빌드/배포 HTML 산출물 -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 +.agents/skills/tmux-agent-orchestrate-delegate-job/USER_MANUAL.html +.agents/skills/tmux-agent-orchestrate-delegate-job/mqtt-broker-setup.html \ No newline at end of file diff --git a/BOOTSTRAP.ko.md b/BOOTSTRAP.ko.md index eb0de46..e53d2c0 100644 --- a/BOOTSTRAP.ko.md +++ b/BOOTSTRAP.ko.md @@ -10,7 +10,7 @@ 본 프로젝트를 새로운 환경에 복제(Clone)한 후, 핵심 구성 요소들의 위치와 역할을 먼저 파악해야 합니다. -* `skills/`: 멀티 에이전트 구동 및 비동기 잡 처리를 수행하는 셸 스크립트 모음 +* `.agents/skills/`: 멀티 에이전트 구동 및 비동기 잡 처리를 수행하는 셸 스크립트 모음 * `lib.sh`: 오케스트레이션의 핵심 셸 함수 및 가상환경(venv) 자동 연동 라이브러리 * `tmux-agent-orchestrate-create/`: 격리된 tmux 에이전트 세션을 시작하는 스크립트 * `tmux-agent-orchestrate-stop/`: 세션을 정상적으로 중지하고 상태를 업데이트하는 스크립트 @@ -84,7 +84,7 @@ source .venv/bin/activate ```bash # 의존성 패키지(pyyaml, paho-mqtt 등) 설치 -pip install -r skills/tmux-agent-orchestrate-delegate-job/requirements.txt +pip install -r .agents/skills/tmux-agent-orchestrate-delegate-job/requirements.txt ``` --- @@ -122,7 +122,7 @@ Python 스크립트 및 venv 라이브러리가 올바르게 로드되는지 확 ```bash # 가상환경(.venv) 파이썬 인터프리터를 사용하여 실행 -.venv/bin/python3 skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py list +.venv/bin/python3 .agents/skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py list ``` * **출력 기대 결과**: 에러 메시지 없이 빈 JSON 배열 `[]` 또는 현재 등록된 pending/running 잡 목록이 성공적으로 출력되어야 합니다. @@ -131,20 +131,20 @@ Python 스크립트 및 venv 라이브러리가 올바르게 로드되는지 확 ```bash # 1. 테스트용 임시 잡 등록 및 발급된 8자리 Hex 잡 ID 획득 -JID=$(.venv/bin/python3 skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py register \ +JID=$(.venv/bin/python3 .agents/skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py register \ --agent "test-agent" \ --prompt "Bootstrap check command" \ --timeout 120) echo "Generated Job ID: $JID" # 2. 획득한 잡 ID에 대해 백그라운드 이벤트 구독기(Subscriber) 구동 -.venv/bin/python3 skills/tmux-agent-orchestrate-delegate-job/scripts/job_subscriber.py --job "$JID" & +.venv/bin/python3 .agents/skills/tmux-agent-orchestrate-delegate-job/scripts/job_subscriber.py --job "$JID" & # 3. 구독자의 MQTT Broker 소켓 연결 및 수신부 초기화 완료를 보장하기 위해 2초 대기 sleep 2 # 4. 테스트 시작 이벤트 발행 (Subscribe-before-Publish 원칙 준수) -.venv/bin/python3 skills/tmux-agent-orchestrate-delegate-job/scripts/publish_event.py \ +.venv/bin/python3 .agents/skills/tmux-agent-orchestrate-delegate-job/scripts/publish_event.py \ --job "$JID" \ --event started \ --detail "Bootstrap MQTT verification connection check" diff --git a/BOOTSTRAP.md b/BOOTSTRAP.md index 503e034..6c78570 100644 --- a/BOOTSTRAP.md +++ b/BOOTSTRAP.md @@ -10,7 +10,7 @@ A new agent can follow the steps in this guide sequentially to establish a stabl Before cloning this project into a new environment, you must first understand the locations and roles of its core components: -* `skills/`: A collection of shell scripts that execute multi-agent coordination and asynchronous job processing. +* `.agents/skills/`: A collection of shell scripts that execute multi-agent coordination and asynchronous job processing. * `lib.sh`: The core orchestration shell functions and virtual environment (venv) auto-loading library. * `tmux-agent-orchestrate-create/`: Script to launch isolated tmux agent sessions. * `tmux-agent-orchestrate-stop/`: Script to gracefully stop agent sessions and update states. @@ -84,7 +84,7 @@ Install the required packages listed in `requirements.txt` under `tmux-agent-orc ```bash # Install dependencies (pyyaml, paho-mqtt, etc.) -pip install -r skills/tmux-agent-orchestrate-delegate-job/requirements.txt +pip install -r .agents/skills/tmux-agent-orchestrate-delegate-job/requirements.txt ``` --- @@ -122,7 +122,7 @@ Verify that the Python scripts and virtual environment libraries load correctly ```bash # Run using the python interpreter in the virtual environment -.venv/bin/python3 skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py list +.venv/bin/python3 .agents/skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py list ``` * **Expected Output**: The command should exit successfully and print an empty JSON array `[]` (or a list of pending/running jobs if any exist) without any python traceback errors. @@ -131,20 +131,20 @@ Test the end-to-end communication through the broker to verify that events are p ```bash # 1. Register a temporary test job and capture its 8-character Hex Job ID -JID=$(.venv/bin/python3 skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py register \ +JID=$(.venv/bin/python3 .agents/skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py register \ --agent "test-agent" \ --prompt "Bootstrap check command" \ --timeout 120) echo "Generated Job ID: $JID" # 2. Run the background event subscriber (Subscriber) for this Job ID -.venv/bin/python3 skills/tmux-agent-orchestrate-delegate-job/scripts/job_subscriber.py --job "$JID" & +.venv/bin/python3 .agents/skills/tmux-agent-orchestrate-delegate-job/scripts/job_subscriber.py --job "$JID" & # 3. Wait 2 seconds to allow the Subscriber to establish its MQTT socket connection sleep 2 # 4. Publish a start event (adhering to the Subscribe-before-Publish rule) -.venv/bin/python3 skills/tmux-agent-orchestrate-delegate-job/scripts/publish_event.py \ +.venv/bin/python3 .agents/skills/tmux-agent-orchestrate-delegate-job/scripts/publish_event.py \ --job "$JID" \ --event started \ --detail "Bootstrap MQTT verification connection check" diff --git a/MESSAGING.md b/MESSAGING.md index 3b40fd8..971fb9c 100644 --- a/MESSAGING.md +++ b/MESSAGING.md @@ -337,7 +337,7 @@ graph LR This project manages **two distinct state domains** that are often confused: ### Session States (YAML — `.hermes/agent-sessions.yaml`) -Managed by `skills/lib.sh` and the 6 `tmux-agent-orchestrate-*` skills. +Managed by `.agents/skills/lib.sh` and the 6 `tmux-agent-orchestrate-*` skills. Valid values (see `lib.sh` valid-status set): | State | Meaning | Set by | @@ -348,7 +348,7 @@ Valid values (see `lib.sh` valid-status set): | `archived` | soft-stopped via `--mode soft`; tmux left alive, YAML-only update | `stop` (soft mode) | ### Job States (Registry — `.hermes/jobs/.json`) -Managed by `skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py`. +Managed by `.agents/skills/tmux-agent-orchestrate-delegate-job/scripts/registry.py`. Valid values: | State | Meaning | Set by |