pi-gauntlet 4.0.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/CHANGELOG.md +300 -0
- package/LICENSE +24 -0
- package/README.md +278 -0
- package/agents/code-reviewer.md +48 -0
- package/agents/conformance-reviewer.md +139 -0
- package/agents/implementer.md +40 -0
- package/agents/spec-council-member.md +47 -0
- package/agents/spec-council-synthesizer.md +39 -0
- package/agents/spec-reviewer.md +47 -0
- package/agents/spec-summarizer.md +42 -0
- package/bin/install-agents.mjs +141 -0
- package/extensions/phase-tracker.ts +622 -0
- package/extensions/plan-tracker.ts +308 -0
- package/extensions/verify-before-ship.ts +132 -0
- package/package.json +43 -0
- package/skills/brainstorming/SKILL.md +290 -0
- package/skills/dispatching-parallel-agents/SKILL.md +192 -0
- package/skills/finishing-a-development-branch/SKILL.md +311 -0
- package/skills/receiving-code-review/SKILL.md +200 -0
- package/skills/requesting-code-review/SKILL.md +115 -0
- package/skills/requesting-code-review/code-reviewer.md +166 -0
- package/skills/roasting-the-spec/SKILL.md +139 -0
- package/skills/subagent-driven-development/SKILL.md +223 -0
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +25 -0
- package/skills/subagent-driven-development/implementer-prompt.md +113 -0
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +68 -0
- package/skills/systematic-debugging/SKILL.md +151 -0
- package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/skills/systematic-debugging/find-polluter.sh +63 -0
- package/skills/systematic-debugging/reference/rationalizations.md +61 -0
- package/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/skills/test-driven-development/SKILL.md +230 -0
- package/skills/test-driven-development/reference/examples.md +99 -0
- package/skills/test-driven-development/reference/rationalizations.md +65 -0
- package/skills/test-driven-development/reference/when-stuck.md +31 -0
- package/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/skills/using-git-worktrees/SKILL.md +193 -0
- package/skills/verification-before-completion/SKILL.md +169 -0
- package/skills/verification-before-completion/reference/conformance-check.md +220 -0
- package/skills/writing-plans/SKILL.md +244 -0
- package/skills/writing-skills/SKILL.md +429 -0
- package/skills/writing-skills/reference/anthropic-best-practices.md +1130 -0
- package/skills/writing-skills/reference/persuasion.md +187 -0
- package/skills/writing-skills/reference/testing-skills-with-subagents.md +384 -0
|
@@ -0,0 +1,311 @@
|
|
|
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 - guides completion of development work by presenting structured options for merge, PR, or cleanup
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Finishing a Development Branch
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Guide completion of development work by presenting clear options and handling chosen workflow.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Verify tests → Detect environment → Surface closure → 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
|
+
At start, call `phase_tracker({ action: "start", phase: "ship" })`.
|
|
17
|
+
|
|
18
|
+
## The Process
|
|
19
|
+
|
|
20
|
+
### Step 1: Verify Tests
|
|
21
|
+
|
|
22
|
+
**Hard verification gate.** Tests/format/lint must pass before presenting any options — including Discard. The user's stated intent to throw the branch away does not change whether the diff is in a verifiable state; verifying first surfaces accidental damage to unrelated code before the branch is gone forever. No exceptions.
|
|
23
|
+
|
|
24
|
+
Run the project's canonical verification target from inside the worktree. The exact command lives in the repo's `AGENTS.md` or service-level docs (look for "verification", "CI", or "test" sections). Typical patterns: `make ci`, `npm test`, `pytest`, `cargo test`, `bundle exec rspec`. Cross-cutting changes: run each affected service's target; don't skip any.
|
|
25
|
+
|
|
26
|
+
**Scoping caveat — pre-existing findings.** Some services carry lint findings unrelated to the diff. If verification fails on lines you didn't touch:
|
|
27
|
+
|
|
28
|
+
1. Confirm with `git diff <base>...HEAD --name-only` that the offending file isn't in your diff.
|
|
29
|
+
2. Surface the pre-existing finding to the user as a separate issue — do **not** auto-fix it in this completion ("surface, don't auto-fix").
|
|
30
|
+
3. Proceed only after the user acknowledges.
|
|
31
|
+
|
|
32
|
+
**If tests fail (within your diff):**
|
|
33
|
+
```
|
|
34
|
+
Tests failing (<N> failures). Must fix before completing:
|
|
35
|
+
|
|
36
|
+
[Show failures]
|
|
37
|
+
|
|
38
|
+
Cannot proceed with Options 1–3 until tests pass.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Stop. Don't proceed to Step 2.
|
|
42
|
+
|
|
43
|
+
**If tests pass:** Continue to Step 2.
|
|
44
|
+
|
|
45
|
+
No documentation prompt here: doc impact is decided at spec time (`/skill:brainstorming` section 6) and has already shipped in the diff by the time you reach finishing.
|
|
46
|
+
|
|
47
|
+
### Step 2: Detect Environment
|
|
48
|
+
|
|
49
|
+
**Determine workspace state before presenting options:**
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
|
|
53
|
+
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
This determines which menu to show and how cleanup works:
|
|
57
|
+
|
|
58
|
+
| State | Menu | Cleanup |
|
|
59
|
+
|-------|------|---------|
|
|
60
|
+
| `GIT_DIR == GIT_COMMON` (normal repo) | Standard 4 options | No worktree to clean up |
|
|
61
|
+
| `GIT_DIR != GIT_COMMON`, named branch | Standard 4 options | Provenance-based (see Step 6) |
|
|
62
|
+
| `GIT_DIR != GIT_COMMON`, detached HEAD | Reduced 3 options (no merge) | No cleanup (externally managed) |
|
|
63
|
+
|
|
64
|
+
### Step 3: Determine Base Branch
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Try common base branches
|
|
68
|
+
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Or ask: "This branch split from main - is that correct?"
|
|
72
|
+
|
|
73
|
+
### Step 3.5: Surface Closure / Conformance Status
|
|
74
|
+
|
|
75
|
+
Before presenting finish options, surface the closing-loop conformance result as **its own section** — the user is about to choose how to ship, and they need to see whether the deliverable matches what was *asked*, not just whether tests pass. Tests prove the code runs; conformance proves it does what was requested. Different gates.
|
|
76
|
+
|
|
77
|
+
- **If the execution flow already closed the loop** (the `conformance-reviewer` ran in the `subagent-driven-development` verify gate), restate its verdict here: `CONFORMS`, or the `GAPS` and how each was dispositioned (fixed / accepted-and-recorded-in-spec / rescoped). If any gap is still open, drive it through the remediation loop in `verification-before-completion/reference/conformance-check.md` "When the check finds gaps"; on a normal-repo (`GIT_DIR == GIT_COMMON`) or detached-HEAD finish there is no worktree to dispatch fix waves into, so that menu offers accept / rescope / manual fix-in-place only.
|
|
78
|
+
- **If no conformance check has run in this flow** (e.g., ad-hoc work that landed without an execution skill), say so plainly and offer to run it now — dispatch a fresh-context `conformance-reviewer` against the origin (spec + verbatim prompt + full diff vs base) per `verification-before-completion/reference/conformance-check.md`. Closing the loop is cheap relative to shipping unverified intent.
|
|
79
|
+
- **Unreconciled gaps are a blocker, not a footnote.** Do not bury them inside the options menu. If any gap is still open, resolve it (or get explicit user acceptance recorded in the spec) before offering Option 1 (squash-merge) or Option 2 (PR).
|
|
80
|
+
|
|
81
|
+
Present it as a distinct line the user reads before choosing:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
Closure / conformance: CONFORMS
|
|
85
|
+
(or: GAPS — <n> open)
|
|
86
|
+
- <gap> → proposed remediation: <one line> [if any open]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Then continue to Step 4.
|
|
90
|
+
|
|
91
|
+
### Step 4: Present Options
|
|
92
|
+
|
|
93
|
+
**Normal repo and named-branch worktree — present exactly these 4 options:**
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
Implementation complete. What would you like to do?
|
|
97
|
+
|
|
98
|
+
1. Squash-merge to <base-branch> (no PR, no surviving branch)
|
|
99
|
+
2. Push and create a Pull Request
|
|
100
|
+
3. Keep the branch as-is (I'll handle it later)
|
|
101
|
+
4. Discard this work
|
|
102
|
+
|
|
103
|
+
Which option?
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Detached HEAD — present exactly these 3 options:**
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
Implementation complete. You're on a detached HEAD (externally managed workspace).
|
|
110
|
+
|
|
111
|
+
1. Push as new branch and create a Pull Request
|
|
112
|
+
2. Keep as-is (I'll handle it later)
|
|
113
|
+
3. Discard this work
|
|
114
|
+
|
|
115
|
+
Which option?
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Don't add explanation** - keep options concise.
|
|
119
|
+
|
|
120
|
+
### Step 5: Execute Choice
|
|
121
|
+
|
|
122
|
+
#### Option 1: Squash-merge to base
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# Get main repo root for CWD safety
|
|
126
|
+
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
|
|
127
|
+
cd "$MAIN_ROOT"
|
|
128
|
+
|
|
129
|
+
# Squash-merge — collapses the feature branch into one commit on base
|
|
130
|
+
git checkout <base-branch>
|
|
131
|
+
git pull
|
|
132
|
+
git merge --squash <feature-branch>
|
|
133
|
+
|
|
134
|
+
# Plans are ephemeral — delete from the squash. Spec stays.
|
|
135
|
+
git rm doc/plans/<plan-file>.md # or <service>/doc/plans/<plan-file>.md
|
|
136
|
+
|
|
137
|
+
# Single commit covering spec + code + review fixes.
|
|
138
|
+
git commit -m "<imperative summary> (ref E-XXXX)"
|
|
139
|
+
|
|
140
|
+
# Verify tests on merged result
|
|
141
|
+
<Step 1 command for the service(s) touched>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
The post-squash re-verify is not optional — `git merge --squash` can surface conflict-resolution mistakes the worktree-side run couldn't catch.
|
|
145
|
+
|
|
146
|
+
Then: Cleanup worktree (Step 6), then delete branch:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
git branch -d <feature-branch>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**No push. No PR.** The squashed commit stays local on `<base-branch>` unless the user explicitly asks to push.
|
|
153
|
+
|
|
154
|
+
#### Option 2: Push and Create PR
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Push branch
|
|
158
|
+
git push -u origin <feature-branch>
|
|
159
|
+
|
|
160
|
+
# Create PR
|
|
161
|
+
gh pr create --title "<title>" --body "$(cat <<'EOF'
|
|
162
|
+
## Summary
|
|
163
|
+
<2-3 bullets of what changed>
|
|
164
|
+
|
|
165
|
+
## Test Plan
|
|
166
|
+
- [ ] <verification steps>
|
|
167
|
+
EOF
|
|
168
|
+
)"
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Do NOT clean up worktree** — user needs it alive to iterate on PR feedback.
|
|
172
|
+
|
|
173
|
+
#### Option 3: Keep As-Is
|
|
174
|
+
|
|
175
|
+
Report: "Keeping branch <name>. Worktree preserved at <path>."
|
|
176
|
+
|
|
177
|
+
**Don't cleanup worktree.**
|
|
178
|
+
|
|
179
|
+
#### Option 4: Discard
|
|
180
|
+
|
|
181
|
+
**Confirm first:**
|
|
182
|
+
```
|
|
183
|
+
This will permanently delete:
|
|
184
|
+
- Branch <name>
|
|
185
|
+
- All commits: <commit-list>
|
|
186
|
+
- Worktree at <path>
|
|
187
|
+
|
|
188
|
+
Type 'discard' to confirm.
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Wait for exact confirmation.
|
|
192
|
+
|
|
193
|
+
If confirmed:
|
|
194
|
+
```bash
|
|
195
|
+
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
|
|
196
|
+
cd "$MAIN_ROOT"
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Then: Cleanup worktree (Step 6), then force-delete branch:
|
|
200
|
+
```bash
|
|
201
|
+
git branch -D <feature-branch>
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Step 6: Cleanup Workspace
|
|
205
|
+
|
|
206
|
+
**Only runs for Options 1 and 4.** Options 2 and 3 always preserve the worktree.
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
|
|
210
|
+
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
|
|
211
|
+
WORKTREE_PATH=$(git rev-parse --show-toplevel)
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**If `GIT_DIR == GIT_COMMON`:** Normal repo, no worktree to clean up. Done.
|
|
215
|
+
|
|
216
|
+
**If the worktree was created by a project-native script (e.g., `script/worktree create`, `bin/worktree`):** defer to the matching destroy command. The script likely cleans up DBs, env files, or other side-effects that raw `git worktree remove` will miss.
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
|
|
220
|
+
name="${WORKTREE_PATH##*-}"
|
|
221
|
+
# Example: project-native wrapper. Substitute your project's destroy command.
|
|
222
|
+
"$MAIN_ROOT/script/worktree" destroy "$name"
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
**If worktree path is under `.worktrees/` or `~/.worktrees/<project>/`:** Gauntlet created this worktree — we own cleanup.
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
|
|
229
|
+
cd "$MAIN_ROOT"
|
|
230
|
+
git worktree remove "$WORKTREE_PATH"
|
|
231
|
+
git worktree prune # Self-healing: clean up any stale registrations
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**Otherwise:** The host environment (harness) owns this workspace. Do NOT remove it. If your platform provides a workspace-exit tool, use it. Otherwise, leave the workspace in place.
|
|
235
|
+
|
|
236
|
+
## Quick Reference
|
|
237
|
+
|
|
238
|
+
| Option | Merge | Push | Keep Worktree | Cleanup Branch |
|
|
239
|
+
|--------|-------|------|---------------|----------------|
|
|
240
|
+
| 1. Squash-merge locally | yes (squash) | - | - | yes |
|
|
241
|
+
| 2. Create PR | - | yes | yes | - |
|
|
242
|
+
| 3. Keep as-is | - | - | yes | - |
|
|
243
|
+
| 4. Discard | - | - | - | yes (force) |
|
|
244
|
+
|
|
245
|
+
## Common Mistakes
|
|
246
|
+
|
|
247
|
+
**Skipping test verification**
|
|
248
|
+
- **Problem:** Merge broken code, create failing PR
|
|
249
|
+
- **Fix:** Always verify tests before offering options
|
|
250
|
+
|
|
251
|
+
**Open-ended questions**
|
|
252
|
+
- **Problem:** "What should I do next?" is ambiguous
|
|
253
|
+
- **Fix:** Present exactly 4 structured options (or 3 for detached HEAD)
|
|
254
|
+
|
|
255
|
+
**Cleaning up worktree for Option 2**
|
|
256
|
+
- **Problem:** Remove worktree user needs for PR iteration
|
|
257
|
+
- **Fix:** Only cleanup for Options 1 and 4
|
|
258
|
+
|
|
259
|
+
**Deleting branch before removing worktree**
|
|
260
|
+
- **Problem:** `git branch -d` fails because worktree still references the branch
|
|
261
|
+
- **Fix:** Merge first, remove worktree, then delete branch
|
|
262
|
+
|
|
263
|
+
**Running git worktree remove from inside the worktree**
|
|
264
|
+
- **Problem:** Command fails silently when CWD is inside the worktree being removed
|
|
265
|
+
- **Fix:** Always `cd` to main repo root before `git worktree remove`
|
|
266
|
+
|
|
267
|
+
**Cleaning up harness-owned worktrees**
|
|
268
|
+
- **Problem:** Removing a worktree the harness created causes phantom state
|
|
269
|
+
- **Fix:** Only clean up worktrees under `.worktrees/`, `~/.worktrees/<project>/`, or paths produced by a project-native worktree script
|
|
270
|
+
|
|
271
|
+
**No confirmation for discard**
|
|
272
|
+
- **Problem:** Accidentally delete work
|
|
273
|
+
- **Fix:** Require typed "discard" confirmation
|
|
274
|
+
|
|
275
|
+
**Skipping the plan-doc deletion in Option 1**
|
|
276
|
+
- **Problem:** Plan docs are ephemeral and shouldn't land on `<base-branch>`. Forgetting `git rm doc/plans/<plan-file>.md` ships scaffolding to main.
|
|
277
|
+
- **Fix:** The plan stays in the deleted branch's git history (`git log --all -- doc/plans/...`). Spec stays on `<base-branch>`; plan does not.
|
|
278
|
+
|
|
279
|
+
## Completion
|
|
280
|
+
|
|
281
|
+
Once the chosen option (Options 1, 2, or 3 — not Discard) is executed successfully, mark the ship phase complete:
|
|
282
|
+
|
|
283
|
+
```
|
|
284
|
+
phase_tracker({ action: "complete", phase: "ship" })
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
## Red Flags
|
|
288
|
+
|
|
289
|
+
**Never:**
|
|
290
|
+
- Proceed with failing tests
|
|
291
|
+
- Merge without verifying tests on result
|
|
292
|
+
- Delete work without confirmation
|
|
293
|
+
- Force-push without explicit request
|
|
294
|
+
- Remove a worktree before confirming merge success
|
|
295
|
+
- Clean up worktrees you didn't create (provenance check)
|
|
296
|
+
- Run `git worktree remove` from inside the worktree
|
|
297
|
+
- Present finish options while a conformance gap is open and undispositioned
|
|
298
|
+
|
|
299
|
+
**Always:**
|
|
300
|
+
- Verify tests before offering options
|
|
301
|
+
- Detect environment before presenting menu
|
|
302
|
+
- Present exactly 4 options (or 3 for detached HEAD)
|
|
303
|
+
- Get typed confirmation for Option 4
|
|
304
|
+
- Clean up worktree for Options 1 & 4 only
|
|
305
|
+
- `cd` to main repo root before worktree removal
|
|
306
|
+
- Run `git worktree prune` after removal
|
|
307
|
+
- Surface the closure / conformance verdict as its own section before the options menu
|
|
308
|
+
|
|
309
|
+
## Project overrides
|
|
310
|
+
|
|
311
|
+
If `.pi/gauntlet-overrides.md` exists, read it. Any sections relevant to this skill — by name match, by topic (routing, verification, worktrees, etc.), or by workflow convention — override or extend the instructions above. Project-local `AGENTS.md` is already in context — check it for project-specific routing tables, service paths, and verification commands.
|
|
@@ -0,0 +1,200 @@
|
|
|
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
|
+
> **Related skills:** Verify each fix with `/skill:verification-before-completion`. Use `/skill:test-driven-development` for regression tests.
|
|
7
|
+
|
|
8
|
+
# Code Review Reception
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Code review requires technical evaluation, not emotional performance.
|
|
13
|
+
|
|
14
|
+
**Core principle:** Verify before implementing. Ask before assuming. Technical correctness over social comfort.
|
|
15
|
+
|
|
16
|
+
## The Response Pattern
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
WHEN receiving code review feedback:
|
|
20
|
+
|
|
21
|
+
1. READ: Complete feedback without reacting
|
|
22
|
+
2. UNDERSTAND: Restate requirement in own words (or ask)
|
|
23
|
+
3. VERIFY: Check against codebase reality
|
|
24
|
+
4. EVALUATE: Technically sound for THIS codebase?
|
|
25
|
+
5. RESPOND: Technical acknowledgment or reasoned pushback
|
|
26
|
+
6. IMPLEMENT: One item at a time, test each
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## How to Respond
|
|
30
|
+
|
|
31
|
+
**Never performative:**
|
|
32
|
+
- ❌ "You're absolutely right!" / "Great point!" / "Thanks for catching that!"
|
|
33
|
+
- ❌ "Let me implement that now" (before verification)
|
|
34
|
+
|
|
35
|
+
**Instead:**
|
|
36
|
+
- ✅ "Fixed. [Brief description of what changed]"
|
|
37
|
+
- ✅ "Good catch - [specific issue]. Fixed in [location]."
|
|
38
|
+
- ✅ Just fix it silently — the code shows you heard the feedback
|
|
39
|
+
- ✅ Push back with technical reasoning if wrong
|
|
40
|
+
- ✅ Ask clarifying questions if unclear
|
|
41
|
+
|
|
42
|
+
## Handling Unclear Feedback
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
IF any item is unclear:
|
|
46
|
+
STOP - do not implement anything yet
|
|
47
|
+
ASK for clarification on unclear items
|
|
48
|
+
|
|
49
|
+
WHY: Items may be related. Partial understanding = wrong implementation.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Example:**
|
|
53
|
+
```
|
|
54
|
+
your human partner: "Fix 1-6"
|
|
55
|
+
You understand 1,2,3,6. Unclear on 4,5.
|
|
56
|
+
|
|
57
|
+
❌ WRONG: Implement 1,2,3,6 now, ask about 4,5 later
|
|
58
|
+
✅ RIGHT: "I understand items 1,2,3,6. Need clarification on 4 and 5 before proceeding."
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Source-Specific Handling
|
|
62
|
+
|
|
63
|
+
### From your human partner
|
|
64
|
+
- **Trusted** - implement after understanding
|
|
65
|
+
- **Still ask** if scope unclear
|
|
66
|
+
- **No performative agreement**
|
|
67
|
+
- **Skip to action** or technical acknowledgment
|
|
68
|
+
|
|
69
|
+
### From External Reviewers
|
|
70
|
+
```
|
|
71
|
+
BEFORE implementing:
|
|
72
|
+
1. Check: Technically correct for THIS codebase?
|
|
73
|
+
2. Check: Breaks existing functionality?
|
|
74
|
+
3. Check: Reason for current implementation?
|
|
75
|
+
4. Check: Works on all platforms/versions?
|
|
76
|
+
5. Check: Does reviewer understand full context?
|
|
77
|
+
|
|
78
|
+
IF suggestion seems wrong:
|
|
79
|
+
Push back with technical reasoning
|
|
80
|
+
|
|
81
|
+
IF can't easily verify:
|
|
82
|
+
Say so: "I can't verify this without [X]. Should I [investigate/ask/proceed]?"
|
|
83
|
+
|
|
84
|
+
IF conflicts with your human partner's prior decisions:
|
|
85
|
+
Stop and discuss with your human partner first
|
|
86
|
+
```
|
|
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
|
+
**Signal if uncomfortable pushing back out loud:** "Strange things are afoot at the Circle K"
|
|
132
|
+
|
|
133
|
+
## Gracefully Correcting Your Pushback
|
|
134
|
+
|
|
135
|
+
If you pushed back and were wrong:
|
|
136
|
+
```
|
|
137
|
+
✅ "You were right - I checked [X] and it does [Y]. Implementing now."
|
|
138
|
+
✅ "Verified this and you're correct. My initial understanding was wrong because [reason]. Fixing."
|
|
139
|
+
|
|
140
|
+
❌ Long apology
|
|
141
|
+
❌ Defending why you pushed back
|
|
142
|
+
❌ Over-explaining
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
State the correction factually and move on.
|
|
146
|
+
|
|
147
|
+
## Common Mistakes
|
|
148
|
+
|
|
149
|
+
| Mistake | Fix |
|
|
150
|
+
|---------|-----|
|
|
151
|
+
| Performative agreement | State requirement or just act |
|
|
152
|
+
| Blind implementation | Verify against codebase first |
|
|
153
|
+
| Batch without testing | One at a time, test each |
|
|
154
|
+
| Assuming reviewer is right | Check if breaks things |
|
|
155
|
+
| Avoiding pushback | Technical correctness > comfort |
|
|
156
|
+
| Partial implementation | Clarify all items first |
|
|
157
|
+
| Can't verify, proceed anyway | State limitation, ask for direction |
|
|
158
|
+
|
|
159
|
+
## Real Examples
|
|
160
|
+
|
|
161
|
+
**Performative Agreement (Bad):**
|
|
162
|
+
```
|
|
163
|
+
Reviewer: "Remove legacy code"
|
|
164
|
+
❌ "You're absolutely right! Let me remove that..."
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Technical Verification (Good):**
|
|
168
|
+
```
|
|
169
|
+
Reviewer: "Remove legacy code"
|
|
170
|
+
✅ "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?"
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**YAGNI (Good):**
|
|
174
|
+
```
|
|
175
|
+
Reviewer: "Implement proper metrics tracking with database, date filters, CSV export"
|
|
176
|
+
✅ "Grepped codebase - nothing calls this endpoint. Remove it (YAGNI)? Or is there usage I'm missing?"
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Unclear Item (Good):**
|
|
180
|
+
```
|
|
181
|
+
your human partner: "Fix items 1-6"
|
|
182
|
+
You understand 1,2,3,6. Unclear on 4,5.
|
|
183
|
+
✅ "Understand 1,2,3,6. Need clarification on 4 and 5 before implementing."
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## GitHub Thread Replies
|
|
187
|
+
|
|
188
|
+
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.
|
|
189
|
+
|
|
190
|
+
## The Bottom Line
|
|
191
|
+
|
|
192
|
+
**External feedback = suggestions to evaluate, not orders to follow.**
|
|
193
|
+
|
|
194
|
+
Verify. Question. Then implement.
|
|
195
|
+
|
|
196
|
+
No performative agreement. Technical rigor always.
|
|
197
|
+
|
|
198
|
+
## Project overrides
|
|
199
|
+
|
|
200
|
+
If `.pi/gauntlet-overrides.md` exists, read it. Any sections relevant to this skill — by name match, by topic (routing, verification, worktrees, etc.), or by workflow convention — override or extend the instructions above. Project-local `AGENTS.md` is already in context — check it for project-specific routing tables, service paths, and verification commands.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: requesting-code-review
|
|
3
|
+
description: Use when completing tasks, implementing major features, or before merging to verify work meets requirements
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
> **Related skills:** Before requesting review, verify with `/skill:verification-before-completion` that tests pass.
|
|
7
|
+
|
|
8
|
+
# Requesting Code Review
|
|
9
|
+
|
|
10
|
+
Dispatch a subagent with the code-reviewer prompt template to catch issues before they cascade.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Review early, review often.
|
|
13
|
+
|
|
14
|
+
## When to Request Review
|
|
15
|
+
|
|
16
|
+
**Mandatory:**
|
|
17
|
+
- After each task in subagent-driven development
|
|
18
|
+
- After completing major feature
|
|
19
|
+
- Before merge to main
|
|
20
|
+
|
|
21
|
+
**Optional but valuable:**
|
|
22
|
+
- When stuck (fresh perspective)
|
|
23
|
+
- Before refactoring (baseline check)
|
|
24
|
+
- After fixing complex bug
|
|
25
|
+
|
|
26
|
+
## How to Request
|
|
27
|
+
|
|
28
|
+
**1. Get git SHAs:**
|
|
29
|
+
```bash
|
|
30
|
+
BASE_SHA=$(git rev-parse HEAD~1) # or origin/main
|
|
31
|
+
HEAD_SHA=$(git rev-parse HEAD)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**2. Dispatch code-reviewer subagent:**
|
|
35
|
+
|
|
36
|
+
Fill the template at `code-reviewer.md` in this skill directory, then dispatch a subagent with it.
|
|
37
|
+
|
|
38
|
+
**How to dispatch:**
|
|
39
|
+
|
|
40
|
+
Use the `subagent` tool with the code-reviewer template filled in:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
subagent({ agent: "code-reviewer", task: "... filled template ..." })
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Placeholders:**
|
|
47
|
+
- `{WHAT_WAS_IMPLEMENTED}` - What you just built
|
|
48
|
+
- `{PLAN_OR_REQUIREMENTS}` - What it should do
|
|
49
|
+
- `{BASE_SHA}` - Starting commit
|
|
50
|
+
- `{HEAD_SHA}` - Ending commit
|
|
51
|
+
- `{DESCRIPTION}` - Brief summary
|
|
52
|
+
|
|
53
|
+
**3. Act on feedback:**
|
|
54
|
+
- Fix Critical issues immediately
|
|
55
|
+
- Fix Important issues before proceeding
|
|
56
|
+
- Note Minor issues for later
|
|
57
|
+
- Push back if reviewer is wrong (with reasoning)
|
|
58
|
+
|
|
59
|
+
## Example
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
[Just completed Task 2: Add verification function]
|
|
63
|
+
|
|
64
|
+
You: Let me request code review before proceeding.
|
|
65
|
+
|
|
66
|
+
BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
|
|
67
|
+
HEAD_SHA=$(git rev-parse HEAD)
|
|
68
|
+
|
|
69
|
+
[Dispatch code-reviewer subagent]
|
|
70
|
+
WHAT_WAS_IMPLEMENTED: Verification and repair functions for conversation index
|
|
71
|
+
PLAN_OR_REQUIREMENTS: Task 2 from doc/plans/deployment-plan.md
|
|
72
|
+
BASE_SHA: a7981ec
|
|
73
|
+
HEAD_SHA: 3df7661
|
|
74
|
+
DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
|
|
75
|
+
|
|
76
|
+
[Subagent returns]:
|
|
77
|
+
Strengths: Clean architecture, real tests
|
|
78
|
+
Issues:
|
|
79
|
+
Important: Missing progress indicators
|
|
80
|
+
Minor: Magic number (100) for reporting interval
|
|
81
|
+
Assessment: Ready to proceed
|
|
82
|
+
|
|
83
|
+
You: [Fix progress indicators]
|
|
84
|
+
[Continue to Task 3]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Integration with Workflows
|
|
88
|
+
|
|
89
|
+
**Subagent-Driven Development:**
|
|
90
|
+
- Review after EACH task
|
|
91
|
+
- Catch issues before they compound
|
|
92
|
+
- Fix before moving to next task
|
|
93
|
+
|
|
94
|
+
**Ad-Hoc Development:**
|
|
95
|
+
- Review before merge
|
|
96
|
+
- Review when stuck
|
|
97
|
+
|
|
98
|
+
## Red Flags
|
|
99
|
+
|
|
100
|
+
**Never:**
|
|
101
|
+
- Skip review because "it's simple"
|
|
102
|
+
- Ignore Critical issues
|
|
103
|
+
- Proceed with unfixed Important issues
|
|
104
|
+
- Argue with valid technical feedback
|
|
105
|
+
|
|
106
|
+
**If reviewer wrong:**
|
|
107
|
+
- Push back with technical reasoning
|
|
108
|
+
- Show code/tests that prove it works
|
|
109
|
+
- Request clarification
|
|
110
|
+
|
|
111
|
+
See template at: `code-reviewer.md` in this skill directory
|
|
112
|
+
|
|
113
|
+
## Project overrides
|
|
114
|
+
|
|
115
|
+
If `.pi/gauntlet-overrides.md` exists, read it. Any sections relevant to this skill — by name match, by topic (routing, verification, worktrees, etc.), or by workflow convention — override or extend the instructions above. Project-local `AGENTS.md` is already in context — check it for project-specific routing tables, service paths, and verification commands.
|