PR classify
Review the current branch (or a specified PR) and produce structured feedback in the user's canonical classification scheme. The user is a Staff Engineer who explicitly wants to filter out nitpicks and focus on meaningful engineering concerns.
Preconditions (before any review work)
- Auth. Run
gh auth status. If unauthenticated, stop and tell the user to run gh auth login before continuing. Do not fall back to a local-branch-only review silently.
- PR target. A PR number/URL or a checked-out branch with an open PR is required. If invoked as a bare review with no PR context, ask for the target instead of guessing.
- Open state. Verify the PR is still open:
gh pr view <id> --json state,mergedAt. If it is merged or closed, surface that and confirm the user still wants the review before proceeding.
Steps
- Identify the PR scope. If invoked on a branch, run
gh pr view --json title,body,baseRefName,headRefName,files or git diff <base>...HEAD. If invoked with a PR number/URL, fetch via gh pr view <id>.
- Read the tests first, then the diff fully. Start with the tests and the PR description to recover intended behavior — what the change is supposed to do — then read the implementation against that intent, not just changed-line context. Cross-reference touched files for callers and tests.
- For each finding, decide the bucket BEFORE writing it. If it's borderline Important/Optional and you can't articulate the cost of ignoring it, drop it.
- Group findings by bucket, not by file. Within each bucket, order by severity.
- Cite file:line for every comment. Never describe an issue abstractly.
- End with a summary verdict: approve / request changes / needs discussion. One sentence rationale.
Classification rules
Critical
Correctness, security, reliability. Examples:
- Logic bug that breaks the happy path or a documented edge case
- SQL injection, XSS, auth bypass, secret leak
- Race condition, unhandled promise rejection in hot path
- Data loss / migration that can't roll back
- Regression in existing test coverage
If you write more than ~3 Critical comments on a normal-sized PR, re-check — you're probably over-classifying.
Important
Maintainability, scalability, readability. Examples:
- Coupling that will hurt the next change in this area
- Missing test for non-trivial branch logic
- N+1 query, O(n²) where O(n) is trivial
- Naming that misleads future readers (not "I'd prefer X")
- Abstraction that leaks implementation across module boundary
Optional
Style, preferences, "would be nice". Examples:
- Could be more functional / could destructure here
- Comment phrasing
- Consistency with a pattern used elsewhere — only when the inconsistency genuinely costs something
If a finding is Optional and the cost of ignoring it is "none" — do not include it. This is the explicit anti-nitpick rule from persona.md.
Confidence
Classification is severity, not certainty — track the two separately. When you are not sure a finding is real (you could not fully trace the path, or it depends on context you cannot see), say so and phrase it as a question, not an assertion: "Is x guaranteed non-null here? If not, this throws." A confident wrong Critical costs more trust than a hedged correct one. Never inflate confidence to make a finding land; never drop a real concern because you are only 60% sure — ask.
Delegation
Delegate the reading, keep the ruling. Run the same gather/judge sequence every review, not only on large diffs — repeatability is the point:
- Orient. A cheaper-tier subagent maps the changed surface (the
codebase-map lens): entry points, touched invariants, risky areas. Compact map back, not file dumps.
- Gather by angle, in parallel. One cheaper-tier subagent per angle — correctness, tests (the
testing-checklist lens), security (the security-pass recon lens, only when the changed surface is sensitive), performance. Each returns compact candidate findings with file:line, not conclusions.
- Judge. Classification, the confidence call, and the verdict stay on the main model. A candidate finding from a subagent is evidence, not a ruling.
Scale the number of gather subagents to the diff; never skip the orient-gather-judge split or fold judgment into a subagent.
Output format
## Summary
<one paragraph: scope, overall direction, verdict>
## Critical
- `path/to/file.ts:42` — <issue> — <why it's critical> — <suggested fix>
## Important
- ...
## Optional
- ...
## Verdict
<approve | request changes | needs discussion> — <one sentence>
If a bucket is empty, write _None._ rather than removing the heading.
Posting inline comments
The classified output above is for the chat. Posting it as inline PR comments is a separate, opt-in step.
- Draft first, post on confirmation only. Show the drafted inline comments and wait for the user to explicitly confirm. Never post to GitHub before that.
- Conversational English, plain prose. Write each comment the way a peer would leave it, not as a classification dump. English unless told otherwise.
- No symbols, no AI tells. Do not use arrows (→), tildes (~), or em-dashes. Strip AI-sounding phrasing — run the text through the
humanizer skill's rules before posting.
- Anchor every comment to file:line via the
gh review API; keep the Critical/Important/Optional context but phrase it naturally.
1---2name: pr-classify-23description: Review a pull request and classify every finding as Critical / Important / Optional per the user's persona framework. Use when the user asks for a "PR review", "review this PR", "проревьюй PR", or wants PR-level triage. Different from /review (generic GitHub PR review) and from /code-review (working-diff bug scan) — this skill enforces the 3-tier classification and filters nitpicks.4---56# PR classify78Review the current branch (or a specified PR) and produce structured feedback in the user's canonical classification scheme. The user is a Staff Engineer who explicitly wants to filter out nitpicks and focus on meaningful engineering concerns.910## Preconditions (before any review work)11121. **Auth.** Run `gh auth status`. If unauthenticated, stop and tell the user to run `gh auth login` before continuing. Do not fall back to a local-branch-only review silently.132. **PR target.** A PR number/URL or a checked-out branch with an open PR is required. If invoked as a bare review with no PR context, ask for the target instead of guessing.143. **Open state.** Verify the PR is still open: `gh pr view <id> --json state,mergedAt`. If it is merged or closed, surface that and confirm the user still wants the review before proceeding.1516## Steps17181. **Identify the PR scope.** If invoked on a branch, run `gh pr view --json title,body,baseRefName,headRefName,files` or `git diff <base>...HEAD`. If invoked with a PR number/URL, fetch via `gh pr view <id>`.192. **Read the tests first, then the diff fully.** Start with the tests and the PR description to recover intended behavior — what the change is supposed to do — then read the implementation against that intent, not just changed-line context. Cross-reference touched files for callers and tests.203. **For each finding, decide the bucket BEFORE writing it.** If it's borderline Important/Optional and you can't articulate the cost of ignoring it, drop it.214. **Group findings by bucket**, not by file. Within each bucket, order by severity.225. **Cite file:line for every comment.** Never describe an issue abstractly.236. **End with a summary verdict**: approve / request changes / needs discussion. One sentence rationale.2425## Classification rules2627### Critical28Correctness, security, reliability. Examples:29- Logic bug that breaks the happy path or a documented edge case30- SQL injection, XSS, auth bypass, secret leak31- Race condition, unhandled promise rejection in hot path32- Data loss / migration that can't roll back33- Regression in existing test coverage3435If you write more than ~3 Critical comments on a normal-sized PR, re-check — you're probably over-classifying.3637### Important38Maintainability, scalability, readability. Examples:39- Coupling that will hurt the next change in this area40- Missing test for non-trivial branch logic41- N+1 query, O(n²) where O(n) is trivial42- Naming that misleads future readers (not "I'd prefer X")43- Abstraction that leaks implementation across module boundary4445### Optional46Style, preferences, "would be nice". Examples:47- Could be more functional / could destructure here48- Comment phrasing49- Consistency with a pattern used elsewhere — only when the inconsistency genuinely costs something5051**If a finding is Optional and the cost of ignoring it is "none" — do not include it.** This is the explicit anti-nitpick rule from persona.md.5253## Confidence5455Classification is severity, not certainty — track the two separately. When you are not sure a finding is real (you could not fully trace the path, or it depends on context you cannot see), say so and phrase it as a question, not an assertion: "Is `x` guaranteed non-null here? If not, this throws." A confident wrong Critical costs more trust than a hedged correct one. Never inflate confidence to make a finding land; never drop a real concern because you are only 60% sure — ask.5657## Delegation5859Delegate the reading, keep the ruling. Run the same gather/judge sequence every review, not only on large diffs — repeatability is the point:60611. **Orient.** A cheaper-tier subagent maps the changed surface (the `codebase-map` lens): entry points, touched invariants, risky areas. Compact map back, not file dumps.622. **Gather by angle, in parallel.** One cheaper-tier subagent per angle — correctness, tests (the `testing-checklist` lens), security (the `security-pass` recon lens, only when the changed surface is sensitive), performance. Each returns compact candidate findings with `file:line`, not conclusions.633. **Judge.** Classification, the confidence call, and the verdict stay on the main model. A candidate finding from a subagent is evidence, not a ruling.6465Scale the number of gather subagents to the diff; never skip the orient-gather-judge split or fold judgment into a subagent.6667## Output format6869```70## Summary71<one paragraph: scope, overall direction, verdict>7273## Critical74- `path/to/file.ts:42` — <issue> — <why it's critical> — <suggested fix>7576## Important77- ...7879## Optional80- ...8182## Verdict83<approve | request changes | needs discussion> — <one sentence>84```8586If a bucket is empty, write `_None._` rather than removing the heading.8788## Posting inline comments8990The classified output above is for the chat. Posting it as inline PR comments is a separate, opt-in step.9192- **Draft first, post on confirmation only.** Show the drafted inline comments and wait for the user to explicitly confirm. Never post to GitHub before that.93- **Conversational English, plain prose.** Write each comment the way a peer would leave it, not as a classification dump. English unless told otherwise.94- **No symbols, no AI tells.** Do not use arrows (→), tildes (~), or em-dashes. Strip AI-sounding phrasing — run the text through the `humanizer` skill's rules before posting.95- **Anchor every comment to file:line** via the `gh` review API; keep the Critical/Important/Optional context but phrase it naturally.