Branch Code Review (General)
Purpose
Perform a general code review on the current branch compared to the base branch (main by default), focusing on architecture, maintainability, and correctness.
Scope
- If
$ARGUMENTS is provided, treat it as a scope (paths, diff range, or PR number).
- If no arguments are provided, review
base...HEAD where base is detected (origin/main → origin/master fallback).
Workflow
- Determine diff target
- Detect base branch:
git symbolic-ref refs/remotes/origin/HEAD → extract main or master.
- If not available, try
origin/main, then origin/master.
- Enumerate change surface
git diff --name-status base...HEAD
git log --oneline base...HEAD
- Read the diff before diving into code.
- Architecture pass
- Evaluate loose coupling, high cohesion, extensibility, and DRY.
- Check module boundaries and whether responsibilities are clearly separated.
- Maintainability pass
- Keep files under ~500 lines unless necessary.
- Names are descriptive; public names are concise; internal names can be verbose.
- Comments explain why for non-obvious logic; remove redundant comments.
- Documentation is updated for behavior, usage, or interface changes.
- Correctness and safety
- Validate logic, edge cases, and error handling.
- Look for regressions, config mismatches, or hidden coupling.
- Tests
- Ensure tests exist and are meaningful for the change surface.
- Prefer tests that would fail on broken behavior.
Best-Practice Signals (from authoritative guidance)
- Review design and interactions first; validate overall intent. (Google Eng Practices)
- Read every changed line in logical sequence; expand context if needed. (Google + Microsoft)
- Focus on correctness, readability/maintainability, and test quality. (Microsoft)
- Use structured checklists to avoid missing issues. (Atlassian)
Repo-Specific Context
This repo is evolving toward extensible planning/content management. Favor:
- Clear interfaces for future content types beyond plans.
- Minimal cross-package coupling.
- Extensible, composable APIs (avoid one-off branching).
- Config/format stability to support long-lived plans and migrations.
Output Format
Follow the repo review style:
- Findings first, ordered by severity.
- Include file references and concrete evidence.
- If no issues, say so explicitly and list residual risks or testing gaps.
Use this structure:
## Findings
- 🔴 Critical: ...
- 🟠 High: ...
- 🟡 Medium: ...
- 🟢 Low: ...
## Questions / Assumptions
- ...
## Tests
- Suggested: ...
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: branch-code-review3description: Review changes on the current branch versus main for design, maintainability, and correctness. Use when a general code review is requested. Use when this capability is needed.4---5# Branch Code Review (General)67## Purpose8Perform a general code review on the current branch compared to the base branch (`main` by default), focusing on architecture, maintainability, and correctness.910## Scope11- If `$ARGUMENTS` is provided, treat it as a scope (paths, diff range, or PR number).12- If no arguments are provided, review `base...HEAD` where `base` is detected (`origin/main` → `origin/master` fallback).1314## Workflow151. **Determine diff target**16 - Detect base branch:17 - `git symbolic-ref refs/remotes/origin/HEAD` → extract `main` or `master`.18 - If not available, try `origin/main`, then `origin/master`.192. **Enumerate change surface**20 - `git diff --name-status base...HEAD`21 - `git log --oneline base...HEAD`22 - Read the diff before diving into code.233. **Architecture pass**24 - Evaluate loose coupling, high cohesion, extensibility, and DRY.25 - Check module boundaries and whether responsibilities are clearly separated.264. **Maintainability pass**27 - Keep files under ~500 lines unless necessary.28 - Names are descriptive; public names are concise; internal names can be verbose.29 - Comments explain *why* for non-obvious logic; remove redundant comments.30 - Documentation is updated for behavior, usage, or interface changes.315. **Correctness and safety**32 - Validate logic, edge cases, and error handling.33 - Look for regressions, config mismatches, or hidden coupling.346. **Tests**35 - Ensure tests exist and are meaningful for the change surface.36 - Prefer tests that would fail on broken behavior.3738## Best-Practice Signals (from authoritative guidance)39- Review design and interactions first; validate overall intent. (Google Eng Practices)40- Read every changed line in logical sequence; expand context if needed. (Google + Microsoft)41- Focus on correctness, readability/maintainability, and test quality. (Microsoft)42- Use structured checklists to avoid missing issues. (Atlassian)4344## Repo-Specific Context45This repo is evolving toward extensible planning/content management. Favor:46- Clear interfaces for future content types beyond plans.47- Minimal cross-package coupling.48- Extensible, composable APIs (avoid one-off branching).49- Config/format stability to support long-lived plans and migrations.5051## Output Format52Follow the repo review style:53- Findings first, ordered by severity.54- Include file references and concrete evidence.55- If no issues, say so explicitly and list residual risks or testing gaps.5657Use this structure:58```59## Findings60- 🔴 Critical: ...61- 🟠 High: ...62- 🟡 Medium: ...63- 🟢 Low: ...6465## Questions / Assumptions66- ...6768## Tests69- Suggested: ...70```7172---73> Converted and distributed by [TomeVault](https://tomevault.io/claim/paulbreuler) — claim your Tome and manage your conversions.74<!-- tomevault:4.0:skill_md:2026-04-12 -->