Perform a strict, evidence-based review. Prioritize defects, regressions, security risks, data risks, and missing tests. Do not edit product code unless the user explicitly asks for fixes.
, , , , , or .git status --short --branch
git branch --show-current
git log --oneline --decorate -10
git diff --name-status origin/master...HEAD
git diff --name-status master...HEAD
Use origin/master...HEAD when available, otherwise use master...HEAD. Record the selected base in the report.
git diff --name-status <base>...HEAD
git diff --stat <base>...HEAD
git diff --unified=80 <base>...HEAD
If the full diff is too large or truncated, review per file:
git diff --unified=80 <base>...HEAD -- <file>
git diff --name-status
git diff --stat
git diff --unified=80
rg to find definitions, call sites, configuration keys, mapper SQL, tests, and related behavior.git diff --check <base>...HEAD
Run focused build or tests only when the project makes the relevant command clear and the command is safe in the local environment.
Check every changed file and hunk for:
Pay extra attention to catch blocks that only log and continue, finally blocks with irreversible side effects, batch jobs with partial failures, payment/order/accounting/refund flows, scheduled or retry jobs, and file upload/download/encryption/decompression code.
Create a Markdown report named code-review-report-YYYYMMDD-HHmm.md in the repository root unless the user asks for inline-only output.
Use this structure:
# Code Review Report
**Branch:** {branch}
**Base:** {base}
**Range:** {base}...HEAD
**Reviewed at:** {timestamp}
**Changed files:** {count}
**Conclusion:** {Pass / Conditional pass / Do not merge}
## 1. Requirement Context
- Source: {provided / not provided}
- Goal: {summary or "not provided"}
- Limitation: {state uncertainty when requirements are missing}
## 2. Overall Assessment
- Overall: {score}/10
- Correctness: {score}/10
- Security: {score}/10
- Reliability: {score}/10
- Maintainability: {score}/10
- Tests: {score}/10
## 3. Scope
| Status | File |
| --- | --- |
| M | path/to/file.ext |
## 4. Findings
### {Severity}-{number}: {title}
- Severity: Critical / Major / Minor / Suggestion
- Location: `path/to/file.ext:Lx`
- Problem: ...
- Impact: ...
- Trigger: ...
- Recommendation: ...
## 5. Test Recommendations
- ...
## 6. Verification
| Command | Result | Notes |
| --- | --- | --- |
| `git diff --check ...` | pass/fail/not run | ... |
## 7. Uncommitted Changes
- State whether uncommitted and untracked files were reviewed, ignored, or only listed.
## 8. Coverage Log
### path/to/file.ext
- Hunks reviewed: {count}
- Changed lines covered: yes/no
- Notes: ...
Severity definitions:
Critical: production outage, data loss/corruption, security vulnerability, or core flow unavailable.Major: clear business bug, broken error path, compatibility break, or reliability problem.Minor: maintainability, localized performance, logging, or test gap.Suggestion: improvement that should not block merge.Final response to the user must summarize the report path, highest-risk findings, verification status, and whether merge is recommended. If no blocking issues are found, say that explicitly and mention residual risk.
共 1 个版本