delegated-worktree-rules

Enforces git worktree isolation rules for delegated parallel coding tasks.

2|Updated Jan 2, 2026
One-click install
npx skills add https://github.com/ShineBreaker/Guix-configs --skill delegated-worktree-rules-shinebreaker
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: delegated-worktree-rules
Source: https://github.com/ShineBreaker/Guix-configs/tree/main/dotfiles/mutable/agents/hermes/.local/share/hermes/skills/hermes-agent-ops/delegated-worktree-rules
Command: npx skills add https://github.com/ShineBreaker/Guix-configs --skill delegated-worktree-rules-shinebreaker

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? When multiple agents or long-running tasks modify the same source checkout, they collide, leave dirty state, or destroy each other's work. This Skill defines when isolated git worktrees are mandatory and how to use them correctly so the source checkout stays stable and interrupted work remains recoverable. ## Core Features & Use Cases - Trigger checklist (T1-T6): Concrete conditions (parallel writers, tasks over 30 minutes, irreversible changes, multi-agent experiments) that mandate worktree isolation instead of editing the source tree directly. - Three usage patterns: hermes --worktree subprocesses, delegate_task with an explicit workdir, or direct git worktree add plus cd, matched to task duration and monitoring needs. - Hard rules R1-R6: Source checkout is never switched or cleaned, every task gets its own branch and directory, dirty or interrupted worktrees are retained 24 hours, and cleanup goes through trash-cli instead of rm -rf. - Use Case: You delegate two feature branches to sub-agents in parallel. Each runs in ../worktrees/<task-id> on branch task/<id>-<desc>, hands back branch name and commit hash, and the main agent verifies nothing leaked into the source root before cleanup. ## Quick Start Ask the agent to set up an isolated worktree for a delegated coding task using the worktree-setup.sh template and verify the source checkout stays clean afterward.

Frequently Asked Questions about delegated-worktree-rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
When should I use git worktree for parallel agent tasks?▼

Use a git worktree whenever two or more writers touch the same source tree, a task runs over 30 minutes, changes are irreversible, or multiple sub-agents run experiments in parallel. Read-only queries and single-file typo fixes do not need isolation.

How do I create an isolated worktree for a delegated coding task?▼

Run the worktree-setup.sh template with a task id, short description, and base branch. It creates ../worktrees/<task-id> on branch task/<task-id>-<desc> outside the source root, so the main checkout stays clean.

Can sub-agents run git checkout or git clean in the source root?▼

No. Sub-agents must never switch branches, run git clean, or stash in the source root because that destabilizes the main agent's working copy. All write operations happen inside the task's own worktree and branch.

What happens to worktrees when a delegated task fails or is interrupted?▼

Failed or interrupted worktrees are retained for at least 24 hours so the main agent or user can inspect and recover them via git worktree list and git log. Cleanup later uses trash-cli, never rm -rf.

How does the main agent verify a sub-agent's worktree handoff?▼

The handoff must include the worktree path, branch name, and last commit hash. The main agent confirms all three exist with git worktree list and git log, then checks git status in the source root for leaked changes.