feat(skills): add /pr-review skill for batch PR review#924
feat(skills): add /pr-review skill for batch PR review#924FlorianBruniaux wants to merge 2 commits intodevelopfrom
Conversation
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]>
There was a problem hiding this comment.
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.mddescribing 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.mdto 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 |
There was a problem hiding this comment.
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.
| gh pr merge <num> --merge --squash | |
| gh pr merge <num> --merge |
| # 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 \ |
There was a problem hiding this comment.
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.
| # 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" \ |
| **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. | ||
|
|
There was a problem hiding this comment.
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.
| # 1. Commandes Python/Go présentes partout | ||
| PYTHON_GO_CMDS=("ruff" "pytest" "pip" "go" "golangci") | ||
| echo "🐍 Checking Python/Go commands documentation..." |
There was a problem hiding this comment.
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.
What this adds
A new Claude Code skill
/pr-reviewthat 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:
Usage
Also fixes
Removes a broken pre-push check in
validate-docs.shthat compared^modcount inmain.rs(8 top-level modules) against "Total: 64 modules" inARCHITECTURE.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.mdso the Python/Go commands check passes on develop-based branches.