Review Branch
Pattern / AGENTS compliance review — not bug hunting and not a security audit.
Use Bugbot for defects, Security Review for vulns. This skill grades the diff
against repo conventions and AGENTS.md / README.md.
Review-only. Do not fix findings unless the user explicitly asks.
Base branch
Default base is main or master, whichever is fresher.
- Prefer remote-tracking refs (
origin/main, origin/master); else local.
- If only one exists, use that.
- If both exist, pick the tip with the newer committer date:
git log -1 --format=%cI <ref>
- If neither exists, use
git symbolic-ref refs/remotes/origin/HEAD or ask.
- User-named base wins (
against develop, vs release/x).
Diff scope: merge-base of HEAD and base through working tree (committed + staged
- unstaged), unless the user asks for commits-only or uncommitted-only.
git merge-base HEAD <base>
git diff --stat <merge-base>...HEAD
git diff <merge-base>
git status --porcelain
User-facing base note: one short line only, e.g. Base: origin/main.
Do not explain the fresher-ref logic in the reply.
Before reviewing
- Read repository
README.md (if present).
- Read repository
AGENTS.md (and nested AGENTS.md / .cursor/rules for
changed paths only).
- Skim siblings and call sites of changed files for existing patterns
(partials/components, tokens/variables) — do not audit the whole repo.
Review guidelines
Evaluate the diff against:
- No regressions are introduced
- No global changes introduced
- Components, partials and functions are reused whenever possible
- Naming conventions are followed
- No magic numbers, variables and colors are introduced
- Repository-level patterns are followed
- No dead code introduced
- Repository README.md and AGENTS.md are read and respected
Regression (static sites: Hugo / Astro)
A regression is a change that breaks or degrades existing page behavior or
contracts without clear intent. In Hugo/Astro diffs, look for:
- Shared layout/partial/component edits that alter markup, classes, slots, or
props used by untouched pages
- Broken includes/imports (
partial, partialCached, Astro component paths)
- Removed/renamed content collections, taxonomies, permalinks, or
url /
slug behavior that orphan links
- CSS specificity or variable overrides that change styling outside the
intended page/section
- Asset pipeline regressions (Hugo Pipes / Astro assets): missing fingerprint,
wrong path, broken
srcset, lost lazy/eager loading
- i18n: missing locale copy, broken
hreflang, locale layout drift when only
one language was meant to change
Global change (static sites: Hugo / Astro)
A global change is anything whose blast radius is site-wide or
cross-section, not confined to the feature’s templates/styles. Flag when the
diff touches:
- Base layouts (
baseof, root Layout.astro, site shell/nav/footer)
- Shared partials/components used across many routes
- Design tokens /
:root / SCSS variables / theme files
- Global CSS entrypoints or resets
hugo.toml / astro.config / build integrations / middleware
- Shared shortcodes, content helpers, or utility modules imported broadly
Local page templates, page-scoped CSS modules/scoped styles, and feature-only
content files are not global by default.
Intentional globals are allowed only when clearly required; put them in
Watchouts if intentional but eyebrow-raising, Critical if accidental or
undocumented vs AGENTS/README.
Diff-scoped extras
Only check these when the diff clearly touches that surface (do not scan
unrelated files):
- Accessibility — if markup/components/templates change
- i18n — if locale files, hreflang, or translated templates change
- Build/CI — if config, deps, pipes/assets, or workflows change
- Secrets / CDN / GDPR / unsafe JS — if scripts, external URLs, or asset hosting change
- Coverage gaps — if shared UI changed with no test or verification note in the
diff/PR context you have
- Blast radius — if shared layouts/partials/tokens/config changed
Evidence (required)
Every table row must cite evidence:
- Location:
path:line (or path) from the diff
- Reference: existing pattern, AGENTS/README rule, or sibling file the change
conflicts with or should have reused — e.g.
AGENTS.md § CSS,
layouts/partials/image.html, src/styles/tokens.css
No evidence → do not list the finding.
Workflow
- Resolve base; print one short
Base: … line.
- Collect the diff vs merge-base (include dirty tree unless told otherwise).
- Read README / AGENTS / local patterns for touched areas only.
- Review changed files against the guidelines.
- Reply with only
Base: + the two tables. No essays, no fix patches
unless asked.
Response format
Base: <ref>
Critical errors
Must-fix before merge. Cap: 8 rows. Merge duplicates. Prefer highest
severity. Number rows 1.1, 1.2, … in priority order. If none:
| — | — | None | — | — | — |.
| ID |
Location |
Issue |
Guideline |
Reference |
Recommended fix |
| 1.1 |
path:line |
Concrete problem |
Which guideline |
AGENTS/README section or existing file/pattern |
Short concrete action (not a full patch) |
Watchouts
Non-obvious changes that may raise eyebrows from leads or fellow developers.
Cap: 8 rows. Number rows 2.1, 2.2, … in priority order. If none:
| — | — | None | — | — | — |.
| ID |
Location |
Change |
Why it stands out |
Reference |
Recommended fix |
| 2.1 |
path:line |
What changed (short) |
Why a lead/dev might question it |
Related file, pattern, or AGENTS note |
Short suggestion, or Confirm with lead / Document in PR |
Recommended fix: one line max. Point at the existing pattern to reuse when possible.
Do not paste multi-line patches here — still review-only until the user asks to fix
(e.g. fix 1.2).
Severity rule
- Critical errors: evidenced guideline violations — regressions, accidental
globals, magic values/colors, dead code, diff-scoped a11y/i18n/CI/security
breaks, or AGENTS/README contradictions.
- Watchouts: evidenced judgment calls — intentional-but-surprising globals,
partial reuse, approach questions, scope/blast-radius, missing verification.
Do not invent issues. Prefer fewer, evidenced rows over speculative noise.
1---2name: review-branch3description: Pattern/AGENTS compliance review of the current branch against main or master (whichever is fresher). Checks regressions, globals, reuse, naming, magic values, dead code, and diff-scoped a11y/i18n/CI/secrets. Use when the user asks to review a branch, run /review-branch, or wants a pre-merge branch review. Not a substitute for Bugbot or Security Review.4---56# Review Branch78**Pattern / AGENTS compliance review** — not bug hunting and not a security audit.9Use Bugbot for defects, Security Review for vulns. This skill grades the diff10against repo conventions and `AGENTS.md` / `README.md`.1112Review-only. Do **not** fix findings unless the user explicitly asks.1314## Base branch1516Default base is `main` or `master`, whichever is **fresher**.17181. Prefer remote-tracking refs (`origin/main`, `origin/master`); else local.192. If only one exists, use that.203. If both exist, pick the tip with the newer committer date:21 `git log -1 --format=%cI <ref>`224. If neither exists, use `git symbolic-ref refs/remotes/origin/HEAD` or ask.235. User-named base wins (`against develop`, `vs release/x`).2425Diff scope: merge-base of HEAD and base through working tree (committed + staged26+ unstaged), unless the user asks for commits-only or uncommitted-only.2728```bash29git merge-base HEAD <base>30git diff --stat <merge-base>...HEAD31git diff <merge-base>32git status --porcelain33```3435**User-facing base note:** one short line only, e.g. `Base: origin/main`.36Do not explain the fresher-ref logic in the reply.3738## Before reviewing39401. Read repository `README.md` (if present).412. Read repository `AGENTS.md` (and nested `AGENTS.md` / `.cursor/rules` for42 **changed paths only**).433. Skim **siblings and call sites of changed files** for existing patterns44 (partials/components, tokens/variables) — do not audit the whole repo.4546## Review guidelines4748Evaluate the **diff** against:4950- No regressions are introduced51- No global changes introduced52- Components, partials and functions are reused whenever possible53- Naming conventions are followed54- No magic numbers, variables and colors are introduced55- Repository-level patterns are followed56- No dead code introduced57- Repository README.md and AGENTS.md are read and respected5859### Regression (static sites: Hugo / Astro)6061A **regression** is a change that breaks or degrades existing page behavior or62contracts without clear intent. In Hugo/Astro diffs, look for:6364- Shared layout/partial/component edits that alter markup, classes, slots, or65 props used by untouched pages66- Broken includes/imports (`partial`, `partialCached`, Astro component paths)67- Removed/renamed content collections, taxonomies, permalinks, or `url` /68 `slug` behavior that orphan links69- CSS specificity or variable overrides that change styling outside the70 intended page/section71- Asset pipeline regressions (Hugo Pipes / Astro assets): missing fingerprint,72 wrong path, broken `srcset`, lost lazy/eager loading73- i18n: missing locale copy, broken `hreflang`, locale layout drift when only74 one language was meant to change7576### Global change (static sites: Hugo / Astro)7778A **global change** is anything whose blast radius is site-wide or79cross-section, not confined to the feature’s templates/styles. Flag when the80diff touches:8182- Base layouts (`baseof`, root `Layout.astro`, site shell/nav/footer)83- Shared partials/components used across many routes84- Design tokens / `:root` / SCSS variables / theme files85- Global CSS entrypoints or resets86- `hugo.toml` / `astro.config` / build integrations / middleware87- Shared shortcodes, content helpers, or utility modules imported broadly8889Local page templates, page-scoped CSS modules/scoped styles, and feature-only90content files are **not** global by default.9192Intentional globals are allowed only when clearly required; put them in93**Watchouts** if intentional but eyebrow-raising, **Critical** if accidental or94undocumented vs AGENTS/README.9596### Diff-scoped extras9798Only check these when the **diff** clearly touches that surface (do not scan99unrelated files):100101- Accessibility — if markup/components/templates change102- i18n — if locale files, hreflang, or translated templates change103- Build/CI — if config, deps, pipes/assets, or workflows change104- Secrets / CDN / GDPR / unsafe JS — if scripts, external URLs, or asset hosting change105- Coverage gaps — if shared UI changed with no test or verification note in the106 diff/PR context you have107- Blast radius — if shared layouts/partials/tokens/config changed108109## Evidence (required)110111Every table row **must** cite evidence:112113- **Location**: `path:line` (or `path`) from the diff114- **Reference**: existing pattern, AGENTS/README rule, or sibling file the change115 conflicts with or should have reused — e.g. `AGENTS.md § CSS`, 116 `layouts/partials/image.html`, `src/styles/tokens.css`117118No evidence → do not list the finding.119120## Workflow1211221. Resolve base; print one short `Base: …` line.1232. Collect the diff vs merge-base (include dirty tree unless told otherwise).1243. Read README / AGENTS / local patterns for **touched** areas only.1254. Review changed files against the guidelines.1265. Reply with **only** `Base:` + the two tables. No essays, no fix patches127 unless asked.128129## Response format130131```text132Base: <ref>133```134135### Critical errors136137Must-fix before merge. Cap: **8 rows**. Merge duplicates. Prefer highest138severity. Number rows **1.1**, **1.2**, … in priority order. If none:139`| — | — | None | — | — | — |`.140141| ID | Location | Issue | Guideline | Reference | Recommended fix |142|----|----------|-------|-----------|-----------|-----------------|143| 1.1 | `path:line` | Concrete problem | Which guideline | AGENTS/README section or existing file/pattern | Short concrete action (not a full patch) |144145### Watchouts146147Non-obvious changes that may raise eyebrows from leads or fellow developers.148Cap: **8 rows**. Number rows **2.1**, **2.2**, … in priority order. If none:149`| — | — | None | — | — | — |`.150151| ID | Location | Change | Why it stands out | Reference | Recommended fix |152|----|----------|--------|-------------------|-----------|-----------------|153| 2.1 | `path:line` | What changed (short) | Why a lead/dev might question it | Related file, pattern, or AGENTS note | Short suggestion, or `Confirm with lead` / `Document in PR` |154155**Recommended fix:** one line max. Point at the existing pattern to reuse when possible.156Do not paste multi-line patches here — still review-only until the user asks to fix157(e.g. `fix 1.2`).158159## Severity rule160161- **Critical errors**: evidenced guideline violations — regressions, accidental162 globals, magic values/colors, dead code, diff-scoped a11y/i18n/CI/security163 breaks, or AGENTS/README contradictions.164- **Watchouts**: evidenced judgment calls — intentional-but-surprising globals,165 partial reuse, approach questions, scope/blast-radius, missing verification.166167Do not invent issues. Prefer fewer, evidenced rows over speculative noise.