chore(claude): rename pr skill to pull-request and fix automation gaps#3568
chore(claude): rename pr skill to pull-request and fix automation gaps#3568PierreBrisorgueil merged 4 commits intomasterfrom
Conversation
- 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 #3566
📝 WalkthroughWalkthroughRenames the Changes
Sequence Diagram(s)sequenceDiagram
participant Agent as Agent (skill)
participant Repo as Repository
participant GitHub as GitHub (PR)
participant CI as CI System
Agent->>Repo: create branch & commit (draft)
Agent->>GitHub: open PR (draft)
GitHub->>CI: trigger CI run
CI-->>Agent: report CI status (pending → success/failure)
alt CI success
Agent->>GitHub: fetch review threads/comments
Agent->>Agent: classify feedback (actionable vs informational)
alt actionable found
Agent->>Repo: apply batched fixes & push
Agent->>GitHub: reply to threads (post-push)
GitHub->>CI: retrigger CI
end
else CI failing
Agent->>Agent: retry/wait per loop rules (retries, grace periods)
end
opt stop conditions
Agent->>GitHub: mark PR ready/complete or stop after iteration cap
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR renames the PR skill from /pr to /pull-request and fixes multiple automation gaps in the PR monitoring loop workflow. The rename addresses an issue where the skill wasn't being loaded into Claude Code's system reminder due to an excessively long description. The automation fixes improve the reliability and correctness of the autonomous PR monitoring workflow.
Changes:
- Renamed skill directory from
.claude/skills/pr/to.claude/skills/pull-request/with shortened description - Added critical automation fixes: push-before-reply order, CI retry fallback with 5 attempts, preliminary review pass after
gh pr ready, unresolved-threads-only tracking, and clarified safety limits - Updated references in CLAUDE.md and feature skill to use
/pull-request
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| CLAUDE.md | Updated skill reference from /pr to /pull-request and added reminder to always use the skill when shipping work |
| .claude/skills/pull-request/SKILL.md | New location for renamed skill with automation gap fixes: push-before-reply ordering, CI retry logic, preliminary review pass, unresolved threads tracking, and monitor loop clarifications |
| .claude/skills/pull-request/references/monitoring.md | New location for monitoring reference with enhanced documentation of unresolved threads query as source of truth and branch protection status checks |
| .claude/skills/pr/SKILL.md | Deleted (moved to pull-request/) |
| .claude/skills/pr/references/monitoring.md | Deleted (moved to pull-request/) |
| .claude/skills/feature/SKILL.md | Updated to invoke /pull-request after verify passes |
…ination, variables
There was a problem hiding this comment.
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/references/monitoring.md:
- Around line 57-59: The jq expression used in the command incorrectly
references the JSON field as line (a bare identifier) instead of .line; update
the jq mapping in the gh api pipeline (the jq 'map({id, user: .user.login, body:
.body[0:100], line})' fragment) to use .line so it extracts the JSON field
properly (i.e., replace line with .line).
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 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.mdAGENTS.mdREADME.md
💤 Files with no reviewable changes (1)
- .github/prompts/pr.prompt.md
✅ Files skipped from review due to trivial changes (1)
- .github/prompts/pull-request.prompt.md
…older, jq line field
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.claude/skills/pull-request/SKILL.md (1)
231-232: Optional: vary repeated sentence starts.Both sentences begin with “After”; consider combining or rephrasing for readability.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude/skills/pull-request/SKILL.md around lines 231 - 232, Combine the two consecutive sentences that both start with "After" into a single, clearer sentence to avoid repetition; e.g., rephrase to cover both cases (regular push and force-push) and vary the sentence start. Locate the two sentences ("After a regular push, wait 30s before watching CI..." and "After a force-push (post-rebase), wait 30s before watching...") in the SKILL.md text and replace them with one sentence that mentions both scenarios and the 30s wait, or reword one to start differently (e.g., "When you regular-push or force-push (post-rebase), wait 30s before watching CI because new runs take time to register and old runs are cancelled.").
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.claude/skills/pull-request/SKILL.md:
- Around line 231-232: Combine the two consecutive sentences that both start
with "After" into a single, clearer sentence to avoid repetition; e.g., rephrase
to cover both cases (regular push and force-push) and vary the sentence start.
Locate the two sentences ("After a regular push, wait 30s before watching CI..."
and "After a force-push (post-rebase), wait 30s before watching...") in the
SKILL.md text and replace them with one sentence that mentions both scenarios
and the 30s wait, or reword one to start differently (e.g., "When you
regular-push or force-push (post-rebase), wait 30s before watching CI because
new runs take time to register and old runs are cancelled.").
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.claude/skills/pull-request/SKILL.md.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
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.claude/skills/pull-request/references/monitoring.md (1)
20-25: Prefer JSON output to avoid brittle string parsing.Relying on
"no checks reported"is fragile (output/localization changes). Use--json/--jqto detect zero checks more robustly.♻️ Suggested update
- 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" && CHECKS_FOUND=1 && break # checks detected - fi + if checks_count=$(gh pr checks "$PR" --json name --jq 'length' 2>/dev/null); then + if [ "$checks_count" -eq 0 ]; then + sleep 30 # checks not started yet + else + gh pr checks "$PR" && CHECKS_FOUND=1 && break # checks detected + fi else echo "$output" >&2 && sleep 30 # gh command failed, retry fi🤖 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 20 - 25, The script currently parses gh pr checks "$PR" text output and looks for the literal "no checks reported", which is brittle; instead call gh pr checks "$PR" with --json (e.g., --json checkSuites or --json nodes) and use jq or gh --jq to inspect the returned array length, set CHECKS_FOUND when the array length is >0, and treat length==0 as "no checks yet" (sleep and retry); update the invocation replacing the plain capture of output and the grep check with the JSON call and a jq/--jq-based condition that robustly detects zero checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.claude/skills/pull-request/references/monitoring.md:
- Around line 20-25: The script currently parses gh pr checks "$PR" text output
and looks for the literal "no checks reported", which is brittle; instead call
gh pr checks "$PR" with --json (e.g., --json checkSuites or --json nodes) and
use jq or gh --jq to inspect the returned array length, set CHECKS_FOUND when
the array length is >0, and treat length==0 as "no checks yet" (sleep and
retry); update the invocation replacing the plain capture of output and the grep
check with the JSON call and a jq/--jq-based condition that robustly detects
zero checks.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3568 +/- ##
=======================================
Coverage 95.93% 95.93%
=======================================
Files 20 20
Lines 516 516
Branches 140 140
=======================================
Hits 495 495
Misses 21 21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
.claude/skills/pr/→.claude/skills/pull-request/and fix multiple automation gaps in the monitor loopprskill 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.Scope
.claude/skills/(internal tooling only, no application code)nonelowValidation
npm run lintnpm testGuardrails check
.env*,secrets/**, keys, tokens)Notes for reviewers
.claude/andCLAUDE.mdSummary by CodeRabbit
/prcommand to/pull-requestacross docs and prompts.