plugin-code-critic/skills/analyze/SKILL.md
Perform AI-powered code review analysis by spawning parallel Task agents directly within the coding agent's context. Does not require the pair-review MCP server — works standalone. Runs Level 1 (diff isolation), Level 2 (file context), and Level 3 (codebase context) as parallel tasks, then orchestrates results into curated suggestions. Results are returned directly in the conversation and also pushed to the pair-review web UI (if running). Use when the user says "analyze", "analyze my changes", "run analysis", "analyze using tasks", "analyze directly", "analyze here", or wants code review analysis of their changes. This is the default analysis skill. If the user says something ambiguous like "analyze my changes" or "run analysis", use this skill unless they specifically ask for in-app analysis.
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 and return curated suggestions.
This skill includes a scripts/git-diff-lines script that annotates git diff output with explicit OLD and NEW line numbers. Each subagent should invoke it by name (git-diff-lines) — the orchestrating agent must ensure the script's directory is on PATH (e.g., via PATH="<skill-dir>/scripts:$PATH").
Determine what's being reviewed:
git diff --name-only HEAD for changed files.git merge-base main HEAD), then diff against it. Get PR title and description if available.Collect:
Obtain the prompt instructions for each analysis level. Use the tier argument (default: balanced).
If get_analysis_prompt is in your available tools (i.e., the pair-review MCP server is connected):
get_analysis_prompt for each level you will run: level1, level2, and (unless skipLevel3 is true) level3get_analysis_prompt with promptType: "orchestration" for the orchestration steptier argument to each callcustomInstructions argument, or gathered from user context in Step 1) as the customInstructions parameter — this injects them into the rendered promptOtherwise (standalone mode — no MCP connection):
references/ directory:
references/level1-{tier}.mdreferences/level2-{tier}.mdreferences/level3-{tier}.md (unless skipLevel3)references/orchestration-{tier}.mdLaunch two or three Task agents simultaneously (subagent_type: "general-purpose"), depending on skipLevel3. Each task must:
git-diff-lines script to get the annotated diffPass each task the following context in its prompt:
git-diff-lines (ensure the script's directory is on PATH)Level 1 — Analyze changes in isolation (diff only)
Level 2 — Analyze changes in file context (full files)
Level 3 — Analyze changes in codebase context (architecture, dependencies) — skip if skipLevel3 is true
Launch one more Task agent (subagent_type: "general-purpose") that:
[] for Level 3 if skipped)Push the orchestrated JSON to the pair-review web UI so suggestions appear inline. This step does not require MCP — it uses a direct HTTP POST with a fallback to http://localhost:7247 when the MCP get_server_info tool is unavailable.
Determine server URL:
get_server_info MCP tool is available, call it and use the url fieldcat ~/.pair-review/config.json 2>/dev/null | jq -r '.port // empty'http://localhost:7247Build the POST body from the orchestrated output:
path (absolute working directory from pwd) and headSha (from git rev-parse HEAD)repo (owner/repo) and prNumberprovider and model to describe what ran the analysis (e.g., the AI provider and model used)summary, suggestions, and fileLevelSuggestions from the orchestrated JSONPOST via curl to ${SERVER_URL}/api/analyses/results:
curl -s --connect-timeout 3 --max-time 10 \
-X POST "${SERVER_URL}/api/analyses/results" \
-H "Content-Type: application/json" \
-d @- <<'PAYLOAD'
{ ... }
PAYLOAD
A successful import returns HTTP 201 with { runId, reviewId, totalSuggestions, status: "completed" }.
Graceful degradation: If the request fails (server not running, timeout, etc.), log a short warning and continue to the Report step. The push is best-effort.
Note in the report whether results were successfully pushed to the pair-review UI.
Present the curated suggestions to the user, organized by file. For each suggestion:
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.