Provide a code review for the given Azure DevOps pull request.
Workflow
Check Eligibility: Use az repos pr show --id {prId} --org {orgUrl} to verify the PR is open, not a draft, and hasn't been reviewed by you already. Skip if ineligible.
Get Context: Identify relevant CLAUDE.md files (root and in modified directories) and get the PR diff using git commands:
First, use az repos pr show --id {prId} --org {orgUrl} to get the target branch name
Then fetch and switch to the PR branch: az repos pr checkout --id {prId} (note: checkout does NOT require --org as it operates on the local git repository)
Generate the diff: git diff origin/{targetBranch}...HEAD
Note: These commands will only work when executed in the same git repository as the PR.
Review the Changes: Use agents to analyze the code changes for:
Validate Issues: For each potential issue, assess confidence (0-100 scale). Filter to only high-confidence issues (80+):
0-25: False positive or stylistic preference not in CLAUDE.md
50: Real but minor issue
75: Important issue affecting functionality or explicitly mentioned in CLAUDE.md
100: Definite issue that will cause problems
Post Review: If high-confidence issues found:
a. Confirm with User: Use the AskUserQuestion tool to confirm with the user before posting comments to the PR, unless the user explicitly requested not to confirm. Present a summary of the issues you found and ask if they should be posted.
b. Post Comments: After user confirmation, use az devops invoke to create a comment thread on the PR:
For file-specific comments, include threadContext with filePath, rightFileStart, and rightFileEnd in the body.
Avoid False Positives
Pre-existing issues not introduced by this PR
Linter/typechecker/compiler issues (handled by CI)
Pedantic nitpicks not explicitly in CLAUDE.md
Intentional functionality changes
Issues on unmodified lines
General quality issues (test coverage, documentation) unless CLAUDE.md requires them
Issues with lint ignore comments
Notes
Don't check build signal or run builds/typechecks (handled separately by CI)
Cite and link each issue with full context
Keep comments brief and professional
Use Azure CLI commands from the azure-cli skill
Comment Format
When posting the review using az devops invoke, format as follows:
If issues found:
### Code review
Found {N} issues:
1. <brief description> (CLAUDE.md says "<quote>")
<Azure DevOps link to file with full commit hash + line range>
2. <brief description> (bug due to <file and code snippet>)
<Azure DevOps link to file with full commit hash + line range>
🤖 Generated with AI
<sub>- If this code review was useful, please react with 👍. Otherwise, react with 👎.</sub>
If no issues:
### Code review
No issues found. Checked for bugs and CLAUDE.md compliance.
🤖 Generated with AI
Azure DevOps Link Format
Use this exact format for code links (must include full commit hash):
Get full commit hash from PR details (az repos pr show --id {prId} --org {orgUrl})
Use lineStart and lineEnd for line ranges (or just line={number} for a single line)
Include 1+ lines of context before/after the issue
Ensure org, project, and repo names match the PR's repository
File path should start with /
1---2name: review-pr3description: Code review an Azure DevOps pull request4---56Provide a code review for the given Azure DevOps pull request.78## Workflow9101. **Check Eligibility**: Use `az repos pr show --id {prId} --org {orgUrl}` to verify the PR is open, not a draft, and hasn't been reviewed by you already. Skip if ineligible.11122. **Get Context**: Identify relevant CLAUDE.md files (root and in modified directories) and get the PR diff using git commands:13 - First, use `az repos pr show --id {prId} --org {orgUrl}` to get the target branch name14 - Then fetch and switch to the PR branch: `az repos pr checkout --id {prId}` (note: checkout does NOT require `--org` as it operates on the local git repository)15 - Generate the diff: `git diff origin/{targetBranch}...HEAD`16 - **Note**: These commands will only work when executed in the same git repository as the PR.17183. **Review the Changes**: Use agents to analyze the code changes for:19 - CLAUDE.md compliance (only applicable instructions)20 - Obvious bugs in the changes themselves21 - Issues revealed by git history/blame22 - Patterns from previous PRs on these files23 - Violations of code comments/guidance24254. **Validate Issues**: For each potential issue, assess confidence (0-100 scale). Filter to only high-confidence issues (80+):26 - **0-25**: False positive or stylistic preference not in CLAUDE.md27 - **50**: Real but minor issue28 - **75**: Important issue affecting functionality or explicitly mentioned in CLAUDE.md29 - **100**: Definite issue that will cause problems30315. **Post Review**: If high-confidence issues found:3233 a. **Confirm with User**: Use the `AskUserQuestion` tool to confirm with the user before posting comments to the PR, unless the user explicitly requested not to confirm. Present a summary of the issues you found and ask if they should be posted.3435 b. **Post Comments**: After user confirmation, use `az devops invoke` to create a comment thread on the PR:3637 ```shell38 az devops invoke --area git --resource pullRequestThreads \39 --route-parameters project={project} repositoryId={repo} pullRequestId={pr} \40 --http-method POST --api-version 7.1-preview \41 --body '{"comments":[{"parentCommentId":0,"content":"Your review","commentType":"text"}],"status":"active"}' \42 --org {orgUrl}43 ```4445 For file-specific comments, include `threadContext` with `filePath`, `rightFileStart`, and `rightFileEnd` in the body.4647## Avoid False Positives4849- Pre-existing issues not introduced by this PR50- Linter/typechecker/compiler issues (handled by CI)51- Pedantic nitpicks not explicitly in CLAUDE.md52- Intentional functionality changes53- Issues on unmodified lines54- General quality issues (test coverage, documentation) unless CLAUDE.md requires them55- Issues with lint ignore comments5657## Notes5859- Don't check build signal or run builds/typechecks (handled separately by CI)60- Cite and link each issue with full context61- Keep comments brief and professional62- Use Azure CLI commands from the azure-cli skill6364## Comment Format6566When posting the review using `az devops invoke`, format as follows:6768**If issues found:**6970```markdown71### Code review7273Found {N} issues:74751. <brief description> (CLAUDE.md says "<quote>")7677 <Azure DevOps link to file with full commit hash + line range>78792. <brief description> (bug due to <file and code snippet>)8081 <Azure DevOps link to file with full commit hash + line range>8283🤖 Generated with AI8485<sub>- If this code review was useful, please react with 👍. Otherwise, react with 👎.</sub>86```8788**If no issues:**8990```markdown91### Code review9293No issues found. Checked for bugs and CLAUDE.md compliance.9495🤖 Generated with AI96```9798## Azure DevOps Link Format99100Use this exact format for code links (must include full commit hash):101102```103https://dev.azure.com/{org}/{project}/_git/{repo}?path=/{file-path}&version=GC{full-commit-hash}&lineStart={start}&lineEnd={end}&lineStartColumn=1&lineEndColumn=1104```105106- Get full commit hash from PR details (`az repos pr show --id {prId} --org {orgUrl}`)107- Use `lineStart` and `lineEnd` for line ranges (or just `line={number}` for a single line)108- Include 1+ lines of context before/after the issue109- Ensure org, project, and repo names match the PR's repository110- File path should start with `/`
Run npx skillmds@latest add scaryrawr/review-pr in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Code review an Azure DevOps pull request It is listed under DevOps & Infra on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
scaryrawr (@scaryrawr) published this skill. Their other Agent Skills are listed on their SkillMD profile.