requesting-code-review
Scannednpx machina-cli add skill CodingCossack/agent-skills-library/requesting-code-review --openclawRequesting Code Review
Dispatch code-reviewer subagent to catch issues before they cascade.
Core principle: Review early, review often.
How to Request
1. Get git SHAs:
# For PR/branch review (recommended):
BASE_SHA=$(git merge-base origin/main HEAD)
HEAD_SHA=$(git rev-parse HEAD)
# For single commit only:
# BASE_SHA=$(git rev-parse HEAD~1)
2. Dispatch code-reviewer subagent:
Use Task tool with template at templates/code-reviewer.md
Placeholders:
{WHAT_WAS_IMPLEMENTED}- What you just built{PLAN_OR_REQUIREMENTS}- What it should do{BASE_SHA}- Starting commit{HEAD_SHA}- Ending commit{DESCRIPTION}- Brief summary
3. Act on feedback:
- Fix Critical issues immediately
- Fix Important issues before proceeding
- Note Minor issues for later
- Push back if reviewer is wrong (with reasoning)
Example
[Just completed Task 2: Add verification function]
BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
HEAD_SHA=$(git rev-parse HEAD)
[Dispatch code-reviewer subagent with references/code-reviewer.md]
WHAT_WAS_IMPLEMENTED: Verification and repair functions for conversation index
PLAN_OR_REQUIREMENTS: Task 2 from docs/plans/deployment-plan.md
BASE_SHA: a7981ec
HEAD_SHA: 3df7661
DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
[Subagent returns]:
Strengths: Clean architecture, real tests
Issues:
Important: Missing progress indicators
Minor: Magic number (100) for reporting interval
Assessment: Ready to proceed
[Fix progress indicators, continue to Task 3]
Integration with Workflows
Subagent-Driven Development:
- Review after EACH task
- Catch issues before they compound
- Fix before moving to next task
Executing Plans:
- Review after each batch (3 tasks)
- Get feedback, apply, continue
Ad-Hoc Development:
- Review before merge
- Review when stuck
Red Flags
Never:
- Skip review because "it's simple"
- Ignore Critical issues
- Proceed with unfixed Important issues
- Argue with valid technical feedback
If reviewer wrong:
- Push back with technical reasoning
- Show code/tests that prove it works
- Request clarification
Source
git clone https://github.com/CodingCossack/agent-skills-library/blob/main/skills/requesting-code-review/SKILL.mdView on GitHub Overview
This skill dispatches a code-reviewer subagent to produce a structured review brief before merging a PR/MR. It standardizes context, scope, risk areas, test instructions, and acceptance criteria to guide the merge decision. By catching issues early, it helps maintain code quality and predictable outcomes.
How This Skill Works
1) Get git SHAs for the review: BASE_SHA and HEAD_SHA. 2) Dispatch the code-reviewer subagent using the template at templates/code-reviewer.md and fill placeholders like WHAT_WAS_IMPLEMENTED, PLAN_OR_REQUIREMENTS, BASE_SHA, HEAD_SHA, and DESCRIPTION. 3) Act on feedback by fixing critical issues immediately, addressing important issues before proceeding, noting minor ones for later, and pushing back with technical reasoning if needed.
When to Use It
- Before merging a PR/MR to ensure a consistent and thorough review brief is created.
- When working across multiple tasks to maintain uniform review standards.
- For changes with potential risk areas that require explicit test instructions and acceptance criteria.
- In task-based workflows to review after each task segment.
- For ad-hoc development where you want structured feedback prior to merge.
Quick Start
- Step 1: Get BASE_SHA and HEAD_SHA from git (e.g., BASE_SHA=$(git merge-base origin/main HEAD); HEAD_SHA=$(git rev-parse HEAD)).
- Step 2: Dispatch code-reviewer subagent with references/code-reviewer.md and fill WHAT_WAS_IMPLEMENTED, PLAN_OR_REQUIREMENTS, BASE_SHA, HEAD_SHA, DESCRIPTION.
- Step 3: Act on feedback: fix Critical, then Important issues, note Minor ones, and push back if needed with reasoning.
Best Practices
- Always compute BASE_SHA and HEAD_SHA correctly for the PR/branch review.
- Dispatch the reviewer using the templates/code-reviewer.md template with the proper placeholders.
- Fill placeholders: WHAT_WAS_IMPLEMENTED, PLAN_OR_REQUIREMENTS, BASE_SHA, HEAD_SHA, DESCRIPTION.
- Act on feedback by fixing Critical issues immediately, then Important issues, and noting Minor ones for later.
- If you disagree with feedback, push back with technical reasoning and request clarification.
Example Use Cases
- Example: Task 2 added verification and repair functions; reviewer provided strengths and issues; proceed after addressing progress indicators.
- Example: Review after each task in a multi-task plan to catch issues early and maintain quality.
- Example: Ad-hoc development where a pre-merge review is required to avoid blockers.
- Example: Using BASE_SHA and HEAD_SHA derived from git to scope the review to the correct commit range.
- Example: Filling in WHAT_WAS_IMPLEMENTED, PLAN_OR_REQUIREMENTS, and DESCRIPTION to clearly communicate changes.