Requesting code review

From seaworld008/Commonly-used-high-value-skills · View interactive version

Requesting code review is an AI agent skill from the GitHub repository seaworld008/Commonly-used-high-value-skills. Use when completing tasks, implementing major features, or before merging to verify work meets requirements

How to use this skill

Skill file

Requesting Code Review

Use an independent code reviewer when delegation is supported and authorized; otherwise review locally with the same checklist and state the independence limit. The reviewer gets precisely crafted context for evaluation — never your session's history.

Core principle: Review early, review often.

When to Request Review

Mandatory:

Optional but valuable:

How to Request

1. Establish the actual review target:

Inspect the current implementation before choosing a commit range:

git status --short
git diff
git diff --staged
git ls-files --others --exclude-standard

Use the task's known base, not an assumed HEAD~1. For fully committed work, identify the intended starting and ending SHAs:

BASE_SHA='REPLACE_WITH_VERIFIED_TASK_BASE_SHA'
HEAD_SHA=$(git rev-parse HEAD)

For uncommitted implementation, the review target is the current snapshot: relevant committed changes plus staged, unstaged, and task-owned untracked files. Include their actual diffs and contents without unrelated user changes or secrets. Do not make a commit just to request review.

2. Request review using available host capabilities:

If delegation is supported and permitted, discover the host's actual schema and pass the template at code-reviewer.md. Otherwise apply that template locally. For snapshot review, replace the template's commit-range-only Git section with the exact review files, staged/unstaged diffs, and relevant untracked contents established above; SHA placeholders alone do not describe uncommitted work.

The review is read-only: do not move HEAD or alter the working tree. If tools need a different checkout, use an authorized temporary copy or isolated checkout and preserve the current one.

Placeholders:

3. Act on feedback:

Example

[Just completed Task 2: Add verification function]

You: Let me request code review before proceeding.

BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | cut -d' ' -f1)
HEAD_SHA=$(git rev-parse HEAD)

[Dispatch code reviewer subagent]
  DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
  PLAN_OR_REQUIREMENTS: Task 2 from docs/superpowers/plans/deployment-plan.md
  BASE_SHA: a7981ec
  HEAD_SHA: 3df7661

[Subagent returns]:
  Strengths: Clean architecture, real tests
  Issues:
    Important: Missing progress indicators
    Minor: Magic number (100) for reporting interval
  Assessment: Ready to proceed

You: [Fix progress indicators]
[Continue to Task 3]

Common Rationalizations

| Excuse | Reality |

|--------|---------|

| "The host has no delegation, so review cannot run" | Review locally with the same requirements and checklist, and state that it was not independent. When delegation is supported and authorized, prefer an independent reviewer. |

| "The reviewer needs my whole session history to understand the change" | Hand it precisely crafted context, never your session's history. That keeps the reviewer on the work product, not your thought process. |

Red Flags

Never:

If reviewer wrong:

See template at: code-reviewer.md

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.