Skip to content
Back to skills

Review

ASecurity

Review a pull request and return line-anchored findings. Use when asked to review this branch, review this pull request, review these commits or review a base...head range. Takes the range from the argument, or the branch's merge base with the default branch up to the working tree when there is none, launches one review-arm agent per lens in its lenses file, all at once, and merges what they return. The merge relaunches once an arm whose block is missing or malformed, then drops it and names ...

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
developmentgoshellbashgitsecurityperformance

Works with

  • claude code

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add sabind/ponderly --skill review --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Review?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Review
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sabind-review/badge)](https://www.skillsdirectory.com/skills/sabind-review)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: review
description: Review a pull request and return line-anchored findings. Use when asked to review this branch, review this pull request, review these commits or review a base...head range. Takes the range from the argument, or the branch's merge base with the default branch up to the working tree when there is none, launches one review-arm agent per lens in its lenses file, all at once, and merges what they return. The merge relaunches once an arm whose block is missing or malformed, then drops it and names its arm, checks every finding's file and lines at the head, collapses duplicates as --duplicates says, and orders high, medium, low. Has the wave-reviewer agent read the change with the merged findings quoted, folds its findings into the list, and reruns only arms it contradicted, when the budget allows. Returns the findings with their counts and the wave review's verdict, or writes them as JSON to a path outside the repository, or ignored by it, with --json. Changes no tracked file in the repository and commits nothing.
argument-hint: "[base...head] [--json <path>] [--duplicates same-defect|keep|overlap]"
allowed-tools: Bash(git status *) Bash(git rev-parse *) Bash(git merge-base *) Bash(git diff *) Bash(git show *) Bash(git ls-files *) Bash(git check-ignore *) Bash(git log *) Bash(git cat-file *) Bash(awk *)
---

# Review a pull request

Review one pull request: find its range, have one `review-arm` read it through each lens of `${CLAUDE_SKILL_DIR}/lenses.md`, all at the same time, merge their findings into one list anchored to lines at the head, have the `wave-reviewer` read the change with that list quoted, fold what it finds into the list and run once more only the arms whose findings it contradicted, when the budget allows, and return the final list with its counts.

The skill reads; it changes no file in the repository, commits nothing and leaves no scratch file, so `git status` shows what it showed before. The one file it writes is the JSON a `--json` path names, and only when that path is outside the repository or ignored by it.

The text after the command: $ARGUMENTS

Terms used below:

- An **arm** is the plugin's `review-arm` agent, launched as `ponderly:review-arm`, one per lens. Its own definition holds its procedure and the shape of its arm block, so the launch carries only the review's inputs; it gathers the diff itself.
- The **reviewer** is the plugin's `wave-reviewer` agent, launched as `ponderly:wave-reviewer`, once per review. Its own definition holds its procedure and the shape of its Findings.
- A **lens** is one `##` section of `lenses.md`. The **shared standard** is the sentences of that file's opening paragraph from the sentence that begins "Across every lens, a finding worth reporting" to the paragraph's end.

## Working with the author

- **Stops.** Only when something is wrong: a `base...head` side that names no commit, a range with only one of its first two words naming a commit, a `--json` without a path or with a path inside the repository that git does not ignore, a `--duplicates` whose word is not `same-defect`, `keep` or `overlap`, a range with no diff, a missing `lenses.md`, and a missing `review-arm` agent. A missing `wave-reviewer` agent does not stop the review; step 5 says what follows.
- **How it asks.** It does not ask; every input comes from the arguments and the repository.
- **Hand-backs.** The report of step 7, or the stop that ends the run.
- **Hand-offs.** None; the author decides what to do with the findings.

## 1. Read the arguments

The arguments are on the first line of the text above; everything after that line is the pull request's title, its first non-empty line, and its body, the rest. When the first line holds neither a range nor `--json` nor `--duplicates`, there is no argument, and the whole text is the title and body.

- **Range.** A word resolves when `git rev-parse --verify --quiet <word>^{commit}` succeeds. A word of the form `base...head` is the range, and both sides must resolve: when one does not, say which names no commit, and stop. Otherwise, when the first two words both resolve, they are the base and the head. When exactly one of the first two words resolves, say that a range needs a base and a head, or a `base...head`, and stop. When neither resolves, there is no range, and unless the first line holds `--json` or `--duplicates`, the whole text is the title and body.
- **`--json <path>`.** The word after `--json` is the path. Missing: say that `--json` needs a path, and stop. Find the repository root with `git rev-parse --show-toplevel` and make the path absolute against the working directory. When it is the root, or lies under it and `git check-ignore -q <path>` fails, say that the `--json` path must be outside the repository or ignored by it, naming both, and stop. When the path already exists, from an earlier review, read it with the Read tool before the first write, so the Write tool may overwrite it.
- **`--duplicates <mode>`.** The word after `--duplicates` is the mode of step 4's duplicate collapse: `same-defect`, the default when the argument is absent, `keep` or `overlap`. Any other word, or none: say that `--duplicates` takes `same-defect`, `keep` or `overlap`, and stop.

A title or body that is not given is passed on as "none given".

## 2. Resolve the range

With a base and a head from the arguments, the base is `git merge-base <base> <head>`, so that commits the base branch gained after the branch left it are not reviewed, or the base as given when there is no merge base; the head is `git rev-parse <head>`. The changed files are `git diff --name-only <base> <head>`. A changed file is **moved** when `git diff --name-status -M <base> <head>` gives it the status `R100`, a rename with no content change, on a line that names its old path before its path at the head; record the old path with it.

With no range, the head is the working tree and the base is the branch's merge base with the default branch: the default branch is `git rev-parse --abbrev-ref origin/HEAD` with the `origin/` prefix removed, or `main` when that command fails, as it does when `origin/HEAD` is unset, even though it still prints `origin/HEAD`; the base is `git merge-base origin/<default> HEAD`; when there is no `origin`, it is `git merge-base <default> HEAD` with the local default branch, if that branch exists and is not the current one; when neither exists, or the merge base cannot be found, the base is `HEAD`. The changed files are those `git diff --name-only <base>` lists, which compares the working tree with the base, with the new files `git ls-files --others --exclude-standard` lists. A changed file is moved, with its old path recorded, when `git diff --name-status -M <base>` gives it the status `R100`, as for a head commit.

When the list of changed files is empty, say "no diff" with the base and head it was measured between, return no findings, and stop. With `--json`, write the findings object of step 4 with `pass` `"final"`, `verdict` `null`, `second_pass` `false`, `counts` holding its nine entries, `candidates`, `removed_by_merge`, `removed_by_review`, `departures_not_reported`, `folded`, `not_anchored` and `files_unread` 0 and `failed_arms` and `relaunched` `[]`, `read` `{}`, `findings` `[]` and `not_reported` `[]` before stopping.

## 3. Launch the arms

Read `${CLAUDE_SKILL_DIR}/lenses.md`. If it is missing, say that the skill's `lenses.md` is missing, naming its path, and stop.

Before the launch, state the effort for the arms and the reviewer, then go on without asking, since a stop would break headless runs. Take the level the request names. Otherwise propose `medium`, or `high` when the pull request's title or body names security, authentication or sign-in, money or payments, deleting or migrating data, or concurrency, or when the review has no context beyond the code: it runs outside the session that built the change, the branch has no spec under `.ponderly/specs/`, no issue is named, and the title, body and commit messages say little more than what changed. A review run in the session that built the change stays at `medium`. For `high`, name the criterion met and the cost: up to about a quarter more than at medium, for the reviewer and for each arm. These are a starting judgement, to be replaced once medium launches are measured. Pass `effort` on a launch only when the chosen level is not `medium`, and pass no `model`. When the Agent tool refuses a launch with an error that names `effort`, launch again without it and tell the author the chosen level could not be applied.

Launch one arm per lens, all in one message so they run at the same time, each with the Agent tool as `subagent_type: ponderly:review-arm` and a prompt that holds:

- the shared standard, quoted;
- the lens: its `##` heading and its text, quoted;
- the range: the base commit, and the head commit or the words "the working tree";
- the changed files, one per line, each moved file followed by `(moved from <old path>, unchanged)`;
- the pull request's title and body.

Nothing more, and never the diff: each arm runs `git diff` and reads the files itself. If the Agent tool cannot find `ponderly:review-arm`, say that the plugin's `review-arm` agent is missing and stop. Wait for every arm.

## 4. Merge

Read each arm's final text as an arm block. An arm **failed** when it did not return, when its text is not an arm block (a `lens:` line, a `findings:` list whose every entry has a `file`, integer `start_line` and `end_line`, a `severity` of `high`, `medium` or `low` and a `category` and `message`, then an `unsure:` list, then a `read:` list), or when its block has `findings: []` and an `unsure` entry beginning `review not done:`, since that arm did not review. Once every arm of the pass has returned, relaunch each failed arm once, all failed ones in one message, with the prompt it had and the effort step 3 chose, and read the relaunch's text by the same rule. An arm of this first pass that fails again is dropped: take none of its entries, and name its lens as failed; an arm of the second pass that fails again keeps its first-pass list instead, as step 6c says. Relaunching a failed arm is not the second pass. Every entry of the blocks that remain is a candidate.

Then, in order:

1. **Normalise** each candidate's `file` to forward slashes, with no leading `./` or `/`.
2. **Check it at the head.** For a head commit, the file exists when `git cat-file -e <head>:<file>` succeeds, and its line count is `git show <head>:<file> | awk 'END{print NR}'`; for the working tree, the file exists when it is in the working tree, and its line count is `awk 'END{print NR}' <file>`. Drop a candidate whose file is absent, or whose lines are not 1 ≤ `start_line` ≤ `end_line` ≤ that line count.
3. **Collapse duplicates**, as `--duplicates` says. `same-defect`, the default: two candidates in the same file become one only when they name the same defect and the same fix, and never when each names the other's file and line, since those are one defect at several places; a different `category` is a sign they do not, since each lens reports its own kind of problem, so a correctness finding on a line and a performance finding spanning it stay two findings. `overlap`: two candidates in the same file whose line ranges overlap also become one. `keep`: no candidate is collapsed. When two become one, keep the one whose message is fuller, with its own `start_line` and `end_line`, never a union of the two ranges, and drop the other.
4. **Order** high, then medium, then low, keeping the lenses' order within a severity.

The merged list is what is left. **Removed by the merge** is the number of candidates the head check and the duplicate collapse dropped; **removed by the review** is 0 until step 6. So the candidates are the merged list plus removed by the merge.

With `--json`, write the interim findings object to the path with the Write tool, after this first merge and before the wave review:

```json
{
  "pass": "first",
  "verdict": null,
  "second_pass": false,
  "counts": {"candidates": 0, "removed_by_merge": 0, "removed_by_review": 0, "failed_arms": [], "departures_not_reported": 0, "folded": 0, "not_anchored": 0, "relaunched": [], "files_unread": 0},
  "read": {},
  "findings": [
    {"file": "path/at/head.py", "start_line": 1, "end_line": 1, "severity": "high", "category": "correctness", "message": "..."}
  ],
  "not_reported": []
}
```

`failed_arms` holds the lens name of each failed arm; `departures_not_reported`, `folded`, `not_anchored`, `relaunched` and `files_unread` are the final pass's counts, kept at `0`, `0`, `0`, `[]` and `0` until step 7; `read` maps the lens name of each arm whose block the merge took to that block's `read:` list, each entry a string as the block gives it, and holds no list for a failed arm; `findings` holds the merged list, each entry with the six fields of its arm-block entry.

## 5. Wave review

Launch the reviewer once, with the Agent tool as `subagent_type: ponderly:wave-reviewer`, at the effort step 3 chose, and a prompt that holds:

- the range in place of a file list: the base commit, and the head commit or the words "the working tree";
- the sentence, verbatim, "These changes are a pull request reviewed for the review skill: judge style, structure, comments and tests against the repository's own bar, what its CLAUDE.md, AGENTS.md, .claude/rules/ files and contributing guide say and the code around the change already does, and list a team-rule departure with no concrete cost in this change under unsure, not as a finding, unless it also departs from that bar.";
- the sentence, verbatim, "Apart from the departures the sentence above lists under unsure, report a problem at each place that needs its own edit, and, when an edit at either of two places alone would fix it, at the place the pull request changed, at each when it changed both, or on the lines next to the removal when it changed neither: one entry per place, each with its own quote and naming the others, never other places listed inside one entry; such a set is not a duplicate, in this list or in yours. A problem you can tie to a file and an exact quote at head is a finding at the severity it deserves, with any doubt stated in its problem together with what would settle it, a file to read or a case to run; a doubtful problem with no way to settle it, or one you cannot quote, goes under unsure.";
- the arms' leads: each `unsure` entry beginning `outside lens:` in the arm blocks the merge took, quoted with its arm's lens, under the words "Leads the arms noticed outside their lens and did not settle: verify each against the code at the head and report those it bears out.", or the words "No leads." when there is none;
- the merged list, quoted in the arm block's shape, as the text that cites the changed files: every place where a finding and the code at the head disagree is a finding, and so is a problem in the changes the list does not hold.

Nothing more, and never the diff. If the Agent tool cannot find `ponderly:wave-reviewer`, say that the plugin's `wave-reviewer` agent is missing, and go on as for a wave review that did not return: the merged list is the final list, the verdict is that the wave review did not run, and there is no second pass; go to step 7.

When the Findings have a `verdict` line, the **departures not reported** are their `unsure` entries that begin `departure not reported:`, each of the form `departure not reported: <file>: "<exact quote>": <the problem>`: team-rule departures the reviewer left out of its findings because they cost nothing in this change. Otherwise there are none to count.

Its Findings' `verdict` line decides what follows. `findings`: go to step 6. `holds`: the merged list is the final list; go to step 7 with no second pass. No Findings with a `verdict` line, because the reviewer did not return or returned something else: the merged list is the final list, the verdict is that the wave review did not return, and there is no second pass; go to step 7.

## 6. Settle the reviewer's findings

Each entry of the reviewer's Findings block is a **reviewer finding**: a file, an exact quote, a problem and a severity of `blocker`, `should-fix` or `nit`. Settle every one, in order; none is dropped without being counted.

### 6a. Sort

A reviewer finding is a **contradiction** when it names a finding of the merged list, by its file and lines or by its message, and says it is wrong: in its claim, its lines or its severity. Any other reviewer finding is **new**. A reviewer finding whose quote, found in its file at head, lies outside the lines of every merged finding in that file is new, even when its problem names a finding of the merged list at another place of the same defect, unless it says that finding is wrong, which makes it a contradiction. Give each a lens: for a contradiction, the lens of the finding it contradicts; for a new one, the lens whose kind of problem it names, by `lenses.md`'s own words.

### 6b. Budget

A **budget note** is any line of the form `USD budget: $<spent>/$<cap>; $<remaining> remaining`, whether Claude Code showed it to the session or the session's prompt carries it. Read the latest one. The budget allows a second pass when there is none, or when its remaining amount is at least its spent amount. When its remaining amount is smaller than its spent amount, the budget does not allow it: relaunch no arm, and fold and settle every reviewer finding in step 6d. The budget **stopped the second pass** only when it does not allow one and at least one finding of the merged list is contradicted, so that an arm would have been relaunched.

### 6c. Second pass

When the budget allows and at least one finding of the merged list is contradicted, launch again the arms of those findings' lenses, and no other, all in one message, each with the prompt of step 3, at the effort step 3 chose, and, added to it:

- the reviewer's Findings block, quoted whole, with the sentence, verbatim, "Leave alone every unsure entry of these Findings that begins `departure not reported:`; it is not a finding, so neither anchor it nor keep it.";
- the whole merged list from step 4, quoted in the arm block's shape, from which the arm takes as its own the entries whose category its lens carries.

Each relaunched arm returns the whole list for its lens, which replaces its first-pass list; its `read:` list joins its first-pass one under its lens name in `read`, the union of the two. Relaunch a failed arm once, as step 4 says; an arm that fails again keeps its first-pass list, and its lens is named as failed in this pass. Wait for every relaunched arm, and for every failed one relaunched again, to return or fail before step 6d: the first to return does not end the pass, and the reply of step 7 comes only after the last. When no finding is contradicted, or the budget stopped it, there is no second pass.

### 6d. Fold and settle

A new reviewer finding whose lens's arm is relaunched in step 6c goes to that arm, which anchors it in its second pass. **Fold** every other new reviewer finding: find its quote in its file at the head, and make it a finding with:

- `file` its file, and `start_line` and `end_line` the smallest line range at the head that holds the quote. The lines that hold the quote's first line are those `git show <head>:<file> | awk 'BEGIN {q = ARGV[1]; ARGV[1] = ""} index($(0), q) {print NR}' '<line>'` prints for a head commit, or `awk 'BEGIN {q = ARGV[1]; ARGV[1] = ""} index($(0), q) {print NR}' '<line>' <file>` for the working tree; awk takes the line as an operand literally, backslashes included, where `-v` would read them as escapes. Write the line as that one single-quoted shell word, with each `'` in it written as `'\''`, so that `it's` becomes `'it'\''s'`. When the quote occurs more than once, anchor the occurrence the reviewer's problem points to, by a line number or context it gives; else the first occurrence in lines the diff changes; else the first occurrence;
- `severity` `high` for `blocker`, `medium` for `should-fix` and `low` for `nit`;
- `category` one its lens carries, for the kind of problem it names;
- `message` its problem.

A reviewer finding whose file is absent at the head, or whose quote is not in that file, is not folded and is counted as **not anchored**.

**Settle** each contradiction no relaunched arm covers by reading the code at the head that it quotes: remove or correct the contradicted finding of the merged list only when that code bears the contradiction out, and otherwise keep the finding as it is.

For an arm that failed its relaunch, keep its first-pass list, fold the new reviewer findings of its lens and settle its lens's contradictions the same way.

### 6e. Merge

Merge as step 4 says, from normalising to ordering, over three sets: the findings of the merged list whose lens's arm was not relaunched or failed its relaunch, as they stand after step 6d's settling, not those arms' first-pass blocks, which the first merge already took; every entry of the second-pass blocks of the relaunched arms that returned one; and the folded findings. A folded finding so passes the head check, collapses with a duplicate as `--duplicates` says, and is ordered like any other. This merge's candidates are those three sets; what its head check and duplicate collapse drop are counted as removed by the merge, as in step 4.

The counts then cover the whole review, each finding counted once and in exactly one of them:

- **Pairing.** Take each relaunched arm's second-pass entries in the order of its block, and pair each with at most one entry of that arm's own first-pass block at the same file with an overlapping line range: one still in the merged list before one step 4 dropped, then the one overlapping it on the most lines, then the first in the block. Each first-pass entry is paired at most once. A paired second-pass entry is that first-pass finding returned again, not a new candidate; an unpaired one is new.
- **Candidates** is every entry the arms returned in the first pass, plus every unpaired second-pass entry, plus every folded finding.
- **Removed by the review** is the number of findings of the merged list that step 6 removed: a contradicted finding step 6d's settling removed, and a finding of an arm that returned a second-pass block with no second-pass entry paired with it, which the arm withdrew. A finding of an arm that failed its relaunch is not withdrawn: it stands as step 6d's settling leaves it, in this merge's first set.
- **Removed by the merge** is the number of candidates the head check or the duplicate collapse dropped, summed over step 4's merge and this one. A finding is counted only at the last merge that held it: one step 4 dropped that a relaunched arm returns again is no longer counted at step 4, but where this merge leaves it.

They add up: the candidates are the final list plus removed by the merge and by the review.

This is the one second pass: no third launch of the arms and no second wave review, whatever the merge holds. The skill skips neither the fold nor a second pass the budget allows for any reason of its own about cost or time; only a budget note as step 6b reads it stops a second pass, and nothing stops the fold.

## 7. Report

Without `--json`, reply with the final list, high first, one finding per line as `<severity> <category> <file>:<start_line>-<end_line> <message>`, or "No findings." when the list is empty. After it, one count line: the candidates, as step 4 counts them or, after a wave review that returned findings, as step 6e does, the number the merge removed, the number removed by the review, the wave review's verdict (`holds`, `findings`, or that it did not return or did not run), and each failed arm by its lens and pass, or that none failed; then `folded <n>, not anchored <n>, relaunched <lens, ...>` or `relaunched none`, then `touched files no arm read <n>`: the number of changed files, leaving out a file absent at the head as step 4 checks it, that no `read` entry of an arm the merges took names with `whole`, each path in a `read` entry normalised as step 4 normalises a finding's file before it is compared with the changed files, and a path that is not a changed file kept in `read` but not counted; then, when the wave review returned Findings, whether they hold or have findings, `departures not reported <n>` with step 5's count, 0 when there are none; and `budget stopped the second pass` when step 6b says it did. When the wave review held, did not return or did not run, nothing is folded and nothing relaunched; when it did not return or did not run, the count line has no `departures not reported`. After the count line, one line per `unsure` entry beginning `change remark:` in the arm blocks the merges took, once per arm, each line as `change remark: <its text after the prefix>`.

With `--json`, write the final findings object to the path, in step 4's shape with `pass` `"final"`, `verdict` `"holds"`, `"findings"` or `null` when the wave review did not return or did not run, `second_pass` `true` when at least one arm was relaunched and `false` otherwise, and the final counts, all nine entries of `counts` required whether the object is written afresh or the interim file is edited: `candidates`, `removed_by_merge`, `removed_by_review` and `failed_arms` as the count line gives them, the failed arms of both passes, `departures_not_reported` the count line's number, 0 when the wave review did not return or did not run; `folded` and `not_anchored` the count line's numbers and `relaunched` its lenses as a list, 0, 0 and `[]` when the wave review held, did not return or did not run, and `relaunched` `[]` when the count line says relaunched none; `files_unread` the count line's number of touched files no arm read; `read` as step 6c leaves it, each lens's first and second pass lists united; and the final list, folded findings included, with the six fields of an arm's entry. Beside `findings`, `not_reported` lists what the review left out, each entry with `file`, `quote`, `problem` and `reason`, and `null` for a file or quote the entry does not give:

- each departure not reported, with the file, quote and problem its entry gives, and `reason` `team-rule departure without cost`;
- each other `unsure` entry of the reviewer's Findings but `nothing`, with its file and quote when it names them, its text as the problem, and `reason` `unsettled lead`;
- each reviewer finding step 6d counts as not anchored, with its file, quote and problem as the reviewer returned them, and `reason` `not anchored`;
- each new reviewer finding step 6d gave to a relaunched arm that returned a second-pass list, when that list does not hold it at its file on lines that hold its quote, with its file, quote and problem as the reviewer returned them, and `reason` `dropped by relaunched arm`;
- each `unsure` entry beginning `change remark:` in the arm blocks the merges took, once per arm, with `file` and `quote` `null`, its text after the prefix as the problem, and `reason` `change remark`.

To read a departure entry, take the text after `departure not reported: ` and split it at its first `: "` and its last `": `: the file is before the first, the quote between the two, and the problem after the last.

`not_reported` holds only the change remarks when the wave review did not return or did not run, and none of its entries is ever in `findings`. Then reply with the path, the count line and the change remark lines alone.

Files in this skill

  • SKILL.md27 KB
  • lenses.md11.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.