/superpowers-deepseek-v4:confirming-worktree-before-editfrom superpowers-deepseek-v4
Asks before editing whether to create an isolated git worktree, records choice once per session, and delegates setup to using-git-worktrees.
Ships in superpowers-deepseek-v4. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Before modifying any file in this session, confirm whether the user wants an isolated worktree — but only once per session.
Core principle: Ask once. Record the choice. Delegate setup. Never edit before the gate when consent is still unknown.
Scope: All persistent writes to project files, including:
docs/superpowers/specs/*.mddocs/superpowers/plans/*.mddocs/superpowers/brainstorms/*-brainstorm.mddocs/superpowers/brainstorms/*-plan-progress.mdAnnounce at start: "I'm using the confirming-worktree-before-edit skill to confirm worktree preference before editing."
Do NOT run this gate when any of these apply:
Read-only mode — Ask mode or any context where file edits are technically impossible (Write/StrReplace/ApplyPatch and equivalent tools unavailable). Skip entirely. Plan mode does not skip this gate when edits are possible.
Subagent dispatch — If you were dispatched as a subagent (<SUBAGENT-STOP> in using-superpowers), skip. The parent agent must run this gate before dispatching you.
Already in a linked worktree — Run detection (same as using-git-worktrees Step 0):
GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
# Submodule guard — if this returns a path, treat as normal repo, not worktree
git rev-parse --show-superproject-working-tree 2>/dev/null
If GIT_DIR != GIT_COMMON (and not a submodule): already isolated. Record worktree consent: asked, choice: skipped (already in worktree) and proceed to Step 4.
User already declared worktree preference — User rules, instructions, or an earlier message in this session explicitly state worktree preference (create one / work in place / use /worktree). Honor it. Record worktree consent: asked, choice: yes|no matching that preference. Proceed to Step 3 or Step 4 as appropriate.
Consent already recorded this session — If you already recorded worktree consent: asked, choice: ... in this session, skip to Step 4. Never ask twice.
You are about to edit a file and none of the Step 0 skip conditions apply.
STOP. Do not edit any file yet.
Ask the user using this exact wording:
Would you like me to set up an isolated worktree? It protects your current branch from changes.
Wait for the user's answer before proceeding.
Immediately after the user answers, record in your session notes:
worktree consent: asked, choice: yes
or
worktree consent: asked, choice: no
This record prevents duplicate asks for the rest of the session. Other skills (including using-git-worktrees) rely on it.
If choice is yes:
REQUIRED SUB-SKILL: Use superpowers-deepseek-v4:using-git-worktrees
Do not call git worktree add directly — using-git-worktrees handles native tools, paths, setup, and baseline tests.
If choice is no:
Work in the current directory. Proceed to Step 4 without creating a worktree.
Gate complete. Continue the calling skill's edit workflow (TDD, plan execution, spec writing, debugging fix, etc.).
| Situation | Action |
|---|---|
| Read-only / Ask mode (edits impossible) | Skip gate |
| Subagent | Skip (parent runs gate) |
| Already in linked worktree | Record skipped, proceed |
| User rules declare preference | Honor + record, no ask |
| Consent already recorded | Skip ask, proceed |
| First edit (spec/plan/source/config), none of above | Ask exact question, record, execute |
| User says yes | Invoke using-git-worktrees |
| User says no | Work in place |
git worktree add after user says yes/worktree or EnterWorktree; agent still asksNever:
git worktree add when a native harness worktree tool exists (using-git-worktrees owns this)Always:
Called by: session bootstrap (before using-superpowers), brainstorming (Step 0.5), writing-plans (Step 0.5), test-driven-development, subagent-driven-development, executing-plans, systematic-debugging (Phase 4), dispatching-parallel-agents, receiving-code-review, writing-skills, resume-brainstorming (abandonment edit), resume-planning (abandonment edit), and using-superpowers (ad-hoc edits).
Delegates to: superpowers-deepseek-v4:using-git-worktrees (when user accepts)
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub gylove1994/superpowers-deepseek-v4 --plugin superpowers-deepseek-v419 skills in this plugin
/brainstormingYou MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation./dispatching-parallel-agentsUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies/executing-plansUse when you have a written implementation plan to execute in a separate session with review checkpoints/finishing-a-development-branchUse when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup/managing-samplesUse ONLY when the user explicitly asks to initialize the exemplar samples library or to promote a specific spec/plan file as an exemplar. Never auto-trigger; never recommend addition unprompted./multi-reviewerUse to run a multi-round review loop on a spec or plan draft. Dispatches 6 fixed reviewers (architect, red-team, edge-cases, yagni-gatekeeper, bdd-reviewer, tdd-reviewer) plus up to 2 exemplar-matchers (one per matched sample), then an arbiter that filters and arbitrates. Loop converges, degenerates, or hits a 3-round ceiling.Other plugins' skills for the same job