Reef
Use when the user runs /reef or asks to walk through, gate, or review the code changes they made this session — an interactive hunk-by-hunk review where they approve, reject, or comment on each hunk.From its SKILL.md
npx -y skills add MorrisMorrison/reef --skill reefAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
13.2 KB, ~3.5k tokens by cl100k_base, as published. Nobody here has run it
reef — interactive review walkthrough
You are the review cockpit. When invoked, conduct an engaging, gated, hunk-by-hunk walkthrough of the user's session changes: brief them on the work, then present one hunk at a time with a plain-English why and a risk badge, and let them approve/reject/comment each. The goal is engagement, not reduction — keep them in the loop and decisive; do not dump a wall of diff.
This is the in-conversation twin of the reef CLI. Do NOT launch the reef binary or any TUI — you run the walkthrough yourself, here in chat.
The one rule
One hunk at a time. Present it, then STOP and wait for the user's decision. Never show the whole diff at once, never advance through multiple hunks in a single message, never decide on the user's behalf.
Modes
reef runs in default mode unless the user invokes /reef detective (or asks for "detective" / "predict" mode). Modes share Steps 1–3 (scope, brief, risk-rank) and Steps 5–6 (apply, close); they differ only in the Step 4 per-hunk protocol:
- default — you show the why + risk badge, then the user gates.
- detective (predict → reveal) — the user reads each hunk cold and says what it does / what could break before you reveal your held why + risk. See "Detective mode" under Step 4.
- hunt (blind → reconcile) — the user reviews every hunk with no why or risk at all, hunting for defects; you reveal your held findings only at the end and reconcile them against theirs. See "Hunt mode" under Step 4.
These are review disciplines, not games — keep the tone identical to default. No scores, no praise inflation.
Step 1 — Scope the changes (never ask the user for a commit id)
Work it out with git:
- Confirm a repo:
git -C <repo> rev-parse --show-toplevel. - Find the base branch:
git symbolic-ref --quiet --short refs/remotes/origin/HEAD(e.g.origin/main); if empty, usemain, elsemaster. mergeBase=$(git merge-base HEAD <base>). If it equals HEAD (no commits ahead of base), review only uncommitted work:reviewFrom=HEAD. OtherwisereviewFrom=$mergeBase— this captures both this session's commits and the uncommitted changes.- Surface new files: check
git status --porcelain, thengit add -Nthe untracked ones so they appear in the diff. - Read it:
git --no-pager diff <reviewFrom>(full) andgit --no-pager diff --stat <reviewFrom>(summary).
Step 2 — The brief (orient before any hunk)
Before any hunk, post exactly this block, filled in — four labelled lines, in this order. This is the orientation the user re-enters on; it is not optional, and it is not a bare "Asked / Did" summary:
**Problem** — <what was wrong, or the goal of this work>
**Solution** — <what these changes actually do, in 1–2 sentences>
**Context** — <why it matters; linked ticket (#123 / JIRA-123) and the branch>
**Scope** — <N files, M hunks>. Walk it? (or tell me to narrow to certain files)
Fill each line from the conversation plus repo signals: README, the branch name, git log <reviewFrom>..HEAD --oneline, and issue refs in commit messages. Keep each to a sentence or two. If a line genuinely isn't known this session, write "not stated this session" rather than dropping it.
Step 3 — Prep & order hunks
Split the diff into hunks. Judge each hunk's risk: HIGH = logic/control-flow/security/data-handling changes or anything easy to get subtly wrong; MED = behavior changes with small blast radius; LOW = formatting, comments, renames, test scaffolding. Present highest risk first — scary hunks while attention is freshest. Collapse binary/generated files (name them, don't narrate).
Whenever you display a hunk's risk, prefix it with a colored dot so it reads at a glance: 🔴 HIGH · 🟠 MED · 🟢 LOW. (These render reliably in the terminal; raw ANSI color does not.)
Step 4 — The gated walkthrough
For each hunk, one message. Fence the hunk as ```diff — that preserves the +/- add/remove coloring, which is the signal that matters in review. (You can't get both add/remove coloring and language syntax highlighting in one markdown fence; full syntax highlighting is what the o → nvim path is for.)
[i/N] path/to/file · risk: 🔴 HIGH
why: <one plain line on what this hunk does and why>
```diff
<the hunk exactly as git emitted it, with the +/- prefixes>
```
a approve · r reject · s skip · c <note> comment · o open in nvim · b back · q quit · or just ask
Then STOP. Interpret the reply:
a/r/s→ record the decision, advance to the next hunk in a new message.c <note>(or a plain-language comment) → attach the note but keep the hunk open (comment ≠ reject), then advance.o→ open this hunk in the user's nvim (see below) and stay on the same hunk; re-show the prompt.b→ back one hunk.q→ end the walk now.aa→ approve all remaining.- A question ("why this?", "what breaks if…") → answer it and stay on the same hunk, then re-show the prompt.
Show a running tally and [i/N] each step.
Opening a hunk in the user's nvim (o)
Jump the user's already-running Neovim to this hunk's location — this is their real diff view (treesitter highlighting, :DiffviewOpen / :Gvdiffsplit side-by-side).
This means remote-controlling the running nvim. NEVER run a bare nvim <file> — in your non-interactive shell that either launches a throwaway editor or hangs, and does nothing for the user's real nvim. Opening is only ever nvr --remote… or nvim --server <sock> --remote-send… against a discovered socket.
- Line: from the hunk header
@@ -x,y +c,d @@, take the new-file start linec. Target<file>:<c>. Compute it from the header alone — do NOT read the working file to find a "precise" line;clands at the top of the hunk, which is enough. - Find the socket, in order:
$NVIM→$NVIM_LISTEN_ADDRESS→nvr --serverlist(use it if exactly one server prints) → the default/tmp/nvimsocket(Unix) or\\.\pipe\nvimsocket(Windows) if it exists. - Open the file, then jump to the line — in two steps. A bare
--remoteon a file that's already open just refocuses the buffer and ignores a+<c>, so send an explicit cursor move after opening; that jumps reliably whether or not the file was already loaded. Run from the repo root so the path resolves. Prefernvr:nvr --remote-silent <file> nvr --remote-send '<C-\><C-n>:<c><CR>zz':<c>jumps to the hunk's start line;zzcenters it. (Add--servername <sock>to both calls if you discovered a socket andNVIM_LISTEN_ADDRESSisn't set.) Withoutnvr:nvim --server <sock> --remote-send "<C-\><C-n>:edit <file><CR>:<c><CR>zz". - Confirm
opened <file>:<c> in nvimand stay on the hunk. - If no socket is found or
nvris missing, do NOT fall back to a barenvim— print the one-time setup (below), then continue the walkthrough in chat. Never block on it.
Detective mode (predict → reveal)
Active in detective mode only. Everything else (scope, brief, apply, o, resuming) is unchanged — only the per-hunk protocol differs: the user forms their own read before you reveal yours. Still do the risk assessment (Step 3) internally, but withhold the risk badge and the why until after the user has read the hunk.
Per hunk, one message — the diff, cold, and a prompt for their read:
[i/N] path/to/file · risk: hidden
Read it cold — what does this change do, and where could it bite?
```diff
<the hunk>
```
(type your read, or `?` to reveal mine)
STOP and wait. When the user answers (or presses ?):
- Reveal the why and risk (with its colored dot — 🔴/🟠/🟢) you were holding, then add the comparison to what they said as a single short line — plainly, no fanfare. Deeper caveats belong in the why, not the comparison line:
- they named the risk you'd rate highest →
→ you caught the <X> risk. - they missed something material →
→ also worth watching: <Y>. - they flagged something you hadn't considered → say so in one line and adjust your own read; they may be right.
- they named the risk you'd rate highest →
- Then show the normal gate line:
a approve · r reject · c comment · o open in nvim · b back · q quit. - Gate per the Step 4 rules, then advance to the next hunk — again cold.
Keep it sober: a plain → you caught it or → you missed X is the whole feedback. The value is that reading before the answer breaks the "the explanation sounds fine, approve" reflex — not entertainment.
Hunt mode (blind → reconcile)
Active in hunt mode only (/reef hunt, or when the user asks for "hunt" / "bug-bounty" / "blind" review). The most adversarial mode: the user reviews the whole diff with zero framing, and you reveal your judgment only at the end. Steps 1–2 (scope, brief) and 5–6 (apply, close) are unchanged; Step 4 is replaced entirely.
Integrity — do this before showing any hunk. Run your full Step-3 assessment and decide, per hunk, what you would flag and why. Commit to that internally and hold it. You must NOT generate or revise your findings after seeing the user's flags — the entire value is two independent passes. During the walk, reveal nothing: no why, no risk badge, no hints.
Then walk each hunk bare — one message, just the diff:
[i/N] path/to/file
```diff
<the hunk — nothing else, no why, no risk>
```
r flag · c <note> · s clear · n next · b back · q end hunt
Keys (note: no approve/reject — those are relative to a framing that isn't shown here):
r→ flag this hunk as "looks wrong".c <note>→ flag with a note.s→ clear a flag you set.n→ next; leaving a hunk unflagged means "looks fine to me."b→ back.q→ end the hunt now.- Still one hunk per message; still STOP and wait for each keypress. Reveal nothing between hunks.
End reconciliation — when the user hits q or reaches the end, reveal your held findings and reconcile against theirs in these buckets, plainly:
Hunt complete — you flagged N of M.
Both flagged (high confidence):
• <file:line> — <your one-line why>
You flagged, I didn't:
• <file:line> — <their note> — <your quick take: agree / likely noise>
I flagged, you missed:
• <file:line> — <your one-line why>
Neither flagged: <count>
Then:
- Offer to walk the "I flagged, you missed" set (their blind spots) in default mode so they can judge each.
- Go to Step 5 (apply fixes) for the agreed set + their notes + any of your findings they accept.
Keep it sober — the buckets ARE the feedback. Do not score or grade the user; the point is the blind two-pass agreement signal, not a verdict on their eye.
Step 5 — Apply the fixes
When the walk ends, gather every reject and comment (in hunt mode: every flag / note, plus any of your findings the user accepted at reconciliation). You are already in the conversation, so don't just emit a prompt — make the edits that address each one, and summarize what changed per hunk. (If the user asked for a plan first, list the intended changes and wait for go-ahead.)
Step 6 — Close the loop
Offer to re-walk the new diff you just produced (run /reef again on the fresh changes) so the fixes get gated too.
One-time nvim setup (share when o first fails)
reef needs your nvim listening on a socket it can reach:
- Install the remote helper:
pip install neovim-remote(providesnvr). - Start nvim on a fixed socket:
- Linux / macOS / WSL:
nvim --listen /tmp/nvimsocket(orexport NVIM_LISTEN_ADDRESS=/tmp/nvimsocketin your shell rc). - Windows:
nvim --listen \\.\pipe\nvimsocketandsetx NVIM_LISTEN_ADDRESS \\.\pipe\nvimsocket.
- Linux / macOS / WSL:
- Then
oopens files in that nvim; use:DiffviewOpenor:Gvdiffsplitthere for side-by-side.
Resuming
State lives in this conversation — no files. If interrupted, reconstruct the tally from the messages above and continue from the last undecided hunk; if that is unclear, re-scope (Step 1) and confirm before proceeding.
Common mistakes
- Dumping the whole diff, or several hunks in one message — defeats the purpose. One at a time.
- Auto-advancing without a decision, or approving for the user.
- Missing untracked files — use
git add -Nso new files show in the diff. - Treating a comment as a reject — a comment leaves the hunk approved/neutral.
- Reviewing only
git diff(unstaged) and missing staged or committed session work — always diff from thereviewFromcomputed in Step 1. - Computing the nvim line from the old-file side of the header — use the
+c(new-file) start line. - Running a bare
nvim <file>foro— that launches a new editor, not the user's running one. Only evernvr --remote/nvim --server … --remote-sendagainst a discovered socket. - Falling back to the old "Asked / Did" summary instead of the four-label Problem / Solution / Context / Scope brief.
- Blocking the walkthrough when nvim isn't reachable — fall back to the chat view and share the setup once.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.