From ccbfa6bd7272151e6e885466bcbd652ce160d07d Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Tue, 24 Feb 2026 12:24:06 +0100 Subject: [PATCH] chore(skills): add branch guard to pr-review skill Reviews must run from main. Added step 0 hard stop if current branch is not main, preventing repeated misuse from team branches. Co-Authored-By: Claude Opus 4.6 --- .claude/skills/pr-review/SKILL.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.claude/skills/pr-review/SKILL.md b/.claude/skills/pr-review/SKILL.md index 08cb8d438..8a9241b63 100644 --- a/.claude/skills/pr-review/SKILL.md +++ b/.claude/skills/pr-review/SKILL.md @@ -16,11 +16,20 @@ on the branch type. All reviewers must approve for a clean review. ## Workflow -### 1. Determine the branch +### 0. Branch guard — MUST be on `main` -If the user provided a branch name as argument, use it. Otherwise use the -current branch (`git branch --show-current`). If on `main`, ask the user -which branch to review. +```bash +git branch --show-current +``` + +If the current branch is **not `main`**, stop immediately and tell the user: +"PR reviews must be run from the `main` worktree. Switch to `main` first." +Do NOT proceed with the review from a team branch. + +### 1. Determine the branch to review + +If the user provided a branch name as argument, use it. Otherwise list open +PRs and ask the user which branch to review. To list open PRs on Gitea: ```bash