Get the FREE Ultimate OpenClaw Setup Guide →

obra-requesting-code-review

Scanned
npx machina-cli add skill faulkdev/github-copilot-superpowers/obra-requesting-code-review --openclaw
Files (1)
SKILL.md
2.7 KB

Requesting Code Review

Use the code-reviewer prompt in this directory to catch issues before they cascade (if your environment supports subagents). Otherwise, perform the same review manually.

Core principle: Review early, review often.

When to Request Review

Mandatory:

  • After each task in subagent-driven development
  • After completing major feature
  • Before merge to main

Optional but valuable:

  • When stuck (fresh perspective)
  • Before refactoring (baseline check)
  • After fixing complex bug

How to Request

1. Get git SHAs:

BASE_SHA=$(git rev-parse HEAD~1)  # or origin/main
HEAD_SHA=$(git rev-parse HEAD)

2. Dispatch code-reviewer subagent:

Use the code-reviewer.md template in this directory for the review prompt.

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]

You: Let me request code review before proceeding.

BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
HEAD_SHA=$(git rev-parse HEAD)

[Dispatch code-reviewer prompt]
  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

You: [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

See template at: requesting-code-review/code-reviewer.md

Source

git clone https://github.com/faulkdev/github-copilot-superpowers/blob/integrate-obra-superpowers/.github/skills/obra/obra-requesting-code-review/SKILL.mdView on GitHub

Overview

This skill guides you to trigger a code-review before merges, major features, or task completion. It emphasizes catching issues early using the code-reviewer prompt to prevent cascading defects. It defines when to review (mandatory) and how to act on feedback.

How This Skill Works

Capture BASE_SHA and HEAD_SHA from git, then dispatch the code-reviewer subagent using the code-reviewer.md template. Fill placeholders for WHAT_WAS_IMPLEMENTED, PLAN_OR_REQUIREMENTS, BASE_SHA, HEAD_SHA, and DESCRIPTION, and review the subagent's feedback. Prioritize Critical issues, then Important, and note Minor items for later before proceeding.

When to Use It

  • After each task in subagent-driven development
  • After completing major feature
  • Before merge to main
  • When stuck (fresh perspective)
  • After fixing complex bug

Quick Start

  1. Step 1: Get git SHAs: BASE_SHA=$(git rev-parse HEAD~1) and HEAD_SHA=$(git rev-parse HEAD)
  2. Step 2: Dispatch code-reviewer with placeholders: WHAT_WAS_IMPLEMENTED, PLAN_OR_REQUIREMENTS, BASE_SHA, HEAD_SHA, DESCRIPTION
  3. Step 3: Act on feedback: fix Critical, then Important issues; note Minor issues for later; push changes

Best Practices

  • Always request a review after each task in subagent-driven development
  • Use the code-reviewer.md template and fill the required placeholders precisely
  • Capture BASE_SHA and HEAD_SHA with git commands before dispatch
  • Act on feedback by fixing Critical issues first, then Important; note Minor issues for later; push back if reviewer is wrong with reasoning
  • Integrate review results into your workflow before moving to the next task or merging

Example Use Cases

  • Example 1: Just completed Task 2: Add verification function. You request code review with BASE_SHA and HEAD_SHA, fill WHAT_WAS_IMPLEMENTED and PLAN_OR_REQUIREMENTS, and receive feedback like 'Strengths: Clean architecture, real tests; Issues: Important: Missing progress indicators.' You fix the issue types accordingly and proceed.
  • Example 2: After implementing a major feature, you dispatch code-reviewer to validate requirements alignment and edge cases; reviewer surfaces 'Critical: security consideration' and you address it before merging.
  • Example 3: Before merging a long-lived feature branch, you perform a final review to ensure no critical issues and documented changes.
  • Example 4: When stuck on a refactor, you request a quick fresh perspective to surface hidden dependencies or regressions.
  • Example 5: After fixing a complex bug, you run a targeted review to verify all related paths are covered and no new issues were introduced.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers