Skip to content

Comments

chore(claude): rename pr skill to pull-request and fix automation gaps#3160

Merged
PierreBrisorgueil merged 6 commits intomasterfrom
chore/pull-request-skill
Feb 24, 2026
Merged

chore(claude): rename pr skill to pull-request and fix automation gaps#3160
PierreBrisorgueil merged 6 commits intomasterfrom
chore/pull-request-skill

Conversation

@PierreBrisorgueil
Copy link
Contributor

@PierreBrisorgueil PierreBrisorgueil commented Feb 23, 2026

Summary

  • What changed: Rename .claude/skills/pr/.claude/skills/pull-request/ and fix multiple automation gaps in the monitor loop
  • Why: The pr skill was not being loaded into Claude Code's system-reminder (description too long + late addition), causing the PR workflow to be silently skipped. Several loop gaps also caused incorrect behavior when the skill was used.
  • Related issues: Closes chore(claude): rename pr skill to pull-request and fix automation gaps #3159

Scope

  • Module(s) impacted: .claude/skills/ (internal tooling only, no application code)
  • Cross-module impact: none
  • Risk level: low

Validation

  • npm run lint
  • npm test
  • Manual checks done (if applicable)

Guardrails check

  • No secrets or credentials introduced (.env*, secrets/**, keys, tokens)
  • No risky rename/move of core stack paths
  • Changes remain merge-friendly for downstream projects
  • Tests added or updated when behavior changed — n/a, no application code changed

Notes for reviewers

  • Security considerations: none
  • Mergeability considerations: safe to merge at any time, only touches .claude/ and CLAUDE.md
  • Changes: shorter skill description, push-before-reply order, CI retry fallback, post-ready preliminary review pass for ready-triggered bots (CodeRabbit etc.), thread ID source doc, safety limit clarification

Summary by CodeRabbit

  • Documentation

    • Added a comprehensive pull-request workflow and autonomous monitoring loop to guide draft → CI → iterative review → stop condition.
    • Added a PR monitoring reference with CLI guidance to list, reply to, and resolve review threads and check PR status.
    • Updated guidance to use /pull-request (replacing /pr) across docs and prompts.
  • Chores

    • Consolidated and reorganized PR guidance and prompts for clearer usage.

- Rename .claude/skills/pr/ → .claude/skills/pull-request/ with shorter
  description so the skill loads reliably in system-reminder
- Fix monitor loop: push before reply/resolve, CI retry fallback, thread ID source
- Add preliminary review pass after gh pr ready (CodeRabbit and ready-triggered bots)
- Add 10-iteration safety limit clarification (preliminary pass not counted)
- Add guardrail in CLAUDE.md to always invoke /pull-request when shipping work
- Update feature/SKILL.md to reference /pull-request

Closes #3159
@PierreBrisorgueil PierreBrisorgueil added the Refactor Neither fixes a bug nor adds a feat label Feb 23, 2026
@PierreBrisorgueil PierreBrisorgueil self-assigned this Feb 23, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c61b023 and 2af2bef.

📒 Files selected for processing (1)
  • .claude/skills/pull-request/references/monitoring.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .claude/skills/pull-request/references/monitoring.md

📝 Walkthrough

Walkthrough

Renames the PR skill from pr to pull-request; removes legacy PR docs; adds a new comprehensive pull-request skill and monitoring references; updates prompts, prompt mappings, top-level docs, and a feature doc step to run /pull-request after verification.

Changes

Cohort / File(s) Summary
Removed legacy PR docs
.claude/skills/pr/SKILL.md, .claude/skills/pr/references/monitoring.md
Deleted the old PR skill documentation and its gh CLI/monitoring reference.
New pull-request skill & refs
.claude/skills/pull-request/SKILL.md, .claude/skills/pull-request/references/monitoring.md
Added a full pull-request playbook and a gh/GraphQL monitoring reference (CI polling, thread resolution, reply/fix loop, batching, conflict handling).
Feature doc tweak
.claude/skills/feature/SKILL.md
Inserted step instructing to run /pull-request after verification (documentation only).
Prompts & mappings updated
.github/prompts/pr.prompt.md (deleted), .github/prompts/pull-request.prompt.md, .github/copilot-instructions.md, AGENTS.md
Removed old pr prompt file, added pull-request prompt, and updated prompt mappings and copilot instruction references.
Top-level docs updated
CLAUDE.md, README.md
Replaced CLI command text from /pr to /pull-request and updated the PR lifecycle wording in top-level docs.
Misc metadata
.github/prompts/pr.prompt.md
Legacy prompt file removed.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as "Developer"
  participant Skill as "pull-request Skill"
  participant GH as "GitHub (gh + API)"
  participant CI as "CI"
  participant Repo as "Repository"

  Dev->>Skill: /pull-request (create draft PR)
  Skill->>Repo: git push branch (create draft PR)
  Skill->>GH: gh pr create (draft)
  Skill->>CI: wait for CI to start (poll)
  CI-->>Skill: CI queued / running / result
  Skill->>GH: list unresolved review threads (GraphQL)
  GH-->>Skill: return threads + IDs
  Skill->>Skill: evaluate actionable comments
  alt actionable comments exist
    Skill->>Repo: apply fixes (batch commits) and push
    Skill->>GH: gh pr ready / update
    Skill->>CI: wait for CI (loop)
  else no actionable comments and CI green
    Skill->>Dev: stop (CI green + zero actionable)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

Chore

Poem

🐇 I hopped from branch to branch with glee,

From /pr to /pull-request — a tidy spree.
CI hums, comments fade, the loop runs light,
Drafts turn ready, fixes push at night.
Hooray — this rabbit hops, workflow bright! 🥕✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: renaming the PR skill from pr to pull-request and fixing automation gaps in the monitor loop.
Description check ✅ Passed The description follows the template structure with Summary, Scope, Validation, Guardrails, and Notes sections; all critical information is provided.
Linked Issues check ✅ Passed The PR addresses all objectives from #3159: skill renamed, description shortened for reliable loading, push-before-reply ordering enforced, CI retry fallback added, thread ID source resolved, post-ready bot preliminary pass implemented, and safety limit clarified.
Out of Scope Changes check ✅ Passed All changes are directly related to renaming the PR skill and fixing automation gaps; no unrelated modifications or scope creep detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/pull-request-skill

Comment @coderabbitai help to get the list of available commands and usage tips.

@PierreBrisorgueil PierreBrisorgueil marked this pull request as ready for review February 23, 2026 19:00
Copilot AI review requested due to automatic review settings February 23, 2026 19:00
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/skills/pull-request/SKILL.md:
- Around line 157-162: The TOTAL calculation uses gh api --paginate piped to jq
'length', which only returns the last page's length; update the TOTAL assignment
(the shell variable TOTAL in the snippet that calls gh api
repos/.../issues/.../comments --paginate) to slurp and aggregate all pages
before computing length (use jq's slurp mode to merge the per-page arrays and
compute the combined length), so the script sums counts across pages rather than
reading only the final page.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0792497 and 0207c87.

📒 Files selected for processing (6)
  • .claude/skills/feature/SKILL.md
  • .claude/skills/pr/SKILL.md
  • .claude/skills/pr/references/monitoring.md
  • .claude/skills/pull-request/SKILL.md
  • .claude/skills/pull-request/references/monitoring.md
  • CLAUDE.md
💤 Files with no reviewable changes (2)
  • .claude/skills/pr/SKILL.md
  • .claude/skills/pr/references/monitoring.md

Copy link

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

Renames the embedded Claude PR workflow skill from /pr to /pull-request and updates the skill content to close gaps in the autonomous PR monitoring loop (CI waiting, feedback handling, and stop conditions) within the repo’s internal .claude/ tooling.

Changes:

  • Renamed the PR skill to pull-request and added updated monitoring/reference documentation under .claude/skills/pull-request/.
  • Updated CLAUDE.md and the /feature skill to point contributors toward /pull-request for PR lifecycle operations.
  • Removed the legacy .claude/skills/pr/ skill docs.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
CLAUDE.md Updates guardrails and the skills table to reference /pull-request.
.claude/skills/pull-request/SKILL.md New PR lifecycle skill playbook with updated autonomous monitor loop steps.
.claude/skills/pull-request/references/monitoring.md New gh/GraphQL reference commands for CI and review thread monitoring.
.claude/skills/pr/SKILL.md Removes the old /pr skill doc.
.claude/skills/pr/references/monitoring.md Removes the old monitoring reference doc.
.claude/skills/feature/SKILL.md Adds a step directing users to /pull-request once verify passes.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
.claude/skills/pull-request/references/monitoring.md (1)

56-66: --paginate | jq 'map(...)' produces separate arrays per page.

gh api --paginate emits one JSON array per page; jq 'map(...)' (without -s) processes each independently, outputting multiple arrays. For display this is functional, but inconsistent with the -s 'add | …' pattern already applied in SKILL.md. Consider using slurp mode for a single flat list:

♻️ Suggested consistency fix
-gh api repos/$OWNER/$REPO/pulls/$PR/comments --paginate \
-  | jq 'map({id, user: .user.login, body: .body[0:100], line})'
+gh api repos/$OWNER/$REPO/pulls/$PR/comments --paginate \
+  | jq -s 'add | map({id, user: .user.login, body: .body[0:100], line})'
-gh api repos/$OWNER/$REPO/issues/$PR/comments --paginate \
-  | jq 'map({id, user: .user.login, body: .body[0:100]})'
+gh api repos/$OWNER/$REPO/issues/$PR/comments --paginate \
+  | jq -s 'add | map({id, user: .user.login, body: .body[0:100]})'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/skills/pull-request/references/monitoring.md around lines 56 - 66,
The current gh api commands using --paginate piped to jq 'map(...)' produce
separate arrays per page; change the jq usage to slurp mode and merge pages into
a single array (use jq -s 'add | map({id, user: .user.login, body: .body[0:100],
line})' for the pull-request comments command and jq -s 'add | map({id, user:
.user.login, body: .body[0:100]})' for the issue comments command) so the output
is a single flattened list while keeping the same fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/skills/pull-request/SKILL.md:
- Around line 139-157: Replace the literal "<number>" placeholder with the
previously defined PR variable ($PR) in the bash blocks that call the GitHub CLI
(specifically the commands like "gh pr checks <number> --watch" and the retry
loop using "gh pr checks <number>") so the script uses the PR variable; update
the occurrences in sections 6a and 6f to reference $PR (matching how other
blocks use $PR) and ensure all instances of "<number>" in those blocks are
changed to $PR so the commands execute with the actual PR number.

---

Nitpick comments:
In @.claude/skills/pull-request/references/monitoring.md:
- Around line 56-66: The current gh api commands using --paginate piped to jq
'map(...)' produce separate arrays per page; change the jq usage to slurp mode
and merge pages into a single array (use jq -s 'add | map({id, user:
.user.login, body: .body[0:100], line})' for the pull-request comments command
and jq -s 'add | map({id, user: .user.login, body: .body[0:100]})' for the issue
comments command) so the output is a single flattened list while keeping the
same fields.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0207c87 and 95ead39.

📒 Files selected for processing (7)
  • .claude/skills/pull-request/SKILL.md
  • .claude/skills/pull-request/references/monitoring.md
  • .github/copilot-instructions.md
  • .github/prompts/pr.prompt.md
  • .github/prompts/pull-request.prompt.md
  • AGENTS.md
  • README.md
💤 Files with no reviewable changes (1)
  • .github/prompts/pr.prompt.md

Copilot AI review requested due to automatic review settings February 23, 2026 19:36
Copy link

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

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
.claude/skills/pull-request/references/monitoring.md (1)

28-29: ⚠️ Potential issue | 🟡 Minor

monitoring.md still has the unconditional --watch — inconsistent with SKILL.md.

The retry loop here has no CHECKS_FOUND guard, so line 29's gh pr checks "$PR" --watch still executes unconditionally after all 5 retries, which can hang indefinitely if CI never starts. SKILL.md (lines 146–164) was updated with the correct guard; this reference snippet was not.

🛠️ Proposed fix — align with SKILL.md
+CHECKS_FOUND=0
 for i in 1 2 3 4 5; do
   if output=$(gh pr checks "$PR" 2>&1); then
     if echo "$output" | grep -q "no checks reported"; then
       sleep 30  # checks not started yet
     else
-      echo "$output" && break  # checks detected
+      echo "$output" && CHECKS_FOUND=1 && break  # checks detected
     fi
   else
     echo "$output" >&2 && sleep 30  # gh command failed, retry
   fi
 done
-gh pr checks "$PR" --watch
+[ "$CHECKS_FOUND" -eq 1 ] && gh pr checks "$PR" --watch
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/skills/pull-request/references/monitoring.md around lines 28 - 29,
The snippet in monitoring.md runs gh pr checks "$PR" --watch unconditionally;
replicate the SKILL.md fix by guarding the final watch invocation with the same
CHECKS_FOUND check used in the retry loop: only run gh pr checks "$PR" --watch
if CHECKS_FOUND is true (i.e., wrap the command in the same conditional used in
SKILL.md), ensuring the retry loop's CHECKS_FOUND variable controls whether the
watch is executed to avoid hanging when CI never starts.
🧹 Nitpick comments (1)
.claude/skills/pull-request/references/monitoring.md (1)

86-92: Use GraphQL variables instead of a hard-coded string literal for THREAD_ID.

Single quotes prevent shell variable expansion, so "THREAD_ID" in the mutation is treated as a literal string. The idiomatic gh api graphql approach is to pass the value as a GraphQL variable using an additional field flag (e.g., -f threadId="$THREAD_ID"), which avoids quoting issues entirely.

♻️ Proposed refactor — use GraphQL variable binding
+THREAD_ID="<id-from-list-query>"
 gh api graphql -f query='mutation {
-  resolveReviewThread(input: {threadId: "THREAD_ID"}) {
+  resolveReviewThread(input: {threadId: $threadId}) {
     thread { isResolved }
   }
-}'
+}' -f threadId="$THREAD_ID"

Or equivalently, declare the variable in the operation signature:

THREAD_ID="<id-from-list-query>"
gh api graphql \
  -f threadId="$THREAD_ID" \
  -f query='mutation Resolve($threadId: ID!) {
    resolveReviewThread(input: {threadId: $threadId}) {
      thread { isResolved }
    }
  }'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/skills/pull-request/references/monitoring.md around lines 86 - 92,
Replace the hard-coded string literal "THREAD_ID" in the GraphQL mutation passed
to gh api graphql with a GraphQL variable binding: declare a variable (e.g.,
threadId) in the mutation signature and pass its value via gh's -f flag (for
example -f threadId="$THREAD_ID"), then use that variable in the
resolveReviewThread input (input: {threadId: $threadId}) so shell variable
expansion works correctly and avoids the single-quote quoting issue.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.claude/skills/pull-request/references/monitoring.md:
- Around line 28-29: The snippet in monitoring.md runs gh pr checks "$PR"
--watch unconditionally; replicate the SKILL.md fix by guarding the final watch
invocation with the same CHECKS_FOUND check used in the retry loop: only run gh
pr checks "$PR" --watch if CHECKS_FOUND is true (i.e., wrap the command in the
same conditional used in SKILL.md), ensuring the retry loop's CHECKS_FOUND
variable controls whether the watch is executed to avoid hanging when CI never
starts.

---

Nitpick comments:
In @.claude/skills/pull-request/references/monitoring.md:
- Around line 86-92: Replace the hard-coded string literal "THREAD_ID" in the
GraphQL mutation passed to gh api graphql with a GraphQL variable binding:
declare a variable (e.g., threadId) in the mutation signature and pass its value
via gh's -f flag (for example -f threadId="$THREAD_ID"), then use that variable
in the resolveReviewThread input (input: {threadId: $threadId}) so shell
variable expansion works correctly and avoids the single-quote quoting issue.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 95ead39 and c61b023.

📒 Files selected for processing (2)
  • .claude/skills/pull-request/SKILL.md
  • .claude/skills/pull-request/references/monitoring.md

@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.86%. Comparing base (0792497) to head (2af2bef).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3160   +/-   ##
=======================================
  Coverage   89.86%   89.86%           
=======================================
  Files          52       52           
  Lines        1164     1164           
  Branches      234      234           
=======================================
  Hits         1046     1046           
  Misses        107      107           
  Partials       11       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PierreBrisorgueil PierreBrisorgueil merged commit b47c0a2 into master Feb 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Neither fixes a bug nor adds a feat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(claude): rename pr skill to pull-request and fix automation gaps

1 participant