refactor(skills): convert absolute paths to workspace-relative + relocate agent-sessions.yaml to .hermes/
Changes: - skills/lib.sh: AGENT_SESSIONS_YAML default moved from ~/PuKi/lab/.../agent-sessions.yaml to <workspace_root>/.hermes/agent-sessions.yaml (relative via BASH_SOURCE) - 6 SKILL.md: descriptions + 'Single source of truth' lines updated to .hermes/agent-sessions.yaml - 6 SKILL.md: bash examples (~/PuKi/lab/agent_sessions/skills/...) → relative paths - SKILL.md file:// links converted from absolute to relative (resolves workspace tool warnings) - tmux-agent-orchestrate-create/SKILL.md: removed outdated wrapper template reference - lib.sh internal comments: removed /home/godopu16/PuKi/lab example - All scripts: internal source/path references use relative resolution Verified on isolated server -L agy-relative-path-test (kill-server after): - syntax check PASS - E2E: create_session.sh auto-creates .hermes/agent-sessions.yaml at new location - status.sh reads new location correctly - 0 leftover absolute path references - Global skill non-interference verified - Main isolated server -L multi-agent-canary untouched
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
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."
|
||||
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 .hermes/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
|
||||
license: MIT
|
||||
@@ -16,7 +16,7 @@ metadata:
|
||||
# Multi-Agent Create — Start a Fresh Agent in a tmux Session
|
||||
|
||||
> **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).
|
||||
> **Single source of truth**: `./.hermes/agent-sessions.yaml` (this skill writes to it; never read it ad-hoc — go through this skill).
|
||||
|
||||
## What this skill does
|
||||
|
||||
@@ -26,7 +26,7 @@ For all agents: the tmux session name is produced by **`lib.sh::derive_session_n
|
||||
|
||||
> slug = the **two trailing path components** of the absolute workspace, `_`→`-`, lowercased, joined with `-`; name = `<slug>-creator-<agent>`.
|
||||
|
||||
So `/home/godopu16/PuKi/lab/landing_page/refer_landing_page` + `claude` → `landing-page-refer-landing-page-creator-claude`. The workspace basename (`refer_landing_page`) **is** included; the hand-written historical entry that dropped it (`lab-landing-page-creator-claude`) was the bug, not the convention.
|
||||
So `$WORKSPACE_ROOT/landing_page/refer_landing_page` + `claude` → `landing-page-refer-landing-page-creator-claude`. The workspace basename (`refer_landing_page`) **is** included; the hand-written historical entry that dropped it (`lab-landing-page-creator-claude`) was the bug, not the convention.
|
||||
|
||||
## Pre-flight checks
|
||||
|
||||
@@ -58,7 +58,7 @@ If any check fails → `kanban_block(reason="...")` (worker path) or report to u
|
||||
- never re-derive this by hand — source lib.sh and call the function
|
||||
- **wrapper script** (claude only): `~/.local/bin/<workspace-slug>-creator-claude`
|
||||
- contents: tmux new-session with `claude` inside, auto-handles trust/bypass dialogs
|
||||
- see `~/PuKi/lab/landing_page/refer_landing_page/agent_sessions.md` for the canonical wrapper template
|
||||
- see `<workdir>/agent_sessions.md` for the canonical wrapper template
|
||||
|
||||
## Tmux Server Isolation (격리 서버)
|
||||
|
||||
@@ -98,7 +98,7 @@ tmc ls # Lists only your multi-agent sessions
|
||||
```bash
|
||||
WORKSPACE=/path/to/project
|
||||
AGENT=claude # or agy
|
||||
source ~/PuKi/lab/agent_sessions/skills/lib.sh
|
||||
source skills/lib.sh
|
||||
SESSION_NAME="$(derive_session_name "$WORKSPACE" "$AGENT")"
|
||||
|
||||
# 1. If session already alive, fail fast
|
||||
@@ -135,7 +135,7 @@ TMUX_EPOCH=$(tmux list-sessions -F '#{session_created}' -t "$SESSION_NAME" 2>/de
|
||||
|
||||
## Registering the session in agent-sessions.yaml
|
||||
|
||||
After spawn, append a new `tmux_sessions[]` entry to `~/PuKi/lab/agent_sessions/agent-sessions.yaml`:
|
||||
After spawn, append a new `tmux_sessions[]` entry to `.hermes/agent-sessions.yaml`:
|
||||
|
||||
```yaml
|
||||
- name: <SESSION_NAME>
|
||||
@@ -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/tmux-agent-orchestrate-create/scripts/create_session.sh \
|
||||
bash skills/tmux-agent-orchestrate-create/scripts/create_session.sh \
|
||||
--workspace "$WORKSPACE" --agent "$AGENT" --session "$SESSION_NAME"
|
||||
```
|
||||
|
||||
@@ -198,7 +198,7 @@ tmux list-panes -t "$SESSION_NAME" -F 'cmd=#{pane_current_command} cwd=#{pane_cu
|
||||
# 3. agent-sessions.yaml has the new entry
|
||||
python3 -c "
|
||||
import yaml
|
||||
d = yaml.safe_load(open('$HOME/PuKi/lab/agent_sessions/agent-sessions.yaml'))
|
||||
d = yaml.safe_load(open('.hermes/agent-sessions.yaml'))
|
||||
names = [s['name'] for s in d['tmux_sessions']]
|
||||
assert '$SESSION_NAME' in names, 'session not registered'
|
||||
print('OK:', names)
|
||||
|
||||
@@ -171,8 +171,8 @@ if [ -n "$SUBMIT_JOB_PROMPT" ]; then
|
||||
fi
|
||||
|
||||
if [ ! -f "$AGENT_SESSIONS_YAML" ]; then
|
||||
echo "ERROR: $AGENT_SESSIONS_YAML not found. Run init first." >&2
|
||||
exit 4
|
||||
mkdir -p "$(dirname "$AGENT_SESSIONS_YAML")"
|
||||
echo "tmux_sessions: []" > "$AGENT_SESSIONS_YAML"
|
||||
fi
|
||||
|
||||
# atomic_dump_yaml: flock + temp+rename + .bak + schema validate (P0-B).
|
||||
|
||||
Reference in New Issue
Block a user