mirror of
https://github.com/obra/superpowers.git
synced 2026-04-23 18:09:05 +08:00
Compare commits
6 Commits
add-worktr
...
72dd30d653
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72dd30d653 | ||
|
|
856959aaeb | ||
|
|
100a56871c | ||
|
|
b1e9711034 | ||
|
|
d4464920ff | ||
|
|
a490478f8a |
@@ -251,7 +251,7 @@ Report with branch state:
|
||||
|
||||
**If `GIT_DIR == GIT_COMMON` (or in a submodule):** You are in a normal repo checkout.
|
||||
|
||||
Has the user already indicated their worktree preference in your instructions? If not, ask for consent before creating a worktree:
|
||||
If the user has not already made their preferences about worktree isolation clear — check global and project agent instruction files (`CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, `.cursorrules`, or equivalent) — ask for consent before creating a worktree:
|
||||
|
||||
> "Would you like me to set up an isolated worktree? It protects your current branch from changes."
|
||||
|
||||
@@ -289,7 +289,7 @@ Follow this priority order:
|
||||
```
|
||||
If found, use it (backward compatibility with legacy global path).
|
||||
|
||||
3. **Check your instructions for a worktree directory preference.** If specified, use it without asking.
|
||||
3. **Check your project's agent instruction file** (CLAUDE.md, GEMINI.md, AGENTS.md, .cursorrules, or equivalent) for a worktree directory preference. If specified, use it without asking.
|
||||
|
||||
4. **Default to `.worktrees/`.**
|
||||
|
||||
|
||||
@@ -48,9 +48,7 @@ echo "Current branch: $BRANCH"
|
||||
echo "Repository: $(basename "$(git rev-parse --show-toplevel)")"
|
||||
```
|
||||
|
||||
**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**:
|
||||
Tell the user their options, then **wait for a reply**:
|
||||
|
||||
> "You're on `<branch>` in `<repo>`. I can set up an isolated worktree, or we can work directly here. What do you prefer?"
|
||||
|
||||
@@ -84,7 +82,7 @@ Only proceed to Step 3b if you have no native worktree tool available.
|
||||
|
||||
Follow this priority order. Explicit user preference always beats observed filesystem state.
|
||||
|
||||
1. **Check your instructions for a declared worktree directory preference.** If the user has already specified one, use it without asking.
|
||||
1. **Check global and project agent instruction files** (`~/.claude/CLAUDE.md`, `~/.config/gemini/AGENTS.md`, project-level `CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, `.cursorrules`, or equivalent) for a declared worktree directory preference. If specified, use it without asking.
|
||||
|
||||
2. **Check for an existing project-local worktree directory:**
|
||||
```bash
|
||||
@@ -243,7 +241,7 @@ Ready to implement <feature-name>
|
||||
- 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 or plan — only an explicit user request counts
|
||||
- Infer worktree consent from the task description, plan, or skill invocation — only an explicit user reply counts
|
||||
|
||||
**Always:**
|
||||
- Run Step 1 detection first
|
||||
@@ -258,9 +256,9 @@ Ready to implement <feature-name>
|
||||
## Integration
|
||||
|
||||
**Called by:**
|
||||
- **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
|
||||
- **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
|
||||
|
||||
**Pairs with:**
|
||||
- **finishing-a-development-branch** - REQUIRED for cleanup after work complete
|
||||
|
||||
Reference in New Issue
Block a user