Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

fix(review-pr): add overlapping PR detection to catch duplicate bot fixes (#1548)

worktrunk-botcbf2ac481145
diff --git a/.claude/skills/review-pr/SKILL.md b/.claude/skills/review-pr/SKILL.md
index 05da9ba4d..7acf5bcb6 100644
--- a/.claude/skills/review-pr/SKILL.md
+++ b/.claude/skills/review-pr/SKILL.md
@@ -51,7 +51,7 @@ gh api "repos/$REPO/compare/$LAST_REVIEW_SHA...$HEAD_SHA" \
```
If the incremental changes are trivial, skip the full review **and do not
-submit a new approval** — the existing review stands. Go directly to step 6 to
+submit a new approval** — the existing review stands. Go directly to step 7 to
resolve any bot threads addressed by the new changes, then exit. Do NOT proceed
to steps 2, 3, or 4. Rough heuristic: changes under ~20 added+deleted lines
that don't introduce new functions, types, or control flow are typically
@@ -80,7 +80,13 @@ question — check whether a bot reply exists after the question's timestamp
before answering. Address unanswered questions in the review body (not via
`gh pr comment`).
-### 2. Read and understand the change
+### 2. Check for overlapping PRs
+
+Before reading the diff, scan other open PRs for file overlap.
+If another PR touches the same files with a similar fix, flag it in the review
+so one can be closed as a duplicate.
+
+### 3. Read and understand the change
1. Read the PR diff with `gh pr diff <number>`.
2. Before going deeper, look at the PR as a reader would — not just the code,
@@ -88,7 +94,7 @@ before answering. Address unanswered questions in the review body (not via
off?
3. Read the changed files in full (not just the diff) to understand context.
-### 3. Review
+### 4. Review
Scale depth to the change. A docs-only PR or a mechanical rename needs a skim
for correctness, not the full checklist. A new algorithm or state-management
@@ -170,7 +176,7 @@ Two search strategies, both required:
Flag duplicates — reuse is almost always better than a parallel implementation.
-### 4. Submit
+### 5. Submit
**If there are no issues, approve with an empty body — silence means correct.**
@@ -204,7 +210,7 @@ review as a COMMENT.
(steps 2–3) — self-review catches real issues (lint failures, edge cases) and is
intentionally valuable. Do NOT attempt
`gh pr review --approve` — GitHub rejects self-approvals. Submit as COMMENT
-when there are concerns, or stay silent and skip to step 5. Always post CI
+when there are concerns, or stay silent and skip to step 6. Always post CI
failure analysis as a COMMENT, even on self-authored PRs.
**Not confident enough to approve** (unfamiliar module, subtle logic): Add a
@@ -295,7 +301,7 @@ array indices to object keys, which GitHub rejects.
GitHub's suggestion parser may consume it as a delimiter, corrupting the
result. Either shrink the range to avoid the fence or push a commit.
-### 5. Monitor CI
+### 6. Monitor CI
After approving or staying silent, monitor CI using the approach from
/running-in-ci.
@@ -329,7 +335,7 @@ After approving or staying silent, monitor CI using the approach from
```
Skip if the bot already commented today and the comment includes this PR.
-### 6. Resolve handled suggestions
+### 7. Resolve handled suggestions
After submitting the review, check if any unresolved bot threads have been
addressed by the new changes. Resolve threads where the suggestion was applied.
@@ -397,7 +403,7 @@ gh api graphql -F query=@/tmp/resolve-thread.graphql -f threadId="THREAD_ID"
Outdated comments (null line) are best-effort — skip if the original context
can't be located.
-### 7. Push mechanical fixes
+### 8. Push mechanical fixes
**Bot PRs** (Dependabot, renovate, etc.): If the review found concrete, fixable
issues and there's no human author to act on feedback, commit and push the fix