gh-code-review

gh-code-review turns structured findings into the same coherent GitHub review a human reviewer submits: inline and multiline threads, whole-file comments, apply-able suggestions, and one final COMMENT, APPROVE, or REQUEST_CHANGES decision.
It has two deliberately separate layers:
gh code-review is a deterministic GitHub CLI extension for inspection, validation, submission, retry safety, and review-thread lifecycle operations. It does not invoke a model or analyze code.
- The portable
gh-code-review Agent Skill teaches coding agents how to review changed code, avoid duplicate threads, choose honest anchors, and use the extension or its gh api fallback.
This is a public preview. GitHub.com is the fully supported host; GitHub
Enterprise Server reports capabilities explicitly.
Install
GitHub CLI extension
gh extension install wildcard/gh-code-review
gh code-review capabilities
Agent Skill
With skills.sh:
npx skills add wildcard/gh-code-review
With GitHub CLI for Codex:
gh skill install wildcard/gh-code-review gh-code-review --agent codex --scope user
Other supported gh skill agents include Claude Code, Cursor, Copilot, Gemini CLI, and more:
gh skill install wildcard/gh-code-review gh-code-review --agent claude-code --scope user
Claude plugin marketplace
claude plugin marketplace add wildcard/gh-code-review
claude plugin install gh-code-review@gh-code-review
Restart or reload Claude Code after installation.
None of these installations happen automatically. The skill can use its bundled standard-library Python fallback when the extension is unavailable.
User guide and live review lab
Follow the user guide for exact commands, portable agent
prompts, and sanitized public PRs covering core submission, mixed line/file
reviews, pending-review lifecycle operations, guardrails, the Python fallback,
Codex, and Claude Code.
The guide's evidence is machine-readable and read-only verifiable:
python3 scripts/demo_lab.py verify --live
Quick start
Inspect the PR and existing review threads:
gh code-review inspect 42 -R owner/repo --unresolved
Create a manifest using the exact head.sha and commentable ranges returned by inspect:
{
"schema_version": "1.0",
"repository": "owner/repo",
"pull_request": 42,
"expected_head_sha": "0123456789abcdef",
"event": "COMMENT",
"summary": "Focused review of the changed request path.",
"idempotency_key": "review-42-0123456789abcdef",
"comments": [
{
"client_id": "nil-result-1",
"subject": "line",
"path": "internal/service.go",
"line": 112,
"side": "RIGHT",
"body": "The result is dereferenced when the call returns an error.",
"replacement": "if err != nil {\n return nil, err\n}"
},
{
"client_id": "storage-boundary-1",
"subject": "file",
"path": "internal/storage.go",
"body": "This file now owns both persistence and cache invalidation."
}
]
}
Validate without writing:
gh code-review validate --input review.json
Submit one formal review:
gh code-review submit --input review.json
APPROVE and REQUEST_CHANGES require --confirm-decision. A stale PR head fails with exit code 3 before submission.
Commands
gh code-review inspect
gh code-review validate
gh code-review submit
gh code-review capabilities
gh code-review pending start|show|abandon
gh code-review comment add|suggest|edit|delete
gh code-review thread list|show|reply|resolve|unresolve
gh code-review review list|show|edit|submit|dismiss
gh code-review file viewed|unviewed
All commands return a versioned JSON envelope. See the CLI reference and review schema.
Why a manifest?
The manifest makes a review inspectable before it is written. Validation catches:
- stale head SHAs;
- paths and lines outside the diff;
- wrong LEFT/RIGHT sides and cross-hunk ranges;
- renamed, deleted, binary, and unavailable-patch limitations;
- suggestions on deleted lines or file subjects;
- duplicate findings and existing equivalent comments;
- pending-review conflicts and self-approval;
- unsupported host capabilities.