一键导入
review-pr
// Review PR with structured approach covering architecture, naming, patterns, and critical questions
// Review PR with structured approach covering architecture, naming, patterns, and critical questions
| name | review-pr |
| description | Review PR with structured approach covering architecture, naming, patterns, and critical questions |
| disable-model-invocation | true |
When asked to review a PR, follow this structured approach.
Always fetch the latest PR state before reviewing. The cached PR data may be stale.
git fetch upstream pull/<PR_NUMBER>/head:pr-<PR_NUMBER>
git log pr-<PR_NUMBER> --oneline -10
git diff upstream/main...pr-<PR_NUMBER> --stat
For follow-up reviews, re-fetch to get new commits:
git fetch upstream pull/<PR_NUMBER>/head:pr-<PR_NUMBER> --force
Read diffs per area (controllers, reconcilers, assets, tests) rather than one massive diff.
Only raise issues if you have a concrete concern — not as a checklist to fill:
_ = err, or is error wrapping missing where failure is plausible?Skip this section if nothing stands out.
Only flag naming if it is genuinely misleading or inconsistent with established patterns in the codebase. Do not flag stylistic preferences or minor wording variations.
-er (Reader, Writer, Reconciler)For production code, load the go-code-review skill and apply its checklist:
_ = err), errors wrapped with context (%w)defer Close() immediately after opening resourcesFor test code, load the go-testing-code-review skill and apply its checklist:
t.Helper()t.Cleanup() or Ginkgo AfterEach()t.Parallel())Describe/Context/It structureenvtest and handle eventual consistencyOnly flag issues that cause real problems (correctness, maintainability, silent failures).
Skip this section if nothing meaningful to flag.
Only ask questions where the answer is genuinely unclear from the code and matters for correctness or design. Do not manufacture questions for completeness.
Skip this section if the design is clear and the concerns above don't apply.
Before writing the final output, launch one subagent per candidate issue to confirm it is real. Do this in parallel for all issues found in sections 3–6.
Each subagent task should:
foo.go lines 40-55 and any callers.")After all subagents complete:
This step exists to filter out false positives before they reach the output. Do not skip it when there are candidate issues.
Structure the review as:
Find code duplication in the codebase. Supports two modes - scoped to current branch changes or a full codebase sweep. Use when the user asks to find duplicated code, copy-paste, repeated patterns, or wants to deduplicate before a PR.
Find functions with high cyclomatic complexity, excessive length, or too many parameters. Use when the user asks to find complex code, complexity hotspots, refactoring candidates, or wants to improve code maintainability.
Find unused functions, types, constants, imports, and unreachable code paths. Use when the user asks to find dead code, unused code, cleanup candidates, or wants to reduce codebase size.
Performs a strict clean rebase of a feature branch onto main with minimal conflict resolution and full validation. Use when the user asks to rebase carefully, avoid extra branches, avoid exploratory edits, and run make test and make lint until green.
After a code change, find affected tests, update them to match new behavior, then guide the user to run validation. Use when the user has made or asked for a code change and wants to make sure nothing is broken.
Run the full validation pipeline (make test, make lint, optionally make test-e2e) and auto-fix trivial failures like formatting and import issues. Use when the user asks to validate, run tests, check the pipeline, or verify changes are clean.