/maruda:gh-pr-reviewerfrom maruda
Reviews a diff against an agreed plan, Issue Done conditions, or PR description before opening a PR. Checks impact scope, Done coverage, and test thresholds, then re-reads for bugs. Reports findings with file:line, classified Important/Nit/Pre-existing.
Ships in maruda. 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.
A change written by an agent has usually been read by nobody when it reaches a Pull Request. This skill is the read that happens first: it checks the diff against what was agreed, and has the diff read once more by a reader that did not write it.
It owns one thing other reviewers cannot do — plan conformance. A general-purpose
reviewer does not know that an agreed plan exists, what its impact scope was, or what it
promised not to cut. Bug-hunting itself is delegated (Step 4); this skill does not
re-implement a review engine. See docs/adr/0007.
Read-only. Never edit code, never comment on or change an Issue or PR, never create
Issues. Fixing belongs to gh-issue-resolver; filing belongs to report-to-issues.
Issues and PRs share one number space, so a bare #<n> is exactly one of them:
gh pr view <n> succeeds only for a PR. A PR number means "review that PR" — the
diff and both ends come from the PR, the intent from the Issue it closes (or its own
description). An Issue number means "review the current branch against that Issue's
plan"; the base is the one the caller names, else the integration branch recorded in
CLAUDE.md, else the repository's default branch. Say in BASELINE which one was used.
Take the first of these that exists and name it in the output (INTENT:):
<!-- gh-issue-planner:agreed-plan -->
— its 対応方針 / どこまで作るか / 影響範囲 / 実装方法 sections. Plans are written in
the user's language; find each section by meaning, not by the Japanese heading.<!-- gh-issue-drafter:scoped-issue --> or states them plainly.gh issue view <id> --json number,title,body,comments
gh pr view <n> --json number,title,body,state,baseRefName,headRefName,baseRefOid,headRefOid,closingIssuesReferences
An agreed plan and the Issue's Done conditions are used together when both exist: the plan is how, the Done conditions are the contract.
Several Issues at once (a batch reviewed as one change): collect the most recent
agreed plan of every Issue named. The scope is the union of their 影響範囲 and of what
each keeps under 削らないもの; every Issue's Done conditions must hold; a file is out of
scope only if no member's plan covers it. One member's 触らない範囲 or 作らないもの does
not fail what another member's plan agreed to — an exclusion binds the Issue that wrote
it. Name all of them on INTENT:, and say in a
finding which Issue's plan or condition it is about.
A plan the user pastes or points to counts as an agreed plan even with no Issue behind it.
If none exists, do not invent an intent. Set INTENT: none (plan conformance not checked), run only the
Weakened checks row of Step 3 (it needs no intent), and say in the report that plan
conformance was not checked.
git diff --stat <base-ref>...HEAD
git diff <base-ref>...HEAD
git diff --name-status <base-ref>...HEAD
# or, for a PR (open or already merged):
gh pr diff <n>
These are three-dot diffs: they compare HEAD with the commit the branch was cut from,
so record the baseline as <base-ref>@<short sha of the merge base>
(git merge-base <base-ref> HEAD).
Only committed work is in that diff. If git status --porcelain shows uncommitted
changes, review the working tree instead — git diff $(git merge-base <base-ref> HEAD) for
tracked files, plus every untracked file (git ls-files --others --exclude-standard),
read whole and treated as added — and say so in the report; do not silently review less
than what is there.
For a
PR, take both ends from the PR itself — baseRefOid and headRefOid — and use them
wherever this skill writes <base-ref> and HEAD: after a merge the base branch already
contains the change, so the branch name is no longer its baseline. If either commit is missing locally, fetch it
(git fetch origin <oid>) or fall back to gh pr diff <n> and say that line attribution
came from the PR diff. Line numbers in findings always refer to the head side of the
diff.
An empty diff ends the review, and it is not a pass: nothing was read. Emit
RESULT: FAIL with the single finding R-01 | Important | <base-ref>...HEAD | empty diff — nothing was reviewed, and say what to check (the base ref, whether the work is
committed, whether the branch is the right one). A caller that expected changes must not
be able to mistake "reviewed nothing" for "found nothing".
Compare the diff with the intent. Each failed check below is an Important finding.
A check runs only against what the intent actually states. An agreed plan carries every section below; a PR description or a one-line statement usually carries none of them. Do not derive a 影響範囲, a Done condition or a list of safeguards from an intent that does not state one — with a loose intent, check that the diff does what it says and nothing unrelated, run the Weakened checks row, and leave the rest.
| Check | Fails when |
|---|---|
| Scope | A changed file is neither listed in the plan's 影響範囲 (files, modules, tests) nor an obvious consequence of a listed step (a test for a listed file, a lockfile for a listed manifest). Name the file. |
| Out of scope | The diff changes something the Issue's 触らない範囲 or the plan's 作らないもの excludes. |
| Done | A Done condition is not made true by the diff — or is made true, but a test the plan promised for it (its テスト entry) is missing or would not fail if the condition stopped being true. Name the condition. A condition the plan agreed to verify by hand, or by running something this skill does not run, is not a failure: list it under Not checked. |
| Kept safeguards | Something the plan lists under 削らないもの (a security boundary, data-loss protection, authorization, input validation, error handling, accessibility) is removed, bypassed or left unhandled. |
| Weakened checks | The diff makes a check pass by weakening it: an assertion deleted or loosened, a test skipped or removed, a threshold, lint rule, type or constraint relaxed, an error swallowed. A test that changed because the agreed behaviour changed is not a weakening — say which it is. |
| Built more than agreed | The diff builds something the plan's どこまで作るか stopped short of (a new abstraction, option or dependency the plan did not call for). |
Do not report a plan step that was implemented differently but still satisfies the Done conditions and stays in scope — how is the implementer's call. The same goes for a tightening made after the plan (a stricter condition added in response to a review) as long as it stays inside the agreed files and breaks no Done condition.
A condition that cannot be judged from the diff — it points at behaviour recorded
elsewhere, or needs something run that this skill does not run — is not a finding. List
it in the Not checked line of the report (Step 6) instead of guessing either way.
One row per location and cause. When one change fails several checks (a deleted assertion is both a weakened check and a cut safeguard), report it once and name every check it fails in the Finding. A file outside the agreed scope gets one Scope row; say in that row what the out-of-scope change does, and do not raise its content again as a separate defect — the fix is the same (take it out of this change).
The reader that wrote a change is the worst reader of it. Hand the diff to a reader with no memory of writing it:
CLAUDE.md, .claude/rules/) by path
when they exist, and the classification in Step 5. Ask for correctness defects only:
logic errors, unhandled edge and error paths, broken contracts with callers, data loss,
races, security defects, and tests that no longer check what they claim to. Its scope
is the files the diff touches: defects on changed lines, and defects it notices on
untouched lines of those same files, each marked changed or untouched so Step 5
can attribute them. It does not go hunting through the rest of the codebase. Ask for
file:line, why it is wrong, and the direction of the fix. Do not hand it your own
conclusions.One reader, one pass. Do not build voting, multiple reviewers or effort levels here; a
project that wants a deeper review runs its platform's own review on top
(e.g. Claude Code's /code-review).
Check each reported defect against the code before keeping it: open the cited line and confirm the failure is real. Drop what you cannot confirm — an unverified finding costs the author more than a missed nit. A finding you can confirm only as an ambiguity (the text or code can be read in a way that fails, and nothing forces that reading) is kept as a Nit, with the uncertainty stated in the row — when it is on code the change altered. The same doubt about untouched code is dropped: Pre-existing is for defects that are real, not for everything a reader could question.
| Class | Meaning | What the caller does |
|---|---|---|
| Important | A plan-conformance failure (Step 3), or a real defect on a line this diff added or changed | Fix before the PR |
| Nit | Style, naming, formatting, a preference; anything the project's formatter or linter owns; and a real but minor weakness a careful reviewer would mention without blocking the merge | Nothing required |
| Pre-existing | A real defect on a line this diff did not change | Not fixed here — handed to report-to-issues |
Attribution is by what the change altered: git diff -U0 <base-ref>...HEAD shows which
lines the change owns, and within a changed line only the part that actually differs is
the change's — a clause carried over verbatim on an edited line is still untouched code. A defect in untouched code that the change merely sits next to is Pre-existing,
however serious. A defect in untouched code that the change newly reaches (a new
caller passing a value the callee never handled) is Important — the change caused the
failure, and the finding is anchored on the changed line.
When unsure between Important and Nit, ask: would a careful reviewer block the merge on it? If not, it is a Nit.
Some changes are read by a person however clean the review is. The project's cycle rules
(.claude/rules/maruda-cycle.md, Changes a human must read) list them; use that list
when it exists, including categories the project added. Without it, use these:
authentication and authorization · money (billing, payment, pricing) · secrets and cryptography · personal data · data migration and destructive operations · the checks themselves (CI, hooks, harness and scanner configuration, thresholds) · dependencies
Judge by what the change does, not by the file's name or path: a permission check
changed in utils/helpers.ts is an authorization change; a typo fixed in
auth/README.md is not. For each category the diff falls into, emit one entry on the
HUMAN-REVIEW line with the file and a one-clause reason.
This is a flag, not a finding. It does not change RESULT, it is not counted in
SUMMARY, and a change may be flagged with zero findings.
Emit this header first, exactly, so gh-issue-resolver and gh-batch-runner can read it:
<!-- gh-pr-reviewer:result -->
RESULT: PASS | FAIL
SUMMARY: important <n> / nit <n> / pre-existing <n>
INTENT: agreed plan on Issue #<id>[, #<id> …] | agreed plan (handed over by the user) | Done conditions on Issue #<id> | PR #<n> description | user statement | none (plan conformance not checked)
BASELINE: <base-ref>@<sha>
READ: independent | not independent
HUMAN-REVIEW: none | <category>: <file> — <reason>[; <category>: <file> — <reason>]
RESULT is FAIL when there is at least one Important finding, otherwise PASS.
SUMMARY counts rows of the table below.
Then the findings, Important first, in the user's language:
| ID | Class | Location | Finding | Direction |
|----|-------|----------|---------|-----------|
| R-01 | Important | internal/order/service.go:88 | Scope: file is outside the agreed 影響範囲 (db/migrations/ only) | Move the change behind the agreed step, or return to the planner |
| R-02 | Important | internal/order/service_test.go:41 | Weakened check: `assert.Equal(want, got)` replaced by `assert.NotNil(got)` | Restore the assertion and fix the writer |
| R-03 | Pre-existing | internal/order/repo.go:120 | `rows.Err()` is never checked after the loop | Hand to report-to-issues |
Every finding carries a location: a file:line, or — for a plan-conformance finding about
something missing (an uncovered Done condition) — the file where the change should have
been, or the plan itself (plan: 完了条件 2).
After the table, when Step 3 left something unjudged, add one line — and nothing else that is not a finding:
Not checked: 完了条件 3 (regression scenarios are recorded in PR #57, not in this diff)
With no findings, say so in one line under the header — 問題なし (no findings) — rather than leaving the table empty. Never pad the report with praise or a summary of the diff.
A second run after fixes reports the current state only. A finding that no longer
reproduces is gone — do not list it as resolved. A Nit the author left alone is still
true and stays listed, so the counts describe the diff being shipped; it still never
fails the review. If the same Important finding survives a fix attempt unchanged, say so on
its row (unchanged since the previous run); the caller uses that to stop retrying.
HUMAN-REVIEW is judged by what the change does, never by its path, and never
changes the resultWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
15 skills in this plugin
/data-validationInspect a project's data for correctness and produce a read-only validation report — record counts, NULL rates, value distribution, uniqueness, referential integrity, format validity, and sampled evidence rows. Data is read only from the project's own test fixtures/seed data or from an explicitly configured connection; never from a guessed or production source. Triggers on requests like "validate the data", "check data quality", "データ検証", "データの妥当性を確認", "NULL率を調べて", "件数がおかしい", "/maruda:data-validation", or when `gh-issue-resolver` verifies a data-related change. Does NOT modify any data or code — read-only inspection only. Produces no JSON.
/dependency-auditAudit third-party dependencies for known vulnerabilities (OWASP A06) without running SAST. Scans lockfiles under a path (plus the owning workspace root lockfile) and explicitly named container images with a pinned Trivy; reports severity, package, version, fixed version, source, and reachability. Records what was scanned and marks what could not be as "not run" with the reason, never as zero. Writes a security-audit-format report for `report-to-issues` and a JSON summary. Only when the user asks, also converts each scanned target into an SBOM (CycloneDX by default, or SPDX) — never by default. Triggers on requests like "依存の脆弱性を調べて", "依存を監査して", "ロックファイルの脆弱性", "ベースイメージの脆弱性", "dependency audit", "check dependencies for CVEs", "scan the lockfile", "scan this image", "SBOMも出して", "generate an SBOM", "CycloneDX", "SPDX", "/maruda:dependency-audit", or when `vulnerability-scan` or `gh-issue-resolver` delegates the dependency audit. Read-only: never upgrades, installs, regenerates a lockfile, or builds an image.
/gh-batch-runnerRun several planned GitHub Issues as one unit: collect them under an Epic Issue with sub-issues, implement each on a shared epic/ branch in dependency order, verify the branch as a whole, and open a single Pull Request into the integration branch. Use when the user wants several Issues fixed, verified and released together. Triggers include requests such as Issue1,2,3をまとめて対応して / まとめて修正してリリースしたい / この3件を一緒に出して, 'batch these issues', 'do issues 1 2 3 together', 'ship these issues as one release'. Prerequisite: every member Issue needs an agreed plan comment from gh-issue-planner. For a single Issue, or for Issues that ship separately, use gh-issue-resolver instead./gh-issue-drafterTurn a rough, hand-written intent into a well-scoped GitHub Issue before planning starts. Takes a loose 'what I want' from the user, proposes the missing structure (Done definition, Out of scope, Design constraints), gets the user's approval, and creates the Issue via the gh CLI with a scoped-issue marker so gh-issue-planner can pick it up. When the intent is too large for one Issue, it proposes splitting it into independent Issues or an Epic with sub-issues. This is the human-authored counterpart to report-to-issues (which registers machine-generated findings). Use when the user wants to file a new Issue from a rough idea, is about to write an Issue by hand, or asks to turn a note/thought into an Issue. Triggers include requests like Issueを起こして / Issueを作って / ざっくり書くのでIssueにして, 'draft an issue', 'create an issue for', 'turn this into an issue', 'file an issue'. Does NOT plan or implement — hand off to gh-issue-planner for the response plan, then gh-issue-resolver for implementation./gh-issue-plannerFetch a GitHub Issue by ID using the gh CLI, investigate related code, propose a structured response plan (policy, impact scope, implementation steps), and post the agreed plan as a comment on the issue. Implementation/PR creation is out of scope — use gh-issue-resolver for that. Use when the user provides a GitHub Issue ID or asks to investigate/analyze/plan a GitHub Issue. Triggers include issue IDs like #42 or 'issue 42', requests such as Issueを調査して / Issueの対応方針を立てて, analyze issue #N, plan issue #N, investigate issue, look at issue. Accepts several Issues at once (e.g. '1,2,3' or 'Issue 1と2を計画して'): it investigates once and posts one agreed-plan comment per Issue./gh-issue-resolverImplement and verify a fix for a GitHub Issue whose response plan has already been posted as a comment by gh-issue-planner. Creates a feature branch, applies the agreed plan, runs tests, and opens a Pull Request. Use when the user asks to implement/fix/resolve a planned GitHub Issue. Triggers include requests such as Issueを実装して / Issueを修正して / Issueを対応して, implement issue #N, fix issue #N, resolve issue #N, work on issue #N. Prerequisite: an agreed plan comment must exist on the issue (run gh-issue-planner first if not).npx claudepluginhub northraystudio/maruda --plugin maruda