CommunityCoding & Developmentgithub.com

code-review-guide

Create a read-only code walkthrough and human review guide for a Git diff, GitLab merge request, or OpenSpec change, especially in Unity/C#. Use when asked how to read, understand, or review a change in execution order. Keep implementation and release actions outside this workflow.

What is code-review-guide?

code-review-guide is a Claude Code agent skill that create a read-only code walkthrough and human review guide for a Git diff, GitLab merge request, or OpenSpec change, especially in Unity/C#. Use when asked how to read, understand, or review a change in execution order. Keep implementation and release actions outside this workflow.

Works with✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/timtaotao/AgentSKills/tree/HEAD/code-review-guide

Installed? Explore more Coding & Development skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Code Review Guide

Help the human reviewer understand what changed, where to start reading, and which behavior needs a decision or verification. Write in the user's language. Use the requested scope and preserve repository review conventions.

Read-only review

Inspect repository files, Git objects, OpenSpec artifacts, and available GitLab evidence. Return the guide in chat. Leave project files, Git refs and index, OpenSpec artifacts and task checkboxes, and GitLab state untouched. Use read operations only. Skip checkouts, fetches, staging, posting, approval, merge, and running code under review, builds, tests, Unity, or CI jobs. Read existing results and suggest targeted checks where evidence is missing.

Pin and inventory the diff

Identify the repository, requested paths, and snapshots before reading code. Print the effective scope up front. When a base or revision is missing, state the assumption if a clear candidate exists. If competing candidates would change the review, name the uncertainty and continue with evidence common to them. Treat a supplied patch as the available review scope when the original snapshots are unavailable.

Local work after Codex implementation

For “current changes” or “what Codex just changed,” start with the current repository's local changes and respect any supplied task baseline or path boundary. Without a baseline, describe the observed changes as local changes and avoid attributing them to Codex. Use this inventory from the repo root and apply the requested pathspec after -- where applicable:

git --no-optional-locks status --porcelain=v1 --untracked-files=all --ignore-submodules=none
git --no-pager diff --cached --no-ext-diff --no-textconv --ignore-submodules=none -M --name-status
git --no-pager diff --no-ext-diff --no-textconv --ignore-submodules=none -M --name-status
git ls-files --others --exclude-standard
  • Staged compares HEAD with the index. Unstaged compares the index with the working tree. Read the patches by removing --name-status. Untracked files have no Git patch, so read relevant non-ignored files directly. Use a combined HEAD-to-worktree diff only as a supplement, since opposing edits can cancel out and untracked files remain outside it. Git diff reference
  • For staged-only or unstaged-only requests, keep that layer and its associated snapshots. Unstaged tracked changes and untracked files are distinct. When both layers change a path, inspect both versions and count the path once, with both layers noted. git show :path/to/file reads the index version when the working copy differs.
  • Preserve adds, deletes, renames, mode changes, conflicts, binaries and submodule pointer changes in the inventory. Flag unresolved merges and dirty nested repositories where relevant. Inspect nested changes only if within scope. If local content changes during review, recheck the affected files and anchors or mark those observations stale.

Commits, branches, and GitLab MRs

  • For an explicit two-tree comparison, use those endpoints. For a branch's changes against its target, use the verified merge base and source head, recording both SHAs. For a single commit, compare it with its parent, using the empty tree for a root commit. Identify the comparison parent for a merge commit. Keep dirty local files outside these scopes unless the user requests them as an additional layer.
  • For a GitLab MR, identify the project, MR IID, target, and diff version. Prefer the MR's diff and its base_sha and head_sha for the selected version. When those objects are available locally, compare those two SHAs directly. Use the start_sha as target context where needed. Keep a local merge-base approximation labeled as such when GitLab's version is unavailable. Never substitute the dirty worktree or an unconfirmed default branch for the MR.
  • Use authorized read access for the MR description, changes and relevant CI evidence. Check pagination and collapsed, oversized or limited diffs. When accessible, recover missing patches from the matching local Git objects. Report unavailable paths or unknown totals when you cannot establish the complete inventory. GitLab merge requests API

Establish intent and trace behavior

Use the task, MR description, linked requirements, or OpenSpec change to establish intended behavior. Compare old and new behavior at the caller or player level. Flag concrete scope drift. Label design rationale as documented or inferred. Discuss an alternative only if it materially changes reviewability or risk.

  • For a linked OpenSpec change, identify it from the request or MR. If discovery is needed and the CLI is available, use openspec list --json and openspec status --change CHANGE_ID --json with OPENSPEC_TELEMETRY=0 set for those processes. Follow the repository's resolved artifact paths. Read the applicable proposal, design, tasks and delta specs from the reviewed revision or supplied context. If several changes could apply, state the ambiguity and continue the code walkthrough without guessing requirements. OpenSpec CLI reference
  • For material requirements or scenarios, point to the implementation and relevant test assertions. Mark what is implemented, partial, missing, deferred or outside the requested slice, as supported by the evidence. Cite the source for a deferral. Keep planned scope and observed implementation distinct when requirements are missing or ambiguous.
  • Trace the shortest representative path through the change. Start at the actual entry or binding, follow the changed calls and state, and end at the observable result. Add materially different error, retry, cancellation, teardown or alternate paths. Use the actual pipeline, editor or build order for changes without a runtime entry. Read unchanged callers or dependencies only when they establish a trigger, contract, or impact.
  • For each stop, show symbol and file:line, what reaches it, what changes there, and what the reviewer should check. Follow data and ownership across boundaries where they matter. Tie tests to the behavior and assertion they exercise. Use a small Mermaid diagram only when it saves reading across multiple boundaries.

Unity and C# review cues

Apply only the checks triggered by the diff. Find the wiring in C# and in scene, prefab, ScriptableObject, or Inspector assets where available. Explain when wiring or callback order depends on runtime state or serialized configuration you could not inspect.

  • Lifecycle and ownership — Trace registration, repeated enable/disable, destruction, scene unload and cleanup. Check subscriptions, coroutines, resources and Addressables handles through early exits and failed loads. Follow actual lifecycle entry points, attributes and project execution-order settings when order matters.
  • Serialization and assets — Check existing scenes, prefabs, variants, saved data and overrides for field/type migrations, missing references and changed defaults. Inspect relevant .meta GUIDs, serialized file IDs and prefab overrides before assuming a move is harmless.
  • Async and C# contracts — Check cancellation and disposal ownership, continuations that touch Unity APIs, stale completions, duplicate execution, exceptions and partial state. Inspect callers for changed nullability, API contracts and explicit failure behavior. Assess extra abstractions or fallbacks where they obscure a real invariant.
  • Hot paths and build boundaries — Inspect update loops, repeated lookups, allocations, instantiation and resource release where they affect runtime cost. Check .asmdef, Editor/runtime separation, conditional symbols and player platforms where the change crosses those boundaries.

Evidence, risks, and coverage

  • Anchors — Verify 1-based line numbers against the exact reviewed version. Cite new-side lines for additions and old-side lines for deletions. Use the matching old/new path for renames. Label index, worktree, old side or commit when ambiguous. Use a clickable Codex file link only when the visible local file matches the cited content. For committed GitLab files, use a verified SHA-pinned blob or diff link when available. Otherwise give a repo-relative path:line with the snapshot, or cite the symbol or hunk when an exact line cannot be recovered.
  • Risks and findings — Lead with any blocking behavior in the opening summary. Give each material item a location, trigger, consequence, and the decision or evidence needed. Present reproducible reasoning from the inspected code. Label open questions and runtime hypotheses separately from demonstrated defects. If a bug-focused review is also requested, put actionable findings in severity order and retain the reading route.
  • Coverage — Reconcile every in-scope changed path with the walkthrough or a short grouped ledger. Distinguish logic read, context skimmed or metadata-only, and unread or unavailable with the reason. Use counts only when the inventory supports them. Enumerate or group residual paths so the reviewer can tell where each landed. Pay attention to assets, generated files, tests and deletions that the main call path does not mention. A path accounted for is different from behavior verified.
  • Verification — State what was inspected and what evidence exists. Attribute CI or test reports to the observed job or log and identify its revision, platform or suite when relevant. Label reported results with unknown or mismatched revisions. Never claim execution, passing tests, coverage, or runtime behavior without supporting evidence. If no execution evidence is available, say so and give only the highest-value checks, with the expected behavior. A test in the diff is evidence of intent and assertions, and an OpenSpec checkbox is a record of task status.

Shape the guide to the change

  • Always give the scope, the behavior change, the first useful reading anchor, and the extent of review and verification. For a small change, combine these into a few bullets and include only concrete review concerns.
  • For a substantial change, give a short ordered route by flow or subsystem. Add a brief map of responsibilities and dependencies when module boundaries change. Place key decisions, exception paths and human review questions at their relevant stops. End with compact coverage and verification notes. A focused requirement-to-evidence table helps when several OpenSpec scenarios matter.
  • When the diff is too large or incomplete, prioritize the highest-impact paths, name what remains unread, and avoid implying full review. Prefer links, symbols and consequences over retelling code.

Install and invoke

Extract the ZIP if supplied, or put this file in a folder named code-review-guide. For one repository, use .agents/skills/code-review-guide/SKILL.md under its root. For your account on Windows, use %USERPROFILE%\.agents\skills\code-review-guide\SKILL.md. If Codex does not discover it, restart Codex and open the repository. Codex skill locations and invocation

Open a Codex chat for the repository and mention $code-review-guide. Example prompts:

$code-review-guide Walk through my current changes, including staged, unstaged and untracked files. Start at the Unity runtime entry point.
$code-review-guide Review only the staged patch. Give me the first three places to read and the main risk.
$code-review-guide Walk me through GitLab MR !42 in this project against OpenSpec change add-replay. Focus on cancellation and scene unload.

Related Skills