@complexthings/superpowers-agent 8.1.0
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/.agents/docs/SUPERPOWERS.md +108 -0
- package/.agents/prompts/001-copilot-tool-mapping-do/001-copilot-tool-mapping-do.md +116 -0
- package/.agents/prompts/001-copilot-tool-mapping-do/SUMMARY.md +72 -0
- package/.agents/prompts/001-copilot-tool-mapping-do/copilot-tool-mapping-do-output.md +83 -0
- package/.agents/prompts/001-release-management-do/001-release-management-do.md +161 -0
- package/.agents/prompts/001-release-management-do/SUMMARY.md +19 -0
- package/.agents/prompts/001-release-management-do/completed/001-release-management-do.md +161 -0
- package/.agents/prompts/002-pull-command-do/SUMMARY.md +28 -0
- package/.agents/prompts/002-pull-command-do/completed/002-pull-command-do.md +122 -0
- package/.agents/prompts/002-pull-command-do/pull-command-do-output.md +174 -0
- package/.agents/prompts/command_updates_prompt.md +69 -0
- package/.agents/prompts/current_prompt.md +8 -0
- package/.agents/prompts/refactor.prompt.md +57 -0
- package/.agents/skills/.gitkeep +0 -0
- package/.agents/superpowers-agent +355 -0
- package/.agents/superpowers-bootstrap.md +42 -0
- package/.agents/templates/AGENTS.md.template +40 -0
- package/.agents/templates/SUPERPOWERS.md.template +108 -0
- package/.agents/templates/TOOLS.md.template +15 -0
- package/.github/workflows/main.yaml +32 -0
- package/AGENTS.md +60 -0
- package/LICENSE +21 -0
- package/README.md +724 -0
- package/hooks/hooks.json +15 -0
- package/hooks/session-start.sh +27 -0
- package/package.json +51 -0
- package/skills/architecture/ABOUT.md +20 -0
- package/skills/architecture/preserving-productive-tensions/SKILL.md +146 -0
- package/skills/architecture/preserving-productive-tensions/skill.json +9 -0
- package/skills/collaboration/brainstorming/SKILL.md +166 -0
- package/skills/collaboration/brainstorming/skill.json +9 -0
- package/skills/collaboration/brainstorming/spec-document-reviewer-prompt.md +50 -0
- package/skills/collaboration/brainstorming/visual-companion.md +277 -0
- package/skills/collaboration/dispatching-parallel-agents/SKILL.md +174 -0
- package/skills/collaboration/dispatching-parallel-agents/skill.json +9 -0
- package/skills/collaboration/executing-plans/SKILL.md +130 -0
- package/skills/collaboration/executing-plans/skill.json +9 -0
- package/skills/collaboration/finishing-a-development-branch/SKILL.md +261 -0
- package/skills/collaboration/finishing-a-development-branch/skill.json +9 -0
- package/skills/collaboration/leveraging-cli-tools/SKILL.md +132 -0
- package/skills/collaboration/leveraging-cli-tools/skill.json +9 -0
- package/skills/collaboration/receiving-code-review/SKILL.md +233 -0
- package/skills/collaboration/receiving-code-review/skill.json +9 -0
- package/skills/collaboration/requesting-code-review/SKILL.md +110 -0
- package/skills/collaboration/requesting-code-review/code-reviewer.md +146 -0
- package/skills/collaboration/requesting-code-review/skill.json +12 -0
- package/skills/collaboration/subagent-driven-development/SKILL.md +255 -0
- package/skills/collaboration/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
- package/skills/collaboration/subagent-driven-development/implementer-prompt.md +113 -0
- package/skills/collaboration/subagent-driven-development/skill.json +15 -0
- package/skills/collaboration/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/skills/collaboration/using-git-worktrees/SKILL.md +366 -0
- package/skills/collaboration/using-git-worktrees/skill.json +9 -0
- package/skills/collaboration/writing-plans/SKILL.md +121 -0
- package/skills/collaboration/writing-plans/plan-document-reviewer-prompt.md +52 -0
- package/skills/collaboration/writing-plans/skill.json +9 -0
- package/skills/debugging/defense-in-depth/SKILL.md +380 -0
- package/skills/debugging/defense-in-depth/skill.json +9 -0
- package/skills/debugging/root-cause-tracing/SKILL.md +361 -0
- package/skills/debugging/root-cause-tracing/find-polluter.sh +63 -0
- package/skills/debugging/root-cause-tracing/skill.json +12 -0
- package/skills/debugging/systematic-debugging/SKILL.md +299 -0
- package/skills/debugging/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/skills/debugging/systematic-debugging/condition-based-waiting.md +115 -0
- package/skills/debugging/systematic-debugging/defense-in-depth.md +122 -0
- package/skills/debugging/systematic-debugging/find-polluter.sh +63 -0
- package/skills/debugging/systematic-debugging/root-cause-tracing.md +169 -0
- package/skills/debugging/systematic-debugging/skill.json +9 -0
- package/skills/debugging/systematic-debugging/test-academic.md +14 -0
- package/skills/debugging/systematic-debugging/test-pressure-1.md +58 -0
- package/skills/debugging/systematic-debugging/test-pressure-2.md +68 -0
- package/skills/debugging/systematic-debugging/test-pressure-3.md +69 -0
- package/skills/debugging/verification-before-completion/SKILL.md +143 -0
- package/skills/debugging/verification-before-completion/skill.json +9 -0
- package/skills/finding-skills/SKILL.md +101 -0
- package/skills/finding-skills/skill.json +8 -0
- package/skills/meta/create-skill-json/SKILL.md +370 -0
- package/skills/meta/create-skill-json/skill.json +9 -0
- package/skills/meta/create-skill-json/test-scenarios.md +29 -0
- package/skills/meta/creating-prompts/SKILL.md +349 -0
- package/skills/meta/creating-prompts/examples/do-example.md +65 -0
- package/skills/meta/creating-prompts/examples/plan-example.md +75 -0
- package/skills/meta/creating-prompts/examples/refine-example.md +65 -0
- package/skills/meta/creating-prompts/examples/research-example.md +63 -0
- package/skills/meta/creating-prompts/scripts/get-next-number.sh +27 -0
- package/skills/meta/creating-prompts/skill.json +20 -0
- package/skills/meta/creating-prompts/templates/do-template.md +59 -0
- package/skills/meta/creating-prompts/templates/plan-template.md +58 -0
- package/skills/meta/creating-prompts/templates/refine-template.md +54 -0
- package/skills/meta/creating-prompts/templates/research-template.md +56 -0
- package/skills/meta/using-superpowers/SKILL.md +122 -0
- package/skills/meta/using-superpowers/skill.json +5 -0
- package/skills/meta/writing-prompts/SKILL.md +345 -0
- package/skills/meta/writing-prompts/skill.json +9 -0
- package/skills/problem-solving/ABOUT.md +40 -0
- package/skills/problem-solving/collision-zone-thinking/SKILL.md +188 -0
- package/skills/problem-solving/collision-zone-thinking/references/historical-examples.md +393 -0
- package/skills/problem-solving/collision-zone-thinking/skill.json +9 -0
- package/skills/problem-solving/inversion-exercise/SKILL.md +174 -0
- package/skills/problem-solving/inversion-exercise/skill.json +9 -0
- package/skills/problem-solving/meta-pattern-recognition/SKILL.md +116 -0
- package/skills/problem-solving/meta-pattern-recognition/skill.json +9 -0
- package/skills/problem-solving/scale-game/SKILL.md +222 -0
- package/skills/problem-solving/scale-game/skill.json +9 -0
- package/skills/problem-solving/simplification-cascades/SKILL.md +113 -0
- package/skills/problem-solving/simplification-cascades/skill.json +9 -0
- package/skills/problem-solving/when-stuck/SKILL.md +69 -0
- package/skills/problem-solving/when-stuck/skill.json +9 -0
- package/skills/research/ABOUT.md +20 -0
- package/skills/research/tracing-knowledge-lineages/SKILL.md +241 -0
- package/skills/research/tracing-knowledge-lineages/skill.json +9 -0
- package/skills/setup-skills/SKILL.md +47 -0
- package/skills/testing/condition-based-waiting/SKILL.md +359 -0
- package/skills/testing/condition-based-waiting/example.ts +158 -0
- package/skills/testing/condition-based-waiting/skill.json +12 -0
- package/skills/testing/test-driven-development/SKILL.md +434 -0
- package/skills/testing/test-driven-development/skill.json +9 -0
- package/skills/testing/testing-anti-patterns/SKILL.md +298 -0
- package/skills/testing/testing-anti-patterns/skill.json +9 -0
- package/skills/testing/verification-before-completion/SKILL.md +246 -0
- package/skills/testing/verification-before-completion/skill.json +10 -0
- package/skills/using-a-skill/SKILL.md +101 -0
- package/skills/using-a-skill/skill.json +8 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: finishing-a-development-branch
|
|
3
|
+
description: Use when implementation is complete and you need to decide how to integrate the work — guides completion of development work by running pre-merge checks, presenting structured options for merge, PR, or cleanup, and handling the chosen workflow including branch and worktree cleanup. Invoke this skill whenever a user says "I'm done", "implementation complete", "wrap up", "finish this branch", "create a PR", "merge to main", or "what do I do now that I'm done coding".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Finishing a Development Branch
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Guide completion of development work by running pre-merge checks, presenting clear options, and handling the chosen workflow.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Verify → Present options → Execute choice → Clean up.
|
|
13
|
+
|
|
14
|
+
**Announce at start:** "I'm using the finishing-a-development-branch skill to complete this work."
|
|
15
|
+
|
|
16
|
+
## The Process
|
|
17
|
+
|
|
18
|
+
### Step 1: Pre-Flight Checks
|
|
19
|
+
|
|
20
|
+
Before presenting options, run these checks in order. Stop and report on any failure.
|
|
21
|
+
|
|
22
|
+
#### 1a. Clean working tree
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
git status --short
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If there are uncommitted changes, ask: "There are uncommitted changes. Should I commit them, stash them, or discard them before proceeding?"
|
|
29
|
+
|
|
30
|
+
Wait for answer before continuing.
|
|
31
|
+
|
|
32
|
+
#### 1b. Run tests
|
|
33
|
+
|
|
34
|
+
Discover the test command by checking `package.json`, `Makefile`, `pyproject.toml`, `.github/workflows/`, or the project's README. Common commands:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm test # Node.js
|
|
38
|
+
cargo test # Rust
|
|
39
|
+
pytest # Python
|
|
40
|
+
go test ./... # Go
|
|
41
|
+
./gradlew test # Gradle
|
|
42
|
+
bundle exec rspec # Ruby
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**If tests fail:**
|
|
46
|
+
```
|
|
47
|
+
Tests failing (<N> failures). Must fix before completing:
|
|
48
|
+
|
|
49
|
+
[Show failures]
|
|
50
|
+
|
|
51
|
+
Cannot proceed with merge/PR until tests pass.
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Stop. Don't proceed to Step 2.
|
|
55
|
+
|
|
56
|
+
**If tests pass:** Continue to Step 2.
|
|
57
|
+
|
|
58
|
+
#### 1c. Check if branch is up-to-date
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
git fetch origin
|
|
62
|
+
git rev-list --count HEAD..origin/<base-branch> 2>/dev/null
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
If the count is greater than 0, inform the user:
|
|
66
|
+
```
|
|
67
|
+
The base branch has <N> new commit(s) that aren't in this branch.
|
|
68
|
+
Rebasing before merging will avoid hidden conflicts and keep history clean.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
This is advisory, not blocking — proceed to Step 2 regardless.
|
|
72
|
+
|
|
73
|
+
### Step 2: Determine Base Branch
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Check what branch this was created from
|
|
77
|
+
git log --oneline HEAD ^main ^master 2>/dev/null | tail -1
|
|
78
|
+
# Or check the most recent common ancestor
|
|
79
|
+
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
If ambiguous, ask: "What branch should I merge/PR into? (main, master, develop, etc.)"
|
|
83
|
+
|
|
84
|
+
### Step 3: Present Options
|
|
85
|
+
|
|
86
|
+
Present exactly these 4 options:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
Implementation complete. What would you like to do?
|
|
90
|
+
|
|
91
|
+
1. Merge back to <base-branch> locally
|
|
92
|
+
2. Push and create a Pull Request
|
|
93
|
+
3. Keep the branch as-is (I'll handle it later)
|
|
94
|
+
4. Discard this work
|
|
95
|
+
|
|
96
|
+
Which option?
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Keep options concise — don't add explanation unless asked.
|
|
100
|
+
|
|
101
|
+
### Step 4: Execute Choice
|
|
102
|
+
|
|
103
|
+
#### Option 1: Merge Locally
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Switch to base branch and update
|
|
107
|
+
git switch <base-branch>
|
|
108
|
+
git pull --ff-only
|
|
109
|
+
|
|
110
|
+
# Merge feature branch (use --no-ff to preserve branch history, or --squash for clean log)
|
|
111
|
+
git merge <feature-branch>
|
|
112
|
+
|
|
113
|
+
# Verify tests still pass on merged result
|
|
114
|
+
<test command>
|
|
115
|
+
|
|
116
|
+
# If tests pass: delete feature branch and prune stale refs
|
|
117
|
+
git branch -d <feature-branch>
|
|
118
|
+
git fetch --prune
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Then: Cleanup worktree (Step 5)
|
|
122
|
+
|
|
123
|
+
#### Option 2: Push and Create PR
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Push branch to remote
|
|
127
|
+
git push -u origin <feature-branch>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Create PR with a meaningful description — fill in every section based on what was actually implemented:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
gh pr create --title "<concise title describing the change>" --body "$(cat <<'EOF'
|
|
134
|
+
## Summary
|
|
135
|
+
- <what changed, bullet 1>
|
|
136
|
+
- <why it exists, bullet 2>
|
|
137
|
+
|
|
138
|
+
## Motivation
|
|
139
|
+
<Why does this exist? Link related issues if applicable.>
|
|
140
|
+
Closes #NNN
|
|
141
|
+
|
|
142
|
+
## Testing
|
|
143
|
+
<How was this verified? What edge cases were exercised?>
|
|
144
|
+
|
|
145
|
+
## Reviewer Notes
|
|
146
|
+
<What feedback do you want? Any design decisions to discuss?>
|
|
147
|
+
EOF
|
|
148
|
+
)"
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Good PR titles are imperative and specific: `"Add retry logic to payment processor"` not `"fix stuff"`.
|
|
152
|
+
After creating the PR, share the URL with the user.
|
|
153
|
+
|
|
154
|
+
Then: Cleanup worktree (Step 5)
|
|
155
|
+
|
|
156
|
+
#### Option 3: Keep As-Is
|
|
157
|
+
|
|
158
|
+
Report: "Keeping branch `<name>`. Worktree preserved at `<path>`."
|
|
159
|
+
|
|
160
|
+
**Don't cleanup worktree.**
|
|
161
|
+
|
|
162
|
+
#### Option 4: Discard
|
|
163
|
+
|
|
164
|
+
**Confirm first:**
|
|
165
|
+
```
|
|
166
|
+
This will permanently delete:
|
|
167
|
+
- Branch <name>
|
|
168
|
+
- All commits: <commit-list>
|
|
169
|
+
- Worktree at <path> (if applicable)
|
|
170
|
+
|
|
171
|
+
Type 'discard' to confirm.
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Wait for exact typed confirmation.
|
|
175
|
+
|
|
176
|
+
If confirmed:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
git switch <base-branch>
|
|
180
|
+
git branch -D <feature-branch>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Then: Cleanup worktree (Step 5)
|
|
184
|
+
|
|
185
|
+
### Step 5: Cleanup Worktree
|
|
186
|
+
|
|
187
|
+
First check whether this work is in a worktree or the main working directory:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
git worktree list | grep "$(git branch --show-current)"
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**If in a worktree (Options 1, 2, 4):**
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
git worktree remove <worktree-path>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**If not in a worktree:** No worktree cleanup needed — the work is in the main repo directory.
|
|
200
|
+
|
|
201
|
+
**For Option 3:** Keep worktree regardless.
|
|
202
|
+
|
|
203
|
+
## Quick Reference
|
|
204
|
+
|
|
205
|
+
| Option | Merge | Push | Keep Worktree | Cleanup Branch |
|
|
206
|
+
|--------|-------|------|---------------|----------------|
|
|
207
|
+
| 1. Merge locally | ✓ | - | - | ✓ (+ prune) |
|
|
208
|
+
| 2. Create PR | - | ✓ | - | - |
|
|
209
|
+
| 3. Keep as-is | - | - | ✓ | - |
|
|
210
|
+
| 4. Discard | - | - | - | ✓ (force) |
|
|
211
|
+
|
|
212
|
+
## Common Mistakes
|
|
213
|
+
|
|
214
|
+
**Skipping test verification**
|
|
215
|
+
- Problem: Merge broken code, create a failing PR
|
|
216
|
+
- Fix: Always verify tests before offering options
|
|
217
|
+
|
|
218
|
+
**Skipping the clean working tree check**
|
|
219
|
+
- Problem: Uncommitted work gets lost or included unexpectedly
|
|
220
|
+
- Fix: `git status --short` first; resolve before proceeding
|
|
221
|
+
|
|
222
|
+
**Not updating before merge**
|
|
223
|
+
- Problem: Stale conflicts hide bugs introduced at merge time
|
|
224
|
+
- Fix: Advisory check in Step 1c; encourage rebasing when base has moved
|
|
225
|
+
|
|
226
|
+
**Open-ended questions**
|
|
227
|
+
- Problem: "What should I do next?" leads to ambiguous answers
|
|
228
|
+
- Fix: Present exactly 4 structured options
|
|
229
|
+
|
|
230
|
+
**Not pruning remote-tracking refs**
|
|
231
|
+
- Problem: Stale refs in `git branch -r` cause confusion about what exists
|
|
232
|
+
- Fix: `git fetch --prune` after Option 1 merge
|
|
233
|
+
|
|
234
|
+
**No confirmation for discard**
|
|
235
|
+
- Problem: Accidentally deletes work
|
|
236
|
+
- Fix: Require typed "discard" confirmation
|
|
237
|
+
|
|
238
|
+
## Red Flags
|
|
239
|
+
|
|
240
|
+
**Never:**
|
|
241
|
+
- Proceed with uncommitted changes without user direction
|
|
242
|
+
- Proceed with failing tests
|
|
243
|
+
- Merge without verifying tests on the merged result
|
|
244
|
+
- Delete work without confirmation
|
|
245
|
+
- Force-push without explicit user request
|
|
246
|
+
|
|
247
|
+
**Always:**
|
|
248
|
+
- Check for uncommitted changes before anything else
|
|
249
|
+
- Verify tests before offering options
|
|
250
|
+
- Present exactly 4 options
|
|
251
|
+
- Get typed confirmation for Option 4
|
|
252
|
+
- Check for worktree vs. main working directory before cleanup
|
|
253
|
+
|
|
254
|
+
## Integration
|
|
255
|
+
|
|
256
|
+
**Called by:**
|
|
257
|
+
- **subagent-driven-development** (Step 7) — After all tasks complete
|
|
258
|
+
- **executing-plans** (Step 5) — After all batches complete
|
|
259
|
+
|
|
260
|
+
**Pairs with:**
|
|
261
|
+
- **using-git-worktrees** — Cleans up worktrees created by that skill
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: leveraging-cli-tools
|
|
3
|
+
description: Use when performing code searches, JSON parsing, file viewing, or file finding tasks - ensures agents verify and use high-performance CLI tools (rg, jq, fd, bat, ast-grep) instead of slower standard tools, reducing token costs and latency by 5-50x
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Leveraging CLI Tools
|
|
7
|
+
|
|
8
|
+
## Core Principle
|
|
9
|
+
|
|
10
|
+
**High-performance CLI tools reduce costs, latency, and cognitive load by 5-50x.**
|
|
11
|
+
|
|
12
|
+
Modern tools have massive RL optimization in frontier models - use them.
|
|
13
|
+
|
|
14
|
+
## Tool Availability Protocol
|
|
15
|
+
|
|
16
|
+
**Session start (silent check, cache result):**
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
command -v rg jq fd bat gh >/dev/null 2>&1 && echo "ready" || echo "missing"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**If tools missing:** Offer installation when relevant task appears.
|
|
23
|
+
**If tools ready:** Use optimal workflows throughout session.
|
|
24
|
+
|
|
25
|
+
## Tool Selection
|
|
26
|
+
|
|
27
|
+
| Task | Use | Instead of | Speedup |
|
|
28
|
+
|------|-----|-----------|---------|
|
|
29
|
+
| Search code | **rg** | grep | 10-50x |
|
|
30
|
+
| Parse JSON | **jq** | awk/sed | 5-20x |
|
|
31
|
+
| Find files | **fd** | find | 5-10x |
|
|
32
|
+
| View code | **bat** | cat | Better UX |
|
|
33
|
+
| Transform code | **ast-grep** | sed | 3-10x |
|
|
34
|
+
| GitHub ops | **gh** | curl+API | 2-5x |
|
|
35
|
+
| Interactive select | **fzf** | manual | 10-100x |
|
|
36
|
+
|
|
37
|
+
## Quick Reference
|
|
38
|
+
|
|
39
|
+
### Code Search: rg
|
|
40
|
+
```bash
|
|
41
|
+
rg "AuthError" --type typescript # 10-50x faster than grep, respects .gitignore
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### JSON Parse: jq
|
|
45
|
+
```bash
|
|
46
|
+
jq '.results[] | select(.status=="error") | .error.code' api.json | sort -u
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Find Files: fd
|
|
50
|
+
```bash
|
|
51
|
+
fd "\.test\.ts$" # 5-10x faster than find, parallel traversal
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### View Code: bat
|
|
55
|
+
```bash
|
|
56
|
+
bat src/auth.ts # Syntax highlighting, Git integration, line numbers
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Code Transform: ast-grep
|
|
60
|
+
```bash
|
|
61
|
+
sg --pattern 'console.log($$$ARGS)' --rewrite 'logger.debug($$$ARGS)'
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Installation Protocol
|
|
65
|
+
|
|
66
|
+
**If tool missing when needed:**
|
|
67
|
+
|
|
68
|
+
1. Explain impact: "Using rg is 10-50x faster, reducing token costs"
|
|
69
|
+
2. Install automatically for core tools (rg, jq, fd, bat, gh): `brew install ripgrep jq fd bat gh` (macOS) or equivalent
|
|
70
|
+
3. Ask before installing: ast-grep, httpie, fzf
|
|
71
|
+
|
|
72
|
+
**No exceptions:** If tool unavailable and user declines install, explain performance cost but use fallback.
|
|
73
|
+
|
|
74
|
+
## Key Workflows
|
|
75
|
+
|
|
76
|
+
### Filter Before Reading
|
|
77
|
+
```bash
|
|
78
|
+
# DON'T: Read all files blindly
|
|
79
|
+
# DO: Filter first, read matches only
|
|
80
|
+
rg "password.*hash" src/auth/ --type ts -l | xargs bat
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Under fatigue: filtering first reduces cognitive load.
|
|
84
|
+
|
|
85
|
+
### Compose Tools
|
|
86
|
+
```bash
|
|
87
|
+
rg "error.code" logs/ -o | jq -r . | sort -u # Search + parse + dedup
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Performance Impact
|
|
91
|
+
|
|
92
|
+
| Task | grep/find/cat | rg/fd/bat | Savings |
|
|
93
|
+
|------|---------------|-----------|---------|
|
|
94
|
+
| Search 50k files | 45s | 0.8s | 56x, ~40k tokens |
|
|
95
|
+
| Parse 10MB JSON | 12s (awk) | 2s (jq) | 6x, ~15k tokens |
|
|
96
|
+
| Find in monorepo | 8s | 1s | 8x, ~10k tokens |
|
|
97
|
+
|
|
98
|
+
## Red Flags
|
|
99
|
+
|
|
100
|
+
- Manually parsing JSON with awk/sed/grep (use jq)
|
|
101
|
+
- Reading files without filtering first (use rg to filter)
|
|
102
|
+
- Not checking tool availability at session start
|
|
103
|
+
- Using bash grep when Grep tool exists (use Grep tool)
|
|
104
|
+
|
|
105
|
+
## Common Rationalizations
|
|
106
|
+
|
|
107
|
+
| Excuse | Reality |
|
|
108
|
+
|--------|---------|
|
|
109
|
+
| "grep works fine" | 50x slower, burns 40k tokens on 50k files |
|
|
110
|
+
| "I don't know if they have jq" | Check once, install takes 30s, saves hours |
|
|
111
|
+
| "Not worth setup overhead" | One install = 10-100x speedup on ALL future tasks |
|
|
112
|
+
| "User didn't ask for optimization" | Faster task completion IS better completion |
|
|
113
|
+
|
|
114
|
+
## When NOT to Use
|
|
115
|
+
|
|
116
|
+
**Skip when:**
|
|
117
|
+
- Small dataset (< 100 files, < 1MB) AND one-off task
|
|
118
|
+
- User explicitly declines install
|
|
119
|
+
- Teaching context where standard tools are the goal
|
|
120
|
+
|
|
121
|
+
**Use when:**
|
|
122
|
+
- Codebase search (always)
|
|
123
|
+
- JSON operations (always)
|
|
124
|
+
- Time pressure, large datasets, repeated operations
|
|
125
|
+
|
|
126
|
+
## Summary
|
|
127
|
+
|
|
128
|
+
**Protocol: Check → Use → Combine**
|
|
129
|
+
|
|
130
|
+
Session start: Silent availability check. Task appears: Use optimal tool or install. Complex tasks: Compose tools.
|
|
131
|
+
|
|
132
|
+
**Not using available tools burns resources.**
|
|
@@ -0,0 +1,233 @@
|
|
|
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. Also use when a PR has been reviewed and you're about to start addressing comments, when another agent or tool suggests code changes you should apply, or when someone asks you to "apply the review feedback" — 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 CLAUDE.md 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 (human or AI)
|
|
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
|
+
**Note on AI reviewers:** Automated review tools (linters, AI agents, CI checks) can be confidently wrong about project-specific patterns. Apply the same external reviewer skepticism — check whether their suggestion actually fits this codebase's conventions before applying it.
|
|
87
|
+
|
|
88
|
+
**your human partner's rule:** "External feedback - be skeptical, but check carefully"
|
|
89
|
+
|
|
90
|
+
## YAGNI Check for "Professional" Features
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
IF reviewer suggests "implementing properly":
|
|
94
|
+
grep codebase for actual usage
|
|
95
|
+
|
|
96
|
+
IF unused: "This endpoint isn't called. Remove it (YAGNI)?"
|
|
97
|
+
IF used: Then implement properly
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**your human partner's rule:** "You and reviewer both report to me. If we don't need this feature, don't add it."
|
|
101
|
+
|
|
102
|
+
## Implementation Order
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
FOR multi-item feedback:
|
|
106
|
+
1. Clarify anything unclear FIRST
|
|
107
|
+
2. Then implement in this order:
|
|
108
|
+
- Blocking issues (breaks, security)
|
|
109
|
+
- Simple fixes (typos, imports)
|
|
110
|
+
- Complex fixes (refactoring, logic)
|
|
111
|
+
3. Test each fix individually
|
|
112
|
+
4. Verify no regressions
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## When To Push Back
|
|
116
|
+
|
|
117
|
+
Push back when:
|
|
118
|
+
- Suggestion breaks existing functionality
|
|
119
|
+
- Reviewer lacks full context
|
|
120
|
+
- Violates YAGNI (unused feature)
|
|
121
|
+
- Technically incorrect for this stack
|
|
122
|
+
- Legacy/compatibility reasons exist
|
|
123
|
+
- Conflicts with your human partner's architectural decisions
|
|
124
|
+
|
|
125
|
+
**How to push back:**
|
|
126
|
+
- Use technical reasoning, not defensiveness
|
|
127
|
+
- Ask specific questions
|
|
128
|
+
- Reference working tests/code
|
|
129
|
+
- Involve your human partner if architectural
|
|
130
|
+
|
|
131
|
+
**If you feel uncomfortable pushing back directly**, you can signal this by saying: "Strange things are afoot at the Circle K" — this is a pre-agreed code phrase meaning "I disagree with this but feel social pressure to comply; please step in."
|
|
132
|
+
|
|
133
|
+
## Acknowledging Correct Feedback
|
|
134
|
+
|
|
135
|
+
When feedback IS correct:
|
|
136
|
+
```
|
|
137
|
+
✅ "Fixed. [Brief description of what changed]"
|
|
138
|
+
✅ "Good catch - [specific issue]. Fixed in [location]."
|
|
139
|
+
✅ [Just fix it and show in the code]
|
|
140
|
+
|
|
141
|
+
❌ "You're absolutely right!"
|
|
142
|
+
❌ "Great point!"
|
|
143
|
+
❌ "Thanks for catching that!"
|
|
144
|
+
❌ "Thanks for [anything]"
|
|
145
|
+
❌ ANY gratitude expression
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Why no thanks:** Actions speak. Just fix it. The code itself shows you heard the feedback.
|
|
149
|
+
|
|
150
|
+
**If you catch yourself about to write "Thanks":** DELETE IT. State the fix instead.
|
|
151
|
+
|
|
152
|
+
## Gracefully Correcting Your Pushback
|
|
153
|
+
|
|
154
|
+
If you pushed back and were wrong:
|
|
155
|
+
```
|
|
156
|
+
✅ "You were right - I checked [X] and it does [Y]. Implementing now."
|
|
157
|
+
✅ "Verified this and you're correct. My initial understanding was wrong because [reason]. Fixing."
|
|
158
|
+
|
|
159
|
+
❌ Long apology
|
|
160
|
+
❌ Defending why you pushed back
|
|
161
|
+
❌ Over-explaining
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
State the correction factually and move on.
|
|
165
|
+
|
|
166
|
+
## After Completing All Items
|
|
167
|
+
|
|
168
|
+
When all review items are addressed:
|
|
169
|
+
- Summarize what was done: "Addressed all N review items: [brief list]"
|
|
170
|
+
- Call out any items you pushed back on and why
|
|
171
|
+
- Flag any items deferred or out of scope
|
|
172
|
+
- If on GitHub: re-request review via `gh pr edit --add-reviewer <username>` or let your human partner decide
|
|
173
|
+
|
|
174
|
+
Don't disappear after fixing things. A clear "done" summary closes the loop.
|
|
175
|
+
|
|
176
|
+
## Common Mistakes
|
|
177
|
+
|
|
178
|
+
| Mistake | Fix |
|
|
179
|
+
|---------|-----|
|
|
180
|
+
| Performative agreement | State requirement or just act |
|
|
181
|
+
| Blind implementation | Verify against codebase first |
|
|
182
|
+
| Batch without testing | One at a time, test each |
|
|
183
|
+
| Assuming reviewer is right | Check if breaks things |
|
|
184
|
+
| Avoiding pushback | Technical correctness > comfort |
|
|
185
|
+
| Partial implementation | Clarify all items first |
|
|
186
|
+
| Can't verify, proceed anyway | State limitation, ask for direction |
|
|
187
|
+
| Trusting AI reviewer unconditionally | Apply same skepticism as external human |
|
|
188
|
+
| Silent completion | Summarize what changed when done |
|
|
189
|
+
|
|
190
|
+
## Real Examples
|
|
191
|
+
|
|
192
|
+
**Performative Agreement (Bad):**
|
|
193
|
+
```
|
|
194
|
+
Reviewer: "Remove legacy code"
|
|
195
|
+
❌ "You're absolutely right! Let me remove that..."
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Technical Verification (Good):**
|
|
199
|
+
```
|
|
200
|
+
Reviewer: "Remove legacy code"
|
|
201
|
+
✅ "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?"
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**YAGNI (Good):**
|
|
205
|
+
```
|
|
206
|
+
Reviewer: "Implement proper metrics tracking with database, date filters, CSV export"
|
|
207
|
+
✅ "Grepped codebase - nothing calls this endpoint. Remove it (YAGNI)? Or is there usage I'm missing?"
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Unclear Item (Good):**
|
|
211
|
+
```
|
|
212
|
+
your human partner: "Fix items 1-6"
|
|
213
|
+
You understand 1,2,3,6. Unclear on 4,5.
|
|
214
|
+
✅ "Understand 1,2,3,6. Need clarification on 4 and 5 before implementing."
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**AI Reviewer Suggestion (Good):**
|
|
218
|
+
```
|
|
219
|
+
AI linter: "Replace all usages with the newer API"
|
|
220
|
+
✅ "This project targets Node 16 which doesn't have that API. Skipping — would break CI."
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## GitHub Thread Replies
|
|
224
|
+
|
|
225
|
+
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.
|
|
226
|
+
|
|
227
|
+
## The Bottom Line
|
|
228
|
+
|
|
229
|
+
**External feedback = suggestions to evaluate, not orders to follow.**
|
|
230
|
+
|
|
231
|
+
Verify. Question. Then implement.
|
|
232
|
+
|
|
233
|
+
No performative agreement. Technical rigor always.
|