From 884b1a5960f435e670d0a3f1f5246e4a8fd54b24 Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Mon, 13 Apr 2026 16:09:19 -0700 Subject: [PATCH] fix: treat direct worktree skill invocation as consent (PRI-974) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The skill previously required an explicit reply to its "do you want a worktree?" dialogue, which produced obtuse UX when the user invoked the skill by name — agents had to stop and ask "do you want a worktree?" even though the user just asked for the skill whose purpose is worktrees. Loosen Step 2 to recognize the invoking turn as consent: if the user's most recent message named the skill, asked for a worktree, or asked for an isolated workspace, proceed directly to Step 3 without re-prompting. The gate still fires for the transitive case (agent infers isolation from a feature description) — that remains the #991 failure mode. Also trim "or skill invocation" from the anti-inference Red Flag and destale the Integration section now that SDD/executing-plans no longer require a worktree. Co-Authored-By: Claude Opus 4.6 (1M context) --- skills/using-git-worktrees/SKILL.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/skills/using-git-worktrees/SKILL.md b/skills/using-git-worktrees/SKILL.md index 57a0b19b..6d450c4f 100644 --- a/skills/using-git-worktrees/SKILL.md +++ b/skills/using-git-worktrees/SKILL.md @@ -48,7 +48,9 @@ echo "Current branch: $BRANCH" echo "Repository: $(basename "$(git rev-parse --show-toplevel)")" ``` -Tell the user their options, then **wait for a reply**: +**Check the user's most recent message first.** If they already asked for a worktree, named the worktree skill, or asked for an isolated workspace in the message that invoked you, that IS the explicit ask — proceed directly to Step 3 without re-prompting. + +Otherwise, tell the user their options and **wait for a reply**: > "You're on `` in ``. I can set up an isolated worktree, or we can work directly here. What do you prefer?" @@ -241,7 +243,7 @@ Ready to implement - Create worktree without verifying it's ignored (project-local) - Skip baseline test verification - Proceed with failing tests without asking -- Infer worktree consent from the task description, plan, or skill invocation — only an explicit user reply counts +- Infer worktree consent from the task description or plan — only an explicit user request counts **Always:** - Run Step 1 detection first @@ -256,9 +258,9 @@ Ready to implement ## Integration **Called by:** -- **subagent-driven-development** - Ensures isolated workspace (creates one or verifies existing) -- **executing-plans** - Ensures isolated workspace (creates one or verifies existing) -- Any skill needing isolated workspace +- **subagent-driven-development** - Calls this to detect the workspace and optionally set up worktree isolation on request +- **executing-plans** - Calls this to detect the workspace and optionally set up worktree isolation on request +- Any skill that may use worktree isolation **Pairs with:** - **finishing-a-development-branch** - REQUIRED for cleanup after work complete