/github-code-review
Review code changes by analyzing git diffs, leaving inline comments on
Claude Code
$ npx -y skills add graniet/kheish --skill github-code-review --agent claude-code
Codex
$ npx skills add graniet/kheish --skill github-code-review -a codex -y
Cursor
$ npx skills add graniet/kheish --skill github-code-review -a cursor -y
Gemini CLI
$ npx skills add graniet/kheish --skill github-code-review -a gemini-cli -y
GitHub Copilot
$ npx skills add graniet/kheish --skill github-code-review -a github-copilot -y
OpenCode
$ npx skills add graniet/kheish --skill github-code-review -a opencode -y
Windsurf
$ npx skills add graniet/kheish --skill github-code-review -a windsurf -y
SKILL.md
github-code-review.SKILL.mddescription: Review code changes by analyzing git diffs, leaving inline comments on
PRs, and performing thorough pre-push review. Works with gh CLI or falls back to
git + GitHub REST API via curl.
version: 1.1.0
license: MIT
metadata:
catalog:
tags:
- GitHub
- Code-Review
- Pull-Requests
- Git
- Quality
related_skills:
- github-auth
- github-pr-workflowKheish Compatibility
This skill is repo-local and stays inactive until explicitly activated.
When the original instructions refer to legacy tool names, use these Kheish mappings:
- `terminal` => `bash`
- `web_extract` => `web_fetch`, plus `web_search` when discovery is needed
- `search_files` => `grep_search` and `glob_search`
- `browser_*` tools require a browser-capable surfaced tool or MCP; if none is available, use the closest available surface and say so explicitly
When the instructions mention local helper files, resolve them from `${KHEISH_SKILL_DIR}`.
GitHub Code Review
Perform code reviews on local changes before pushing, or review open PRs on GitHub. Most of this skill uses plain `git` — the `gh`/`curl` split only matters for PR-level interactions.
Prerequisites
- Authenticated with GitHub (see `github-auth` skill)
- Inside a git repository
Setup (for PR interactions)
if command -v gh &>/dev/null && gh auth status &>/dev/null; then
AUTH="gh"
elif [ -n "$GITHUB_TOKEN" ]; then
AUTH="curl"
else
AUTH="none"
fi
[ "$AUTH" = "none" ] && echo "Run 'gh auth login' or export GITHUB_TOKEN before PR interactions" && exit 1
REMOTE_URL=$(git remote get-url origin)
OWNER_REPO=$(echo "$REMOTE_URL" | sed -E 's|.*github\.com[:/]||; s|\.git$||')
OWNER=$(echo "$OWNER_REPO" | cut -d/ -f1)
REPO=$(echo "$OWNER_REPO" | cut -d/ -f2)
---
1. Reviewing Local Changes (Pre-Push)
This is pure `git` — works everywhere, no API needed.
Get the Diff
# Staged changes (what would be committed)
git diff --staged
# All changes vs main (what a PR would contain)
git diff main...HEAD
# File names only
git diff main...HEAD --name-only
# Stat summary (insertions/deletions per file)
git diff main...HEAD --stat
Review Strategy
1. **Get the big picture first:**
git diff main...HEAD --stat
git log main..HEAD --oneline
2. **Review file by file** — use `read_file` on changed files for full context, and the diff to see what changed:
git diff main...HEAD -- src/auth/login.py
3. **Check for common issues:**
# Debug statements, TODOs, console.logs left behind
git diff main...HEAD | grep -n "print(\|console\.log\|TODO\|FIXME\|HACK\|XXX\|debugger"
# Large files accidentally staged
git diff main...HEAD --stat | sort -t'|' -k2 -rn | head -10
# Secrets or credential patterns
git diff main...HEAD | grep -in "password\|secret\|api_key\|token.*=\|private_key"
# Merge conflict markers
git diff main...HEAD | grep -n "<<<<<<\|>>>>>>\|======="
4. **Present structured feedback** to the user.
Review Output Format
When reviewing local changes, present findings in this structure:
## Code Review Summary
### Critical
- **src/auth.py:45** — SQL injection: user input passed directly to query.
Suggestion: Use parameterized queries.
### Warnings
- **src/models/user.py:23** — Password stored in plaintext. Use bcrypt or argon2.
- **src/api/routes.py:112** — No rate limiting on login endpoint.
### Suggestions
- **src/utils/helpers.py:8** — Duplicates logic in `src/core/utils.py:34`. Consolidate.
- **tests/test_auth.py** — Missing edge case: expired token test.
### Looks Good
- Clean separation of concerns in the middleware layer
- Good test coverage for the happy path
---
2. Reviewing a Pull Request on GitHub
View PR Details
**With gh:**
gh pr view 123
gh pr diff 123
gh pr diff 123 --name-only
**With git + curl:**
PR_NUMBER=123
# Get PR details
curl -s \
-H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER \
| python3 -c "
import sys, json
pr = json.load(sys.stdin)
print(f\"Title: {pr['title']}\")
print(f\"Author: {pr['user']['login']}\")
print(f\"Branch: {pr['head']['ref']} -> {pr['base']['ref']}\")
print(f\"State: {pr['state']}\")
print(f\"Body:\n{pr['body']}\")"
# List changed files
curl -s \
-H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER/files \
| python3 -c "
import sys, json
for f in json.load(sys.stdin):
print(f\"{f['status']:10} +{f['additions']:-4} -{f['deletions']:-4} {f['filename']}\")"Check Out PR Locally for Full Review
This works with plain `git` — no `gh` needed:
# Fetch the PR branch and check it out
git fetch origin pull/123/head:pr-123
git checkout pr-123
# Now you can use read_file, search_files, run tests, etc.
# View diff against the base branch
git diff main...pr-123
**With gh (shortcut):**
gh pr checkout 123
Leave Comments on a PR
**General PR comment — with gh:**
gh pr comment 123 --body "Overall looks good, a few suggestions below."
**General PR comment — with curl:**
curl -s -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/$OWNER/$REPO/issues/$PR_NUMBER/comments \
-d '{"body": "Overall looks good, a few suggestions below."}'Leave Inline Review Comments
**Single inline comment — with gh (via API):**
HEAD_SHA=$(gh pr view 123 --json headRefOid --jq '.headRefOid')
gh api repos/$OWNER/$REPO/pulls/123/comments \
--method POST \
-f body="This could be simplified with a list comprehension." \
-f path="src/auth/login.py" \
-f commit_id="$HEAD_SHA" \
-f line=45 \
-f side="RIGHT"
**Single inline comment — with curl:**
# Get the head commit SHA
HEAD_SHA=$(curl -s \
-H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER \
| python3 -c "import sys,jso
Read more
description: Review code changes by analyzing git diffs, leaving inline comments on
PRs, and performing thorough pre-push review. Works with gh CLI or falls back to
git + GitHub REST API via curl.
version: 1.1.0
license: MIT
metadata:
catalog:
tags:
- GitHub
- Code-Review
- Pull-Requests
- Git
- Quality
related_skills:
- github-auth
- github-pr-workflowKheish Compatibility
This skill is repo-local and stays inactive until explicitly activated.
When the original instructions refer to legacy tool names, use these Kheish mappings:
- `terminal` => `bash`
- `web_extract` => `web_fetch`, plus `web_search` when discovery is needed
- `search_files` => `grep_search` and `glob_search`
- `browser_*` tools require a browser-capable surfaced tool or MCP; if none is available, use the closest available surface and say so explicitly
When the instructions mention local helper files, resolve them from `${KHEISH_SKILL_DIR}`.
GitHub Code Review
Perform code reviews on local changes before pushing, or review open PRs on GitHub. Most of this skill uses plain `git` — the `gh`/`curl` split only matters for PR-level interactions.
Prerequisites
- Authenticated with GitHub (see `github-auth` skill)
- Inside a git repository
Setup (for PR interactions)
if command -v gh &>/dev/null && gh auth status &>/dev/null; then AUTH="gh" elif [ -n "$GITHUB_TOKEN" ]; then AUTH="curl" else AUTH="none" fi [ "$AUTH" = "none" ] && echo "Run 'gh auth login' or export GITHUB_TOKEN before PR interactions" && exit 1 REMOTE_URL=$(git remote get-url origin) OWNER_REPO=$(echo "$REMOTE_URL" | sed -E 's|.*github\.com[:/]||; s|\.git$||') OWNER=$(echo "$OWNER_REPO" | cut -d/ -f1) REPO=$(echo "$OWNER_REPO" | cut -d/ -f2)
---
1. Reviewing Local Changes (Pre-Push)
This is pure `git` — works everywhere, no API needed.
Get the Diff
# Staged changes (what would be committed) git diff --staged # All changes vs main (what a PR would contain) git diff main...HEAD # File names only git diff main...HEAD --name-only # Stat summary (insertions/deletions per file) git diff main...HEAD --stat
Review Strategy
1. **Get the big picture first:**
git diff main...HEAD --stat git log main..HEAD --oneline
2. **Review file by file** — use `read_file` on changed files for full context, and the diff to see what changed:
git diff main...HEAD -- src/auth/login.py
3. **Check for common issues:**
# Debug statements, TODOs, console.logs left behind git diff main...HEAD | grep -n "print(\|console\.log\|TODO\|FIXME\|HACK\|XXX\|debugger" # Large files accidentally staged git diff main...HEAD --stat | sort -t'|' -k2 -rn | head -10 # Secrets or credential patterns git diff main...HEAD | grep -in "password\|secret\|api_key\|token.*=\|private_key" # Merge conflict markers git diff main...HEAD | grep -n "<<<<<<\|>>>>>>\|======="
4. **Present structured feedback** to the user.
Review Output Format
When reviewing local changes, present findings in this structure:
## Code Review Summary ### Critical - **src/auth.py:45** — SQL injection: user input passed directly to query. Suggestion: Use parameterized queries. ### Warnings - **src/models/user.py:23** — Password stored in plaintext. Use bcrypt or argon2. - **src/api/routes.py:112** — No rate limiting on login endpoint. ### Suggestions - **src/utils/helpers.py:8** — Duplicates logic in `src/core/utils.py:34`. Consolidate. - **tests/test_auth.py** — Missing edge case: expired token test. ### Looks Good - Clean separation of concerns in the middleware layer - Good test coverage for the happy path
---
2. Reviewing a Pull Request on GitHub
View PR Details
**With gh:**
gh pr view 123 gh pr diff 123 gh pr diff 123 --name-only
**With git + curl:**
PR_NUMBER=123
# Get PR details
curl -s \
-H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER \
| python3 -c "
import sys, json
pr = json.load(sys.stdin)
print(f\"Title: {pr['title']}\")
print(f\"Author: {pr['user']['login']}\")
print(f\"Branch: {pr['head']['ref']} -> {pr['base']['ref']}\")
print(f\"State: {pr['state']}\")
print(f\"Body:\n{pr['body']}\")"
# List changed files
curl -s \
-H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER/files \
| python3 -c "
import sys, json
for f in json.load(sys.stdin):
print(f\"{f['status']:10} +{f['additions']:-4} -{f['deletions']:-4} {f['filename']}\")"Check Out PR Locally for Full Review
This works with plain `git` — no `gh` needed:
# Fetch the PR branch and check it out git fetch origin pull/123/head:pr-123 git checkout pr-123 # Now you can use read_file, search_files, run tests, etc. # View diff against the base branch git diff main...pr-123
**With gh (shortcut):**
gh pr checkout 123
Leave Comments on a PR
**General PR comment — with gh:**
gh pr comment 123 --body "Overall looks good, a few suggestions below."
**General PR comment — with curl:**
curl -s -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/$OWNER/$REPO/issues/$PR_NUMBER/comments \
-d '{"body": "Overall looks good, a few suggestions below."}'Leave Inline Review Comments
**Single inline comment — with gh (via API):**
HEAD_SHA=$(gh pr view 123 --json headRefOid --jq '.headRefOid') gh api repos/$OWNER/$REPO/pulls/123/comments \ --method POST \ -f body="This could be simplified with a list comprehension." \ -f path="src/auth/login.py" \ -f commit_id="$HEAD_SHA" \ -f line=45 \ -f side="RIGHT"
**Single inline comment — with curl:**
# Get the head commit SHA HEAD_SHA=$(curl -s \ -H "Authorization: token $GITHUB_TOKEN" \ https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER \ | python3 -c "import sys,jso
Other skills on kheish.
More skills from other plugins.
agentmail
Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…
adr-create
Create a new Architecture Decision Record with sequential numbering and AgentDB registration
Questions about github-code-review.
- Which coding agents can use github-code-review?
- github-code-review installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

