@hecer/yoke 0.2.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.
Files changed (82) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +494 -0
  3. package/canon/AGENTS.md +28 -0
  4. package/canon/context/DECISIONS.md +4 -0
  5. package/canon/context/KNOWLEDGE.md +4 -0
  6. package/canon/context/PROJECT.md +15 -0
  7. package/canon/loop/loop-spec.md +30 -0
  8. package/canon/loop/prd.schema.md +14 -0
  9. package/canon/manifest.yaml +47 -0
  10. package/canon/policy/gates.md +7 -0
  11. package/canon/policy/roles.md +9 -0
  12. package/canon/skills/ATTRIBUTION.md +71 -0
  13. package/canon/skills/authoring-prd/SKILL.md +44 -0
  14. package/canon/skills/brainstorming/SKILL.md +164 -0
  15. package/canon/skills/dispatching-parallel-agents/SKILL.md +182 -0
  16. package/canon/skills/document-release/SKILL.md +297 -0
  17. package/canon/skills/executing-plans/SKILL.md +70 -0
  18. package/canon/skills/finishing-a-development-branch/SKILL.md +200 -0
  19. package/canon/skills/health/SKILL.md +177 -0
  20. package/canon/skills/maintaining-context/SKILL.md +34 -0
  21. package/canon/skills/minimal-code/SKILL.md +21 -0
  22. package/canon/skills/plan-ceo-review/SKILL.md +541 -0
  23. package/canon/skills/plan-eng-review/SKILL.md +362 -0
  24. package/canon/skills/receiving-code-review/SKILL.md +213 -0
  25. package/canon/skills/requesting-code-review/SKILL.md +105 -0
  26. package/canon/skills/retro/SKILL.md +397 -0
  27. package/canon/skills/review/SKILL.md +246 -0
  28. package/canon/skills/ship/SKILL.md +696 -0
  29. package/canon/skills/subagent-driven-development/SKILL.md +277 -0
  30. package/canon/skills/systematic-debugging/SKILL.md +296 -0
  31. package/canon/skills/tdd/SKILL.md +371 -0
  32. package/canon/skills/unslop-ui/SKILL.md +34 -0
  33. package/canon/skills/using-git-worktrees/SKILL.md +218 -0
  34. package/canon/skills/verification-before-completion/SKILL.md +139 -0
  35. package/canon/skills/visual-verification/SKILL.md +54 -0
  36. package/canon/skills/workflow/SKILL.md +18 -0
  37. package/canon/skills/writing-plans/SKILL.md +152 -0
  38. package/canon/skills/writing-skills/SKILL.md +655 -0
  39. package/canon/skills/yoke-retrofit/SKILL.md +18 -0
  40. package/canon/tools/graphify.md +3 -0
  41. package/canon/tools/playwright-mcp.md +3 -0
  42. package/canon/tools/rtk.md +7 -0
  43. package/canon/tools/serena.md +7 -0
  44. package/dist/canon/frontmatter.js +10 -0
  45. package/dist/canon/manifest.js +26 -0
  46. package/dist/canon/validate.js +73 -0
  47. package/dist/cli.js +244 -0
  48. package/dist/context/command.js +33 -0
  49. package/dist/context/context.js +57 -0
  50. package/dist/loop/cleanup.js +42 -0
  51. package/dist/loop/gates.js +12 -0
  52. package/dist/loop/git.js +25 -0
  53. package/dist/loop/lock.js +45 -0
  54. package/dist/loop/loop.js +190 -0
  55. package/dist/loop/prd.js +29 -0
  56. package/dist/loop/reporter.js +91 -0
  57. package/dist/loop/run-command.js +134 -0
  58. package/dist/loop/runner.js +157 -0
  59. package/dist/loop/verify.js +38 -0
  60. package/dist/loop/watchdog.js +86 -0
  61. package/dist/new/command.js +53 -0
  62. package/dist/prd/command.js +129 -0
  63. package/dist/retrofit/apply.js +54 -0
  64. package/dist/retrofit/canon-dir.js +22 -0
  65. package/dist/retrofit/command.js +37 -0
  66. package/dist/retrofit/config.js +53 -0
  67. package/dist/retrofit/context-actions.js +21 -0
  68. package/dist/retrofit/detect.js +17 -0
  69. package/dist/retrofit/gitignore.js +26 -0
  70. package/dist/retrofit/gstack.js +19 -0
  71. package/dist/retrofit/merge-json.js +38 -0
  72. package/dist/retrofit/plan.js +29 -0
  73. package/dist/retrofit/planners/claude.js +67 -0
  74. package/dist/retrofit/planners/codex.js +36 -0
  75. package/dist/retrofit/planners/gemini.js +54 -0
  76. package/dist/retrofit/report.js +14 -0
  77. package/dist/retrofit/tools.js +23 -0
  78. package/dist/retrofit/wsl.js +15 -0
  79. package/dist/review/command.js +43 -0
  80. package/dist/scan/design.js +79 -0
  81. package/dist/smoke/command.js +141 -0
  82. package/package.json +61 -0
@@ -0,0 +1,362 @@
1
+ ---
2
+ name: plan-eng-review
3
+ description: |
4
+ Engineering plan review. Reviews a plan document for architecture, code quality,
5
+ test coverage, and performance before implementation begins. Produces a coverage
6
+ diagram, failure modes map, and parallelization strategy.
7
+ Use when asked to "review this plan", "eng review", or "architecture review".
8
+ triggers:
9
+ - review this plan
10
+ - plan review
11
+ - eng review
12
+ - architecture review
13
+ ---
14
+
15
+ # Plan Review Mode
16
+
17
+ You are running the `plan-eng-review` skill. Review this plan thoroughly before making any code changes. For every issue or recommendation, explain the concrete tradeoffs, give an opinionated recommendation, and ask for user input before assuming a direction.
18
+
19
+ ## Priority hierarchy
20
+
21
+ Step 0 > Test diagram > Opinionated recommendations > Everything else. Never skip Step 0 or the test diagram.
22
+
23
+ ## Engineering preferences (use these to guide recommendations)
24
+
25
+ - DRY is important — flag repetition aggressively.
26
+ - Well-tested code is non-negotiable; better too many tests than too few.
27
+ - Code should be "engineered enough" — not under-engineered (fragile, hacky) and not over-engineered (premature abstraction, unnecessary complexity).
28
+ - Err on the side of handling more edge cases, not fewer; thoughtfulness > speed.
29
+ - Bias toward explicit over clever.
30
+ - Right-sized diff: favor the smallest diff that cleanly expresses the change — but don't compress a necessary rewrite into a minimal patch. If the existing foundation is broken, say "scrap it and do this instead."
31
+
32
+ ## Cognitive Patterns — How Great Eng Managers Think
33
+
34
+ These are thinking instincts — the pattern recognition that separates "reviewed the code" from "caught the landmine." Apply them throughout the review.
35
+
36
+ 1. **State diagnosis** — Teams exist in four states: falling behind, treading water, repaying debt, innovating. Each demands a different intervention.
37
+ 2. **Blast radius instinct** — Every decision evaluated through "what's the worst case and how many systems/people does it affect?"
38
+ 3. **Boring by default** — Every company gets about three innovation tokens. Everything else should be proven technology.
39
+ 4. **Incremental over revolutionary** — Strangler fig, not big bang. Canary, not global rollout. Refactor, not rewrite.
40
+ 5. **Systems over heroes** — Design for tired humans at 3am, not your best engineer on their best day.
41
+ 6. **Reversibility preference** — Feature flags, A/B tests, incremental rollouts. Make the cost of being wrong low.
42
+ 7. **Failure is information** — Blameless postmortems, error budgets, chaos engineering. Incidents are learning opportunities.
43
+ 8. **DX is product quality** — Slow CI, bad local dev, painful deploys → worse software, higher attrition.
44
+ 9. **Essential vs accidental complexity** — Before adding anything: "Is this solving a real problem or one we created?"
45
+ 10. **Make the change easy, then make the easy change** — Refactor first, implement second.
46
+ 11. **Own your code in production** — No wall between dev and ops.
47
+
48
+ When evaluating architecture, think "boring by default." When reviewing tests, think "systems over heroes." When assessing complexity, ask whether the complexity is essential or accidental.
49
+
50
+ ## Documentation and diagrams
51
+
52
+ - ASCII art diagrams are valuable for data flow, state machines, dependency graphs, processing pipelines, and decision trees.
53
+ - Embed ASCII diagrams directly in code comments for Models (data relationships, state transitions), Controllers (request flow), Services (processing pipelines), and Tests (non-obvious setup).
54
+ - **Diagram maintenance is part of the change.** When modifying code that has ASCII diagrams, review whether those diagrams are still accurate. Stale diagrams are worse than no diagrams.
55
+
56
+ ---
57
+
58
+ ## BEFORE YOU START
59
+
60
+ ### Design Doc Check
61
+
62
+ Check if a design doc exists for this branch. Look for a `.md` file in the project's plan directories (e.g., `.claude/plans/`, `~/.claude/plans/`, the project root) whose name includes the current branch name, or that was recently modified and appears to be a design doc.
63
+
64
+ If a design doc exists, read it. Use it as the source of truth for the problem statement, constraints, and chosen approach.
65
+
66
+ ### Step 0: Scope Challenge
67
+
68
+ Before reviewing anything, answer these questions:
69
+
70
+ 1. **What existing code already partially or fully solves each sub-problem?** Can we capture outputs from existing flows rather than building parallel ones?
71
+ 2. **What is the minimum set of changes that achieves the stated goal?** Flag any work that could be deferred without blocking the core objective.
72
+ 3. **Complexity check:** If the plan touches more than 8 files or introduces more than 2 new classes/services, treat that as a smell and challenge whether the same goal can be achieved with fewer moving parts.
73
+ 4. **Search check:** For each architectural pattern, infrastructure component, or concurrency approach the plan introduces — does the runtime/framework have a built-in? Is the chosen approach current best practice? Are there known pitfalls? Use WebSearch if available.
74
+ 5. **TODOS cross-reference:** Read `TODOS.md` if it exists. Are any deferred items blocking this plan? Can any deferred items be bundled into this PR without expanding scope?
75
+ 6. **Completeness check:** Is the plan doing the complete version or a shortcut? With AI-assisted coding, the cost of completeness is much lower than with a human team alone. If the plan proposes a shortcut that saves human-hours but only saves minutes with an AI coding agent, recommend the complete version.
76
+ 7. **Distribution check:** If the plan introduces a new artifact type (CLI binary, library package, container image), does it include the build/publish pipeline? Code without distribution is code nobody can use.
77
+
78
+ If the complexity check triggers (8+ files or 2+ new classes/services), proactively recommend scope reduction via AskUserQuestion.
79
+
80
+ **Critical: Once the user accepts or rejects a scope reduction recommendation, commit fully.** Do not re-argue for smaller scope during later review sections.
81
+
82
+ ---
83
+
84
+ ## Review Sections (after scope is agreed)
85
+
86
+ **Anti-skip rule:** Never condense, abbreviate, or skip any review section (1-4). Every section exists for a reason. If a section has zero findings, say "No issues found" and move on.
87
+
88
+ ### 1. Architecture review
89
+
90
+ Evaluate:
91
+ - Overall system design and component boundaries.
92
+ - Dependency graph and coupling concerns.
93
+ - Data flow patterns and potential bottlenecks.
94
+ - Scaling characteristics and single points of failure.
95
+ - Security architecture (auth, data access, API boundaries).
96
+ - Whether key flows deserve ASCII diagrams in the plan or in code comments.
97
+ - For each new codepath or integration point, describe one realistic production failure scenario and whether the plan accounts for it.
98
+ - **Distribution architecture:** If this introduces a new artifact (binary, package, container), how does it get built, published, and updated?
99
+
100
+ **STOP.** For each issue found in this section, call AskUserQuestion individually. One issue per call. Present options, state recommendation, explain WHY. Do NOT batch multiple issues into one AskUserQuestion. Only proceed to the next section after ALL issues are resolved.
101
+
102
+ ---
103
+
104
+ ## Confidence Calibration
105
+
106
+ Every finding MUST include a confidence score (1-10):
107
+
108
+ | Score | Meaning | Display rule |
109
+ |-------|---------|-------------|
110
+ | 9-10 | Verified by reading specific code. Concrete bug or exploit demonstrated. | Show normally |
111
+ | 7-8 | High confidence pattern match. Very likely correct. | Show normally |
112
+ | 5-6 | Moderate. Could be a false positive. | Show with caveat: "Medium confidence, verify this is actually an issue" |
113
+ | 3-4 | Low confidence. Pattern is suspicious but may be fine. | Suppress from main report. Include in appendix only. |
114
+ | 1-2 | Speculation. | Only report if severity would be P0. |
115
+
116
+ **Finding format:** `[SEVERITY] (confidence: N/10) file:line — description`
117
+
118
+ ---
119
+
120
+ ### 2. Code quality review
121
+
122
+ Evaluate:
123
+ - Code organization and module structure.
124
+ - DRY violations — be aggressive here.
125
+ - Error handling patterns and missing edge cases (call these out explicitly).
126
+ - Technical debt hotspots.
127
+ - Areas that are over-engineered or under-engineered relative to the engineering preferences above.
128
+ - Existing ASCII diagrams in touched files — are they still accurate after this change?
129
+
130
+ **STOP.** For each issue found in this section, call AskUserQuestion individually.
131
+
132
+ ---
133
+
134
+ ### 3. Test review
135
+
136
+ 100% coverage is the goal. Evaluate every codepath in the plan and ensure the plan includes tests for each one.
137
+
138
+ #### Test Framework Detection
139
+
140
+ Before analyzing coverage, detect the project's test framework:
141
+
142
+ 1. **Read CLAUDE.md** — look for a `## Testing` section with test command and framework name. If found, use that as the authoritative source.
143
+ 2. **If CLAUDE.md has no testing section, auto-detect:**
144
+
145
+ ```bash
146
+ [ -f Gemfile ] && echo "RUNTIME:ruby"
147
+ [ -f package.json ] && echo "RUNTIME:node"
148
+ [ -f requirements.txt ] || [ -f pyproject.toml ] && echo "RUNTIME:python"
149
+ [ -f go.mod ] && echo "RUNTIME:go"
150
+ [ -f Cargo.toml ] && echo "RUNTIME:rust"
151
+ ls jest.config.* vitest.config.* playwright.config.* .rspec pytest.ini phpunit.xml 2>/dev/null
152
+ ls -d test/ tests/ spec/ __tests__/ cypress/ e2e/ 2>/dev/null
153
+ ```
154
+
155
+ 3. **If no framework detected:** still produce the coverage diagram, but skip test generation.
156
+
157
+ #### Step 1. Trace every codepath in the plan
158
+
159
+ Read the plan document. For each new feature, service, endpoint, or component described, trace how data will flow through the code:
160
+
161
+ 1. **Read the plan.** For each planned component, understand what it does and how it connects to existing code.
162
+ 2. **Trace data flow.** Starting from each entry point, follow the data through every branch: where does input come from, what transforms it, where does it go, what can go wrong.
163
+ 3. **Diagram the execution.** For each planned component, draw an ASCII diagram showing every function/method, every conditional branch (if/else, switch, ternary, guard clause), every error path, every call to another function, every edge case.
164
+
165
+ #### Step 2. Map user flows, interactions, and error states
166
+
167
+ For each changed feature, think through:
168
+
169
+ - **User flows:** What sequence of actions does a user take? Map the full journey.
170
+ - **Interaction edge cases:** Double-click/rapid resubmit, navigate away mid-operation, stale data, slow connection, concurrent actions.
171
+ - **Error states the user can see:** Is there a clear error message or a silent failure? Can the user recover?
172
+ - **Empty/zero/boundary states:** What does the UI show with zero results? With maximum input?
173
+
174
+ #### Step 3. Check each branch against existing tests
175
+
176
+ Go through the diagram branch by branch. For each one, search for a test that exercises it.
177
+
178
+ Quality scoring rubric:
179
+ - ★★★ Tests behavior with edge cases AND error paths
180
+ - ★★ Tests correct behavior, happy path only
181
+ - ★ Smoke test / existence check / trivial assertion
182
+
183
+ #### E2E Test Decision Matrix
184
+
185
+ **RECOMMEND E2E** (mark as `[→E2E]`):
186
+ - Common user flow spanning 3+ components/services
187
+ - Integration point where mocking hides real failures
188
+ - Auth/payment/data-destruction flows
189
+
190
+ **RECOMMEND EVAL** (mark as `[→EVAL]`):
191
+ - Critical LLM call that needs a quality eval
192
+ - Changes to prompt templates, system instructions, or tool definitions
193
+
194
+ **STICK WITH UNIT TESTS:**
195
+ - Pure function with clear inputs/outputs
196
+ - Internal helper with no side effects
197
+ - Edge case of a single function
198
+
199
+ #### REGRESSION RULE (mandatory)
200
+
201
+ When the coverage audit identifies a REGRESSION — code that previously worked but the diff broke — a regression test is added to the plan as a critical requirement. No exceptions.
202
+
203
+ #### Step 4. Output ASCII coverage diagram
204
+
205
+ Include BOTH code paths and user flows in the same diagram:
206
+
207
+ ```
208
+ CODE PATHS USER FLOWS
209
+ [+] src/services/billing.ts [+] Payment checkout
210
+ ├── processPayment() ├── [★★★ TESTED] Complete purchase
211
+ │ ├── [★★★ TESTED] happy + declined + timeout ├── [GAP] [→E2E] Double-click submit
212
+ │ ├── [GAP] Network timeout └── [GAP] Navigate away mid-payment
213
+ │ └── [GAP] Invalid currency
214
+
215
+ COVERAGE: 5/13 paths tested (38%)
216
+ ```
217
+
218
+ #### Step 5. Add missing tests to the plan
219
+
220
+ For each GAP identified, add a test requirement to the plan. Be specific:
221
+ - What test file to create (match existing naming conventions)
222
+ - What the test should assert (specific inputs → expected outputs/behavior)
223
+ - Whether it's a unit test, E2E test, or eval (use the decision matrix)
224
+ - For regressions: flag as **CRITICAL** and explain what broke
225
+
226
+ #### Test Plan Artifact
227
+
228
+ After producing the coverage diagram, write a test plan to `.claude/plans/{branch}-test-plan.md` (or the project's plan directory) so browser-based QA can consume it as primary test input:
229
+
230
+ ```markdown
231
+ # Test Plan
232
+ Generated by plan-eng-review on {date}
233
+ Branch: {branch}
234
+
235
+ ## Affected Pages/Routes
236
+ - {URL path} — {what to test and why}
237
+
238
+ ## Key Interactions to Verify
239
+ - {interaction description} on {page}
240
+
241
+ ## Edge Cases
242
+ - {edge case} on {page}
243
+
244
+ ## Critical Paths
245
+ - {end-to-end flow that must work}
246
+ ```
247
+
248
+ **STOP.** For each issue found in this section, call AskUserQuestion individually.
249
+
250
+ ---
251
+
252
+ ### 4. Performance review
253
+
254
+ Evaluate:
255
+ - N+1 queries and database access patterns.
256
+ - Memory-usage concerns.
257
+ - Caching opportunities.
258
+ - Slow or high-complexity code paths.
259
+
260
+ **STOP.** For each issue found in this section, call AskUserQuestion individually.
261
+
262
+ ---
263
+
264
+ ## Outside Voice — Independent Plan Challenge (optional, recommended)
265
+
266
+ After all review sections are complete, offer an independent second opinion from an independent AI agent. Two perspectives agreeing on a plan is stronger signal than one model's thorough review.
267
+
268
+ Use AskUserQuestion:
269
+
270
+ > "All review sections are complete. Want an outside voice? An independent AI agent can give a brutally honest, independent challenge of this plan — logical gaps, feasibility risks, and blind spots that are hard to catch from inside the review. Takes about 2 minutes."
271
+ >
272
+ > RECOMMENDATION: Choose A — an independent second opinion catches structural blind spots.
273
+
274
+ Options:
275
+ - A) Get the outside voice (recommended)
276
+ - B) Skip — proceed to outputs
277
+
278
+ **If A:** Dispatch via the Agent tool. The subagent has fresh context — genuine independence.
279
+
280
+ Subagent prompt: "You are a brutally honest technical reviewer examining a development plan that has already been through a multi-section review. Your job is NOT to repeat that review. Instead, find what it missed. Look for: logical gaps and unstated assumptions that survived the review scrutiny, overcomplexity (is there a fundamentally simpler approach?), feasibility risks taken for granted, missing dependencies or sequencing issues, and strategic miscalibration (is this the right thing to build at all?). Be direct. Be terse. No compliments. Just the problems.
281
+
282
+ THE PLAN:
283
+ [plan content]"
284
+
285
+ Present findings under an `OUTSIDE VOICE (independent subagent):` header.
286
+
287
+ **Cross-model tension:** After presenting outside voice findings, note any points of disagreement with earlier review findings. For each substantive tension point, use AskUserQuestion and wait for user decision. Outside voice findings are INFORMATIONAL until explicitly approved.
288
+
289
+ ---
290
+
291
+ ## Required Outputs
292
+
293
+ ### "NOT in scope" section
294
+
295
+ Every plan review MUST produce a "NOT in scope" section listing work that was considered and explicitly deferred, with a one-line rationale for each item.
296
+
297
+ ### "What already exists" section
298
+
299
+ List existing code/flows that already partially solve sub-problems, and whether the plan reuses them or unnecessarily rebuilds them.
300
+
301
+ ### TODOS.md updates
302
+
303
+ After all review sections are complete, present each potential TODO as its own individual AskUserQuestion. Never batch TODOs. For each:
304
+ - **What:** One-line description.
305
+ - **Why:** The concrete problem it solves or value it unlocks.
306
+ - **Context:** Enough detail that someone picking this up in 3 months understands the motivation.
307
+ - **Depends on / blocked by:** Any prerequisites.
308
+
309
+ Options: A) Add to TODOS.md B) Skip C) Build it now in this PR.
310
+
311
+ ### Diagrams
312
+
313
+ Identify which files in the implementation should get inline ASCII diagram comments — particularly Models with complex state transitions, Services with multi-step pipelines, and non-obvious test setups.
314
+
315
+ ### Failure modes
316
+
317
+ For each new codepath identified in the test review diagram, list one realistic way it could fail in production and whether:
318
+ 1. A test covers that failure
319
+ 2. Error handling exists for it
320
+ 3. The user would see a clear error or a silent failure
321
+
322
+ If any failure mode has no test AND no error handling AND would be silent, flag it as a **critical gap**.
323
+
324
+ ### Worktree parallelization strategy
325
+
326
+ Analyze the plan's implementation steps for parallel execution opportunities (for use with git worktrees or parallel subagents).
327
+
328
+ **Skip if:** all steps touch the same primary module, or the plan has fewer than 2 independent workstreams.
329
+
330
+ **Otherwise, produce:**
331
+
332
+ 1. **Dependency table** — for each implementation step/workstream, list modules touched and dependencies.
333
+ 2. **Parallel lanes** — group steps into lanes (steps sharing a module directory go in the same lane).
334
+ 3. **Execution order** — which lanes launch in parallel, which wait.
335
+ 4. **Conflict flags** — if two parallel lanes touch the same module directory, flag it.
336
+
337
+ ### Completion Summary
338
+
339
+ ```
340
+ - Step 0: Scope Challenge — [scope accepted as-is / scope reduced]
341
+ - Architecture Review: ___ issues found
342
+ - Code Quality Review: ___ issues found
343
+ - Test Review: diagram produced, ___ gaps identified
344
+ - Performance Review: ___ issues found
345
+ - NOT in scope: written
346
+ - What already exists: written
347
+ - TODOS.md updates: ___ items proposed
348
+ - Failure modes: ___ critical gaps flagged
349
+ - Outside voice: ran / skipped
350
+ - Parallelization: ___ lanes, ___ parallel / ___ sequential
351
+ ```
352
+
353
+ ## Retrospective Learning
354
+
355
+ Check the git log for this branch. If there are prior commits suggesting a previous review cycle, note what was changed and whether the current plan touches the same areas. Be more aggressive reviewing areas that were previously problematic.
356
+
357
+ ## Formatting rules
358
+
359
+ - NUMBER issues (1, 2, 3...) and LETTERS for options (A, B, C...).
360
+ - Label with NUMBER + LETTER (e.g., "3A", "3B").
361
+ - One sentence max per option.
362
+ - After each review section, pause and ask for feedback before moving on.
@@ -0,0 +1,213 @@
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 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
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
+ **Signal if uncomfortable pushing back out loud:** "Strange things are afoot at the Circle K"
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.
206
+
207
+ ## The Bottom Line
208
+
209
+ **External feedback = suggestions to evaluate, not orders to follow.**
210
+
211
+ Verify. Question. Then implement.
212
+
213
+ No performative agreement. Technical rigor always.
@@ -0,0 +1,105 @@
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
+ # Requesting Code Review
7
+
8
+ Dispatch superpowers:code-reviewer subagent to catch issues before they cascade. The reviewer gets precisely crafted context for evaluation — never your session's history. This keeps the reviewer focused on the work product, not your thought process, and preserves your own context for continued work.
9
+
10
+ **Core principle:** Review early, review often.
11
+
12
+ ## When to Request Review
13
+
14
+ **Mandatory:**
15
+ - After each task in subagent-driven development
16
+ - After completing major feature
17
+ - Before merge to main
18
+
19
+ **Optional but valuable:**
20
+ - When stuck (fresh perspective)
21
+ - Before refactoring (baseline check)
22
+ - After fixing complex bug
23
+
24
+ ## How to Request
25
+
26
+ **1. Get git SHAs:**
27
+ ```bash
28
+ BASE_SHA=$(git rev-parse HEAD~1) # or origin/main
29
+ HEAD_SHA=$(git rev-parse HEAD)
30
+ ```
31
+
32
+ **2. Dispatch code-reviewer subagent:**
33
+
34
+ Use Task tool with superpowers:code-reviewer type, fill template at `code-reviewer.md`
35
+
36
+ **Placeholders:**
37
+ - `{WHAT_WAS_IMPLEMENTED}` - What you just built
38
+ - `{PLAN_OR_REQUIREMENTS}` - What it should do
39
+ - `{BASE_SHA}` - Starting commit
40
+ - `{HEAD_SHA}` - Ending commit
41
+ - `{DESCRIPTION}` - Brief summary
42
+
43
+ **3. Act on feedback:**
44
+ - Fix Critical issues immediately
45
+ - Fix Important issues before proceeding
46
+ - Note Minor issues for later
47
+ - Push back if reviewer is wrong (with reasoning)
48
+
49
+ ## Example
50
+
51
+ ```
52
+ [Just completed Task 2: Add verification function]
53
+
54
+ You: Let me request code review before proceeding.
55
+
56
+ BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
57
+ HEAD_SHA=$(git rev-parse HEAD)
58
+
59
+ [Dispatch superpowers:code-reviewer subagent]
60
+ WHAT_WAS_IMPLEMENTED: Verification and repair functions for conversation index
61
+ PLAN_OR_REQUIREMENTS: Task 2 from docs/superpowers/plans/deployment-plan.md
62
+ BASE_SHA: a7981ec
63
+ HEAD_SHA: 3df7661
64
+ DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
65
+
66
+ [Subagent returns]:
67
+ Strengths: Clean architecture, real tests
68
+ Issues:
69
+ Important: Missing progress indicators
70
+ Minor: Magic number (100) for reporting interval
71
+ Assessment: Ready to proceed
72
+
73
+ You: [Fix progress indicators]
74
+ [Continue to Task 3]
75
+ ```
76
+
77
+ ## Integration with Workflows
78
+
79
+ **Subagent-Driven Development:**
80
+ - Review after EACH task
81
+ - Catch issues before they compound
82
+ - Fix before moving to next task
83
+
84
+ **Executing Plans:**
85
+ - Review after each batch (3 tasks)
86
+ - Get feedback, apply, continue
87
+
88
+ **Ad-Hoc Development:**
89
+ - Review before merge
90
+ - Review when stuck
91
+
92
+ ## Red Flags
93
+
94
+ **Never:**
95
+ - Skip review because "it's simple"
96
+ - Ignore Critical issues
97
+ - Proceed with unfixed Important issues
98
+ - Argue with valid technical feedback
99
+
100
+ **If reviewer wrong:**
101
+ - Push back with technical reasoning
102
+ - Show code/tests that prove it works
103
+ - Request clarification
104
+
105
+ See template at: requesting-code-review/code-reviewer.md