Skip to content

Commit b82901f

Browse files
fix(dev-infra): improve PR review skill handling of git worktrees
The current PR review skill blindly attempts to checkout branches using the `gh` CLI. This creates fatal errors if the branch being checked out is already tied to a different git worktree. Additionally, the logic didn't give the user a clear way to enforce a remote code review when they are the author. This change updates the `Execution Workflow` to prioritize an explicit user instruction to review remotely, and updates the `Local Code Review` instructions to enforce checking for worktree conflicts before executing local checkouts.
1 parent d4c085d commit b82901f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.agent/skills/pr_review/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ When reviewing a pull request for the `angular` repository, follow these essenti
2222
- **Payload Size**: Pay attention to the impact of changes on the final client payload size.
2323

2424
3. **Execution Workflow**:
25-
Determine the appropriate review method. If the user explicitly asks for a `local` or `remote` review in their request, that takes precedence. Otherwise, use the GitHub MCP or available scripts to determine if the review should be `local` or `remote`.
25+
Determine the appropriate review method. If the user explicitly asks for a `remote` or `local` review in their request, that takes precedence (e.g. "leave comments on the PR" implies `remote`). Otherwise, use the GitHub MCP or available scripts to determine if the review should be `local` or `remote`.
2626

2727
**Common Review Practices (Applies to both Local and Remote)**
2828
- **Preparation & Checklist**:
@@ -35,7 +35,7 @@ When reviewing a pull request for the `angular` repository, follow these essenti
3535
- **Constructive Feedback**: Provide clear, actionable, and polite feedback. Explain the _why_ behind your suggestions or edits. Do **NOT** leave inline comments purely to praise, agree with, or acknowledge a correct implementation detail, as this clutters the review. If you want to praise the PR, do so in the single general PR comment.
3636

3737
**A. Local Code Review (If the PR is owned by the author requesting the review)**
38-
- **Checkout**: Check out the PR branch locally (if it doesn't already exist, fetch it).
38+
- **Checkout**: Check out the PR branch locally (if it doesn't already exist, fetch it). If checking out the branch fails due to a worktree claim (e.g. "fatal: '<branch>' is already used by worktree at '<path>'"), do the review in that directory.
3939
- **Review & Edit**: Execute the review directly on the code. Instead of adding inline PR comments for suggestions, format the codebase or apply the edits directly to the files.
4040
- **Feedback**: Summarize the review findings and the concrete changes you made in a message to the user, referencing the completed items from your checklist.
4141
- **Do NOT Commit or Push**: Leave the changes uncommitted in the working directory so the user can easily review the pending edits locally. Let the user know the changes are ready for their review, but do not ask for approval to push.

0 commit comments

Comments
 (0)