agh-worktree-isolation
Installation
SKILL.md
Worktree Isolation
Default ~/.agh/ and the default daemon port deadlock when two agents run concurrently in different worktrees. Symmetrically, git commit against the same .git/index from concurrent processes hits Unable to create '.git/index.lock'. This skill provisions a per-scenario isolated runtime envelope and prints the env vars to source.
Required Inputs
- scenario-slug (optional): a short kebab-case slug used to name the AGH_HOME directory and tmux socket. Defaults to
agh-iso-<timestamp>.
Procedures
Step 1: Detect Concurrency Signal
- Look for explicit signals in the user's request: parallel-worktree language, "another agent is running", "tem outro agent trabalhando", "QA in parallel", or invocation under a worktree path like
Compozy/_worktrees/<slug>/. - If no concurrency signal is present and the user is on a single worktree without parallel runs planned, ask whether to skip isolation (it adds setup overhead). Default to applying isolation when in doubt.
- Confirm the scenario-slug, defaulting to a timestamped slug when omitted.
Step 2: Allocate AGH_HOME