with one click
github-cli-code-review
// Use GitHub CLI (gh) and SonarQube MCP tools to fetch PR details, review comments, threads, and quality gate status for the current branch before addressing code review feedback.
// Use GitHub CLI (gh) and SonarQube MCP tools to fetch PR details, review comments, threads, and quality gate status for the current branch before addressing code review feedback.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | github-cli-code-review |
| description | Use GitHub CLI (gh) and SonarQube MCP tools to fetch PR details, review comments, threads, and quality gate status for the current branch before addressing code review feedback. |
When addressing code review comments, do not rely on user-provided summaries. Use gh to pull the authoritative review threads for the PR associated with the current branch. Additionally, check the SonarQube quality gate for the PR and address any issues causing it to fail.
Assume git authentication is available via SSH and does not block access.
Use this skill when you need to:
gh# Confirm we're in a git repo and on the expected branch
git status
# Find the PR associated with the current branch
gh pr view --json number,title,url,headRefName,baseRefName,author
# Get the full set of review threads (includes unresolved/resolved state)
gh pr view --json reviewThreads
# Quick human-readable view
gh pr view
# List PR comments (timeline entries)
gh pr view --comments
Use the SonarQube MCP tools (not CLI) for quality gate inspection:
Discover the project key:
mcp--sonarqube--search_my_sonarqube_projects
Check quality gate status for this PR:
mcp--sonarqube--get_project_quality_gate_status with projectKey=<key> and pullRequest=<PR_NUMBER>
List issues on this PR:
mcp--sonarqube--search_sonar_issues_in_projects with projects=[<key>] and pullRequestId=<PR_NUMBER>
Understand a specific rule (if unfamiliar):
mcp--sonarqube--show_rule with key=<rule_key>
View source context in SonarQube (if needed):
mcp--sonarqube--get_raw_source with key=<file_key> and pullRequest=<PR_NUMBER>
gh pr view --json ... and then parse, because it includes thread resolution state.gh pr list --head <branch> --json number,title,url and pick the one matching the current head branch.If the SonarQube MCP server is unavailable or unresponsive, this is a line fault — do NOT skip and continue. Emit a Line Fault Contract (see .kilocode/contracts/line_health/line_fault_contract.md) and dispatch the fitter via dispatch fitter (commands.dispatch_fitter).
Fault payload fields:
gate_id: "sonarqube-quality-gate"invocation: the MCP tool call that failedstop_reason: "env_missing"repro_hints: SonarQube URL, project key, PR numberThe fitter will attempt to restore the connection. If the fitter succeeds, retry the SonarQube steps. If the fitter cannot restore the line, it escalates to a human. Max 1 retry.
gh fails.mcp--sonarqube--search_my_sonarqube_projects.pullRequest / pullRequestId parameters when querying SonarQube for PR-scoped results.