$npx -y skills add rengwu/wayfinder-maps --skill review-codeReview the changes since a fixed point (commit, branch, tag, or merge-base) along two axes — Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating spec/PRD asked for?). Use when the user wants to review a bran
| 1 | Two-axis review of the diff between `HEAD` and a fixed point the user supplies: |
| 2 | |
| 3 | - **Standards** — does the code conform to this repo's documented coding standards? |
| 4 | - **Spec** — does the code faithfully implement the originating spec / PRD? |
| 5 | |
| 6 | The two axes are reviewed **in isolation** so they don't pollute each other, then aggregated side by side. |
| 7 | |
| 8 | ## Process |
| 9 | |
| 10 | ### 1. Pin the fixed point |
| 11 | |
| 12 | Whatever the user said is the fixed point — a commit SHA, branch name, tag, `main`, `HEAD~5`, etc. If they didn't specify one, ask for it. |
| 13 | |
| 14 | Capture the diff command once: `git diff <fixed-point>...HEAD` (three-dot, so the comparison is against the merge-base). Also note the list of commits via `git log <fixed-point>..HEAD --oneline`. |
| 15 | |
| 16 | Before going further, confirm the fixed point resolves (`git rev-parse <fixed-point>`) and the diff is non-empty. A bad ref or empty diff should fail here — not inside the two reviews. |
| 17 | |
| 18 | ### 2. Identify the spec source |
| 19 | |
| 20 | Look for the originating spec, in this order: |
| 21 | |
| 22 | 1. A path the user passed as an argument. |
| 23 | 2. A spec under `.plan/` — typically `.plan/<slug>/spec.md`, matching the branch name or feature. |
| 24 | 3. A PRD/spec file elsewhere in the repo (`docs/`, `specs/`, or similar) matching the branch name or feature. |
| 25 | 4. Issue references in the commit messages (`#123`, `Closes #45`, etc.) — if the environment has a way to fetch them (e.g. the repo host's CLI), fetch the referenced issue. |
| 26 | 5. If nothing is found, ask the user where the spec is. If they say there isn't one, the **Spec** axis will skip and report "no spec available". |
| 27 | |
| 28 | ### 3. Identify the standards sources |
| 29 | |
| 30 | Anything in the repo that documents how code should be written, such as `CODING_STANDARDS.md` or `CONTRIBUTING.md`. |
| 31 | |
| 32 | On top of whatever the repo documents, the Standards axis always carries the **smell baseline** below — a fixed set of Fowler code smells (_Refactoring_, ch.3) that applies even when a repo documents nothing. Three rules bind it: |
| 33 | |
| 34 | - **The repo overrides.** A documented repo standard always wins; where it endorses something the baseline would flag, suppress the smell. |
| 35 | - **The language's paradigm applies.** Skip smells that don't fit the language being reviewed — e.g. Refused Bequest in a language without inheritance, Feature Envy where there are no objects to envy. |
| 36 | - **Always a judgement call.** Each smell is a labelled heuristic ("possible Feature Envy"), never a hard violation — and, like any standard here, skip anything tooling already enforces. |
| 37 | |
| 38 | Each smell reads *what it is* → *how to fix*; match it against the diff: |
| 39 | |
| 40 | - **Mysterious Name** — a function, variable, or type whose name doesn't reveal what it does or holds. → rename it; if no honest name comes, the design's murky. |
| 41 | - **Duplicated Code** — the same logic shape appears in more than one hunk or file in the change. → extract the shared shape, call it from both. |
| 42 | - **Feature Envy** — a method that reaches into another object's data more than its own. → move the method onto the data it envies. |
| 43 | - **Data Clumps** — the same few fields or params keep travelling together (a type wanting to be born). → bundle them into one type, pass that. |
| 44 | - **Primitive Obsession** — a primitive or string standing in for a domain concept that deserves its own type. → give the concept its own small type. |
| 45 | - **Repeated Switches** — the same `switch`/`if`-cascade/pattern-match on the same type recurs across the change. → replace with polymorphism, a dispatch table, or one match site both callers share. |
| 46 | - **Shotgun Surgery** — one logical change forces scattered edits across many files in the diff. → gather what changes together into one module. |
| 47 | - **Divergent Change** — one file or module is edited for several unrelated reasons. → split so each module changes for one reason. |
| 48 | - **Speculative Generality** — abstraction, parameters, or hooks added for needs the spec doesn't have. → delete it; inline back until a real need shows. |
| 49 | - **Message Chains** — long `a.b().c().d()` navigation the caller shouldn't depend on. → hide the walk behind one method on the first object. |
| 50 | - **Middle Man** — a class or function that mostly just delegates onward. → cut it, call the real target direct. |
| 51 | - **Refused Bequest** — a subclass or implementer that ignores or overrides most of what it inherits. → drop the inheritance, use composition. |
| 52 | |
| 53 | ### 4. Run both reviews in isolation |
| 54 | |
| 55 | **If your environment supports spawning subagents**, send a single message with two subagent calls (use a general-purpose subagent for both) so the axes run in parallel with isolated context. |
| 56 | |
| 57 | **Otherwise**, run the two axes as sequential, self-contained passes in this s |