plugins/git-worktrees/skills/worktree-manager/SKILL.md
Proactive git worktree orchestration -- detects WIP state (uncommitted changes, stashes, unpushed commits) and offers to isolate work into worktrees. MUST activate BEFORE any implementation task (add, create, build, implement, develop, make, fix, refactor) when the working directory has uncommitted changes or stashes. Also provides dashboard, context recovery, multi-worktree creation, cleanup advisor, and conflict early warning across parallel development sessions. Triggers: any implementation request when WIP exists, "show my worktrees", "what am I working on", "help me manage parallel tasks", "worktree status", "coordinate my work". TRIGGER WHEN: before any implementation task (add, create, build, fix, refactor) when the working directory has uncommitted changes, stashes, or unpushed commits; when the user asks about worktrees, branches, or parallel development. DO NOT TRIGGER WHEN: the repo state is clean and the user is doing a single-file read-only task.
npx skillsauth add acaprino/anvil-toolset worktree-managerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Orchestrate parallel development through git worktrees. Proactively detect WIP state and offer isolation. Provide dashboards, context recovery, and conflict warnings.
Activate when session starts and working directory has WIP state. Detection:
# Uncommitted or staged changes
git status --porcelain
# Stashes
git stash list
# Unpushed commits (may fail if no upstream - that's ok)
git log --oneline @{u}..HEAD 2>/dev/null
If ANY of these return output, present:
I notice you have work in progress:
[X modified files / Y staged files / Z stashes / N unpushed commits]
Would you like to:
A) Move this WIP into a worktree (stash, create worktree, apply there)
B) Continue on current branch (I'll back off)
C) Show details first
git stash push -m "wt-migration: <name>"/wt new <name> --desc "..." -- pass name and description directly, never prompt for category or work typegit stash popBack off for the session. Do not prompt again about WIP state.
Show full output of all three detection commands, then re-offer A/B.
When asked "show my worktrees", "what am I working on", or "worktree status":
.worktrees/registry.jsongit -C <path> log --oneline <base>..<branch> - commits aheadgit -C <path> log --oneline <branch>..<base> - commits behind basegit -C <path> status --porcelain - uncommitted changesgit -C <path> log -1 --format=%ar - last activityParallel Development Dashboard
==============================
[1] auth-refactor [active] - 2h ago
Branch: wt/auth-refactor (from master)
+5 commits, 0 behind | 3 modified files
"Refactoring auth middleware for compliance"
[2] fix-login [paused] - 1d ago
Branch: wt/fix-login (from master)
+2 commits, 3 behind | clean
"Fix OAuth login redirect bug"
Warnings:
- fix-login is 3 commits behind master - consider rebasing
When user says "what am I working on" or returns after a break:
When user says "I need to work on N things" or lists multiple tasks:
I'll create 3 worktrees:
1. auth-refactor -> wt/auth-refactor "Refactor auth middleware"
2. fix-login -> wt/fix-login "Fix OAuth redirect bug"
3. add-dashboard -> wt/add-dashboard "New analytics dashboard"
Proceed?
/wt new flowWhen asked "clean up worktrees" or detected during dashboard:
Identify candidates:
Present:
Cleanup recommendations:
Done (branch merged):
- fix-login: branch wt/fix-login merged into master
-> /wt rm fix-login
Stale (no activity >7 days):
- old-experiment: last commit 12 days ago
-> Pause? Remove?
Missing (path gone):
- deleted-wt: path .worktrees/deleted-wt not found
-> Remove from registry
When asked "check for conflicts" or proactively during dashboard if >1 active worktree:
# Files changed in each worktree vs its base
git -C <path1> diff --name-only <base1>...<branch1>
git -C <path2> diff --name-only <base2>...<branch2>
git -C <path1> diff <base1>...<branch1> -- <file>
git -C <path2> diff <base2>...<branch2> -- <file>
Conflict Risk Assessment
========================
auth-refactor vs fix-login:
Overlapping files: 2
src/middleware/auth.ts - LIKELY CONFLICT (both modify lines 45-80)
src/config.ts - low risk (different sections)
auth-refactor vs add-dashboard:
No overlapping files - clean
Recommendation: Merge auth-refactor first, then rebase fix-login.
Direct the user to /wt command for operations:
/wt new <name> - create worktree/wt list - compact listing/wt status - detailed dashboard/wt pause <name> / /wt resume <name> - toggle status/wt rm <name> - remove worktree/wt merge <name> - guided merge flowdevelopment
Quality gates for multi-reviewer code review pipelines: adversarial verification panel, completeness critic, reviewer pipeline conventions, and the context sharing pattern for parallel reviewers. TRIGGER WHEN: running /senior-review:team-review quality gates; running /senior-review:code-review Steps 4b/4c (adversarial verification and completeness check); consolidating or deduplicating findings from multiple parallel reviewers. DO NOT TRIGGER WHEN: single-reviewer style review without a consolidation phase, or generic team coordination (the upstream agent-teams skills cover that).
development
Knowledge base for pure-architecture decisions on when to unify duplicated logic into a shared abstraction versus leave it duplicated. Covers the canonical theory (Rule of Three, DRY/WET/AHA, Wrong Abstraction, Locality of Behaviour, Bounded Contexts, Tidy First options framing, CUPID vs SOLID), 12 essential-duplication patterns that justify unification, 12 wrong-abstraction patterns that justify inlining or decomposition, an operational decision frame, and a verified reading list. TRIGGER WHEN: the user is making an architectural decision about whether to centralize, extract, or remove a layer; reviewing an abstraction for premature generality; auditing scattered cross-cutting concerns; spawned by the abstraction-architect agent during /abstraction-architect:audit or as the Abstraction dimension of /senior-review:team-review or /senior-review:code-review; the user asks "should I extract this into a service" / "is this DRY enough" / "is this wrong abstraction". DO NOT TRIGGER WHEN: the task is code formatting and readability cleanup (use clean-code:clean-code), Python-specific refactoring with metrics (use python-development:python-refactor), generic dead-code removal (use senior-review:cleanup-dead-code), security review (use senior-review:security-auditor), or pure pattern-consistency review without an architecture lens (use senior-review:code-auditor).
development
Unified web frontend knowledge base covering CSS architecture, UX psychology, UI components, distinctive aesthetics, and interface design generation. TRIGGER WHEN: working on web styling, design systems, component decisions, responsive strategy, distinctive frontend aesthetics, or exploring multiple interface designs. DO NOT TRIGGER WHEN: the task is purely backend or unrelated to web frontend.
development
Stripe payments knowledge base - API patterns, checkout optimization, subscription lifecycle, pricing strategies, webhook reliability, Firebase integration, cost analysis, and revenue modeling. Loaded by stripe-integrator and revenue-optimizer agents; also consumable directly when the user asks for Stripe-specific patterns without needing an agent. TRIGGER WHEN: working with Stripe API (Payment Intents, Customers, Subscriptions, Checkout Sessions, Connect, webhooks, tax, usage-based billing), pricing strategy, or revenue modeling. DO NOT TRIGGER WHEN: payment work is non-Stripe (PayPal, Square, crypto) or the task is generic e-commerce unrelated to payments.