From 2425b4f2a43b750a9a098f8e281cc0039e6103ed Mon Sep 17 00:00:00 2001 From: "Kevin A. Mitchell" Date: Tue, 17 Feb 2026 01:57:14 -0600 Subject: [PATCH] agents: Update PR review range to use merge base - Changed references from `/..HEAD` to `..HEAD` across documentation, scripts, and prompts to align with Git best practices. - Updated `SKILL.md`, `review-checklist.md`, and agent configuration to reflect this change. - Revised shell scripts (`collect_pr_context.sh` and `review_range.sh`) to compute and use `merge-base` for the review range. Assisted-by: Codex --- .agents/skills/pr-review-auditor/SKILL.md | 4 ++-- .agents/skills/pr-review-auditor/agents/openai.yaml | 4 ++-- .../skills/pr-review-auditor/references/review-checklist.md | 2 +- .../skills/pr-review-auditor/scripts/collect_pr_context.sh | 2 +- .agents/skills/pr-review-auditor/scripts/review_range.sh | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.agents/skills/pr-review-auditor/SKILL.md b/.agents/skills/pr-review-auditor/SKILL.md index 856c4507..543004db 100644 --- a/.agents/skills/pr-review-auditor/SKILL.md +++ b/.agents/skills/pr-review-auditor/SKILL.md @@ -1,6 +1,6 @@ --- name: pr-review-auditor -description: Review the currently checked-out PR by discovering its upstream base branch with GitHub CLI, diffing base..HEAD, and performing a correctness-first code review that enforces repository policy with special priority on *GUIDELINES*.md rules and then AGENTS.md. Use when asked to do a full PR review, /review-style audit, commit-range quality check, or policy-compliance review of branch changes. +description: Review the currently checked-out PR by discovering its upstream base branch with GitHub CLI, diffing merge-base..HEAD, and performing a correctness-first code review that enforces repository policy with special priority on *GUIDELINES*.md rules and then AGENTS.md. Use when asked to do a full PR review, /review-style audit, commit-range quality check, or policy-compliance review of branch changes. --- # PR Review Auditor @@ -20,7 +20,7 @@ policy precedence: `*GUIDELINES*.md` before `AGENTS.md`. - checked-out branch, - PR number and base branch (via `gh pr view`), - merge-base commit, -- review range (`/..HEAD`), +- review range (`..HEAD`), - changed files, - available policy files (`*GUIDELINES*.md`, `AGENTS.md`). diff --git a/.agents/skills/pr-review-auditor/agents/openai.yaml b/.agents/skills/pr-review-auditor/agents/openai.yaml index 8639e469..ba67fdbd 100644 --- a/.agents/skills/pr-review-auditor/agents/openai.yaml +++ b/.agents/skills/pr-review-auditor/agents/openai.yaml @@ -1,4 +1,4 @@ interface: display_name: "PR Review Auditor" - short_description: "Review base..HEAD with GUIDELINES-first policy checks." - default_prompt: "Use $pr-review-auditor to review the current PR from upstream base to HEAD with findings-first output and strict GUIDELINES/AGENTS compliance checks." + short_description: "Review merge-base..HEAD with GUIDELINES-first policy checks." + default_prompt: "Use $pr-review-auditor to review the current PR from merge-base to HEAD with findings-first output and strict GUIDELINES/AGENTS compliance checks." diff --git a/.agents/skills/pr-review-auditor/references/review-checklist.md b/.agents/skills/pr-review-auditor/references/review-checklist.md index 8b184640..358e1e43 100644 --- a/.agents/skills/pr-review-auditor/references/review-checklist.md +++ b/.agents/skills/pr-review-auditor/references/review-checklist.md @@ -8,7 +8,7 @@ ## Review Scope -- Determine PR base branch and audit `/..HEAD`. +- Determine PR base branch, compute merge-base, and audit `..HEAD`. - Review full commit messages, changed files, and relevant patches. - Focus on behavior, CI impact, tests, then style. diff --git a/.agents/skills/pr-review-auditor/scripts/collect_pr_context.sh b/.agents/skills/pr-review-auditor/scripts/collect_pr_context.sh index 4218877d..74857326 100755 --- a/.agents/skills/pr-review-auditor/scripts/collect_pr_context.sh +++ b/.agents/skills/pr-review-auditor/scripts/collect_pr_context.sh @@ -62,7 +62,7 @@ fi rm -f "${fetch_error_file}" merge_base="$(git merge-base "${base_remote}/${base_ref}" HEAD)" -review_range="${base_remote}/${base_ref}..HEAD" +review_range="${merge_base}..HEAD" echo "CONTEXT_SOURCE=${context_source}" echo "PR_NUMBER=${pr_number}" diff --git a/.agents/skills/pr-review-auditor/scripts/review_range.sh b/.agents/skills/pr-review-auditor/scripts/review_range.sh index 8c6a61ed..1c3b4562 100755 --- a/.agents/skills/pr-review-auditor/scripts/review_range.sh +++ b/.agents/skills/pr-review-auditor/scripts/review_range.sh @@ -4,7 +4,7 @@ set -euo pipefail range="${1:-}" if [[ -z "${range}" ]]; then echo "usage: $(basename "$0") " >&2 - echo "example: $(basename "$0") upstream/main..HEAD" >&2 + echo "example: $(basename "$0") ..HEAD" >&2 exit 1 fi