engine7 7.1.39 → 7.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +438 -255
- package/dist/engine-startup.mjs +3862 -3486
- package/dist/main.mjs +4982 -4606
- package/package.json +1 -1
- package/templates/config.template.json +2 -1
- package/templates/skills/superpowers/brainstorming/SKILL.md +151 -0
- package/templates/skills/superpowers/brainstorming/scripts/frame-template.html +213 -0
- package/templates/skills/superpowers/brainstorming/scripts/helper.js +167 -0
- package/templates/skills/superpowers/brainstorming/scripts/server.cjs +723 -0
- package/templates/skills/superpowers/brainstorming/scripts/start-server.sh +209 -0
- package/templates/skills/superpowers/brainstorming/scripts/stop-server.sh +120 -0
- package/templates/skills/superpowers/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/templates/skills/superpowers/brainstorming/visual-companion.md +298 -0
- package/templates/skills/superpowers/dispatching-parallel-agents/SKILL.md +167 -0
- package/templates/skills/superpowers/executing-plans/SKILL.md +64 -0
- package/templates/skills/superpowers/finishing-a-development-branch/SKILL.md +201 -0
- package/templates/skills/superpowers/receiving-code-review/SKILL.md +205 -0
- package/templates/skills/superpowers/requesting-code-review/SKILL.md +95 -0
- package/templates/skills/superpowers/requesting-code-review/code-reviewer.md +172 -0
- package/templates/skills/superpowers/subagent-driven-development/SKILL.md +503 -0
- package/templates/skills/superpowers/subagent-driven-development/implementer-prompt.md +142 -0
- package/templates/skills/superpowers/subagent-driven-development/re-review-prompt.md +106 -0
- package/templates/skills/superpowers/subagent-driven-development/scripts/review-package +46 -0
- package/templates/skills/superpowers/subagent-driven-development/scripts/sdd-workspace +40 -0
- package/templates/skills/superpowers/subagent-driven-development/scripts/task-brief +41 -0
- package/templates/skills/superpowers/subagent-driven-development/task-reviewer-prompt.md +185 -0
- package/templates/skills/superpowers/systematic-debugging/CREATION-LOG.md +119 -0
- package/templates/skills/superpowers/systematic-debugging/SKILL.md +283 -0
- package/templates/skills/superpowers/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/templates/skills/superpowers/systematic-debugging/condition-based-waiting.md +115 -0
- package/templates/skills/superpowers/systematic-debugging/defense-in-depth.md +122 -0
- package/templates/skills/superpowers/systematic-debugging/find-polluter.sh +72 -0
- package/templates/skills/superpowers/systematic-debugging/root-cause-tracing.md +169 -0
- package/templates/skills/superpowers/systematic-debugging/test-academic.md +14 -0
- package/templates/skills/superpowers/systematic-debugging/test-pressure-1.md +58 -0
- package/templates/skills/superpowers/systematic-debugging/test-pressure-2.md +68 -0
- package/templates/skills/superpowers/systematic-debugging/test-pressure-3.md +69 -0
- package/templates/skills/superpowers/test-driven-development/SKILL.md +320 -0
- package/templates/skills/superpowers/test-driven-development/writing-good-tests.md +198 -0
- package/templates/skills/superpowers/using-git-worktrees/SKILL.md +167 -0
- package/templates/skills/superpowers/using-superpowers/SKILL.md +62 -0
- package/templates/skills/superpowers/using-superpowers/references/antigravity-tools.md +23 -0
- package/templates/skills/superpowers/using-superpowers/references/codex-tools.md +39 -0
- package/templates/skills/superpowers/using-superpowers/references/gemini-tools.md +63 -0
- package/templates/skills/superpowers/using-superpowers/references/pi-tools.md +16 -0
- package/templates/skills/superpowers/verification-before-completion/SKILL.md +120 -0
- package/templates/skills/superpowers/writing-plans/SKILL.md +168 -0
- package/templates/skills/superpowers/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/templates/skills/superpowers/writing-skills/SKILL.md +679 -0
- package/templates/skills/superpowers/writing-skills/anthropic-best-practices.md +1150 -0
- package/templates/skills/superpowers/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/templates/skills/superpowers/writing-skills/graphviz-conventions.dot +172 -0
- package/templates/skills/superpowers/writing-skills/persuasion-principles.md +187 -0
- package/templates/skills/superpowers/writing-skills/render-graphs.js +168 -0
- package/templates/skills/superpowers/writing-skills/testing-skills-with-subagents.md +384 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dispatching-parallel-agents
|
|
3
|
+
description: Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Dispatching Parallel Agents
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
You delegate tasks to specialized agents with isolated context. By precisely crafting their instructions and context, you ensure they stay focused and succeed at their task. They should never inherit your session's context or history — you construct exactly what they need. This also preserves your own context for coordination work.
|
|
11
|
+
|
|
12
|
+
When you have multiple unrelated failures (different test files, different subsystems, different bugs), investigating them sequentially wastes time. Each investigation is independent and can happen in parallel.
|
|
13
|
+
|
|
14
|
+
**Core principle:** Dispatch one agent per independent problem domain. Let them work concurrently.
|
|
15
|
+
|
|
16
|
+
## When to Use
|
|
17
|
+
|
|
18
|
+
```dot
|
|
19
|
+
digraph when_to_use {
|
|
20
|
+
"Multiple failures?" [shape=diamond];
|
|
21
|
+
"Are they independent?" [shape=diamond];
|
|
22
|
+
"Single agent investigates all" [shape=box];
|
|
23
|
+
"One agent per problem domain" [shape=box];
|
|
24
|
+
"Can they work in parallel?" [shape=diamond];
|
|
25
|
+
"Sequential agents" [shape=box];
|
|
26
|
+
"Parallel dispatch" [shape=box];
|
|
27
|
+
|
|
28
|
+
"Multiple failures?" -> "Are they independent?" [label="yes"];
|
|
29
|
+
"Are they independent?" -> "Single agent investigates all" [label="no - related"];
|
|
30
|
+
"Are they independent?" -> "Can they work in parallel?" [label="yes"];
|
|
31
|
+
"Can they work in parallel?" -> "Parallel dispatch" [label="yes"];
|
|
32
|
+
"Can they work in parallel?" -> "Sequential agents" [label="no - shared state"];
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Use when:**
|
|
37
|
+
- 3+ test files failing with different root causes
|
|
38
|
+
- Multiple subsystems broken independently
|
|
39
|
+
- Each problem can be understood without context from others
|
|
40
|
+
- No shared state between investigations
|
|
41
|
+
|
|
42
|
+
**Don't use when:**
|
|
43
|
+
- Failures are related (fix one might fix others)
|
|
44
|
+
- Need to understand full system state
|
|
45
|
+
- Agents would interfere with each other
|
|
46
|
+
|
|
47
|
+
## The Pattern
|
|
48
|
+
|
|
49
|
+
### 1. Identify Independent Domains
|
|
50
|
+
|
|
51
|
+
Group failures by what's broken:
|
|
52
|
+
- File A tests: Tool approval flow
|
|
53
|
+
- File B tests: Batch completion behavior
|
|
54
|
+
- File C tests: Abort functionality
|
|
55
|
+
|
|
56
|
+
Each domain is independent - fixing tool approval doesn't affect abort tests.
|
|
57
|
+
|
|
58
|
+
### 2. Create Focused Agent Tasks
|
|
59
|
+
|
|
60
|
+
Each agent gets:
|
|
61
|
+
- **Specific scope:** One test file or subsystem
|
|
62
|
+
- **Clear goal:** Make these tests pass
|
|
63
|
+
- **Constraints:** Don't change other code
|
|
64
|
+
- **Expected output:** Summary of what you found and fixed
|
|
65
|
+
|
|
66
|
+
### 3. Dispatch in Parallel
|
|
67
|
+
|
|
68
|
+
Issue all three subagent dispatches in the same response — they run in parallel:
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
Subagent (general-purpose): "Fix agent-tool-abort.test.ts failures"
|
|
72
|
+
Subagent (general-purpose): "Fix batch-completion-behavior.test.ts failures"
|
|
73
|
+
Subagent (general-purpose): "Fix tool-approval-race-conditions.test.ts failures"
|
|
74
|
+
# All three run concurrently.
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Multiple dispatch calls in one response = parallel execution. One per response = sequential.
|
|
78
|
+
|
|
79
|
+
### 4. Review and Integrate
|
|
80
|
+
|
|
81
|
+
When agents return:
|
|
82
|
+
- Read each summary
|
|
83
|
+
- Verify fixes don't conflict
|
|
84
|
+
- Run full test suite
|
|
85
|
+
- Integrate all changes
|
|
86
|
+
|
|
87
|
+
## Agent Prompt Structure
|
|
88
|
+
|
|
89
|
+
Good agent prompts are:
|
|
90
|
+
1. **Focused** - One clear problem domain
|
|
91
|
+
2. **Self-contained** - All context needed to understand the problem
|
|
92
|
+
3. **Specific about output** - What should the agent return?
|
|
93
|
+
|
|
94
|
+
```markdown
|
|
95
|
+
Fix the 3 failing tests in src/agents/agent-tool-abort.test.ts:
|
|
96
|
+
|
|
97
|
+
1. "should abort tool with partial output capture" - expects 'interrupted at' in message
|
|
98
|
+
2. "should handle mixed completed and aborted tools" - fast tool aborted instead of completed
|
|
99
|
+
3. "should properly track pendingToolCount" - expects 3 results but gets 0
|
|
100
|
+
|
|
101
|
+
These are timing/race condition issues. Your task:
|
|
102
|
+
|
|
103
|
+
1. Read the test file and understand what each test verifies
|
|
104
|
+
2. Identify root cause - timing issues or actual bugs?
|
|
105
|
+
3. Fix by:
|
|
106
|
+
- Replacing arbitrary timeouts with event-based waiting
|
|
107
|
+
- Fixing bugs in abort implementation if found
|
|
108
|
+
- Adjusting test expectations if testing changed behavior
|
|
109
|
+
|
|
110
|
+
Do NOT just increase timeouts - find the real issue.
|
|
111
|
+
|
|
112
|
+
Return: Summary of what you found and what you fixed.
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Common Mistakes
|
|
116
|
+
|
|
117
|
+
**❌ Too broad:** "Fix all the tests" - agent gets lost
|
|
118
|
+
**✅ Specific:** "Fix agent-tool-abort.test.ts" - focused scope
|
|
119
|
+
|
|
120
|
+
**❌ No context:** "Fix the race condition" - agent doesn't know where
|
|
121
|
+
**✅ Context:** Paste the error messages and test names
|
|
122
|
+
|
|
123
|
+
**❌ No constraints:** Agent might refactor everything
|
|
124
|
+
**✅ Constraints:** "Do NOT change production code" or "Fix tests only"
|
|
125
|
+
|
|
126
|
+
**❌ Vague output:** "Fix it" - you don't know what changed
|
|
127
|
+
**✅ Specific:** "Return summary of root cause and changes"
|
|
128
|
+
|
|
129
|
+
## When NOT to Use
|
|
130
|
+
|
|
131
|
+
**Related failures:** Fixing one might fix others - investigate together first
|
|
132
|
+
**Need full context:** Understanding requires seeing entire system
|
|
133
|
+
**Exploratory debugging:** You don't know what's broken yet
|
|
134
|
+
**Shared state:** Agents would interfere (editing same files, using same resources)
|
|
135
|
+
|
|
136
|
+
## Real Example from Session
|
|
137
|
+
|
|
138
|
+
**Scenario:** 6 test failures across 3 files after major refactoring
|
|
139
|
+
|
|
140
|
+
**Failures:**
|
|
141
|
+
- agent-tool-abort.test.ts: 3 failures (timing issues)
|
|
142
|
+
- batch-completion-behavior.test.ts: 2 failures (tools not executing)
|
|
143
|
+
- tool-approval-race-conditions.test.ts: 1 failure (execution count = 0)
|
|
144
|
+
|
|
145
|
+
**Decision:** Independent domains - abort logic separate from batch completion separate from race conditions
|
|
146
|
+
|
|
147
|
+
**Dispatch:**
|
|
148
|
+
```
|
|
149
|
+
Agent 1 → Fix agent-tool-abort.test.ts
|
|
150
|
+
Agent 2 → Fix batch-completion-behavior.test.ts
|
|
151
|
+
Agent 3 → Fix tool-approval-race-conditions.test.ts
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Results:**
|
|
155
|
+
- Agent 1: Replaced timeouts with event-based waiting
|
|
156
|
+
- Agent 2: Fixed event structure bug (threadId in wrong place)
|
|
157
|
+
- Agent 3: Added wait for async tool execution to complete
|
|
158
|
+
|
|
159
|
+
**Integration:** All fixes independent, no conflicts, full suite green
|
|
160
|
+
|
|
161
|
+
## Verification
|
|
162
|
+
|
|
163
|
+
After agents return:
|
|
164
|
+
1. **Review each summary** - Understand what changed
|
|
165
|
+
2. **Check for conflicts** - Did agents edit same code?
|
|
166
|
+
3. **Run full suite** - Verify all fixes work together
|
|
167
|
+
4. **Spot check** - Agents can make systematic errors
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: executing-plans
|
|
3
|
+
description: Use when you have a written implementation plan to execute in a separate session with review checkpoints
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Executing Plans
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Load plan, review critically, execute all tasks, report when complete.
|
|
11
|
+
|
|
12
|
+
**Announce at start:** "I'm using the executing-plans skill to implement this plan."
|
|
13
|
+
|
|
14
|
+
**Note:** Tell your human partner that Superpowers works much better with access to subagents (Claude Code, Codex CLI, Codex App, Copilot CLI, and Gemini CLI all qualify; see the per-platform tool refs in `../using-superpowers/references/`). If subagents are available, use superpowers:subagent-driven-development instead of this skill.
|
|
15
|
+
|
|
16
|
+
## The Process
|
|
17
|
+
|
|
18
|
+
### Step 1: Load and Review Plan
|
|
19
|
+
1. Ensure an isolated workspace: use superpowers:using-git-worktrees to create one or verify the existing one
|
|
20
|
+
2. Read plan file
|
|
21
|
+
3. Review critically - identify any questions or concerns about the plan
|
|
22
|
+
4. If concerns: Raise them with your human partner before starting
|
|
23
|
+
5. If no concerns: Create todos for the plan items and proceed
|
|
24
|
+
|
|
25
|
+
### Step 2: Execute Tasks
|
|
26
|
+
|
|
27
|
+
For each task:
|
|
28
|
+
1. Mark as in_progress
|
|
29
|
+
2. Follow each step exactly (plan has bite-sized steps)
|
|
30
|
+
3. Run verifications as specified
|
|
31
|
+
4. Mark as completed
|
|
32
|
+
|
|
33
|
+
### Step 3: Complete Development
|
|
34
|
+
|
|
35
|
+
After all tasks complete and verified:
|
|
36
|
+
- Announce: "I'm using the finishing-a-development-branch skill to complete this work."
|
|
37
|
+
- **REQUIRED SUB-SKILL:** Use superpowers:finishing-a-development-branch
|
|
38
|
+
- Follow that skill to verify tests, present options, execute choice
|
|
39
|
+
|
|
40
|
+
## When to Stop and Ask for Help
|
|
41
|
+
|
|
42
|
+
**STOP executing immediately when:**
|
|
43
|
+
- Hit a blocker (missing dependency, test fails, instruction unclear)
|
|
44
|
+
- Plan has critical gaps preventing starting
|
|
45
|
+
- You don't understand an instruction
|
|
46
|
+
- Verification fails repeatedly
|
|
47
|
+
|
|
48
|
+
**Ask for clarification rather than guessing.**
|
|
49
|
+
|
|
50
|
+
## When to Revisit Earlier Steps
|
|
51
|
+
|
|
52
|
+
**Return to Review (Step 1) when:**
|
|
53
|
+
- Partner updates the plan based on your feedback
|
|
54
|
+
- Fundamental approach needs rethinking
|
|
55
|
+
|
|
56
|
+
**Don't force through blockers** - stop and ask.
|
|
57
|
+
|
|
58
|
+
## Remember
|
|
59
|
+
- Review plan critically first
|
|
60
|
+
- Follow plan steps exactly
|
|
61
|
+
- Don't skip verifications
|
|
62
|
+
- Reference skills when plan says to
|
|
63
|
+
- Stop when blocked, don't guess
|
|
64
|
+
- Never start implementation on main/master branch without explicit user consent
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: finishing-a-development-branch
|
|
3
|
+
description: Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Finishing a Development Branch
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
**Core principle:** Verify tests → Detect environment → Present options → Execute choice → Clean up.
|
|
11
|
+
|
|
12
|
+
**Announce at start:** "I'm using the finishing-a-development-branch skill to complete this work."
|
|
13
|
+
|
|
14
|
+
## Step 1: Verify Tests
|
|
15
|
+
|
|
16
|
+
Run the project's full test suite (`npm test` / `cargo test` / `pytest` / `go test ./...`).
|
|
17
|
+
|
|
18
|
+
**If tests fail**, report the failures and stop — the menu comes after a green suite:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
Tests failing (<N> failures). Must fix before completing:
|
|
22
|
+
|
|
23
|
+
[Show failures]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**If tests pass:** continue to Step 2.
|
|
27
|
+
|
|
28
|
+
## Step 2: Detect Environment
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
|
|
32
|
+
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
|
|
33
|
+
# Capture now, while still inside the workspace — Step 5 changes directory
|
|
34
|
+
# before cleanup (Step 6) needs this value
|
|
35
|
+
WORKTREE_PATH=$(git rev-parse --show-toplevel)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
This determines which menu to show and how cleanup works:
|
|
39
|
+
|
|
40
|
+
| State | Menu | Cleanup |
|
|
41
|
+
|-------|------|---------|
|
|
42
|
+
| `GIT_DIR == GIT_COMMON` (normal repo) | Standard 3 options | No worktree to clean up |
|
|
43
|
+
| `GIT_DIR != GIT_COMMON`, named branch | Standard 3 options | Provenance-based (see Step 6) |
|
|
44
|
+
| `GIT_DIR != GIT_COMMON`, detached HEAD | Reduced 2 options (no merge) | Externally managed — leave in place |
|
|
45
|
+
|
|
46
|
+
## Step 3: Determine Base Branch
|
|
47
|
+
|
|
48
|
+
The base branch is whatever this work forked from — usually named in the
|
|
49
|
+
plan, the conversation, or the branch's upstream. If it is not already
|
|
50
|
+
known, ask: "This branch split from <your best guess> - is that correct?"
|
|
51
|
+
Confirm before merging: merging into the wrong base is expensive to undo.
|
|
52
|
+
|
|
53
|
+
## Step 4: Present Options
|
|
54
|
+
|
|
55
|
+
**Normal repo and named-branch worktree — present exactly these 3 options:**
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
Implementation complete. What would you like to do?
|
|
59
|
+
|
|
60
|
+
1. Merge back to <base-branch> locally
|
|
61
|
+
2. Push and create a Pull Request
|
|
62
|
+
3. Keep the branch as-is (I'll handle it later)
|
|
63
|
+
|
|
64
|
+
Which option?
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Detached HEAD — present exactly these 2 options:**
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
Implementation complete. You're on a detached HEAD (externally managed workspace).
|
|
71
|
+
|
|
72
|
+
1. Push as new branch and create a Pull Request
|
|
73
|
+
2. Keep as-is (I'll handle it later)
|
|
74
|
+
|
|
75
|
+
Which option?
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Present the menu exactly as written — concise, with every option coming
|
|
79
|
+
from the list above. Discarding the work happens only in response to your
|
|
80
|
+
human partner explicitly asking for it (see "If your human partner asks to
|
|
81
|
+
discard the work" below). Wait for their answer; the integration decision
|
|
82
|
+
is theirs.
|
|
83
|
+
|
|
84
|
+
## Step 5: Execute Choice
|
|
85
|
+
|
|
86
|
+
### Option 1: Merge Locally
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Get main repo root for CWD safety
|
|
90
|
+
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
|
|
91
|
+
cd "$MAIN_ROOT"
|
|
92
|
+
|
|
93
|
+
# Merge first — verify success before removing anything
|
|
94
|
+
git checkout <base-branch>
|
|
95
|
+
git pull
|
|
96
|
+
git merge <feature-branch>
|
|
97
|
+
|
|
98
|
+
# Verify tests on merged result
|
|
99
|
+
<test command>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
If tests fail on the merged result: stop, leave the worktree and branch in
|
|
103
|
+
place, and investigate — nothing has been pushed, so the merge is local
|
|
104
|
+
and recoverable.
|
|
105
|
+
|
|
106
|
+
Once the merged result is green: clean up the worktree (Step 6), then
|
|
107
|
+
delete the branch:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
git branch -d <feature-branch>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Option 2: Push and Create PR
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
git push -u origin <feature-branch>
|
|
117
|
+
# From a detached HEAD, name the new branch on the remote:
|
|
118
|
+
# git push origin HEAD:refs/heads/<new-branch>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Then create the pull/merge request against <base-branch> with the forge's
|
|
122
|
+
tooling — its CLI if one is available, or the creation URL most forges
|
|
123
|
+
print when you push — following the repo's PR template and conventions if
|
|
124
|
+
present, and report the URL to your human partner.
|
|
125
|
+
|
|
126
|
+
Keep the worktree — your human partner iterates on PR feedback there.
|
|
127
|
+
|
|
128
|
+
### Option 3: Keep As-Is
|
|
129
|
+
|
|
130
|
+
Report: "Keeping branch <name>. Worktree preserved at <path>."
|
|
131
|
+
|
|
132
|
+
### If your human partner asks to discard the work
|
|
133
|
+
|
|
134
|
+
This path exists only as a response to an explicit request to throw the
|
|
135
|
+
work away. Confirm first:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
This will permanently delete:
|
|
139
|
+
- Branch <name>
|
|
140
|
+
- All commits: <commit-list>
|
|
141
|
+
- Worktree at <path>
|
|
142
|
+
|
|
143
|
+
Type 'discard' to confirm.
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Wait for that exact confirmation. When it arrives:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
|
|
150
|
+
cd "$MAIN_ROOT"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Then clean up the worktree (Step 6) and force-delete the branch:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
git branch -D <feature-branch>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Step 6: Cleanup Workspace
|
|
160
|
+
|
|
161
|
+
**Runs for Option 1 and confirmed discards.** Options 2 and 3 always
|
|
162
|
+
preserve the worktree. Both callers have already changed directory to the
|
|
163
|
+
main repo root — worktree removal must run from outside the worktree —
|
|
164
|
+
and use the `GIT_DIR`/`GIT_COMMON`/`WORKTREE_PATH` values captured in
|
|
165
|
+
Step 2, from before that directory change.
|
|
166
|
+
|
|
167
|
+
**If `GIT_DIR == GIT_COMMON`:** Normal repo, no worktree to clean up. Done.
|
|
168
|
+
|
|
169
|
+
**If `WORKTREE_PATH` is under `.worktrees/` or `worktrees/`:** Superpowers
|
|
170
|
+
created this worktree — we own cleanup:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
git worktree remove "$WORKTREE_PATH"
|
|
174
|
+
git worktree prune # Self-healing: clean up any stale registrations
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Otherwise:** The host environment owns this workspace — leave it in
|
|
178
|
+
place. If your platform provides a workspace-exit tool, use it.
|
|
179
|
+
|
|
180
|
+
## Quick Reference
|
|
181
|
+
|
|
182
|
+
| Option | Merge | Push | Keep Worktree | Cleanup Branch |
|
|
183
|
+
|--------|-------|------|---------------|----------------|
|
|
184
|
+
| 1. Merge locally | yes | - | - | yes |
|
|
185
|
+
| 2. Create PR | - | yes | yes | - |
|
|
186
|
+
| 3. Keep as-is | - | - | yes | - |
|
|
187
|
+
| Discard (explicit request only) | - | - | - | yes (force) |
|
|
188
|
+
|
|
189
|
+
## Common Rationalizations
|
|
190
|
+
|
|
191
|
+
| Excuse | Reality |
|
|
192
|
+
|--------|---------|
|
|
193
|
+
| "Tests passed earlier this session" | Run the suite on the tree you are about to integrate. A green run only proves the tree it ran on. |
|
|
194
|
+
| "They obviously want it merged" | Integration is your human partner's decision. Present the menu and wait. |
|
|
195
|
+
| "They seem done with this feature — I'll offer to discard it" | The menu is complete as written. Discard happens only when your human partner asks for it in so many words. |
|
|
196
|
+
| "'Yeah, get rid of it' counts as confirmation" | Only the typed word `discard` authorizes deletion. |
|
|
197
|
+
| "The PR is up, so the worktree is clutter now" | PR feedback gets fixed in that worktree. It stays until the work lands. |
|
|
198
|
+
| "This other worktree looks stale — I'll clean it too" | Clean up only worktrees under `.worktrees/` or `worktrees/`. Everything else belongs to the host. |
|
|
199
|
+
| "The merged-result failure is probably flaky" | A failing merged result stops everything. Branch and worktree stay put while you investigate. |
|
|
200
|
+
| "The base branch is obviously main" | Confirm the fork point or ask. Merging into the wrong base is expensive to undo. |
|
|
201
|
+
| "The push was rejected — force-push will fix it" | A rejected push means the remote moved. Investigate; force-push only on your human partner's explicit request. |
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: receiving-code-review
|
|
3
|
+
description: Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review Reception
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Code review requires technical evaluation, not emotional performance.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Verify before implementing. Ask before assuming. Technical correctness over social comfort.
|
|
13
|
+
|
|
14
|
+
## The Response Pattern
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
WHEN receiving code review feedback:
|
|
18
|
+
|
|
19
|
+
1. READ: Complete feedback without reacting
|
|
20
|
+
2. UNDERSTAND: Restate requirement in own words (or ask)
|
|
21
|
+
3. VERIFY: Check against codebase reality
|
|
22
|
+
4. EVALUATE: Technically sound for THIS codebase?
|
|
23
|
+
5. RESPOND: Technical acknowledgment or reasoned pushback
|
|
24
|
+
6. IMPLEMENT: One item at a time, test each
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Forbidden Responses
|
|
28
|
+
|
|
29
|
+
**NEVER:**
|
|
30
|
+
- "You're absolutely right!" (explicit instruction-file violation)
|
|
31
|
+
- "Great point!" / "Excellent feedback!" (performative)
|
|
32
|
+
- "Let me implement that now" (before verification)
|
|
33
|
+
|
|
34
|
+
**INSTEAD:**
|
|
35
|
+
- Restate the technical requirement
|
|
36
|
+
- Ask clarifying questions
|
|
37
|
+
- Push back with technical reasoning if wrong
|
|
38
|
+
- Just start working (actions > words)
|
|
39
|
+
|
|
40
|
+
## Handling Unclear Feedback
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
IF any item is unclear:
|
|
44
|
+
STOP - do not implement anything yet
|
|
45
|
+
ASK for clarification on unclear items
|
|
46
|
+
|
|
47
|
+
WHY: Items may be related. Partial understanding = wrong implementation.
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Example:**
|
|
51
|
+
```
|
|
52
|
+
your human partner: "Fix 1-6"
|
|
53
|
+
You understand 1,2,3,6. Unclear on 4,5.
|
|
54
|
+
|
|
55
|
+
❌ WRONG: Implement 1,2,3,6 now, ask about 4,5 later
|
|
56
|
+
✅ RIGHT: "I understand items 1,2,3,6. Need clarification on 4 and 5 before proceeding."
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Source-Specific Handling
|
|
60
|
+
|
|
61
|
+
### From your human partner
|
|
62
|
+
- **Trusted** - implement after understanding
|
|
63
|
+
- **Still ask** if scope unclear
|
|
64
|
+
- **No performative agreement**
|
|
65
|
+
- **Skip to action** or technical acknowledgment
|
|
66
|
+
|
|
67
|
+
### From External Reviewers
|
|
68
|
+
```
|
|
69
|
+
BEFORE implementing:
|
|
70
|
+
1. Check: Technically correct for THIS codebase?
|
|
71
|
+
2. Check: Breaks existing functionality?
|
|
72
|
+
3. Check: Reason for current implementation?
|
|
73
|
+
4. Check: Works on all platforms/versions?
|
|
74
|
+
5. Check: Does reviewer understand full context?
|
|
75
|
+
|
|
76
|
+
IF suggestion seems wrong:
|
|
77
|
+
Push back with technical reasoning
|
|
78
|
+
|
|
79
|
+
IF can't easily verify:
|
|
80
|
+
Say so: "I can't verify this without [X]. Should I [investigate/ask/proceed]?"
|
|
81
|
+
|
|
82
|
+
IF conflicts with your human partner's prior decisions:
|
|
83
|
+
Stop and discuss with your human partner first
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**your human partner's rule:** "External feedback - be skeptical, but check carefully"
|
|
87
|
+
|
|
88
|
+
## YAGNI Check for "Professional" Features
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
IF reviewer suggests "implementing properly":
|
|
92
|
+
grep codebase for actual usage
|
|
93
|
+
|
|
94
|
+
IF unused: "This endpoint isn't called. Remove it (YAGNI)?"
|
|
95
|
+
IF used: Then implement properly
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**your human partner's rule:** "You and reviewer both report to me. If we don't need this feature, don't add it."
|
|
99
|
+
|
|
100
|
+
## Implementation Order
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
FOR multi-item feedback:
|
|
104
|
+
1. Clarify anything unclear FIRST
|
|
105
|
+
2. Then implement in this order:
|
|
106
|
+
- Blocking issues (breaks, security)
|
|
107
|
+
- Simple fixes (typos, imports)
|
|
108
|
+
- Complex fixes (refactoring, logic)
|
|
109
|
+
3. Test each fix individually
|
|
110
|
+
4. Verify no regressions
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## When To Push Back
|
|
114
|
+
|
|
115
|
+
Push back when:
|
|
116
|
+
- Suggestion breaks existing functionality
|
|
117
|
+
- Reviewer lacks full context
|
|
118
|
+
- Violates YAGNI (unused feature)
|
|
119
|
+
- Technically incorrect for this stack
|
|
120
|
+
- Legacy/compatibility reasons exist
|
|
121
|
+
- Conflicts with your human partner's architectural decisions
|
|
122
|
+
|
|
123
|
+
**How to push back:**
|
|
124
|
+
- Use technical reasoning, not defensiveness
|
|
125
|
+
- Ask specific questions
|
|
126
|
+
- Reference working tests/code
|
|
127
|
+
- Involve your human partner if architectural
|
|
128
|
+
|
|
129
|
+
**If you're uncomfortable pushing back out loud:** Name that tension, then tell your partner about the issue you've seen. They'll appreciate your honesty.
|
|
130
|
+
|
|
131
|
+
## Acknowledging Correct Feedback
|
|
132
|
+
|
|
133
|
+
When feedback IS correct:
|
|
134
|
+
```
|
|
135
|
+
✅ "Fixed. [Brief description of what changed]"
|
|
136
|
+
✅ "Good catch - [specific issue]. Fixed in [location]."
|
|
137
|
+
✅ [Just fix it and show in the code]
|
|
138
|
+
|
|
139
|
+
❌ "You're absolutely right!"
|
|
140
|
+
❌ "Great point!"
|
|
141
|
+
❌ "Thanks for catching that!"
|
|
142
|
+
❌ "Thanks for [anything]"
|
|
143
|
+
❌ ANY gratitude expression
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Why no thanks:** Actions speak. Just fix it. The code itself shows you heard the feedback.
|
|
147
|
+
|
|
148
|
+
**If you catch yourself about to write "Thanks":** DELETE IT. State the fix instead.
|
|
149
|
+
|
|
150
|
+
## Gracefully Correcting Your Pushback
|
|
151
|
+
|
|
152
|
+
If you pushed back and were wrong:
|
|
153
|
+
```
|
|
154
|
+
✅ "You were right - I checked [X] and it does [Y]. Implementing now."
|
|
155
|
+
✅ "Verified this and you're correct. My initial understanding was wrong because [reason]. Fixing."
|
|
156
|
+
|
|
157
|
+
❌ Long apology
|
|
158
|
+
❌ Defending why you pushed back
|
|
159
|
+
❌ Over-explaining
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
State the correction factually and move on.
|
|
163
|
+
|
|
164
|
+
## Common Mistakes
|
|
165
|
+
|
|
166
|
+
| Mistake | Fix |
|
|
167
|
+
|---------|-----|
|
|
168
|
+
| Performative agreement | State requirement or just act |
|
|
169
|
+
| Blind implementation | Verify against codebase first |
|
|
170
|
+
| Batch without testing | One at a time, test each |
|
|
171
|
+
| Assuming reviewer is right | Check if breaks things |
|
|
172
|
+
| Avoiding pushback | Technical correctness > comfort |
|
|
173
|
+
| Partial implementation | Clarify all items first |
|
|
174
|
+
| Can't verify, proceed anyway | State limitation, ask for direction |
|
|
175
|
+
|
|
176
|
+
## Real Examples
|
|
177
|
+
|
|
178
|
+
**Performative Agreement (Bad):**
|
|
179
|
+
```
|
|
180
|
+
Reviewer: "Remove legacy code"
|
|
181
|
+
❌ "You're absolutely right! Let me remove that..."
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Technical Verification (Good):**
|
|
185
|
+
```
|
|
186
|
+
Reviewer: "Remove legacy code"
|
|
187
|
+
✅ "Checking... build target is 10.15+, this API needs 13+. Need legacy for backward compat. Current impl has wrong bundle ID - fix it or drop pre-13 support?"
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**YAGNI (Good):**
|
|
191
|
+
```
|
|
192
|
+
Reviewer: "Implement proper metrics tracking with database, date filters, CSV export"
|
|
193
|
+
✅ "Grepped codebase - nothing calls this endpoint. Remove it (YAGNI)? Or is there usage I'm missing?"
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Unclear Item (Good):**
|
|
197
|
+
```
|
|
198
|
+
your human partner: "Fix items 1-6"
|
|
199
|
+
You understand 1,2,3,6. Unclear on 4,5.
|
|
200
|
+
✅ "Understand 1,2,3,6. Need clarification on 4 and 5 before implementing."
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## GitHub Thread Replies
|
|
204
|
+
|
|
205
|
+
When replying to inline review comments on GitHub, reply in the comment thread (`gh api repos/{owner}/{repo}/pulls/{pr}/comments/{id}/replies`), not as a top-level PR comment.
|