plugin/skills/analyze/SKILL.md
Perform AI-powered code review analysis using pair-review's server-side analysis engine via MCP. Requires the pair-review MCP server to be connected. For standalone analysis without MCP, use the `code-critic:analyze` skill instead. Starts analysis via the pair-review MCP start_analysis tool, polls for completion, then fetches and presents the curated suggestions. Results are also visible in the pair-review web UI alongside the diff. Use when the user says "analyze in the app", "analyze in the UI", "run server analysis", "analyze with pair-review", or wants analysis results integrated into the pair-review web UI. If the user says something ambiguous like "analyze my changes" or "run analysis" without specifying a method, and both the `code-critic:analyze` and `pair-review:analyze` skills are available, ask whether they want: (1) agent-based analysis (`code-critic:analyze` — results returned directly in the conversation, no server required), or (2) in-app analysis (`pair-review:analyze` — results appear in the pair-review web UI, requires MCP connection). If only one analysis skill is available, use it directly without asking.
npx skillsauth add in-the-loop-labs/pair-review analyzeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Perform a three-level code review analysis using pair-review's built-in analysis engine. Unlike the code-critic:analyze skill (which spawns analysis agents directly within the coding agent's context), this skill delegates all analysis work to the pair-review server via MCP tool calls. Use this skill when the pair-review MCP server is connected; use code-critic:analyze when it is not.
Prerequisites: The pair-review MCP server must be connected with the start_analysis, get_ai_analysis_runs, and get_ai_suggestions tools available.
Determine what is being reviewed:
git rev-parse HEAD to get the HEAD SHA, and use the current working directory as the path.owner/repo) and PR number. If the user provides a PR URL, extract these from it. If available, run gh pr view --json number,headRepository or similar.Collect:
owner/repo string and PR numberCall the start_analysis MCP tool with the appropriate parameters:
For local mode:
{
"path": "/absolute/path/to/repo",
"headSha": "abc123...",
"tier": "balanced",
"skipLevel3": false,
"customInstructions": "optional instructions"
}
For PR mode:
{
"repo": "owner/repo",
"prNumber": 42,
"tier": "balanced",
"skipLevel3": false,
"customInstructions": "optional instructions"
}
Pass the tier, skipLevel3, and customInstructions arguments from the skill invocation.
The tool returns immediately with { analysisId, runId, reviewId, status: "started" }.
Analysis typically takes 1-5 minutes depending on the size of the changes and the tier.
Poll using get_ai_analysis_runs with limit: 1 and the review coordinates from step 1. Wait approximately 10 seconds between polls.
For local mode:
{
"path": "/absolute/path/to/repo",
"headSha": "abc123...",
"limit": 1
}
For PR mode:
{
"repo": "owner/repo",
"prNumber": 42,
"limit": 1
}
Verify that runs[0].id matches the runId returned from step 2 to ensure you are polling the correct analysis (another tab or user could have triggered a concurrent run).
Check the status field in runs[0]:
"running": Analysis is still in progress — keep polling"completed": Analysis finished — proceed to fetch results using the same runId"failed": Analysis failed — report the failure to the userKeep polling until status is completed or failed. Report progress to the user between polls.
start_analysis returns an error, report it to the user with the error message. Common causes: the PR has not been loaded in pair-review yet, the worktree is missing, or invalid parameters.status: "failed", report the failure to the user. The error field in the run object contains the failure reason.get_ai_suggestions returns an empty list after a completed analysis, this means no issues were found -- report a clean result.Once the analysis is complete, call get_ai_suggestions to retrieve the curated suggestions.
Pass the runId from step 2's start_analysis response (same value used for polling):
{
"runId": "the-runId-from-step-2"
}
If runId is unavailable, fall back to resolving by review coordinates:
For local mode:
{
"path": "/absolute/path/to/repo",
"headSha": "abc123..."
}
For PR mode:
{
"repo": "owner/repo",
"prNumber": 42
}
This returns the final orchestrated suggestions from the latest analysis run.
Present the curated suggestions to the user, organized by file. For each suggestion show:
Group suggestions by file for easy navigation. Highlight critical issues (bugs, security) prominently.
If no suggestions were found, report that the analysis completed cleanly.
development
Fetch human review comments from pair-review and make code changes to address them. Use when the user says "address review feedback", "fix review comments", "address comments", or wants to iterate on code based on feedback left by a human reviewer in pair-review.
development
Open outstanding GitHub review requests in pair-review for AI-powered code review. Finds open PRs where my review is pending from the past week and starts pair-review analysis for each. Use when the user says "review requests", "review my PRs", "check review requests", "open review requests", "pair-review my requests", or wants to batch-review their outstanding GitHub review requests.
tools
Open the GitHub pull request for the current branch in the pair-review web UI. This only opens the browser — it does not run AI analysis or generate suggestions. Once open, the user can browse the diff, leave comments, and trigger analysis from the web UI themselves. Use when the user says "review this PR", "review pull request", "open PR review", or wants to open a pair-review session for the current branch's pull request. If the user wants automated AI analysis of the PR rather than just opening the browser, use the `code-critic:analyze` skill (standalone, requires code-critic plugin) or `pair-review:analyze` skill (requires MCP server) instead. Note that the user can also trigger AI analysis from within the pair-review web UI after opening it.
tools
Open local uncommitted changes for review in the pair-review web UI. This only opens the browser — it does not run AI analysis or generate suggestions. Once open, the user can browse the diff, leave comments, and trigger analysis from the web UI themselves. Use when the user says "review my local changes", "review local", "open local review", or wants to open a pair-review session for uncommitted work in the current directory. If the user wants automated AI analysis of their local changes rather than just opening the browser, use the `code-critic:analyze` skill (standalone, requires code-critic plugin) or `pair-review:analyze` skill (requires MCP server) instead. Note that the user can also trigger AI analysis from within the pair-review web UI after opening it.