From b859970b840f9f864e45ded014f70d61bd377491 Mon Sep 17 00:00:00 2001 From: Godopu Date: Mon, 24 Aug 2026 13:18:45 +0900 Subject: [PATCH] docs(skills): update SKILL.md guides for herdr workspace runtime synchronization and add unit tests --- .../skills/multi-agent-mux-create/SKILL.md | 2 +- .../skills/multi-agent-mux-resume/SKILL.md | 1 + tests/test_tier1_unit.py | 22 +++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.agents/skills/multi-agent-mux-create/SKILL.md b/.agents/skills/multi-agent-mux-create/SKILL.md index 1c729c9..5475fd9 100644 --- a/.agents/skills/multi-agent-mux-create/SKILL.md +++ b/.agents/skills/multi-agent-mux-create/SKILL.md @@ -68,7 +68,7 @@ If any check fails โ†’ abort with a non-zero exit and report the reason (automat When running multiple agent sessions alongside other workflows (e.g., cmux, background workers, manual herdr sessions), sharing the default herdr server can lead to session name conflicts, monitoring clutter, and accidental destruction of user sessions via global commands. To prevent this, you can run this skill inside an **isolated herdr session** using the `HERDR_SESSION_NAME` environment variable or the `--herdr-session ` flag (opt-in; alias: `--herdr-server`; legacy env alias: `HERDR_SERVER_NAME`). -Additionally, you can specify `--herdr-workspace ` to record a distinct project workspace label in `.mam/agent-sessions.yaml` (default: workspace slug without `mam-` prefix). Note that `--herdr-workspace` is a metadata label only and never selects a herdr daemon socket. +Additionally, you can specify `--herdr-workspace ` (default: workspace slug without `mam-` prefix) to name and group the agent panes inside a dedicated Herdr workspace tab in the Herdr runtime (`herdr workspace create --label` / `rename`) as well as recording it in `.mam/agent-sessions.yaml`. Note that `--herdr-workspace` configures the workspace tab label within the session, whereas `--herdr-session` selects the daemon socket itself. Under the hood this maps to a real, separate herdr **session** (`herdr --session ` โ€” its own socket, its own `agent list`/`workspace list`, completely invisible to the default session and vice versa), not just a workspace label inside the same server. `lib.sh`'s shim bootstraps the named session's server headlessly (`herdr --session server`, backgrounded) the first time it's needed, and scopes every subsequent herdr call to it automatically โ€” this headless bootstrap is what lets it work even when the skill itself is running from inside another herdr-managed pane (a plain interactive `herdr --session ` launch is blocked there by herdr's "nested herdr is disabled" guard; headless `server` mode isn't). diff --git a/.agents/skills/multi-agent-mux-resume/SKILL.md b/.agents/skills/multi-agent-mux-resume/SKILL.md index 8b074b2..4d683c7 100644 --- a/.agents/skills/multi-agent-mux-resume/SKILL.md +++ b/.agents/skills/multi-agent-mux-resume/SKILL.md @@ -74,6 +74,7 @@ if [ -z "$UUID" ]; then fi export HERDR_SESSION_NAME="$(resolve_herdr_session "$SESSION_NAME" "$WORKSPACE")" +export MAM_WS_LABEL="${HERDR_WORKSPACE_OPT:-$(resolve_herdr_workspace "$SESSION_NAME" "$WORKSPACE")}" # 2. If herdr is alive, attach. Done. if herdr has-session -t "$SESSION_NAME" 2>/dev/null; then diff --git a/tests/test_tier1_unit.py b/tests/test_tier1_unit.py index bf695e3..ae28fe7 100644 --- a/tests/test_tier1_unit.py +++ b/tests/test_tier1_unit.py @@ -843,4 +843,26 @@ def test_g10_delegate_job_rc3_not_mistaken_for_error(mam_sandbox): assert 'job_status="broker_unavailable"' in content +def test_claude_adapter_ready_tokens_includes_modern_banners(): + """Verify claude adapter ready_tokens regex includes modern Claude Code banners.""" + from lib_py.agents.adapters.claude import ClaudeAgentAdapter + adapter = ClaudeAgentAdapter() + tokens = adapter.ready_tokens + assert "Claude Code" in tokens + assert "Opus" in tokens + assert "Sonnet" in tokens + import re + assert re.search(tokens, "Claude Code v2.1.241") + assert re.search(tokens, "Opus 5 with high effort ยท Claude Pro") + + +def test_lib_sh_new_session_passes_mam_ws_label(mam_sandbox): + """Verify lib.sh new-session translates MAM_WS_LABEL to herdr workspace create --label and rename.""" + lib_path = mam_sandbox / "skills" / "lib.sh" + content = lib_path.read_text() + assert '${MAM_WS_LABEL:+--label "$MAM_WS_LABEL"}' in content + assert '_real_herdr workspace rename "$existing_ws" "$MAM_WS_LABEL"' in content + + +