Skip to main content

In this article

Code Review

Code Review prioritizes functional review so changed code meets the contribution bar of the codebase, catches unintended side effects and regressions, reuses existing APIs, SDKs, and abstractions, and clears out unneeded edge-case checks. Everything lives in one consolidated code-review skill. You can run it with /code-review or select the Code Review agent, and both follow the same skill.

Each review captures the change once as an immutable snapshot. Functional review runs first by default, while non-functional vectors (security, rai, sssc, performance, privacy, accessibility) and BRD/PRD/ADR alignment remain completely unloaded unless you request them for specific areas or the whole review. Findings and discussion comments carry vector pills alongside severity, and review.md stays yours to edit before anything reaches a pull request.

Why use Code Review​

Code Review focuses reviewer attention on functional contribution quality first while keeping evidence traceable:

NeedHow Code Review handles it
Review the change you meanReviews a PR or MR, a named branch comparison, a commit, staged or unstaged local changes, or selected code, and asks when the target is ambiguous
Functional review firstChecks codebase requirements, standards, unintended side effects, refactored paths, missed APIs/SDKs, missed abstractions, and unneeded edge cases
Zero non-functional clutterSecurity, RAI, SSSC, performance, privacy, accessibility, and BRD/PRD/ADR alignment stay unloaded unless you explicitly request them
Vector-tagged findingsFindings and comments carry vector pills (functional, security, rai, sssc, performance, privacy) alongside severity
Human controlYou edit review.md, and staging or posting to a pull request from an interactive review needs your explicit consent

TIP

To try it, stage a small change and run /code-review staged changes. Read the generated review.md before you act on any finding.

Start a review​

Entry pointHow to start
/code-reviewType the command in Copilot Chat, optionally followed by a target and options
Code Review agentSelect Code Review in the agent picker and describe the target. The agent preloads the code-review skill and follows it

Options follow the target, and each one is optional:

/code-review [target] [vectors=functional|security,rai,sssc,performance,privacy] [depth=basic|standard|comprehensive] [mode=sweep|guided]

For example:

/code-review PR #482
/code-review feature/search compared with main
/code-review staged changes depth=comprehensive
/code-review src/auth/ vectors=functional,security mode=guided

Code Review supports these targets:

TargetWhat Code Review captures
Pull request or merge requestProvider identity, base and head revisions, description, required checks, template checkboxes, linked issues, and inline and timeline comments
Branch comparisonThe named base and head, compared from their merge base unless you ask for a direct comparison
CommitThe commit against its parent, or against a base you name. A merge commit needs an explicit base
Local changesStaged, unstaged, or combined working-tree changes
Selected codeThe paths and line ranges you name

Code Review doesn't guess a base branch, fetch, or check out a branch; it asks you instead. A PR review never mixes in uncommitted local edits. If you ask for a local overlay, Code Review treats it as a separate review, and that review can't produce PR inline comments. When provider reads are partial or unavailable, the review records the gap and doesn't treat the discussion as empty.

Choose the scope​

Three independent options shape a review. The mode decides when Code Review stops for your input, the profile picks the perspectives, and the depth sets how far each perspective traces the change.

Sweep and guided modes​

ModeBehavior
sweep (default)After the target is clear, Code Review shows a compact scope summary and continues
guidedCode Review waits for your choice of areas, perspectives, or depth at each decision point

In both modes the chosen scope stays visible and you can override it. Material ambiguity, such as an unclear target, still stops for your input.

Functional default and opt-in non-functional vectors​

CategoryPerspectives and vectorsWhen it runs
Functional (default)functional, standards, readiness (vector: functional)Runs by default on every review to verify contribution quality, standards, bugs/side effects, API/SDK & abstraction fit, and unneeded edge cases
Opt-in non-functionalsecurity, rai, sssc, performance, privacy, accessibilityRuns only when explicitly requested by you (in chat, arguments, or the Code Review canvas) for specific areas or across all areas
Opt-in plan/doc alignmentBRD, PRD, ADR alignment and Security Plan DriftLoaded only when explicitly requested by you; never scanned or preloaded during a standard functional review

Adding an opt-in non-functional reviewer to one area (for example, security on an auth area and sssc plus rai on a dependency/prompt area) schedules work only on those areas. Adding one to a finished review reopens the review until that work finishes, then re-renders review.md.

Depth​

Depth sets how far each selected perspective follows the change, independently of the profile:

DepthWhat each perspective checks
basicThe changed path and its immediate contract
standard (default)Also relevant consumers, error paths, and validation evidence
comprehensiveAlso follows demonstrated high-risk interactions and missing evidence further

Code Review uses standard unless you pick another depth or concrete risk in the change supports a different recommendation. A recommendation names the evidence and missing checks behind it; there's no fixed risk questionnaire. No depth authorizes source edits or a repository-wide audit.

Vectors, references, and parallel task orchestration​

All review guidance lives inside .github/skills/coding-standards/code-review/ and its on-demand references/ directory:

Review phases, perspectives, vector pills, and on-demand references
Phase or perspectiveVector pillReference (loaded only when active)Focus
functionalfunctionalreferences/functional.mdContribution bar, bugs and side effects, refactored paths, missed APIs/SDKs, missed abstractions, unneeded edge cases
standardsfunctionalreferences/standards.mdApplicable repository instructions and language/domain skills with cited provenance
readinessfunctionalreferences/readiness.mdPR description, linked issues, checklists, required checks, validation evidence, and changed documentation
contextn/a (phase)references/context.mdFactual overview of changed areas, reasons, changeMap, and symbol or call-path explanations
investigationn/a (phase)references/investigation.mdBounded walkback answering one specific evidence gap without restarting the review
securitysecurityreferences/security.mdOpt-in: trust-boundary weaknesses, auth, secrets, injection, and requested Security Plan Drift
rairaireferences/specialist.mdOpt-in: model calls, prompts, human oversight, disclosure, and misuse paths (rai-standards)
ssscssscreferences/specialist.mdOpt-in: dependencies, lockfiles, SHA pinning, workflow permissions, checksums (supply-chain-security)
performanceperformancereferences/specialist.mdOpt-in: complexity growth, blocking I/O, memory retention, and stated SLO budgets (performance-slo-planner)
privacyprivacyreferences/specialist.mdOpt-in: personal data collection, logging, storage, minimization, retention, and deletion (privacy-by-design)
accessibilityaccessibilityreferences/accessibility.mdOpt-in: user barriers in changed interaction, markup, and content (accessibility)

Code Review does not rely on custom named code-review-* subagents. Instead:

  • Small or tightly coupled changes run inline in the orchestrating agent.
  • Multi-area or multi-vector reviews dispatch parallel general-purpose tasks, scaling to any number of tasks needed per vector, phase, or area, with task-matched reasoning_effort (low through max) and long_context when large snapshots or call graphs require it.
  • Each general-purpose task follows the code-review skill, reads references/review-contract.md plus only its assigned reference file, focuses on its assigned areas, and writes only its assigned result JSON.
  • When operating inside a persistent Project with a Project coordinator, the orchestrating agent can report recommended code-review vector and phase sessions back to the coordinator for session delegation; otherwise it manages all tasks directly.

The standards perspective takes its criteria from the repository instructions and skills that apply to the changed files. See Language Skills to add your own.

How a review runs​

  1. Code Review resolves the target and its revisions, and asks when anything is ambiguous.
  2. The core helper captures the change once. Code Review groups the files into areas and records each area's intent, before and after behavior, and entry points. Scope accounting covers lockfiles, configuration, renames, deletions, and omitted files, and explains anything left out as irrelevant.
  3. Code Review records the scope and its reviewer choices, and assigns the work. Each acceptance criterion gets one owner: functional for behavior, readiness for deliverable-only criteria. Without a story definition, criteria stay unassessed.
  4. The selected perspectives run inline or as parallel workers.
  5. Code Review verifies each returned claim against its captured anchors and counter-evidence, merges duplicates once, and records each finding as accepted, disputed, deferred, or rejected with a reason.
  6. Optional integrations run when their context exists.
  7. The core helper renders review.md, keeping your edits and the canonical disclaimer.
IntegrationRuns whenResult
Business alignmentYou supply BRD, PRD, or ADR sources, or confirm sources Code Review discoversDrift findings rated with the shared business-alignment rubric, compared with each source at the base revision
Security Plan DriftA confirmed security plan baseline exists and the security findings are acceptedAccepted security findings correlated with the plan
Specialist referralA concern the added reviewers don't cover, or a full audit beyond the change, is warranted and a capability existsA named follow-up, such as the Privacy, RAI, or SSSC Reviewer; no extra review runs

Review records and the report​

Every review gets its own folder:

.copilot-tracking/reviews/code-reviews/<date>/<review-id>/
├── snapshots/<snapshot-id>/
│ ├── snapshot.json
│ └── files/
├── review-state.json
├── results/<snapshot-id>/<work-id>.json
├── feedback.json
└── review.md

The code-review skill's review contract defines each record:

RecordOwnerContents
snapshot.json and files/Core helperImmutable capture of the target, changed files and hunks, discussion, and omissions
review-state.jsonCode ReviewScope, reviewer choices, areas, work items, verified findings, limitations, and outcome
results/<snapshot-id>/<work-id>.jsonAssigned workerOne work item's coverage, findings, observations, and limitations
feedback.jsonCode Review canvasFeedback you send from the canvas, including requests to add a reviewer and items you dismissed
review.mdYouThe human-editable report

Review IDs include a random identifier, so a second review of the same branch gets its own folder. Resuming a review reuses its snapshot when the repository and target still match. When the evidence changes, a new capture archives the previous state and resets coverage, while earlier snapshots, feedback, and reports stay in place.

Findings and outcome​

Each finding states a claim and its consequence, anchors it to captured lines, names the criterion it applies when there is one, and suggests a remediation. Severity (Critical, High, Medium, or Low) describes the consequence, and findings carry no confidence scores. A new finding stays proposed until Code Review verifies it and records a disposition with a reason. Disputed and deferred findings stay visible in the report.

Completed reviewOutcome
Any retained Critical or High findingrequest_changes
Only Medium or Low findingsapprove_with_comments
No retained findingsapprove

When required work is blocked, unavailable, skipped, or stale, or a blocking limitation exists, the review is incomplete and has no outcome. Complete coverage and an empty findings list are separate facts, and the report shows both.

The report​

review.md contains the target and coverage, the findings, context and limitations, and the disclaimer with an unchecked human-review checkbox. Pull request and merge request reports add a comment draft with the proposed event and its own unchecked posting checkbox. Only a human checks either box.

Your edits are authoritative. Code Review regenerates review.md only while the file still matches its last render. If you've edited the file, rendering stops and Code Review reconciles the changes with you.

Code Review canvas​

When your host supports canvases and the Code Review canvas (hve-core-code-review) is available, Code Review opens it on the current review. The canvas shows the captured changes, review coverage, findings, PR discussion, and your feedback in one read-only panel.

The canvas canThe canvas can't
Show captured changes, coverage, findings, and PR discussionChange coverage, dispositions, or human sign-off
Send your feedback to Code ReviewStage, post, approve, or merge anything
Keep unsent drafts privateCreate another review or delete an earlier one
Show which reviewers run and in what order, and request oneAdd a reviewer itself; Code Review does that when it collects your request
Dismiss feedback the agent doesn't have yet, with UndoTake back an item the agent has already collected

Code Review collects sent feedback at dispatch and completion boundaries, before a material decision, and before closeout. It applies each item within the review's authority and records what changed. If the canvas is missing or fails, the review continues in chat with the same evidence and decisions, and Code Review names the limitation. See the Code Review canvas guide for the panel itself.

Publishing to a pull request​

Saving the local report, staging a draft review with the provider, and posting are separate actions. Staging a draft doesn't submit it, and neither the canvas nor the core helper can stage or post. Before Code Review stages or posts anything:

  1. It shows every retained Critical or High finding and any pending or unopened areas, and asks you to inspect them or explicitly acknowledge proceeding. Acknowledging doesn't complete missing review work.
  2. It links the report and the PR comment draft, then asks you to confirm the target, the event, and the comments. Posting the general comment also needs its checkbox, which only you can check.
  3. Right before submission, it re-reads the PR's identity, open or closed state, base and head revisions, and inline-comment anchors. A mismatch stops the submission until you agree how to refresh.
  4. It records what was staged or posted, including provider IDs, separately from findings and coverage.

Code Review never resolves threads, approves, or merges as a side effect. Evidence from local changes or selected code can't become PR inline comments, and local stakeholder notes are never published. If you decline, the local report is the delivered result.

Automated PR review​

The PR Review workflow runs Code Review on a pull request when a user with write access posts /review. It activates the code-review skill in host-managed, non-interactive mode with fixed settings:

SettingValue
Perspectivesfull: functional, standards, accessibility, security, and readiness
Depthbasic
ExecutionInline, without subagents
OutputOwned by the workflow, including any review it submits

In host-managed runs, Code Review asks no routine questions and doesn't require a canvas or local tracking files when the host forbids them. It applies the same criteria, verification, and coverage rules in memory. It uses only business sources the host supplies, never grants owner-acknowledged status, and returns a blocked or incomplete result when the target or required evidence is missing. See Agentic Workflows for the trigger, labels, and maintainer advisory mode.

What you need​

RequirementDetails
VS Code and GitHub Copilot ChatAgent mode enabled
HVE CoreThe hve-core extension or plugin, which includes the consolidated code-review skill and the Code Review agent
GitThe revisions under review must be in your local clone. Code Review doesn't fetch or check out branches
Node.jsRuns the code-review helper (scripts/review.mjs) that captures snapshots, updates review state, and renders the report
Provider read accessOptional. Needed for PR descriptions, checks, linked issues, and comments; without it, those checks are recorded as unavailable
Canvas supportOptional. Needed only for the Code Review canvas

Code Review works with any programming language. Standards and accessibility coverage depend on the instructions and skills available for the changed files. When none apply, the perspective reports the gap and doesn't count the change as passing.

🤖 Crafted with precision by ✨Copilot following brilliant human instruction, then carefully refined by our team of discerning human reviewers.