feat: add shipping-pr skill for end-to-end PR lifecycle automation - #18
Conversation
Adds /skill-set:pr:ship command that drives a PR from creation to clean-merge-ready state without manual intervention between cycles. - shipping-pr skill orchestrates: PR creation (delegated to managing-git-workflow), CI/CodeRabbit polling, blocker resolution (delegated to resolving-pr-blockers), and re-polling after each fix-push cycle until clean or convergence fails. - Reference files split: polling.md (Steps 2-4), blocker-resolution.md (Steps 5-8), troubleshooting.md (common mistakes). SKILL.md = 168 lines. - Race-free polling via HEAD SHA tracking, commit_id-filtered CodeRabbit reviews, chunked gh pr checks --watch under Bash 10-min cap, macOS timeout/gtimeout auto-detection. - Convergence check uses single signal (did fix produce a new commit?) with HARD_BLOCKERS flag to disambiguate clean exit from stuck exit.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 47 minutes and 5 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a new top-level skill, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ShippingSkill as Shipping-PR Skill
participant GitHub
participant CI as CI (check-runs)
participant CodeRabbit
participant Resolver as resolving-pr-blockers
User->>ShippingSkill: invoke /skill-set:pr:ship [flags]
ShippingSkill->>GitHub: gh pr view / create PR (if needed)
GitHub-->>ShippingSkill: PR metadata (state, headRefOid)
ShippingSkill->>CI: wait for check-runs for headRefOid (guard)
CI-->>ShippingSkill: checks appear / stabilize
ShippingSkill->>CodeRabbit: wait for review filtered by commit_id
CodeRabbit-->>ShippingSkill: review results (or timeout)
ShippingSkill->>ShippingSkill: assess blockers, set HARD_BLOCKERS
alt HARD_BLOCKERS or other blockers
ShippingSkill->>Resolver: dispatch resolving-pr-blockers (repo, PR, PRE_SHA)
Resolver-->>GitHub: push fixes / open review commits
GitHub-->>Resolver: updated headRefOid (POST_SHA)
Resolver-->>ShippingSkill: finished (POST_SHA)
end
ShippingSkill->>ShippingSkill: compare PRE_SHA vs POST_SHA -> continue/exit
ShippingSkill-->>User: final status / post PR summary comment
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@AGENTS.md`:
- Around line 114-115: AGENTS.md's project tree entry for the shipping-pr skill
is incomplete: update the shipping-pr subtree (the entry that currently only
shows SKILL.md) to include the three newly added files reference/polling.md,
reference/blocker-resolution.md, and reference/troubleshooting.md so the
documentation matches the repository layout; locate the shipping-pr block in
AGENTS.md and add lines for reference/polling.md,
reference/blocker-resolution.md, and reference/troubleshooting.md under the
shipping-pr/ node alongside SKILL.md.
In `@plugins/skill-set/commands/pr/ship.md`:
- Around line 9-10: The timeout examples in the ship command docs use duration
strings ("30m"/"10m") but the skill contract expects integer minutes for the
flags --ci-timeout and --review-timeout; update the examples so they use integer
minutes and match the documented flag format (e.g., replace "30m" with "30" and
"10m" with "10"), and ensure the help snippet or usage shows the flags as
`--ci-timeout MIN` and `--review-timeout MIN` with corresponding default values
(30 and 10) to avoid invalid invocations.
In `@plugins/skill-set/skills/shipping-pr/reference/blocker-resolution.md`:
- Around line 44-48: The brief buffer uses sleep 2 which is shorter than the
documented 3-second retry convention and may read a stale headRefOid; update the
delay to sleep 3 so the script waits the full 3 seconds before calling gh pr
view (the POST_SHA assignment that queries .headRefOid) to match the
UNKNOWN-mergeable retry convention and avoid misclassifying progress.
In `@plugins/skill-set/skills/shipping-pr/SKILL.md`:
- Around line 30-44: The three code fences showing example commands (e.g.,
`/skill-set:pr:ship`, `/skill-set:pr:ship --max-cycles 1`, `/skill-set:pr:ship
--required-only=false`) need explicit fence language identifiers to satisfy
markdown linting; update each triple-backtick fence to use a language label such
as "text" (i.e., replace ``` with ```text for those three blocks) so the
examples include a fence language identifier while leaving the command lines
themselves unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: dbf28f23-d451-48fe-a244-531fbaeb7a95
📒 Files selected for processing (6)
AGENTS.mdplugins/skill-set/commands/pr/ship.mdplugins/skill-set/skills/shipping-pr/SKILL.mdplugins/skill-set/skills/shipping-pr/reference/blocker-resolution.mdplugins/skill-set/skills/shipping-pr/reference/polling.mdplugins/skill-set/skills/shipping-pr/reference/troubleshooting.md
- AGENTS.md: complete shipping-pr subtree with reference/ files (polling.md, blocker-resolution.md, troubleshooting.md) - commands/pr/ship.md: fix --ci-timeout/--review-timeout examples to use integer minutes (30, 10) matching the skill contract - shipping-pr/SKILL.md: add `text` language identifier to three command-example fences (markdownlint MD040) - shipping-pr/reference/blocker-resolution.md: extend post-fix buffer from sleep 2 to sleep 3 to match the documented 3-second UNKNOWN-mergeable retry convention and avoid reading stale headRefOid
pr-review-feedback summary (shipping-pr cycle 1)Resolved all 4 unresolved CodeRabbit threads from review 4137971945 on SHA
All 4 items were classified as OBVIOUS (autofixing-and-escalating): each had a precise location, a clear correction, and CodeRabbit-supplied diff suggestions. No AMBIGUOUS items required user input. Committed in |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
plugins/skill-set/skills/shipping-pr/SKILL.md (2)
54-64: Document required dependencies upfront.Per the learning, "List all required package dependencies in SKILL.md and verify they are available in the code execution environment." The skill requires several external tools (git, gh CLI, jq, timeout/gtimeout) but lacks a dedicated Dependencies section.
While lines 70-83 provide install guidance for timeout/gtimeout, other required packages (gh, jq) aren't documented upfront. Based on learnings, add a Dependencies section documenting all required tools and their purposes.
📦 Suggested Dependencies section to add before Defaults & Flags
Insert after line 52:
Always keep in English: bash commands, file paths, technical identifiers. +## Dependencies + +Required external tools: +- **git** — version control operations +- **gh** (GitHub CLI) — PR view, checks, comments +- **jq** — JSON parsing for GitHub API responses +- **timeout** or **gtimeout** — command timing for chunked CI waits + - macOS: `brew install coreutils` (provides gtimeout) + - Linux: usually pre-installed as `timeout` + +The skill detects timeout/gtimeout availability at runtime (Step 0) and fails fast with install guidance if neither is found. + ## Defaults & FlagsBased on learnings: "Applies to **/skills/*/SKILL.md: List all required package dependencies in SKILL.md and verify they are available in the code execution environment"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@plugins/skill-set/skills/shipping-pr/SKILL.md` around lines 54 - 64, Add a new "Dependencies" section above the existing "Defaults & Flags" header that lists all required external tools (git, gh CLI, jq, timeout/gtimeout) and a one-line purpose for each (e.g., git for repo operations, gh for PR creation/inspection, jq for JSON parsing, timeout/gtimeout for enforcing CI/review timeouts), and include a short note that these must be installed in the execution environment (with the existing timeout/gtimeout install guidance retained where it currently exists); update SKILL.md so the Dependencies section is the canonical upfront source of required tools referenced by the rest of the document (Defaults & Flags and the existing install hints).
88-99: Clarify the PR creation delegation mechanism.Lines 92-93 say "Read managing-git-workflow/reference/pr.md and execute it" but don't show HOW the delegation occurs. This creates ambiguity about whether the AI agent should:
- Read and manually follow that reference file's workflow
- Programmatically invoke the managing-git-workflow skill
- Execute a script
Per the learning, "Use descriptive file paths in all documentation and configuration to make execution intent clear." Consider rephrasing to explicitly state the delegation mechanism, e.g.:
fi - # Delegate PR creation to managing-git-workflow's PR workflow - # Read managing-git-workflow/reference/pr.md and execute it + # Delegate PR creation to managing-git-workflow skill + # Follow the workflow defined in managing-git-workflow/reference/pr.md # AFTER creation completes, re-fetch — the delegated workflow does not return PR_JSON.or if there's a programmatic invocation mechanism:
fi - # Delegate PR creation to managing-git-workflow's PR workflow - # Read managing-git-workflow/reference/pr.md and execute it + # Invoke managing-git-workflow skill with PR creation mode + # (see managing-git-workflow/reference/pr.md for workflow details) # AFTER creation completes, re-fetch — the delegated workflow does not return PR_JSON.Based on learnings: "Applies to /skills//*.md: Use descriptive file paths in all documentation and configuration to make execution intent clear (e.g., 'Run script.py' for execution vs. 'See script.py' for reference)"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@plugins/skill-set/skills/shipping-pr/SKILL.md` around lines 88 - 99, The documentation is ambiguous about how PR creation is delegated; update the paragraph that references managing-git-workflow/reference/pr.md so it explicitly states the delegation mechanism (e.g., "Invoke the managing-git-workflow skill's PR workflow by running: gh workflow run pr.yml --ref $BRANCH" or "Run the script managing-git-workflow/reference/pr.md as documented using: ./manage-pr.sh $BRANCH") and indicate that after that programmatic invocation completes the script should re-fetch PR_JSON with gh pr view (the existing PR_JSON, BRANCH, NO_CREATE, and gh pr view symbols should be referenced) so readers know whether to call the other skill programmatically or merely read the reference file.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@plugins/skill-set/skills/shipping-pr/SKILL.md`:
- Around line 54-64: Add a new "Dependencies" section above the existing
"Defaults & Flags" header that lists all required external tools (git, gh CLI,
jq, timeout/gtimeout) and a one-line purpose for each (e.g., git for repo
operations, gh for PR creation/inspection, jq for JSON parsing, timeout/gtimeout
for enforcing CI/review timeouts), and include a short note that these must be
installed in the execution environment (with the existing timeout/gtimeout
install guidance retained where it currently exists); update SKILL.md so the
Dependencies section is the canonical upfront source of required tools
referenced by the rest of the document (Defaults & Flags and the existing
install hints).
- Around line 88-99: The documentation is ambiguous about how PR creation is
delegated; update the paragraph that references
managing-git-workflow/reference/pr.md so it explicitly states the delegation
mechanism (e.g., "Invoke the managing-git-workflow skill's PR workflow by
running: gh workflow run pr.yml --ref $BRANCH" or "Run the script
managing-git-workflow/reference/pr.md as documented using: ./manage-pr.sh
$BRANCH") and indicate that after that programmatic invocation completes the
script should re-fetch PR_JSON with gh pr view (the existing PR_JSON, BRANCH,
NO_CREATE, and gh pr view symbols should be referenced) so readers know whether
to call the other skill programmatically or merely read the reference file.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4c81aba6-555c-45ba-b08a-2e354f1ea257
📒 Files selected for processing (4)
AGENTS.mdplugins/skill-set/commands/pr/ship.mdplugins/skill-set/skills/shipping-pr/SKILL.mdplugins/skill-set/skills/shipping-pr/reference/blocker-resolution.md
✅ Files skipped from review due to trivial changes (2)
- plugins/skill-set/skills/shipping-pr/reference/blocker-resolution.md
- plugins/skill-set/commands/pr/ship.md
🚧 Files skipped from review as they are similar to previous changes (1)
- AGENTS.md
Adds the shipping-pr entry (with /skill-set:pr:ship command and trigger phrases) to the using-skill-set router, immediately after resolving-pr-blockers so the PR lifecycle reads fix → ship in order.
Summary
shipping-prskill and/skill-set:pr:shipcommand that drive a PR from creation to clean-merge-ready state without manual intervention between cycles/skill-set:git:pr(create only) and/skill-set:pr:fix(one-shot blocker resolution)managing-git-workflow, blocker resolution toresolving-pr-blockersChanges
plugins/skill-set/skills/shipping-pr/SKILL.md(168 lines) — workflow orchestration: env check, PR discovery, CodeRabbit detection, cycle loop skeletonplugins/skill-set/skills/shipping-pr/reference/polling.md— Steps 2–4: check-runs registration wait, chunked CI stabilization, commit_id-filtered CodeRabbit incremental reviewplugins/skill-set/skills/shipping-pr/reference/blocker-resolution.md— Steps 5–8: blocker assessment, resolver dispatch, convergence check, cycle bookkeepingplugins/skill-set/skills/shipping-pr/reference/troubleshooting.md— six common pitfalls with Problem/Fix pairsplugins/skill-set/commands/pr/ship.md— thin wrapper command exposing flagsAGENTS.md— adds shipping-pr to the skill list and project structureDesign Highlights
commits/{SHA}/check-runsregistration wait eliminates stale-check false-clean exitsgh pr checks --watchat 540s with model re-entry between chunkstimeoutvsgtimeout, fails fast with install guidance if neither foundHARD_BLOCKERSflag disambiguates clean exit from stuck exitgh pr list --state merged --limit 1is more reliable than.coderabbit.yaml(org-level installs have no repo config)Test Plan
/skill-set:pr:shipon a branch without a PR — verify PR creation flow runsWAIT_CR=falseskips Step 4--max-cycles 1cap: verify loop terminates after one cycle--required-only=false: verify advisory checks are awaitedSummary by CodeRabbit
New Features
/skill-set:pr:shipcommand with flags for max cycles, CI timeout, review timeout, and toggles for PR creation and review waiting.Documentation