/dev-flow-skills:layered-reviewfrom Dev Flow Skills
Review a single PR (or a local diff / branch) using a top-down three-layer method — (1) production-impact check (feature-flag gating, dead references), (2) chunk-level comprehension check (SOLID / DRY / YAGNI at the "does this shape make sense" altitude, not line-by-line), (3) surface check (shallow methods, patterns foreign to this repository). Use when the user wants to review a specific PR carefully, self-review their own working-tree change before pushing, or apply a consistent review discipline. Complements `smelly-prs` — that skill triages many merged PRs; this skill goes deep on one change. Read-only by default; never pushes, comments, or edits. Requires `gh` CLI when reviewing a remote PR. Invoke as `/layered-review <PR-url|PR-number|--diff>`.
Ships in Dev Flow Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Review one code change — a specific PR, or the local working-tree diff — with a disciplined three-layer top-down pass. Each layer has a different altitude and a different question. Do not skip layers, do not merge them: the point of the discipline is that a shallow layer's answer changes whether you spend time on the deeper ones.
The three layers, in order:
This skill is read-only. It fetches a PR / diff and produces a written review. It never comments on GitHub, edits files, or pushes.
Parse from the user's invocation:
| arg | meaning |
|---|---|
<PR-url> | e.g. https://github.com/foo/bar/pull/123 |
<PR-number> | e.g. #123 — only valid when cwd is a checkout of the target repo |
--diff | review the local working-tree diff (git diff vs the base branch) |
--base BRANCH | with --diff, override the base branch (default: origin's default branch) |
--repo owner/repo | with <PR-number> when the shell is not inside that repo |
If nothing parseable is supplied, ask the user once: "What are we reviewing — a PR URL/number, or the local working-tree diff?" Do not guess.
gh auth status. If not authenticated, stop and ask the user to run gh auth login themselves. Do not attempt to log in.--diff: verify you are inside a git worktree and there is at least one changed file vs the base branch. If the working tree is clean, stop and say so.Before any layered analysis, read the entire change end-to-end once, quickly. Do not take notes on issues yet. The goal is a mental map of what this PR is trying to do.
For a PR:
gh pr view <n> --repo <owner/repo> --json title,body,author,baseRefName,additions,deletions,changedFiles,labels,files,commits,reviewDecision
gh pr diff <n> --repo <owner/repo>
For --diff:
git diff --stat <base>...HEAD
git diff <base>...HEAD
If the diff is very large (> ~3000 lines), read the PR body / commit messages carefully and sample the diff (all touched file headers + the first meaningful hunk of each file + any migration/config/flag files in full). Note in the final report that a full read was not possible.
At the end of this pass, write down (internally) one sentence: "This change tries to __." If that sentence does not form, stop and ask the user what the change is supposed to do — you cannot layer-review a change whose intent you cannot state.
Question: Can this change hurt production the moment it lands? Only two sub-checks.
For any new user-visible behavior, external side effect, schema change, or expensive path:
Flag a finding when: new behavior ships unconditionally, or the flag exists but one code path bypasses it, or the flag defaults to on.
Do not flag: pure refactors, internal-only helper additions, test-only changes, docs — even if they lack a flag.
For anything the diff removes, renames, or narrows in visibility:
rg/grep the old symbol name — including strings, YAML/JSON configs, generated bindings, migrations, and templates)Flag a finding when: a removed/renamed symbol still has live references, or a newly added public surface has zero real callers.
Do not flag: internal helpers that are obviously wired up further down the diff — read the whole PR before firing.
Layer-1 exit rule: if Layer 1 produces any severity-3 finding (see §5), stop and report. Do not descend into Layer 2 / 3 — the change is not review-ready. A note that says "Layer 2 and 3 skipped: this change is not safe to land as-is" is a valid, useful review.
Question: Do the pieces of this change make sense as blocks, without reading the lines?
You are looking at the diff as shapes: what modules were added, what methods were added to which class, what the seams are. Do not open every hunk line-by-line here. That is Layer 3's job.
Judge against these three principles — cite the principle explicitly when firing a finding:
if/else or switch chain on a type tag extended again in this PR? That's the tell that the extension point is wrong. (This overlaps with the "Strategy opportunity" pattern smell — pick one label, do not double-count.)file:line each).if version >= 2 when version is always 2)?Layer-2 exit rule: Layer 2 findings are almost never blockers on their own, but they are the ones that shape long-term maintainability. Write them as redesign notes, not "please fix this line" comments.
Question: Does this code look like this codebase?
Now open the hunks. Two things to look for.
A "shallow" method is one where the interface is nearly as complex as the body: the signature has ~as many parameters and concepts as the body has statements. Classic examples:
fooManager.setFooEnabled(user, enabled) whose body is user.fooEnabled = enabled.Ousterhout's rule of thumb: deep methods are good, shallow methods are noise. A method earns its keep by hiding non-trivial work behind a simpler interface. Prefer inlining shallow methods, or bundling multiple shallow methods behind one deeper method that owns an invariant.
Do not flag: intentionally minimal public API methods that hide a future implementation (that's a Layer-2 YAGNI check, not this). Do not flag: test helpers — they are supposed to be shallow.
Look for constructs that this repository does not otherwise use. Examples:
Promise.all, threading) introduced in a codebase that is otherwise synchronous.To check: rg for one distinctive keyword of the pattern across the repo (excluding the diff itself). If the count is near zero outside this PR, fire the finding.
Do not flag: patterns that are new because they are being introduced by this PR intentionally. That will be obvious from the PR body — read it. In that case Layer 3 is instead: "Is the introduction rationale documented? Is there a follow-up plan to convert existing sites, or an ADR?"
Each finding gets one severity:
Structure every finding as:
- **[Layer <n> · <principle>]** sev <s> — <one-line claim>
evidence: <file:line or file@hunk>
suggestion: <one sentence — what to do about it>
Do not invent evidence. If you cannot cite a file:line, drop the finding.
Output one markdown message with this shape. Keep prose short; be specific.
# Review — <PR title or "local diff on <branch>">
<url or "working-tree diff vs <base>"> · +<add>/-<del> across <files> files
**Intent (as I read it):** <one sentence>
## Layer 1 — Production impact
<summary line: "clean" / "one flag issue" / "removed symbol still has references">
<findings, if any, in the format above>
## Layer 2 — Meaning at the chunk level
<summary line>
<findings, if any>
## Layer 3 — Surface / fit
<summary line>
<findings, if any>
---
**Verdict:** ✅ ready to merge | 🟡 ready after Layer-<n> notes are addressed | 🚨 not review-ready (Layer 1 blocker)
**What I did not check:** <e.g. "did not run tests locally", "diff was truncated at 3000 lines", "did not audit the migration SQL semantics">
If Layer 1 tripped the exit rule (§2), the report contains Layer 1 findings, the 🚨 verdict, and a line saying Layer 2 and 3 skipped — resolve Layer 1 first.
gh pr comment, gh pr review, gh issue comment. The user decides what to send.file:line citations. Drop the finding if you cannot point at real evidence.User: /layered-review https://github.com/mitubaEX/dev-flow-skills/pull/12
→ Fetch PR #12, do the three-layer pass, output the report.
User: /layered-review --diff
→ Review the current worktree's diff vs origin/main (or the detected default branch).
User: /layered-review --diff --base develop
→ Review the worktree's diff vs origin/develop.
User: /layered-review #42 --repo foo/bar
→ Fetch PR #42 from foo/bar and review it, even though cwd is a different repo.
smelly-prs — bulk-triages many recently merged PRs and ranks the smelliest. Use it when you want to find a PR worth reviewing. Then use layered-review on that PR.code-flow:review-respond — actually replies to reviewer comments on your own PR. Use it after layered-review if the review target is your PR and you want to act on feedback you received (not on feedback this skill produced).What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mitubaex/dev-flow-skills --plugin dev-flow-skills7 skills in this plugin
/autoloopWork through a backlog file with no human in the loop — each iteration picks the next task from `.autoloop/backlog.md`, gates it with `worth-it`, settles the design by self-grilling, trims it with `prune`, implements it red → green on an `autoloop/<slug>` branch, self-reviews with `layered-review`, and opens a PR. Never merges. Tasks it should not or cannot do are marked skipped or blocked with the reason, so the human's only jobs are adding tasks, answering blocked questions, and merging PRs. Designed to be driven by `/loop /autoloop` (self-paced; schedules its own next wakeup and stops when the backlog is drained or a guardrail trips). Use when the user wants an autonomous / unattended / hands-off dev loop, "放置で回す", "自律ループ", "バックログを消化して", or invokes `/autoloop`. Requires `git`, a pushable remote, and an authenticated `gh` CLI./grillingGrill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases./grill-meA relentless interview to sharpen a plan or design.