TimZander / TimZander/claude

deep-review/code-review: honor a bare 'pr <N>' argument and support Azure DevOps PRs

Open
#173 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
0
Forks
1
Avg merge
1d 3h
Merged PRs (30d)
7

Description

Problem

When /deep-review (and /code-review) is invoked with a bare pr <N> argument (e.g. /deep-review pr 4748), the skill does not review that PR. It falls through to treating the text as free-form "focus" context and defaults to its standard behavior — diffing the current checked-out branch against main. The result is a fully-formed, confident review of the wrong diff.

This has now happened at least twice in the same repo (user: "you did this last time as well"). Because the output looks complete and authoritative, the wrong target is easy to miss until the user notices the file list doesn't match the PR.

Contributing factors
  1. No first-class pr <N> mode. The skill's Context Input section documents branch:<name> / base:<name> tokens and PR URLs (via gh pr view), but a bare pr <N> token is not recognized as "review that PR's diff."
  2. GitHub-only assumption. The PR-fetch path assumes gh. Many repos (including the one where this recurred) are hosted on Azure DevOps, which has no gh. Reviewing an ADO PR requires the azure-devops MCP, and the skill has no ADO path.
  3. Silent fallback. When the PR can't be resolved, the skill silently reviews the current branch instead of stopping. Silent wrong-target is the core failure.
ADO fetch recipe (for the implementation)

For an Azure DevOps repo, reviewing PR N is:

  1. repo_get_repo_by_name_or_id → resolve repo GUID (note: ADO project name often differs from repo name).
  2. repo_get_pull_request_by_id → get lastMergeTargetCommit and lastMergeSourceCommit.
  3. git fetch origin <sourceSha> <targetSha> then git diff <targetSha>..<sourceSha> → the PR's actual diff (works for open and already-merged PRs).

Acceptance criteria

  • A bare pr <N>, !<N>, #<N>, or a PR URL argument switches the review target to that PR's diff instead of the current branch.
  • Host detection from the origin remote: GitHub → gh; Azure DevOps (*.visualstudio.com / dev.azure.com) → azure-devops MCP using the recipe above.
  • If the argument names a PR but it cannot be resolved, the skill stops and reports the error — it must never silently fall back to the current-branch diff.
  • The review output begins with a one-line confirmation of what is being reviewed, e.g. Reviewing PR #<N>: <source-branch> → <target-branch> (<M> files), so a wrong target is caught immediately.
  • Works for already-merged PRs (diff by commit SHAs, not by live branch refs).

Notes

  • Scope covers both deep-review and code-review skills since they share the same argument-parsing convention.
  • The one-line target confirmation is cheap and independently valuable — it would have caught both prior incidents on sight.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing argument parsing and the PR-fetch path for the /deep-review and /code-review skills, including their Context Input handling and current-branch fallback. Inspect how the origin remote is identified and follow the ADO recipe using repo_get_repo_by_name_or_id and repo_get_pull_request_by_id. Done means all listed PR forms select the PR diff, unresolved targets stop with an error, merged PRs work by SHA, and the review begins with target confirmation.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, git, github
Domain
devtools, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.