From 82bb6289c7fc3414951faa51abcb181dbd9e1d9e Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Sat, 14 Feb 2026 09:48:26 +0100 Subject: [PATCH] fix(skills): discover worktree branches dynamically in worktree-update The skill previously relied on the agent hardcoding branch names, which missed non-standard branches like planning. Now explicitly instructs the agent to use git worktree list for discovery. Co-Authored-By: Claude Opus 4.6 --- .claude/skills/worktree-update/SKILL.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.claude/skills/worktree-update/SKILL.md b/.claude/skills/worktree-update/SKILL.md index 403b2e1c3..d0a676748 100644 --- a/.claude/skills/worktree-update/SKILL.md +++ b/.claude/skills/worktree-update/SKILL.md @@ -44,10 +44,16 @@ Branch determines the mode: `main` → outbound sync, anything else → inbound git fetch --all ``` +Discover all worktree branches (excluding `main` itself): + +```bash +git worktree list | grep -v '\[main\]' | sed 's/.*\[//;s/\]//' +``` + For each worktree branch, check if it has commits ahead of main: ```bash -git rev-list --count main.. +git rev-list --count main..origin/ ``` Skip branches with 0 commits ahead. For branches that ARE ahead, collect: