[GOAL REMINDER — MUST ATTENTION CRITICAL]
Ensure every review target is reasonable, correct, proof-backed, and best-practice aligned.
ALWAYS ASK THE 3 TRADE-OFF QUESTIONS (every decision AND every recommendation you make): (1) is there any trade-off? — name what it sacrifices; "none" is an unfinished analysis, not an answer; (2) is it worth it? — gain vs cost, who pays, when → WORTH IT / NOT WORTH IT / UNCLEAR; (3) is the trade-off material enough to confirm with the user? — irreversible, cost shifted to someone else, one quality attribute traded for another, boundary crossed, high-consequence path, or UNCLEAR → STOP and confirm via AskUserQuestion BEFORE the verdict. NEVER resolve a material trade-off silently. — why: naming a benefit without its price is an endorsement, not a review, and a one-way door is the user's call to walk through, never yours.
MANDATORY SECOND PASS (full mode): whenever Round 1 produces ANY finding, you MUST call /why-review --validate-findings a SECOND time on those findings to confirm each is correct and reasonable BEFORE handoff. NEVER skip it; NEVER suppress, demote, or under-report findings to dodge it. The self-recursive review loop bound as the first full-mode action — the protocol loop primarily (host-independent), plus a /goal Stop-hook gate WHEN available — BLOCKS stopping until findings are validated. — why: an unvalidated finding is an unproven claim, and a second self-review catches the misreads and inflation Round 1 rationalized.
[BLOCKING] Execute skill steps in declared order. NEVER skip, reorder, or merge steps without explicit user approval.
[BLOCKING] Before each step or sub-skill call, update task tracking: set in_progress when step starts, set completed when step ends.
[BLOCKING] Every completed/skipped step MUST include brief evidence or explicit skip reason.
[BLOCKING] If Task tools are unavailable, create and maintain an equivalent step-by-step plan tracker with the same status transitions.
Quick Summary
Goal: Resolve the requested review target and apply the matching adversarial review path (plan/PBI rationale, code changes, docs/spec/report, findings, or explicit artifact) so decisions, findings, and plans survive adversarial rationale review before downstream work proceeds.
Summary: (read-this-if-nothing-else digest — the skill's purpose + ALL main steps)
- PURPOSE — be the adversarial rationale reviewer: every plan/PBI/diff/doc/spec/report/finding survives a SKEPTIC pass before downstream work proceeds; success metric is Easy-to-Change (lower future change cost or reject). Gate EVERY finding on
file:line + severity + confidence.
- STEP 1 — DETECT MODE FIRST (recursion control):
--validate-findings is TERMINAL — NEVER re-invokes /why-review, NEVER runs the gate, NEVER spawns a sub-agent; full mode may call itself ONCE in validate-findings mode. Non-negotiable guard. — why: any of these from terminal mode loops infinitely.
- STEP 2 — FULL-MODE FIRST ACTION → bind the self-recursive review loop: the protocol loop is the primary, host-independent binding (you self-drive review → validate → reconcile → full re-review until CLEAN with no new findings; max 2 re-dos, then escalate), and a
/goal gate is an optional accelerator invoked WHEN available (its absence never weakens the loop) — NEVER bind it in terminal mode; "self-fix" = reconcile this review's OWN findings set, not code. THEN Task Bootstrap: create phase tasks + the MANDATORY Findings Validation Gate closing task.
- STEP 3 — RESOLVE TARGET TYPE before any review (commit/PR/diff → code-change; PBI/spec/doc → artifact; "no active plan" ONLY for an unresolved plan-rationale request — NEVER silently convert), read the active Goal Contract, then route by concern (code-reviewer / security-auditor / performance-optimizer / general-purpose). Integration tests in the target → apply the Integration-Test-Review Linkage (read
/integration-test-review's 8 gates, or delegate in standalone full mode) — SKIPPED under its 4-row recursion guard.
- STEP 4 — REVIEW as SKEPTIC → complete ALL 7 Anti-Bias Gate boxes (steel-man rejected alt · unseen alternative · args against · stressed assumptions · pre-mortem · pros/cons symmetry · Trade-Off Interrogation Gate) + Validation Checklist (presence AND quality depth) + Round 2 re-review; triangulate spec↔tests↔code — any disagreeing face is a finding, presence is NEVER a pass.
- TRADE-OFF GATE — ALWAYS ASK, on every decision AND every recommendation YOU make: (1) is there any trade-off? name the sacrifice — "none" is an unfinished analysis, so state the dimensions checked; (2) is it worth it? gain vs cost, who pays, when → WORTH IT / NOT WORTH IT / UNCLEAR; (3) is it material enough to confirm with the user? irreversible · cost shifted elsewhere · quality attribute traded · boundary crossed · high-consequence path · UNCLEAR → STOP and confirm via
AskUserQuestion BEFORE the verdict. Emit the Trade-Off Assessment table; a material trade-off unconfirmed = NEVER PASS.
- STEP 5 — FINDINGS VALIDATION GATE on your OWN findings (any severity): re-invoke terminal
--validate-findings, reconcile, RE-DO the full review until CLEAN with no new findings (max 2), then ask next step via AskUserQuestion (+ conditional /llm-council). Dual-feedback: a behavior-changing finding needs BOTH a spec-drift verdict (CODE-WRONG / SPEC-STALE / AMBIGUOUS / SPEC-SILENT / in-sync) AND a test-feedback action; SPEC-SILENT also REQUIRES §4 BR/§3 AC + §8 TC enrichment — a missing axis is HAS-ISSUES, never clean.
Workflow: Detect mode/target → (full mode only) bind the self-recursive review loop (protocol-primary; optional /goal accelerator when available) → route path/docs/graph/sub-agent focus → review dimensions/adversarial gates/Easy-to-Change → validate findings via terminal --validate-findings → reconcile + holistic full re-review until CLEAN with no new findings (max 2 re-dos) → ask next step in full mode.
Key Rules: MUST ATTENTION resolve target type BEFORE review. MUST ATTENTION every finding needs file:line, severity, confidence, best-practice rationale. MUST ATTENTION ask the 3 trade-off questions on every decision AND every recommendation (trade-off? worth it? material → confirm with user); NEVER accept "no trade-off" unexamined, NEVER decide a material trade-off silently. NEVER say "No active plan" except unresolved plan-rationale request. NEVER call /why-review from validate-findings. MUST ATTENTION judge by Easy-to-Change: lower future change cost or reject.
Your Mission
Review Mode (DETECT FIRST — recursion control)
Detect mode from $ARGUMENTS BEFORE any review work:
| Mode |
Trigger in $ARGUMENTS |
What it runs |
Recursion |
| full (default) |
no validate-findings token |
Full design-rationale review (Validation Checklist + Adversarial Rounds below), THEN the Findings Validation Gate closing task — which re-invokes THIS skill in validate-findings mode on its own findings. |
May call itself ONCE in validate-findings mode (same session). |
| validate-findings |
$ARGUMENTS contains --validate-findings / mode=validate-findings / validate findings in |
ONLY the Findings Validation Routine against the supplied findings/report — verify each finding is correct, proof-backed, reasonable, best-practice; surface missed enhancements; emit a CLEAN / HAS-ISSUES verdict. |
TERMINAL — NEVER calls /why-review, NEVER runs the gate, NEVER spawns a sub-agent. Stops recursion. |
Recursion guard (NON-NEGOTIABLE): validate-findings terminates. MUST NOT invoke /why-review or validation gate — prevents infinite recursion. Re-do loop lives in CALLER, max 2 re-dos, SAME main-agent session, NEVER spawned sub-agent.
In validate-findings mode: skip full Validation Checklist, Adversarial Rounds, Task Bootstrap, Next-Steps council gate. Jump straight to Findings Validation Routine, emit verdict, return to caller.
Bind the Self-Recursive Review Loop (full mode — FIRST ACTION, after mode detection; protocol-first, /goal optional)
MUST ATTENTION: In full mode only, the FIRST action after mode detection — before Task Bootstrap, before any review work — binds this skill's self-recursive review loop so you cannot stop until this review's own findings are all validated and a holistic re-review surfaces nothing new (or a bounded escalation fires). The loop is bound by TWO layers: the protocol loop (primary, host-independent) and an optional /goal accelerator. Correctness rides on the protocol loop — the project rule is that hooks/commands are accelerators only, so /goal's absence NEVER weakens the loop.
Entry gate:
- Run in full mode (no
validate-findings token).
- SKIP in
validate-findings terminal mode — that mode only returns a verdict to its caller and MUST NOT bind a loop, install a goal, create a closing task, or loop (recursion guard). Record nothing.
1. Protocol loop — ALWAYS binding (hook/command-independent). You, the running agent, are personally responsible for not stopping until the loop converges or bounded-escalates. This binds Claude, Codex, and Copilot equally, whether or not /goal exists:
Run the full adversarial review (Validation Checklist + both Adversarial Rounds) over the whole target → run /why-review --validate-findings on the findings → reconcile (drop unproven/inflated findings, fix proof gaps, ADD surfaced findings/enhancements) → re-run the FULL review over the WHOLE target combined with the reconciled findings (not just re-checking the changed findings) → loop until a complete pass yields zero new findings and validation returns CLEAN, or a bounded blocker escalates. Max 2 re-do rounds, then escalate via AskUserQuestion. Do not stop while a finding is unvalidated or a re-review would surface new findings.
Treat this as a standing obligation you re-read at the Findings Validation Gate — NOT a one-time note you can rationalize away after the first pass.
2. /goal command — invoke as an accelerator WHEN AVAILABLE. If a /goal command exists and you are permitted to run it in this environment, ALSO invoke it (a real command call, NOT a paraphrase, NOT a Goal Contract file substituted for it) with a condition encoding THIS skill's self-recursive loop, so a session Stop hook mechanically enforces it:
/goal why-review self-recursive loop: run the full adversarial review (Validation Checklist + both Adversarial Rounds) over the whole target → run /why-review --validate-findings on the findings → reconcile (drop unproven/inflated findings, fix proof gaps, ADD surfaced findings/enhancements) → re-run the FULL review over the WHOLE target combined with the reconciled findings (not just re-checking the changed findings) → loop until a complete pass yields zero new findings and validation returns CLEAN, or a bounded blocker escalates. Max 2 re-do rounds, then escalate via AskUserQuestion. Do not stop while a finding is unvalidated or a re-review would surface new findings.
The /goal Stop hook blocks stopping until the condition holds and auto-clears when met — do not tell the user to clear it.
If /goal is unavailable, unregistered, or not permitted (e.g. Codex/Copilot, or a Claude run without the command): DO NOT error, DO NOT block, and DO NOT invent a stand-in gate. Record ONE line where you track the review (the closing Findings Validation Gate task, or the active Goal Contract if one exists) — /goal accelerator unavailable — review loop bound by protocol (above) — and proceed. The protocol loop IS the gate, enforced by discipline instead of a hook.
why-review fixes its OWN findings set, not code. "Self-fix" here = reconcile the findings report so every surviving finding is correct, proof-backed, reasonable, best-practice, and nothing is missed — the same loop the Findings Validation Gate runs, now made unabandonable by the goal gate. Code/spec/test fixes remain the caller's job; this skill is review-only.
Task Bootstrap (full mode — do at skill START)
Before review work, TaskCreate phase tasks AND required closing task:
Create at START. Keep the closing task pending until findings exist; then execute before skill completes. In validate-findings mode, do NOT create either task.
First Principle — Easy to Change
Success metric: future change cost. DRY, SRP, abstraction, design patterns, naming, layering, tests exist to make next change cheaper.
When reviewing code/refactor/test/abstraction, ask: does this make next change cheaper or more expensive?
- Reject "best practices" raising change cost: premature abstraction, speculative generality, leaky indirection, ceremony without payoff.
- Name real enemies in findings: coupling, hidden state, duplicated knowledge, unclear intent, irreversible decisions exposed too early.
- Prefer simple design easy to change over sophisticated design hard to change.
Apply before any rule/checklist below; if downstream rule raises change cost, this principle wins.
Adversarial Review Mindset (NON-NEGOTIABLE)
Default stance: SKEPTIC, not validator. Your job is to find what's wrong, not confirm what's right.
Confirmation bias trap: After reading a coherent plan, AI naturally finds reasons to agree. Current context (post-plan, post-fix) amplifies this — you already saw the reasoning and rationalized it. This section breaks that loop. — why: a reviewer who already endorsed the reasoning cannot also be its skeptic without a forced reset.
Adversarial Techniques (apply ALL before concluding)
| Technique |
Think |
| Steel-Man |
Argue FOR rejected alternative. Would a 10-year domain senior choose it? If yes, dismissal needs stronger proof. |
| Why NOT? |
For every "chose X because Y", ask what X sacrifices. |
| Assumption Stress Test |
List top 3 assumptions; ask impact if wrong. Strong plan survives 2/3 false. |
| Pre-Mortem |
Assume 3-month production failure; write one plausible scenario. |
| Unseen Alternatives |
Identify 1-2 approaches not mentioned; absence without exclusion reasoning = weak coverage. |
| Pros/Cons Symmetry |
Count chosen-approach pros/cons. Pros > cons by 2:1 means likely bias. |
| Contrarian Pass |
Before finding/verdict, argue opposite conclusion in 2 sentences; choose stronger argument. |
| Trade-Off Interrogation |
Ask the 3 questions (below): is there a trade-off? · is it worth it? · is it material enough to confirm with the user? |
Forbidden Patterns
| Forbidden pattern |
Required correction |
| "Looks good because..." |
Lead with challenges first. |
| Presence = quality |
Test quality depth; real alternatives, causal rationale. |
| Vague rationale |
Demand metric + cost: better at what cost? |
| Asymmetric trade-offs |
Treat 3 pros / 1 con as incomplete analysis. |
| "Looks fine" |
Provide adversarial challenge evidence. |
| "No trade-off" / "pure win" |
Name the dimensions checked and why each is unaffected; unexamined ≠ absent. |
| Material trade-off decided silently |
Escalate to the user via AskUserQuestion; a one-way door is never yours to walk through. |
Anti-Bias Gate (MANDATORY before finalizing verdict)
Complete ALL 7 checks before writing the final verdict (MUST ATTENTION):
- steel-man at least one rejected alternative (argue FOR it)
- identify at least 1 alternative NOT in the plan
- list 2-3 arguments AGAINST the chosen approach
- surface 2-3 hidden assumptions with stress tests
- run the pre-mortem (one concrete failure scenario)
- check pros/cons symmetry
- run the Trade-Off Interrogation Gate below (trade-off named · worth-it verdict · materiality escalation decided)
Any check incomplete → adversarial review NOT complete. Go back.
Trade-Off Interrogation Gate (MANDATORY — no verdict, no finding, no recommendation without it)
[BLOCKING] Ask these THREE questions EVERY time — about the decision under review AND about every recommendation YOU make. — why: a review that names benefits without naming their price is an endorsement, not a review; and the biggest trade-offs are the ones nobody wrote down.
1. Is there any trade-off? Name what this decision/recommendation SACRIFICES. Every choice buys something with something. "None" is NOT an acceptable answer — it is an unfinished analysis. To claim no material trade-off, state which dimensions you checked and why each is unaffected:
future change cost · complexity · performance/latency · memory/cost · coupling · reversibility · migration burden · operational/ops load · blast radius · security posture · testability · team skill/ramp · delivery time · UX.
2. Is it worth it? Weigh gain against sacrifice EXPLICITLY — what is gained · what it costs · who pays · when it comes due — then emit one verdict: WORTH IT / NOT WORTH IT / UNCLEAR. Anchor on Easy-to-Change: a trade-off raising future change cost needs a proportionate, named payoff, not a vague one. "Better" without a metric and a cost FAILS this question.
3. Is the trade-off material enough to CONFIRM WITH THE USER? A material trade-off is the user's call, never yours. MATERIAL when ANY row below holds:
| Material when the trade-off… |
Examples |
| Is irreversible — a one-way door |
data migration, public API/contract shape, storage format, framework/vendor lock-in |
| Shifts cost onto someone else |
another team, ops/on-call, the future maintainer, the end user |
| Trades one quality attribute for another |
correctness↔speed, security↔convenience, latency↔cost, simplicity↔flexibility |
| Crosses a boundary |
client↔server tier seam, service contract, event contract, shared library |
| Sits on a high-consequence path |
auth, money, data integrity, breaking change, High/Medium residual risk |
| Cannot be evidenced (worth-it verdict = UNCLEAR) |
gain or cost unquantifiable from available evidence |
- MATERIAL → STOP and confirm via
AskUserQuestion BEFORE the verdict stands: state the trade-off, both options, what each sacrifices, your recommendation. NEVER resolve a material trade-off silently on the user's behalf, and NEVER bury it as a Low-severity note.
- NOT material → record it inline in the Trade-Off Assessment table with a one-line justification and proceed; no escalation needed.
- In
validate-findings terminal mode: assess and record, do NOT escalate — that mode asks nothing (see Next Steps exemption); flag the unescalated material trade-off in the verdict so the CALLER escalates it.
Output: every review emits the Trade-Off Assessment table (see Output Format) — one row per reviewed decision and per recommendation you make. An empty table with findings present is an incomplete review.
Target Resolution (DO THIS BEFORE REVIEW)
Analyze user request, not only literal argument shape. Determine target, then choose matching path.
| User request / evidence |
Review path |
Required target work |
Explicit plan directory, plan.md, phase files |
Plan-rationale review |
Read plan.md and all phase-*.md files. |
| PBI/story/spec planning artifact, rationale request |
PBI/artifact rationale review |
Read the named artifact and related acceptance/design/risk sections; if it references plan files, read those too. |
Commit SHA, Commit: ..., PR/merge commit, git diff |
Code-change review |
Establish the diff range, read changed files, run graph impact when available, and apply code-review/adversarial review protocols. |
| Branch comparison or uncommitted changes |
Code-change review |
Use the requested branch/diff or git diff; read changed files and tests/docs touched by the diff. |
| Docs/spec/report/findings path |
Artifact review |
Read the target artifact and verify claims against source evidence; use rationale checklist only where the artifact is a plan/PBI. |
| Ambiguous request |
Infer from evidence; ask if unsafe |
Prefer a reasonable target from the request and repo evidence. Ask only when two plausible review paths would produce different work. |
Important defaults:
- Commit hash /
Commit: block => code-change review, not "no active plan."
- PBI file => review that PBI/artifact; no
plans/**/plan.md wrapper required.
- "No active plan found. Run
/plan first." valid ONLY for unresolved plan-rationale requests.
- MUST ATTENTION record target type, evidence, confidence; NEVER silently convert target types.
Active-goal read (BEFORE judging rationale): Resolve active Goal Contract per goal-contract-satisfaction-loop protocol (active plan goal.md → plans/goals/{YYMMDD-HHmm}-{slug}/goal.md). When one exists, review artifact's rationale AGAINST saved Original Request, Purpose, Success Criteria — flag rationale justifying work the saved goal never asked for, and saved required criteria the artifact's reasoning never addresses. When none exists, record No active goal — rationale reviewed against the current request only. Full mode only; --validate-findings terminal mode skips this read.
Review Focus Routing
| Detected concern |
Primary focus / sub-agent route |
| Source code / diff |
code-reviewer + embedded code-review protocols. |
| Integration/E2E tests in the target, OR a behavior change whose code has covering integration tests |
Apply the Integration-Test-Review Linkage below — /integration-test-review owns the 8 test-quality gates; this skill reads its protocol (Mode A) or delegates to it (Mode B), never re-derives them. |
| Auth, secrets, permissions, data |
security-auditor if available; otherwise code-reviewer with explicit security pass. |
| Latency, scale, memory, queries |
performance-optimizer if available; otherwise code-reviewer with explicit performance pass. |
| Plan / PBI / doc / spec |
general-purpose with rationale/artifact dimensions. |
| Mixed target |
Split focused passes by concern; aggregate findings after all passes. |
Code-Change Review Path
When target is code changes:
- Resolve the diff source:
- Commit SHA: use
git show --name-status and diff against its first parent.
- Merge commit: default to first-parent diff unless the user specifies another parent/range.
- Branch/range: use the user-supplied range.
- Uncommitted changes: use
git diff plus staged diff if relevant.
- Comprehend change context + trace full pipeline across BOTH boundaries (MANDATORY for code-change targets; N/A for pure plan/PBI/doc targets). Before deep file judging, write a one-line Change Context (what · intent · originating tier · main affected flow), then apply BOTH inlined blocks below:
SYNC:cross-stack-impact-trace for the client↔server tier seam (BE→FE forward, FE→BE backward) and SYNC:cross-service-check for the microservice / event / external / loosely-coupled boundary. Classify each seam/touchpoint NONE / ADDITIVE / BREAKING; a BREAKING seam whose other-side consumer is un-updated in the same diff is a HIGH-min finding. State Single-tier / monolith — N/A when no cross-boundary seam exists.
- Read the changed files and any nearby tests/docs required to prove behavior.
- Integration-test detection (CONDITIONAL). If the target contains integration/E2E test files, OR changes behavior-bearing code that has covering integration tests, run the Integration-Test-Review Linkage below before judging the
Test/spec/doc sync dimension. State No integration tests in target — linkage N/A when neither holds.
- Read project reference docs based on changed file types before judging patterns.
- If
.code-graph/graph.db exists, run graph blast-radius or trace on key changed files before concluding.
- Apply embedded code-review protocols by serial focused pass: bug detection, design patterns quality, logic/intention, test/spec verification, graph investigation, Easy-to-Change.
- Output findings first, with
file:line evidence, severity, confidence, and tests/docs gaps.
Integration-Test-Review Linkage (CONDITIONAL — advisory, guarded)
Purpose: this skill's Test/spec/doc sync dimension asks "does evidence prove tests/specs/docs protect the intended invariant?" — but the 8 gates answering it (assertion value · data state · repeatability · domain logic · spec traceability · three-way sync · change coverage · scenario fidelity) belong to /integration-test-review. Route to that owner; NEVER re-derive a weaker copy here. — why: a rationale review judging test quality by eye endorses assertions it never mutation-tested.
Recursion guard — SKIP entirely when ANY row holds. Record the deferral line, then proceed; NEVER invoke or read:
| Suppressing context |
Evidence |
Deferral line to record |
Mode is validate-findings |
Terminal mode — no sub-skill calls at all |
Linkage N/A — validate-findings is terminal. |
Invoked by /integration-test-review Phase 9 |
It calls this skill at integration-test-review/SKILL.md:429-431 and guards the reverse edge at :438 |
Linkage deferred — invoked by /integration-test-review Phase 9. |
Invoked by changes-review in ANY phase — 0.8 parallel rationale dimension, 6 validate-findings, or 7.5 holistic — or inside $workflow-review-changes |
changes-review/SKILL.md:395 (Phase 0.8, which states this deferral as a binding sub-agent constraint), :867 (Phase 6), :938 (Phase 7.5); its Phase 3.7 (:608-626) already owns the gate |
Linkage deferred to changes-review Phase 3.7 / parent workflow step. |
Invoked by /debug-investigate's Root Cause Validation gate |
debug-investigate/SKILL.md:151; inside integration-test-verify-loop that gate fires in a round already running /integration-test-review (integration-test-verify-loop/SKILL.md:98,110,495) |
Linkage deferred — debug-investigate gate; the verify loop owns the audit. |
— why: unguarded, this edge closes a cycle (why-review → integration-test-review → Phase 9 → why-review) and re-creates the duplicate-ownership defect integration-test-verify-loop/SKILL.md:31 removes.
Mode A — READ the protocol (DEFAULT). Read .claude/skills/integration-test-review/SKILL.md §"The 8 Quality Gates"; apply Gates 1-8 as review lenses over target tests. Cheap — no recursion, no sub-skill call. Findings enter this review's normal finding set with file:line evidence + severity.
Mode B — DELEGATE to /integration-test-review (ESCALATION). Invoke ONLY when ALL hold: no guard row fired · standalone full-mode review · target diff itself contains integration test files. Its GAP / SPEC-GAP verdicts become ordinary findings for this review's Findings Validation Gate.
Advisory, NEVER blocking — matches this skill's Enforcement: Advisory scope; mandatory coverage lives in changes-review Phase 3.7. — why: without this linkage a standalone rationale review silently skips test quality.
Rationale / Artifact Review Dimensions
Run one focused pass per applicable dimension; do NOT scan all dimensions simultaneously.
| Dimension |
Think |
| Target fit |
Did we resolve what user asked, with evidence and confidence? |
| Goal alignment |
Does the rationale serve the saved Goal Contract's purpose and success criteria — or drift past them? |
| Rationale depth |
Are alternatives real, causal, symmetric, assumption-aware? |
| Trade-off honesty |
What does this SACRIFICE, is it worth it, and is the trade-off material enough to confirm with the user? An unpriced benefit is a rationale gap. |
| Behavioral risk |
What breaks in happy, error, edge, and rollback paths? |
| Cross-boundary impact |
Does a changed contract break a consumer on the other client↔server tier (BE↔FE), or a loosely-coupled/external service or event consumer? (tier seam + service/event) |
| Test/spec/doc sync |
Does evidence prove tests/specs/docs protect the intended invariant and avoid stale claims? |
| Future change cost |
Does recommendation reduce coupling, hidden state, duplication, unclear intent? |
Validation Checklist
For plan/PBI/artifact rationale reviews, read resolved target first. If plan directory, read plan.md and all phase-*.md files. Check presence AND quality depth.
For code-change reviews, use Code-Change Review Path instead of forcing plan checklist. Still include adversarial analysis, pre-mortem, assumptions, evidence, findings validation.
Rule: Presence alone is NOT a pass. A section that exists but contains weak, asymmetric, or unverified reasoning FAILS quality depth.
Required Sections (in plan.md or phase files)
| # |
Section |
Presence Check |
Quality Depth Check (adversarial) |
| 1 |
Problem Statement |
2-3 sentences describing the problem |
Is the problem scoped correctly? Could it be framed differently to lead to a different solution? Are symptoms confused with root cause? |
| 2 |
Alternatives Considered |
Minimum 2 alternatives listed with pros/cons |
Are alternatives real (not strawmen)? Would a domain expert seriously consider each? Are the cons of the CHOSEN approach listed, not just cons of the others? |
| 3 |
Design Rationale |
Explicit reasoning linking decision to trade-offs |
Is reasoning causal (X leads to Y) or just descriptive (X is better)? Are hidden assumptions surfaced? Does it address failure modes, not just success modes? |
| 4 |
Risk Assessment |
At least 1 risk per phase |
Are risks ranked by severity? Are mitigations concrete actions or vague intentions ("monitor closely")? Is there at least one risk about the approach itself (not just execution)? |
| 5 |
Ownership |
Clear who maintains code post-merge |
Implicit OK (author owns), explicit better |
Residual Risk Gate
- Challenge over-broad scope, weak rejected alternatives, and any High/Medium residual risk.
- High/Medium risks must be fixed, reduced, or explicitly accepted by user/owner before PASS.
- AI-extracted specs/TCs are not accepted evidence unless the canonical owner/review gate accepted them.
Optional (Flag if Missing, Don't Fail)
| # |
Section |
When Required |
Quality Depth Check |
| 6 |
Operational Impact |
Service-layer or API changes |
Are rollback steps defined? What breaks if this is reverted? |
| 7 |
Cross-Service Impact |
Changes touching multiple microservices |
Are all downstream consumers identified? Who needs to be notified? |
| 8 |
Migration Strategy |
Database schema or data changes |
Is there a rollback plan? Is it tested on a data sample? |
Output Format
## Why-Review Results
**Plan:** {plan path}
**Target Type:** {plan/PBI/code changes/docs/spec/report/artifact}
**Target:** {path, commit, branch range, or artifact}
**Date:** {date}
**Verdict:** PASS / NEEDS WORK
### Checklist
| # | Check | Presence | Quality Depth | Notes |
| --- | ----------------------- | --------- | ------------- | -------------------------------------------------------------------- |
| 1 | Problem Statement | ✅/❌ | ✅/⚠️/❌ | {what's strong / what's w
…(truncated)
1---2name: why-review-23description: "[Code Quality] Use when reviewing rationale and change quality for plans, PBIs, commits, diffs, docs, specs, reports, or explicit artifacts."4---56> **[GOAL REMINDER — MUST ATTENTION CRITICAL]**7>8> Ensure every review target is reasonable, correct, proof-backed, and best-practice aligned.9> **ALWAYS ASK THE 3 TRADE-OFF QUESTIONS (every decision AND every recommendation you make):** (1) **is there any trade-off?** — name what it sacrifices; "none" is an unfinished analysis, not an answer; (2) **is it worth it?** — gain vs cost, who pays, when → WORTH IT / NOT WORTH IT / UNCLEAR; (3) **is the trade-off material enough to confirm with the user?** — irreversible, cost shifted to someone else, one quality attribute traded for another, boundary crossed, high-consequence path, or UNCLEAR → STOP and confirm via `AskUserQuestion` BEFORE the verdict. NEVER resolve a material trade-off silently. — why: naming a benefit without its price is an endorsement, not a review, and a one-way door is the user's call to walk through, never yours.10> **MANDATORY SECOND PASS (full mode):** whenever Round 1 produces ANY finding, you MUST call `/why-review --validate-findings` a SECOND time on those findings to confirm each is correct and reasonable BEFORE handoff. NEVER skip it; NEVER suppress, demote, or under-report findings to dodge it. The self-recursive review loop bound as the first full-mode action — the **protocol loop primarily** (host-independent), plus a `/goal` Stop-hook gate WHEN available — BLOCKS stopping until findings are validated. — why: an unvalidated finding is an unproven claim, and a second self-review catches the misreads and inflation Round 1 rationalized.1112<!-- PROMPT-ENHANCE:STEP-TASK-ANCHOR:START -->1314> **[BLOCKING]** Execute skill steps in declared order. NEVER skip, reorder, or merge steps without explicit user approval.15> **[BLOCKING]** Before each step or sub-skill call, update task tracking: set `in_progress` when step starts, set `completed` when step ends.16> **[BLOCKING]** Every completed/skipped step MUST include brief evidence or explicit skip reason.17> **[BLOCKING]** If Task tools are unavailable, create and maintain an equivalent step-by-step plan tracker with the same status transitions.1819<!-- PROMPT-ENHANCE:STEP-TASK-ANCHOR:END -->2021## Quick Summary2223**Goal:** Resolve the requested review target and apply the matching adversarial review path (plan/PBI rationale, code changes, docs/spec/report, findings, or explicit artifact) so decisions, findings, and plans survive adversarial rationale review before downstream work proceeds.2425**Summary:** (read-this-if-nothing-else digest — the skill's purpose + ALL main steps)2627- **PURPOSE** — be the adversarial rationale reviewer: every plan/PBI/diff/doc/spec/report/finding survives a SKEPTIC pass before downstream work proceeds; success metric is Easy-to-Change (lower future change cost or reject). Gate EVERY finding on `file:line` + severity + confidence.28- **STEP 1 — DETECT MODE FIRST** (recursion control): `--validate-findings` is TERMINAL — NEVER re-invokes `/why-review`, NEVER runs the gate, NEVER spawns a sub-agent; full mode may call itself ONCE in validate-findings mode. Non-negotiable guard. — why: any of these from terminal mode loops infinitely.29- **STEP 2 — FULL-MODE FIRST ACTION** → bind the self-recursive review loop: the **protocol loop is the primary, host-independent binding** (you self-drive review → validate → reconcile → full re-review until CLEAN with no new findings; max 2 re-dos, then escalate), and a `/goal` gate is an **optional accelerator invoked WHEN available** (its absence never weakens the loop) — NEVER bind it in terminal mode; "self-fix" = reconcile this review's OWN findings set, not code. THEN Task Bootstrap: create phase tasks + the MANDATORY Findings Validation Gate closing task.30- **STEP 3 — RESOLVE TARGET TYPE** before any review (commit/PR/diff → code-change; PBI/spec/doc → artifact; "no active plan" ONLY for an unresolved plan-rationale request — NEVER silently convert), read the active Goal Contract, then route by concern (code-reviewer / security-auditor / performance-optimizer / general-purpose). **Integration tests in the target → apply the Integration-Test-Review Linkage** (read `/integration-test-review`'s 8 gates, or delegate in standalone full mode) — SKIPPED under its 4-row recursion guard.31- **STEP 4 — REVIEW as SKEPTIC** → complete ALL 7 Anti-Bias Gate boxes (steel-man rejected alt · unseen alternative · args against · stressed assumptions · pre-mortem · pros/cons symmetry · **Trade-Off Interrogation Gate**) + Validation Checklist (presence AND quality depth) + Round 2 re-review; triangulate spec↔tests↔code — any disagreeing face is a finding, presence is NEVER a pass.32- **TRADE-OFF GATE — ALWAYS ASK, on every decision AND every recommendation YOU make:** (1) **is there any trade-off?** name the sacrifice — "none" is an unfinished analysis, so state the dimensions checked; (2) **is it worth it?** gain vs cost, who pays, when → WORTH IT / NOT WORTH IT / UNCLEAR; (3) **is it material enough to confirm with the user?** irreversible · cost shifted elsewhere · quality attribute traded · boundary crossed · high-consequence path · UNCLEAR → **STOP and confirm via `AskUserQuestion` BEFORE the verdict**. Emit the `Trade-Off Assessment` table; a material trade-off unconfirmed = NEVER PASS.33- **STEP 5 — FINDINGS VALIDATION GATE** on your OWN findings (any severity): re-invoke terminal `--validate-findings`, reconcile, RE-DO the full review until CLEAN with no new findings (max 2), then ask next step via `AskUserQuestion` (+ conditional `/llm-council`). Dual-feedback: a behavior-changing finding needs BOTH a spec-drift verdict (CODE-WRONG / SPEC-STALE / AMBIGUOUS / SPEC-SILENT / in-sync) AND a test-feedback action; SPEC-SILENT also REQUIRES §4 BR/§3 AC + §8 TC enrichment — a missing axis is HAS-ISSUES, never clean.3435**Workflow:** Detect mode/target → (full mode only) bind the self-recursive review loop (protocol-primary; optional `/goal` accelerator when available) → route path/docs/graph/sub-agent focus → review dimensions/adversarial gates/Easy-to-Change → validate findings via terminal `--validate-findings` → reconcile + holistic full re-review until CLEAN with no new findings (max 2 re-dos) → ask next step in full mode.3637**Key Rules:** MUST ATTENTION resolve target type BEFORE review. MUST ATTENTION every finding needs `file:line`, severity, confidence, best-practice rationale. MUST ATTENTION ask the 3 trade-off questions on every decision AND every recommendation (trade-off? worth it? material → confirm with user); NEVER accept "no trade-off" unexamined, NEVER decide a material trade-off silently. NEVER say "No active plan" except unresolved plan-rationale request. NEVER call `/why-review` from `validate-findings`. MUST ATTENTION judge by Easy-to-Change: lower future change cost or reject.3839## Your Mission4041<task>42$ARGUMENTS43</task>4445## Review Mode (DETECT FIRST — recursion control)4647Detect mode from `$ARGUMENTS` BEFORE any review work:4849| Mode | Trigger in `$ARGUMENTS` | What it runs | Recursion |50| --------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |51| **full** (default) | no `validate-findings` token | Full design-rationale review (Validation Checklist + Adversarial Rounds below), THEN the **Findings Validation Gate** closing task — which re-invokes THIS skill in `validate-findings` mode on its own findings. | May call itself **ONCE** in `validate-findings` mode (same session). |52| **validate-findings** | `$ARGUMENTS` contains `--validate-findings` / `mode=validate-findings` / `validate findings in` | ONLY the **Findings Validation Routine** against the supplied findings/report — verify each finding is correct, proof-backed, reasonable, best-practice; surface missed enhancements; emit a CLEAN / HAS-ISSUES verdict. | **TERMINAL — NEVER calls `/why-review`, NEVER runs the gate, NEVER spawns a sub-agent.** Stops recursion. |5354> **Recursion guard (NON-NEGOTIABLE):** `validate-findings` terminates. MUST NOT invoke `/why-review` or validation gate — prevents infinite recursion. Re-do loop lives in CALLER, max 2 re-dos, SAME main-agent session, NEVER spawned sub-agent.5556> **In `validate-findings` mode:** skip full Validation Checklist, Adversarial Rounds, Task Bootstrap, Next-Steps council gate. Jump straight to **Findings Validation Routine**, emit verdict, return to caller.5758## Bind the Self-Recursive Review Loop (full mode — FIRST ACTION, after mode detection; protocol-first, `/goal` optional)5960> **MUST ATTENTION:** In **full mode only**, the FIRST action after mode detection — before Task Bootstrap, before any review work — binds this skill's self-recursive review loop so you cannot stop until this review's own findings are all validated and a holistic re-review surfaces nothing new (or a bounded escalation fires). The loop is bound by TWO layers: the **protocol loop (primary, host-independent)** and an **optional `/goal` accelerator**. Correctness rides on the protocol loop — the project rule is that hooks/commands are accelerators only, so `/goal`'s absence NEVER weakens the loop.6162**Entry gate:**6364- **Run** in full mode (no `validate-findings` token).65- **SKIP** in `validate-findings` terminal mode — that mode only returns a verdict to its caller and MUST NOT bind a loop, install a goal, create a closing task, or loop (recursion guard). Record nothing.6667**1. Protocol loop — ALWAYS binding (hook/command-independent).** You, the running agent, are personally responsible for not stopping until the loop converges or bounded-escalates. This binds Claude, Codex, and Copilot equally, whether or not `/goal` exists:6869> Run the full adversarial review (Validation Checklist + both Adversarial Rounds) over the whole target → run `/why-review --validate-findings` on the findings → reconcile (drop unproven/inflated findings, fix proof gaps, ADD surfaced findings/enhancements) → re-run the FULL review over the WHOLE target combined with the reconciled findings (not just re-checking the changed findings) → loop until a complete pass yields zero new findings and validation returns CLEAN, or a bounded blocker escalates. Max 2 re-do rounds, then escalate via `AskUserQuestion`. Do not stop while a finding is unvalidated or a re-review would surface new findings.7071Treat this as a standing obligation you re-read at the Findings Validation Gate — NOT a one-time note you can rationalize away after the first pass.7273**2. `/goal` command — invoke as an accelerator WHEN AVAILABLE.** If a `/goal` command exists and you are permitted to run it in this environment, ALSO invoke it (a real command call, NOT a paraphrase, NOT a Goal Contract file substituted for it) with a condition encoding THIS skill's self-recursive loop, so a session Stop hook mechanically enforces it:7475```76/goal why-review self-recursive loop: run the full adversarial review (Validation Checklist + both Adversarial Rounds) over the whole target → run /why-review --validate-findings on the findings → reconcile (drop unproven/inflated findings, fix proof gaps, ADD surfaced findings/enhancements) → re-run the FULL review over the WHOLE target combined with the reconciled findings (not just re-checking the changed findings) → loop until a complete pass yields zero new findings and validation returns CLEAN, or a bounded blocker escalates. Max 2 re-do rounds, then escalate via AskUserQuestion. Do not stop while a finding is unvalidated or a re-review would surface new findings.77```7879The `/goal` Stop hook blocks stopping until the condition holds and auto-clears when met — do not tell the user to clear it.8081**If `/goal` is unavailable, unregistered, or not permitted** (e.g. Codex/Copilot, or a Claude run without the command): DO NOT error, DO NOT block, and DO NOT invent a stand-in gate. Record ONE line where you track the review (the closing Findings Validation Gate task, or the active Goal Contract if one exists) — `/goal accelerator unavailable — review loop bound by protocol (above)` — and proceed. The protocol loop IS the gate, enforced by discipline instead of a hook.8283> **why-review fixes its OWN findings set, not code.** "Self-fix" here = reconcile the findings report so every surviving finding is correct, proof-backed, reasonable, best-practice, and nothing is missed — the same loop the Findings Validation Gate runs, now made unabandonable by the goal gate. Code/spec/test fixes remain the caller's job; this skill is review-only.8485## Task Bootstrap (full mode — do at skill START)8687Before review work, `TaskCreate` phase tasks AND required closing task:8889- [ ] `[Why-Review] Bind self-recursive review loop — protocol-primary; optional /goal accelerator when available (full mode only)` — in_progress **(MANDATORY FIRST TASK — skip in `validate-findings` mode)**90- [ ] `[Why-Review] Findings Validation Gate — if ANY findings exist, run /why-review --validate-findings on them; re-do until CLEAN (max 2)` — pending **(MANDATORY CLOSING TASK)**9192> Create at START. Keep the closing task `pending` until findings exist; then execute before skill completes. In `validate-findings` mode, do NOT create either task.9394## First Principle — Easy to Change9596> **Success metric: future change cost.** DRY, SRP, abstraction, design patterns, naming, layering, tests exist to make next change cheaper.9798When reviewing code/refactor/test/abstraction, ask: **does this make next change cheaper or more expensive?**99100- Reject "best practices" raising change cost: premature abstraction, speculative generality, leaky indirection, ceremony without payoff.101- Name real enemies in findings: **coupling, hidden state, duplicated knowledge, unclear intent, irreversible decisions exposed too early**.102- Prefer simple design easy to change over sophisticated design hard to change.103104Apply before any rule/checklist below; if downstream rule raises change cost, this principle wins.105106---107108## Adversarial Review Mindset (NON-NEGOTIABLE)109110**Default stance: SKEPTIC, not validator. Your job is to find what's wrong, not confirm what's right.**111112> **Confirmation bias trap:** After reading a coherent plan, AI naturally finds reasons to agree. Current context (post-plan, post-fix) amplifies this — you already saw the reasoning and rationalized it. This section breaks that loop. — why: a reviewer who already endorsed the reasoning cannot also be its skeptic without a forced reset.113114### Adversarial Techniques (apply ALL before concluding)115116| Technique | Think |117| ----------------------- | ---------------------------------------------------------------------------------------------------------------------- |118| Steel-Man | Argue FOR rejected alternative. Would a 10-year domain senior choose it? If yes, dismissal needs stronger proof. |119| Why NOT? | For every "chose X because Y", ask what X sacrifices. |120| Assumption Stress Test | List top 3 assumptions; ask impact if wrong. Strong plan survives 2/3 false. |121| Pre-Mortem | Assume 3-month production failure; write one plausible scenario. |122| Unseen Alternatives | Identify 1-2 approaches not mentioned; absence without exclusion reasoning = weak coverage. |123| Pros/Cons Symmetry | Count chosen-approach pros/cons. Pros > cons by 2:1 means likely bias. |124| Contrarian Pass | Before finding/verdict, argue opposite conclusion in 2 sentences; choose stronger argument. |125| Trade-Off Interrogation | Ask the 3 questions (below): is there a trade-off? · is it worth it? · is it material enough to confirm with the user? |126127### Forbidden Patterns128129| Forbidden pattern | Required correction |130| ----------------------------------- | ------------------------------------------------------------------------------------------ |131| "Looks good because..." | Lead with challenges first. |132| Presence = quality | Test quality depth; real alternatives, causal rationale. |133| Vague rationale | Demand metric + cost: better at what cost? |134| Asymmetric trade-offs | Treat 3 pros / 1 con as incomplete analysis. |135| "Looks fine" | Provide adversarial challenge evidence. |136| "No trade-off" / "pure win" | Name the dimensions checked and why each is unaffected; unexamined ≠ absent. |137| Material trade-off decided silently | Escalate to the user via `AskUserQuestion`; a one-way door is never yours to walk through. |138139### Anti-Bias Gate (MANDATORY before finalizing verdict)140141Complete ALL 7 checks before writing the final verdict (MUST ATTENTION):142143- steel-man at least one rejected alternative (argue FOR it)144- identify at least 1 alternative NOT in the plan145- list 2-3 arguments AGAINST the chosen approach146- surface 2-3 hidden assumptions with stress tests147- run the pre-mortem (one concrete failure scenario)148- check pros/cons symmetry149- run the **Trade-Off Interrogation Gate** below (trade-off named · worth-it verdict · materiality escalation decided)150151Any check incomplete → adversarial review NOT complete. Go back.152153## Trade-Off Interrogation Gate (MANDATORY — no verdict, no finding, no recommendation without it)154155> **[BLOCKING]** Ask these THREE questions EVERY time — about the decision under review AND about every recommendation YOU make. — why: a review that names benefits without naming their price is an endorsement, not a review; and the biggest trade-offs are the ones nobody wrote down.156157**1. Is there any trade-off?** Name what this decision/recommendation SACRIFICES. Every choice buys something with something. "None" is NOT an acceptable answer — it is an unfinished analysis. To claim no material trade-off, state which dimensions you checked and why each is unaffected:158159> future change cost · complexity · performance/latency · memory/cost · coupling · reversibility · migration burden · operational/ops load · blast radius · security posture · testability · team skill/ramp · delivery time · UX.160161**2. Is it worth it?** Weigh gain against sacrifice EXPLICITLY — **what is gained · what it costs · who pays · when it comes due** — then emit one verdict: **WORTH IT / NOT WORTH IT / UNCLEAR**. Anchor on Easy-to-Change: a trade-off raising future change cost needs a proportionate, named payoff, not a vague one. "Better" without a metric and a cost FAILS this question.162163**3. Is the trade-off material enough to CONFIRM WITH THE USER?** A material trade-off is the user's call, never yours. MATERIAL when ANY row below holds:164165| Material when the trade-off… | Examples |166| ------------------------------------------------ | ----------------------------------------------------------------------------------- |167| Is irreversible — a one-way door | data migration, public API/contract shape, storage format, framework/vendor lock-in |168| Shifts cost onto someone else | another team, ops/on-call, the future maintainer, the end user |169| Trades one quality attribute for another | correctness↔speed, security↔convenience, latency↔cost, simplicity↔flexibility |170| Crosses a boundary | client↔server tier seam, service contract, event contract, shared library |171| Sits on a high-consequence path | auth, money, data integrity, breaking change, High/Medium residual risk |172| Cannot be evidenced (worth-it verdict = UNCLEAR) | gain or cost unquantifiable from available evidence |173174- **MATERIAL → STOP and confirm via `AskUserQuestion`** BEFORE the verdict stands: state the trade-off, both options, what each sacrifices, your recommendation. NEVER resolve a material trade-off silently on the user's behalf, and NEVER bury it as a Low-severity note.175- **NOT material → record it inline** in the Trade-Off Assessment table with a one-line justification and proceed; no escalation needed.176- In `validate-findings` terminal mode: **assess and record, do NOT escalate** — that mode asks nothing (see Next Steps exemption); flag the unescalated material trade-off in the verdict so the CALLER escalates it.177178**Output:** every review emits the `Trade-Off Assessment` table (see Output Format) — one row per reviewed decision and per recommendation you make. An empty table with findings present is an incomplete review.179180## Target Resolution (DO THIS BEFORE REVIEW)181182Analyze user request, not only literal argument shape. Determine target, then choose matching path.183184| User request / evidence | Review path | Required target work |185| ---------------------------------------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |186| Explicit plan directory, `plan.md`, phase files | Plan-rationale review | Read `plan.md` and all `phase-*.md` files. |187| PBI/story/spec planning artifact, rationale request | PBI/artifact rationale review | Read the named artifact and related acceptance/design/risk sections; if it references plan files, read those too. |188| Commit SHA, `Commit: ...`, PR/merge commit, git diff | Code-change review | Establish the diff range, read changed files, run graph impact when available, and apply code-review/adversarial review protocols. |189| Branch comparison or uncommitted changes | Code-change review | Use the requested branch/diff or `git diff`; read changed files and tests/docs touched by the diff. |190| Docs/spec/report/findings path | Artifact review | Read the target artifact and verify claims against source evidence; use rationale checklist only where the artifact is a plan/PBI. |191| Ambiguous request | Infer from evidence; ask if unsafe | Prefer a reasonable target from the request and repo evidence. Ask only when two plausible review paths would produce different work. |192193**Important defaults:**1941951. Commit hash / `Commit:` block => code-change review, not "no active plan."1962. PBI file => review that PBI/artifact; no `plans/**/plan.md` wrapper required.1973. "No active plan found. Run `/plan` first." valid ONLY for unresolved plan-rationale requests.1984. MUST ATTENTION record target type, evidence, confidence; NEVER silently convert target types.199200**Active-goal read (BEFORE judging rationale):** Resolve active Goal Contract per goal-contract-satisfaction-loop protocol (active plan `goal.md` → `plans/goals/{YYMMDD-HHmm}-{slug}/goal.md`). When one exists, review artifact's rationale AGAINST saved Original Request, Purpose, Success Criteria — flag rationale justifying work the saved goal never asked for, and saved required criteria the artifact's reasoning never addresses. When none exists, record `No active goal — rationale reviewed against the current request only.` Full mode only; `--validate-findings` terminal mode skips this read.201202### Review Focus Routing203204| Detected concern | Primary focus / sub-agent route |205| --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |206| Source code / diff | `code-reviewer` + embedded code-review protocols. |207| Integration/E2E tests in the target, OR a behavior change whose code has covering integration tests | Apply the **Integration-Test-Review Linkage** below — `/integration-test-review` owns the 8 test-quality gates; this skill reads its protocol (Mode A) or delegates to it (Mode B), never re-derives them. |208| Auth, secrets, permissions, data | `security-auditor` if available; otherwise `code-reviewer` with explicit security pass. |209| Latency, scale, memory, queries | `performance-optimizer` if available; otherwise `code-reviewer` with explicit performance pass. |210| Plan / PBI / doc / spec | `general-purpose` with rationale/artifact dimensions. |211| Mixed target | Split focused passes by concern; aggregate findings after all passes. |212213### Code-Change Review Path214215When target is code changes:2162171. Resolve the diff source:218 - Commit SHA: use `git show --name-status` and diff against its first parent.219 - Merge commit: default to first-parent diff unless the user specifies another parent/range.220 - Branch/range: use the user-supplied range.221 - Uncommitted changes: use `git diff` plus staged diff if relevant.2222. **Comprehend change context + trace full pipeline across BOTH boundaries (MANDATORY for code-change targets; N/A for pure plan/PBI/doc targets).** Before deep file judging, write a one-line Change Context (what · intent · originating tier · main affected flow), then apply BOTH inlined blocks below: `SYNC:cross-stack-impact-trace` for the client↔server tier seam (BE→FE forward, FE→BE backward) and `SYNC:cross-service-check` for the microservice / event / external / loosely-coupled boundary. Classify each seam/touchpoint NONE / ADDITIVE / BREAKING; a BREAKING seam whose other-side consumer is un-updated in the same diff is a HIGH-min finding. State `Single-tier / monolith — N/A` when no cross-boundary seam exists.2233. Read the changed files and any nearby tests/docs required to prove behavior.2244. **Integration-test detection (CONDITIONAL).** If the target contains integration/E2E test files, OR changes behavior-bearing code that has covering integration tests, run the **Integration-Test-Review Linkage** below before judging the `Test/spec/doc sync` dimension. State `No integration tests in target — linkage N/A` when neither holds.2255. Read project reference docs based on changed file types before judging patterns.2266. If `.code-graph/graph.db` exists, run graph blast-radius or trace on key changed files before concluding.2277. Apply embedded code-review protocols by serial focused pass: bug detection, design patterns quality, logic/intention, test/spec verification, graph investigation, Easy-to-Change.2288. Output findings first, with `file:line` evidence, severity, confidence, and tests/docs gaps.229230### Integration-Test-Review Linkage (CONDITIONAL — advisory, guarded)231232> **Purpose:** this skill's `Test/spec/doc sync` dimension asks _"does evidence prove tests/specs/docs protect the intended invariant?"_ — but the 8 gates answering it (assertion value · data state · repeatability · domain logic · spec traceability · three-way sync · change coverage · scenario fidelity) belong to `/integration-test-review`. Route to that owner; NEVER re-derive a weaker copy here. — why: a rationale review judging test quality by eye endorses assertions it never mutation-tested.233234**Recursion guard — SKIP entirely when ANY row holds.** Record the deferral line, then proceed; NEVER invoke or read:235236| Suppressing context | Evidence | Deferral line to record |237| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |238| Mode is `validate-findings` | Terminal mode — no sub-skill calls at all | `Linkage N/A — validate-findings is terminal.` |239| Invoked by `/integration-test-review` Phase 9 | It calls this skill at `integration-test-review/SKILL.md:429-431` and guards the reverse edge at `:438` | `Linkage deferred — invoked by /integration-test-review Phase 9.` |240| Invoked by `changes-review` in ANY phase — 0.8 parallel rationale dimension, 6 validate-findings, or 7.5 holistic — or inside `$workflow-review-changes` | `changes-review/SKILL.md:395` (Phase 0.8, which states this deferral as a binding sub-agent constraint), `:867` (Phase 6), `:938` (Phase 7.5); its Phase 3.7 (`:608-626`) already owns the gate | `Linkage deferred to changes-review Phase 3.7 / parent workflow step.` |241| Invoked by `/debug-investigate`'s Root Cause Validation gate | `debug-investigate/SKILL.md:151`; inside `integration-test-verify-loop` that gate fires in a round already running `/integration-test-review` (`integration-test-verify-loop/SKILL.md:98,110,495`) | `Linkage deferred — debug-investigate gate; the verify loop owns the audit.` |242243> — why: unguarded, this edge closes a cycle (`why-review` → `integration-test-review` → Phase 9 → `why-review`) and re-creates the duplicate-ownership defect `integration-test-verify-loop/SKILL.md:31` removes.244245**Mode A — READ the protocol (DEFAULT).** Read `.claude/skills/integration-test-review/SKILL.md` §"The 8 Quality Gates"; apply Gates 1-8 as review lenses over target tests. Cheap — no recursion, no sub-skill call. Findings enter this review's normal finding set with `file:line` evidence + severity.246247**Mode B — DELEGATE to `/integration-test-review` (ESCALATION).** Invoke ONLY when ALL hold: no guard row fired · standalone full-mode review · target diff itself contains integration test files. Its GAP / SPEC-GAP verdicts become ordinary findings for this review's Findings Validation Gate.248249**Advisory, NEVER blocking** — matches this skill's `Enforcement: Advisory` scope; mandatory coverage lives in `changes-review` Phase 3.7. — why: without this linkage a standalone rationale review silently skips test quality.250251### Rationale / Artifact Review Dimensions252253Run one focused pass per applicable dimension; do NOT scan all dimensions simultaneously.254255| Dimension | Think |256| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |257| Target fit | Did we resolve what user asked, with evidence and confidence? |258| Goal alignment | Does the rationale serve the saved Goal Contract's purpose and success criteria — or drift past them? |259| Rationale depth | Are alternatives real, causal, symmetric, assumption-aware? |260| Trade-off honesty | What does this SACRIFICE, is it worth it, and is the trade-off material enough to confirm with the user? An unpriced benefit is a rationale gap. |261| Behavioral risk | What breaks in happy, error, edge, and rollback paths? |262| Cross-boundary impact | Does a changed contract break a consumer on the other client↔server tier (BE↔FE), or a loosely-coupled/external service or event consumer? (tier seam + service/event) |263| Test/spec/doc sync | Does evidence prove tests/specs/docs protect the intended invariant and avoid stale claims? |264| Future change cost | Does recommendation reduce coupling, hidden state, duplication, unclear intent? |265266## Validation Checklist267268For plan/PBI/artifact rationale reviews, read resolved target first. If plan directory, read `plan.md` and all `phase-*.md` files. Check **presence AND quality depth**.269270For code-change reviews, use Code-Change Review Path instead of forcing plan checklist. Still include adversarial analysis, pre-mortem, assumptions, evidence, findings validation.271272> **Rule:** Presence alone is NOT a pass. A section that exists but contains weak, asymmetric, or unverified reasoning FAILS quality depth.273274### Required Sections (in plan.md or phase files)275276| # | Section | Presence Check | Quality Depth Check (adversarial) |277| --- | --------------------------- | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |278| 1 | **Problem Statement** | 2-3 sentences describing the problem | Is the problem scoped correctly? Could it be framed differently to lead to a different solution? Are symptoms confused with root cause? |279| 2 | **Alternatives Considered** | Minimum 2 alternatives listed with pros/cons | Are alternatives real (not strawmen)? Would a domain expert seriously consider each? Are the cons of the CHOSEN approach listed, not just cons of the others? |280| 3 | **Design Rationale** | Explicit reasoning linking decision to trade-offs | Is reasoning causal (X leads to Y) or just descriptive (X is better)? Are hidden assumptions surfaced? Does it address failure modes, not just success modes? |281| 4 | **Risk Assessment** | At least 1 risk per phase | Are risks ranked by severity? Are mitigations concrete actions or vague intentions ("monitor closely")? Is there at least one risk about the approach itself (not just execution)? |282| 5 | **Ownership** | Clear who maintains code post-merge | Implicit OK (author owns), explicit better |283284## Residual Risk Gate285286- Challenge over-broad scope, weak rejected alternatives, and any High/Medium residual risk.287- High/Medium risks must be fixed, reduced, or explicitly accepted by user/owner before PASS.288- AI-extracted specs/TCs are not accepted evidence unless the canonical owner/review gate accepted them.289290### Optional (Flag if Missing, Don't Fail)291292| # | Section | When Required | Quality Depth Check |293| --- | ------------------------ | --------------------------------------- | ------------------------------------------------------------------ |294| 6 | **Operational Impact** | Service-layer or API changes | Are rollback steps defined? What breaks if this is reverted? |295| 7 | **Cross-Service Impact** | Changes touching multiple microservices | Are all downstream consumers identified? Who needs to be notified? |296| 8 | **Migration Strategy** | Database schema or data changes | Is there a rollback plan? Is it tested on a data sample? |297298## Output Format299300```markdown301## Why-Review Results302303**Plan:** {plan path}304**Target Type:** {plan/PBI/code changes/docs/spec/report/artifact}305**Target:** {path, commit, branch range, or artifact}306**Date:** {date}307**Verdict:** PASS / NEEDS WORK308309### Checklist310311| # | Check | Presence | Quality Depth | Notes |312| --- | ----------------------- | --------- | ------------- | -------------------------------------------------------------------- |313| 1 | Problem Statement | ✅/❌ | ✅/⚠️/❌ | {what's strong / what's w314315…(truncated)