Thorough code review of branch changes. Supports automatic/interactive fixing, instruction-based, agnostic, or combined review lenses. Use when: review my code, review this branch, do a code review, review branch changes, check my changes. Input: [--base <branch>] [--mode automatic|interactive] [--lens instructions|agnostic|both]
69
86%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Low
Low-risk findings worth noting
You are performing a thorough code review of all changes on the current branch relative to the base branch.
A review has two jobs, in this order:
lint:check, format:check, test:unit) must pass.Find every issue. Do not accept code just because it is already written, and do not accept your own first impressions — walk concrete inputs through the code and compare outputs against the stated intent.
Parse $ARGUMENTS:
| Argument | Description |
|---|---|
--base <branch> | Base branch to review against. If omitted, use master unless the user clearly specified another base in plain language. |
--mode automatic | Find all issues, fix Critical/Warning issues automatically, then present the summary table. This is the default. |
--mode interactive | Find all issues, present them to the user first, wait for the user to confirm which to fix, then fix the approved issues and present the summary table. |
--lens instructions | Review using Babylon.js repo instructions and matching instruction files. |
--lens agnostic | Review without using repo instruction files as the rubric. Use general engineering review judgment, correctness, maintainability, security, and test coverage expectations. |
--lens both | Run both the agnostic and instructions lenses independently, then combine and deduplicate findings. This is the default. |
If the user says "interactive", "review first", "show me the issues first", or similar, use --mode interactive. Otherwise, default to --mode automatic.
If the user says "instructions", "repo instructions only", or similar, use --lens instructions. If they say "agnostic", "without instructions", "general review", or similar, use --lens agnostic. Otherwise, default to --lens both.
Use the term lens in user-facing text rather than "passes". A lens is the review rubric; both means two independent review passes.
Review using all applicable Babylon.js guidance:
.github/copilot-instructions.md..github/instructions/*.instructions.md.This lens should catch correctness issues plus repo-specific issues such as public API compatibility, side-effect imports, prohibited APIs, performance rules, doc comment requirements, and test conventions.
Review as an external senior engineer who has the diff, surrounding code, commit intent, and normal engineering judgment, but is not applying Babylon.js instruction files as a checklist.
For this lens:
.github/instructions/*.instructions.md files just to apply repo rules.Run the agnostic lens and instructions lens independently, then merge findings:
Agnostic, Instructions, Both, or Quality Tools.Both.Every issue you flag must be assigned one of these severities.
| Severity | Meaning |
|---|---|
| Critical | Bugs, runtime crashes, data loss, broken public API contracts, missing side-effect imports that will cause undefined at runtime. Must be fixed. |
| Warning | Backward compatibility concerns, missing doc comments on public APIs, performance anti-patterns (render-loop allocations, unnecessary notifyObservers), missing tests for new APIs, use of deprecated or prohibited APIs. Should be fixed. |
| Nit | Style, naming, minor readability improvements, non-essential suggestions. Fix if convenient. |
Before reading the diff, resolve and remember:
<base-branch> from --base or the default master.<mode> as automatic or interactive.<selected-lenses> from --lens, defaulting to [agnostic, instructions] (--lens both).If an argument is invalid, stop and ask the user to choose a valid value. Do
not silently reinterpret misspelled options. Use ask_user for interactive
choices when the tool is available.
Run the following git commands to collect all changes (committed, uncommitted, and untracked) relative to the base branch:
git diff <base-branch>...HEAD --name-only
git diff --name-only
git diff --name-only --cached
git ls-files --others --exclude-standardCombine the results into a deduplicated list of changed files. If there are no changes, inform the user and stop.
git show <base-branch>:<path> to read the base version and review the deletion via the diff only.git show <base-branch>:<old-path>.git diff <base-branch>...HEAD and git diff) to know exactly what changed.Files to exclude from review (note them in the summary but do not apply the checklist to them):
package-lock.json, yarn.lock, pnpm-lock.yaml.dist/, build/, coverage/, *.d.ts.map, *.js.map, auto-generated declaration files, minified bundles.vendor/, third_party/, node_modules/.__snapshots__/, *.snap, reference images (*.png, *.jpg), fonts, models.If an excluded file contains meaningful hand-written changes (e.g. a hand-edited snapshot, or an intentional change to a lockfile beyond a version bump), note it and review it normally.
Do this pass before the mechanical checklist. This is where most real bugs are caught; skipping it is the most common way a review misses a bug.
Run this semantic pass for each selected lens. The tracing method is the same for both lenses; the difference is only the rubric used when deciding whether a finding is a repo-specific issue or a general engineering issue.
For the branch as a whole, and then for each non-trivial new or changed function, work through the following steps. Record the output in your response (not just in internal reasoning): for each function, produce a short bullet block containing the stated intent, the enumerated inputs, any input-to-output mismatches, and any missing test coverage. This record is what you'll draw from when compiling the issue table in Step 7.
number[] | string), walk through one concrete value per variant so every branch sees a realistic value — a single input that happens to satisfy a shared guard (like .length) will hide bugs where the guard means different things across variants.Apply each item to every changed line that is not excluded under Step 3.
eval / Function(), unsafe deserialization of untrusted input (e.g. parsed scene files, glTF extensions, user-supplied JSON).For small branches (≲ 10 changed files, ≲ 500 changed lines), review every function yourself end-to-end.
For larger branches, protect your context window without losing rigor:
Explore / explore / similar read-only subagent is available in your environment, use it to investigate ancillary questions (e.g. "does any caller depend on the old behavior of X?") without consuming main-thread context. Don't delegate the core semantic pass — that stays on the main thread so you can trace inputs precisely.Run the repo's quality commands from the repo root:
npm run format:check
npm run lint:check
npm run test:unitCapture any failures and include them as Quality Tools issues in the review. If a command doesn't exist in this repo or workspace, note that in the summary and continue — do not invent alternative commands or skip the step silently. The branch is not reviewable as "passing" until all three (or their documented equivalents) are clean.
Compile every issue found into a single markdown table, sorted by severity (Critical → Warning → Nit). This is the table you will present in Step 9, so record issues in their final format now.
| # | File | Line(s) | Lens | Severity | Issue | Fix Applied |
|---|---|---|---|---|---|---|
| 1 | path/file.ts | 42 | Instructions | Critical | Clear description of the problem and how to fix it | Filled in during Step 8 (Skipped / N/A allowed) |
File paths should be markdown links. The Lens column must be Instructions, Agnostic, Both, or Quality Tools. The Fix Applied column is left blank in Step 7 and filled in during Step 8 as each issue is resolved (or marked Skipped / Needs confirmation / N/A).
When multiple lenses find the same root issue, deduplicate it into one row and mark the lens as Both. Do not double-count the same bug just because it was found twice.
The two modes differ only in whether the user approves fixes before or after they are applied. Both modes finish by re-running the quality tools and moving to Step 9.
If interactive mode:
ask_user when available, or the environment's structured prompt tool, so the user can reply with choices rather than free-form text.format:check, lint:check, test:unit) to verify the fixes don't introduce new problems.If automatic mode (default):
Needs confirmation in the Fix Applied column and skip them during the fix pass.format:check, lint:check, test:unit) to verify the fixes don't introduce new problems.Needs confirmation, present the current table to the user and ask which of those to fix (use ask_user when available, or the environment's structured prompt tool). Apply the approved fixes and re-run the quality tools again.Present the completed issue table to the user. If no issues were found, skip the table and congratulate the user on clean code.
787eedf
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.