Code Review Workflow
Use this workflow to review git changes with evidence-backed findings and risk-aware verdicts.
Step 1: Determine Review Target
Identify what to review from the user's request.
| User Input |
Action |
| Commit hash provided |
Use that commit |
Commit range (start~end) |
Use the range (start = earliest, end = latest) |
| "리뷰해줘" / "review" with no hash |
Use staged changes (git diff --cached). If nothing staged, use HEAD |
| File paths specified |
Scope review to those files within the target |
Always confirm the target before proceeding:
git --no-pager show --stat <commit_hash>
# or for staged changes:
git --no-pager diff --cached --stat
Step 2: Retrieve the Diff
Get the full diff for the review target. Refer to git_operations.md for detailed commands and fallback handling (root commits, merge commits, range stabilization).
# Single commit
git --no-pager show <commit_hash>
# Staged changes
git --no-pager diff --cached
# Commit range
git --no-pager diff <start_hash>^..<end_hash>
# File-scoped
git --no-pager show <commit_hash> -- <file_path>
Step 3: Classify Changes and Filter Noise
Categorize each changed file and filter out noise before deep review. This prevents wasting review effort on non-reviewable content.
File Categories
| Category |
Examples |
| Source |
.ts, .js, .py, .java, .go, .rs, .swift, .kt, .rb, .php, .c, .cpp |
| Test |
*.test.*, *.spec.*, __tests__/*, test_*.*, *_test.* |
| Config |
.json, .yaml, .toml, .env*, .*rc, config/* |
| Docs |
.md, .rst, .txt, docs/* |
| Build/CI |
Dockerfile*, Makefile, .github/workflows/*, *.gradle* |
| Deps |
package.json, pyproject.toml, go.mod, Cargo.toml, requirements*.txt |
Noise Filtering
Skip line-by-line review for these — check consistency/integrity only:
| Noise Type |
Pattern |
Handling |
| Generated files |
generated/, *.pb.*, *.generated.* |
Inspect generation source instead |
| Lock files |
package-lock.json, yarn.lock, go.sum, Cargo.lock |
Verify manifest consistency only |
| Minified/bundled |
*.min.js, *.bundle.js |
Exclude from logic findings |
| Vendor/third-party |
vendor/, third_party/ |
Evaluate integration impact only |
| Mechanical renames |
Status R/C with no behavioral delta |
Validate paths, then deprioritize |
| Format-only changes |
Whitespace/indent-only diffs |
Note as low-risk, skip deep analysis |
Review Depth by Scale
| Files Changed |
Strategy |
| 1–10 |
Full line-by-line review |
| 11–30 |
Prioritize source/config, then tests/docs |
| 30+ |
Separate noise first, sample low-risk files, full-review high-risk files |
Always Full-Review (Regardless of Scale)
- Security/auth/authorization files
- Data schema, migration, persistence contracts
- Runtime entrypoints and routing bindings
- Critical production config files
Step 4: Analyze Reviewable Files
Read the full context of each reviewable file to understand the change, not just the diff. Focus on:
- What behavior changed and why
- Whether the change is correct and complete
- Edge cases, error handling, boundary conditions
- Consistency with surrounding code patterns
Step 5: Trace Impact
Identify who/what is affected by the changes. Refer to impact_detection.md for detailed techniques.
Key actions:
- Find consumers — search for references to changed symbols, APIs, contracts
- Check exposure — is the changed entity publicly consumed or internal-only?
- Detect breaking changes — required inputs increased? Output contract changed? Symbols removed/renamed?
- Check test coverage — do tests cover the changed behavior paths?
# Find direct callers
rg -F "symbolName(" .
# Find broader references
rg "symbolName" .
Breaking Change Signals
| Change Type |
Breaking? |
| New mandatory parameter/field |
Yes |
| Removed/renamed output field |
Yes |
| Accepted values narrowed |
Yes |
| Endpoint signature changed |
Yes |
| Additive optional extension |
No (usually) |
If a breaking change has normalized consumers > 0, classify at least as Critical candidate.
Step 6: Classify Findings
Assign each finding a severity and confidence level.
Severity Levels
Critical
Immediate high risk to security, data integrity, availability, or external contracts.
- Security exposure: injection, credential leakage, auth bypass
- Data integrity: corruption, irreversible mutation, destructive migration without rollback
- Availability: crash loops, deadlock, unbounded resource exhaustion
- Breaking contract: incompatible changes on consumed public interfaces
- Rollback gap: no rollback path for high-impact operational changes
Major
Incorrect behavior, reliability degradation, or high operational cost.
- Behavioral defects: wrong branch logic, boundary errors, invalid fallbacks
- Performance: unbounded processing, repeated expensive ops
- Error handling gaps: swallowed failures, incorrect retries
- Concurrency/race conditions
- Observability regression: lost diagnostic context
- Config semantics drift without compatibility handling
Minor
Maintainability, readability, or medium-term quality concerns.
- Excessive complexity, duplicated logic
- Ambiguous naming, unclear control flow
- Tight coupling, low cohesion
Nit
Low-impact polish and consistency.
- Style/formatting drift
- Naming clarity improvements
- Outdated comments
Critical vs Major Boundary
| Factor |
→ Critical |
→ Major |
| Data risk |
Loss/corruption likely, irreversible |
Inconsistency possible, recoverable |
| Business logic |
Core transaction/auth broken |
Limited-path incorrect behavior |
| Rollback |
No safe rollback path |
Rollback exists and is practical |
| Observability |
Incident detection critically degraded |
Degraded but manageable |
Confidence Tiers
| Tier |
Meaning |
| High |
Strong direct evidence; severity can be acted on directly |
| Medium |
Credible but partially indirect evidence; include verification note |
| Low |
Weak or indirect evidence; avoid automatic escalation, request manual verification |
Escalation Rule
A Major finding becomes a REQUEST_CHANGES candidate when ALL of:
- Impacts a critical domain (auth, payment, data integrity, availability)
- High user/service/data impact
- Confidence is Medium or High
Step 7: Determine Verdict
Combine findings into a final verdict.
Baseline Rules
| Verdict |
Condition |
| REQUEST_CHANGES |
Any Critical finding |
| REQUEST_CHANGES |
3+ Major findings |
| COMMENT |
1–2 Major findings |
| COMMENT |
5+ Minor findings |
| APPROVE |
Only Minor/Nit or no findings |
Risk-Weighted Adjustment (Internal Logic)
Use internally to validate the baseline verdict — do NOT output the score:
- Severity weights: Critical=10, Major=5, Minor=2, Nit=1
- Confidence factor: High=1.0, Medium=0.7, Low=0.4
- Critical domain bonus: +4 per finding in auth/payment/data integrity/availability
| Score |
Adjustment |
| ≥ 12 with medium+ confidence |
REQUEST_CHANGES |
| 6–11 |
COMMENT (unless baseline already requests changes) |
| ≤ 5 and no Major+ findings |
APPROVE candidate |
Confidence-Aware Handling
| Evidence Shape |
Handling |
| High confidence + high impact |
Keep or escalate severity |
| Medium confidence + medium/high impact |
Keep severity, add verification note |
| Low confidence |
No automatic escalation; request manual verification |
Step 8: Generate Report
Output the review using the format in output_format.md.
Key requirements:
- Group findings by severity (default) or by file if requested
- Each finding must include: file location, issue, evidence, impact, confidence tier, and suggestion
- State analysis limitations honestly (unverifiable areas, sampling scope)
- Include a
Highlights section when patch quality deserves recognition
- End with a clear verdict and decision rationale
Tools
- Git CLI: Commit metadata, diffs, history, range context
- Search tools (
rg): Consumer tracing, reference lookup, test coverage checks
Reference Files
| File |
When to Read |
| git_operations.md |
Step 2 — for edge cases (root commits, merges, range fallbacks) |
| impact_detection.md |
Step 5 — for consumer tracing and breaking change detection |
| output_format.md |
Step 8 — for report structure and finding entry format |
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: code-review-263description: Performs production-ready code reviews on git changes. Supports commit/range/file-scoped analysis, impact assessment, breaking-change detection, confidence-aware finding classification, and risk-weighted verdict generation. Use when this capability is needed.4---56# Code Review Workflow78Use this workflow to review git changes with evidence-backed findings and risk-aware verdicts.910## Step 1: Determine Review Target1112Identify what to review from the user's request.1314| User Input | Action |15|------------|--------|16| Commit hash provided | Use that commit |17| Commit range (`start~end`) | Use the range (start = earliest, end = latest) |18| "리뷰해줘" / "review" with no hash | Use staged changes (`git diff --cached`). If nothing staged, use `HEAD` |19| File paths specified | Scope review to those files within the target |2021Always confirm the target before proceeding:22```bash23git --no-pager show --stat <commit_hash>24# or for staged changes:25git --no-pager diff --cached --stat26```2728## Step 2: Retrieve the Diff2930Get the full diff for the review target. Refer to **[git_operations.md](references/git_operations.md)** for detailed commands and fallback handling (root commits, merge commits, range stabilization).3132```bash33# Single commit34git --no-pager show <commit_hash>3536# Staged changes37git --no-pager diff --cached3839# Commit range40git --no-pager diff <start_hash>^..<end_hash>4142# File-scoped43git --no-pager show <commit_hash> -- <file_path>44```4546## Step 3: Classify Changes and Filter Noise4748Categorize each changed file and filter out noise before deep review. This prevents wasting review effort on non-reviewable content.4950### File Categories5152| Category | Examples |53|----------|----------|54| **Source** | `.ts`, `.js`, `.py`, `.java`, `.go`, `.rs`, `.swift`, `.kt`, `.rb`, `.php`, `.c`, `.cpp` |55| **Test** | `*.test.*`, `*.spec.*`, `__tests__/*`, `test_*.*`, `*_test.*` |56| **Config** | `.json`, `.yaml`, `.toml`, `.env*`, `.*rc`, `config/*` |57| **Docs** | `.md`, `.rst`, `.txt`, `docs/*` |58| **Build/CI** | `Dockerfile*`, `Makefile`, `.github/workflows/*`, `*.gradle*` |59| **Deps** | `package.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`, `requirements*.txt` |6061### Noise Filtering6263Skip line-by-line review for these — check consistency/integrity only:6465| Noise Type | Pattern | Handling |66|------------|---------|----------|67| Generated files | `generated/`, `*.pb.*`, `*.generated.*` | Inspect generation source instead |68| Lock files | `package-lock.json`, `yarn.lock`, `go.sum`, `Cargo.lock` | Verify manifest consistency only |69| Minified/bundled | `*.min.js`, `*.bundle.js` | Exclude from logic findings |70| Vendor/third-party | `vendor/`, `third_party/` | Evaluate integration impact only |71| Mechanical renames | Status `R`/`C` with no behavioral delta | Validate paths, then deprioritize |72| Format-only changes | Whitespace/indent-only diffs | Note as low-risk, skip deep analysis |7374### Review Depth by Scale7576| Files Changed | Strategy |77|---------------|----------|78| 1–10 | Full line-by-line review |79| 11–30 | Prioritize source/config, then tests/docs |80| 30+ | Separate noise first, sample low-risk files, full-review high-risk files |8182### Always Full-Review (Regardless of Scale)8384- Security/auth/authorization files85- Data schema, migration, persistence contracts86- Runtime entrypoints and routing bindings87- Critical production config files8889## Step 4: Analyze Reviewable Files9091Read the full context of each reviewable file to understand the change, not just the diff. Focus on:9293- What behavior changed and why94- Whether the change is correct and complete95- Edge cases, error handling, boundary conditions96- Consistency with surrounding code patterns9798## Step 5: Trace Impact99100Identify who/what is affected by the changes. Refer to **[impact_detection.md](references/impact_detection.md)** for detailed techniques.101102Key actions:1031. **Find consumers** — search for references to changed symbols, APIs, contracts1042. **Check exposure** — is the changed entity publicly consumed or internal-only?1053. **Detect breaking changes** — required inputs increased? Output contract changed? Symbols removed/renamed?1064. **Check test coverage** — do tests cover the changed behavior paths?107108```bash109# Find direct callers110rg -F "symbolName(" .111# Find broader references112rg "symbolName" .113```114115### Breaking Change Signals116117| Change Type | Breaking? |118|-------------|-----------|119| New mandatory parameter/field | Yes |120| Removed/renamed output field | Yes |121| Accepted values narrowed | Yes |122| Endpoint signature changed | Yes |123| Additive optional extension | No (usually) |124125If a breaking change has normalized consumers > 0, classify at least as **Critical candidate**.126127## Step 6: Classify Findings128129Assign each finding a **severity** and **confidence** level.130131### Severity Levels132133#### Critical134Immediate high risk to security, data integrity, availability, or external contracts.135- Security exposure: injection, credential leakage, auth bypass136- Data integrity: corruption, irreversible mutation, destructive migration without rollback137- Availability: crash loops, deadlock, unbounded resource exhaustion138- Breaking contract: incompatible changes on consumed public interfaces139- Rollback gap: no rollback path for high-impact operational changes140141#### Major142Incorrect behavior, reliability degradation, or high operational cost.143- Behavioral defects: wrong branch logic, boundary errors, invalid fallbacks144- Performance: unbounded processing, repeated expensive ops145- Error handling gaps: swallowed failures, incorrect retries146- Concurrency/race conditions147- Observability regression: lost diagnostic context148- Config semantics drift without compatibility handling149150#### Minor151Maintainability, readability, or medium-term quality concerns.152- Excessive complexity, duplicated logic153- Ambiguous naming, unclear control flow154- Tight coupling, low cohesion155156#### Nit157Low-impact polish and consistency.158- Style/formatting drift159- Naming clarity improvements160- Outdated comments161162### Critical vs Major Boundary163164| Factor | → Critical | → Major |165|--------|-----------|---------|166| Data risk | Loss/corruption likely, irreversible | Inconsistency possible, recoverable |167| Business logic | Core transaction/auth broken | Limited-path incorrect behavior |168| Rollback | No safe rollback path | Rollback exists and is practical |169| Observability | Incident detection critically degraded | Degraded but manageable |170171### Confidence Tiers172173| Tier | Meaning |174|------|---------|175| **High** | Strong direct evidence; severity can be acted on directly |176| **Medium** | Credible but partially indirect evidence; include verification note |177| **Low** | Weak or indirect evidence; avoid automatic escalation, request manual verification |178179### Escalation Rule180181A Major finding becomes a `REQUEST_CHANGES` candidate when ALL of:182- Impacts a critical domain (auth, payment, data integrity, availability)183- High user/service/data impact184- Confidence is Medium or High185186## Step 7: Determine Verdict187188Combine findings into a final verdict.189190### Baseline Rules191192| Verdict | Condition |193|---------|-----------|194| **REQUEST_CHANGES** | Any Critical finding |195| **REQUEST_CHANGES** | 3+ Major findings |196| **COMMENT** | 1–2 Major findings |197| **COMMENT** | 5+ Minor findings |198| **APPROVE** | Only Minor/Nit or no findings |199200### Risk-Weighted Adjustment (Internal Logic)201202Use internally to validate the baseline verdict — do NOT output the score:203- Severity weights: Critical=10, Major=5, Minor=2, Nit=1204- Confidence factor: High=1.0, Medium=0.7, Low=0.4205- Critical domain bonus: +4 per finding in auth/payment/data integrity/availability206207| Score | Adjustment |208|-------|------------|209| ≥ 12 with medium+ confidence | REQUEST_CHANGES |210| 6–11 | COMMENT (unless baseline already requests changes) |211| ≤ 5 and no Major+ findings | APPROVE candidate |212213### Confidence-Aware Handling214215| Evidence Shape | Handling |216|----------------|----------|217| High confidence + high impact | Keep or escalate severity |218| Medium confidence + medium/high impact | Keep severity, add verification note |219| Low confidence | No automatic escalation; request manual verification |220221## Step 8: Generate Report222223Output the review using the format in **[output_format.md](references/output_format.md)**.224225Key requirements:226- Group findings by severity (default) or by file if requested227- Each finding must include: file location, issue, evidence, impact, confidence tier, and suggestion228- State analysis limitations honestly (unverifiable areas, sampling scope)229- Include a `Highlights` section when patch quality deserves recognition230- End with a clear verdict and decision rationale231232## Tools233234- **Git CLI**: Commit metadata, diffs, history, range context235- **Search tools (`rg`)**: Consumer tracing, reference lookup, test coverage checks236237## Reference Files238239| File | When to Read |240|------|-------------|241| [git_operations.md](references/git_operations.md) | Step 2 — for edge cases (root commits, merges, range fallbacks) |242| [impact_detection.md](references/impact_detection.md) | Step 5 — for consumer tracing and breaking change detection |243| [output_format.md](references/output_format.md) | Step 8 — for report structure and finding entry format |244245---246> Converted and distributed by [TomeVault](https://tomevault.io/claim/buyoung) — claim your Tome and manage your conversions.247<!-- tomevault:4.0:skill_md:2026-04-11 -->