Skip to content

feat(skills): add /pr-review skill for batch PR review#924

Open
FlorianBruniaux wants to merge 2 commits intodevelopfrom
feat/pr-review-skill
Open

feat(skills): add /pr-review skill for batch PR review#924
FlorianBruniaux wants to merge 2 commits intodevelopfrom
feat/pr-review-skill

Conversation

@FlorianBruniaux
Copy link
Copy Markdown
Collaborator

What this adds

A new Claude Code skill /pr-review that automates the systematic batch review workflow for RTK pull requests, ordered by complexity (XS → S → M → L).

How it works

For each PR, the skill:

  • Checks mergeable state, CLA status, and existing reviews before reading the diff
  • Reads the full diff and source context for non-trivial logic changes
  • Presents a structured summary: link, size badge, CLA status, analysis, recommendation
  • Waits for explicit approval before any merge — no silent auto-merging
  • Posts boldguy-adapt comments on blocked PRs (conflict, unsigned CLA, CHANGES_REQUESTED) with context-appropriate templates

Usage

/pr-review              # build list from open PRs, review XS first
/pr-review triage       # run /rtk-triage first, then review quick wins
/pr-review from:884     # resume from a specific PR number

Also fixes

Removes a broken pre-push check in validate-docs.sh that compared ^mod count in main.rs (8 top-level modules) against "Total: 64 modules" in ARCHITECTURE.md. These are different metrics that can never match, so the check was blocking all branches unconditionally.

Also adds the missing ecosystems line to CLAUDE.md so the Python/Go commands check passes on develop-based branches.

FlorianBruniaux and others added 2 commits March 30, 2026 10:23
Adds a new Claude Code skill that automates the batch review workflow
for RTK pull requests, ordered by complexity (XS → S → M → L).

For each PR the skill:
- Verifies mergeable state, CLA, and existing reviews before reading
- Reads the full diff and source context for non-trivial logic
- Presents a structured summary (link, size, CLA, analysis, recommendation)
- Waits for explicit user approval before any merge
- Posts boldguy-adapt comments on blocked PRs (conflict, CLA, CHANGES_REQUESTED)
- Tracks session results in a final recap table

Includes templates for conflict/CLA/both comment scenarios, a conflict
post-merge check (CHANGELOG.md, rules.rs, registry.rs, main.rs), and
support for `from:<num>` to resume interrupted sessions.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Florian BRUNIAUX <[email protected]>
The check compared `^mod ` count in main.rs (8 top-level modules) against
the "Total: 64 modules" number in ARCHITECTURE.md, which are fundamentally
different metrics and will never match. This caused all branches to fail
the pre-push hook regardless of whether docs were actually out of sync.

Also adds the missing ecosystems line to CLAUDE.md so the Python/Go
commands check passes consistently on develop-based branches.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Florian BRUNIAUX <[email protected]>
Copilot AI review requested due to automatic review settings March 30, 2026 08:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Claude Code skill (/pr-review) to batch-review RTK pull requests from smallest to largest, with pre-diff gating (mergeability/CLA/reviews) and explicit user confirmation before merging. Also fixes docs validation friction by removing an always-failing module-count check and updating CLAUDE.md so Python/Go command checks pass.

Changes:

  • Introduces .claude/skills/pr-review/SKILL.md describing a structured PR review + merge workflow with “blocked PR” comment templates.
  • Removes the broken module-count consistency check from scripts/validate-docs.sh.
  • Adds a “Supported ecosystems” line to CLAUDE.md to satisfy documentation command presence checks.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
scripts/validate-docs.sh Drops an invalid module-count comparison; keeps Python/Go command doc checks.
CLAUDE.md Adds a supported-ecosystems line so validation checks detect required tooling terms.
.claude/skills/pr-review/SKILL.md New skill documentation detailing batch PR review, gating, and comment/merge flow.

#### Étape E — Merger (si validé)

```bash
gh pr merge <num> --merge --squash
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gh pr merge <num> --merge --squash is not a valid gh pr merge invocation (the merge strategy flags are mutually exclusive). This also conflicts with the earlier instruction to use only --merge. Pick a single strategy (--merge or --squash) and use it consistently in both places so the skill doesn’t fail at runtime.

Suggested change
gh pr merge <num> --merge --squash
gh pr merge <num> --merge

Copilot uses AI. Check for mistakes.
Comment on lines +80 to +85
# 2. Reviews existantes (CHANGES_REQUESTED ?)
gh api repos/rtk-ai/rtk/pulls/<num>/reviews \
--jq '.[] | {author: .user.login, state: .state, body: .body}'

# 3. Commentaires inline (si CHANGES_REQUESTED)
gh api repos/rtk-ai/rtk/pulls/<num>/comments \
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gh api calls hardcode repos/rtk-ai/rtk/..., which makes the skill break when run from forks or other repos. Prefer using gh repo view --json nameWithOwner (or {owner}/{repo} placeholders like other skills in this repo) and interpolate that into the API paths.

Suggested change
# 2. Reviews existantes (CHANGES_REQUESTED ?)
gh api repos/rtk-ai/rtk/pulls/<num>/reviews \
--jq '.[] | {author: .user.login, state: .state, body: .body}'
# 3. Commentaires inline (si CHANGES_REQUESTED)
gh api repos/rtk-ai/rtk/pulls/<num>/comments \
# Déterminer le repo courant (owner/repo) pour supporter forks et clones
REPO="$(gh repo view --json nameWithOwner -q .nameWithOwner)"
# 2. Reviews existantes (CHANGES_REQUESTED ?)
gh api "repos/${REPO}/pulls/<num>/reviews" \
--jq '.[] | {author: .user.login, state: .state, body: .body}'
# 3. Commentaires inline (si CHANGES_REQUESTED)
gh api "repos/${REPO}/pulls/<num>/comments" \

Copilot uses AI. Check for mistakes.
Comment on lines +158 to +175
**Règles du commentaire** :
- **Anglais uniquement** (GitHub)
- Remercier la contribution en ouverture (sincèrement, pas de manière générique)
- Dire clairement ce qui bloque (1-2 points max)
- Donner les étapes exactes pour débloquer
- Pas d'em dash (`—`), pas de staccato, longueurs de phrases variées
- Ne pas sonner comme un bot

**Template conflit + CLA** :
```
Hey @<author>, thanks for the contribution! [mention spécifique de ce que la PR apporte]

Two things before we can merge:

1. The branch needs a rebase on `develop` — there's a conflict on [fichier]. A `git rebase origin/develop` should do it.

2. The CLA hasn't been signed yet. The CLAassistant bot left instructions in the PR — just follow the link, takes about a minute.

Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The skill’s own rules say GitHub comments should not use em dashes (), but the provided comment templates include them (e.g., "rebase on develop — there's a conflict"). Either relax the rule or update the templates to follow it, otherwise the guidance is self-contradictory.

Copilot uses AI. Check for mistakes.
Comment on lines +6 to 8
# 1. Commandes Python/Go présentes partout
PYTHON_GO_CMDS=("ruff" "pytest" "pip" "go" "golangci")
echo "🐍 Checking Python/Go commands documentation..."
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After removing the module-count check, the step numbering/comments are now inconsistent (this section is labeled # 1 but later the script still has # 4). Consider renumbering or dropping the numeric prefixes so the script remains easy to follow and maintain.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants