Skip to content

feat: add shipping-pr skill for end-to-end PR lifecycle automation - #18

Merged
ether-moon merged 3 commits into
mainfrom
pr-ship-skill
Apr 20, 2026
Merged

feat: add shipping-pr skill for end-to-end PR lifecycle automation#18
ether-moon merged 3 commits into
mainfrom
pr-ship-skill

Conversation

@ether-moon

@ether-moon ether-moon commented Apr 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add shipping-pr skill and /skill-set:pr:ship command that drive a PR from creation to clean-merge-ready state without manual intervention between cycles
  • Closes the gap between /skill-set:git:pr (create only) and /skill-set:pr:fix (one-shot blocker resolution)
  • Reuses existing components: delegates PR creation to managing-git-workflow, blocker resolution to resolving-pr-blockers

Changes

  • plugins/skill-set/skills/shipping-pr/SKILL.md (168 lines) — workflow orchestration: env check, PR discovery, CodeRabbit detection, cycle loop skeleton
  • plugins/skill-set/skills/shipping-pr/reference/polling.md — Steps 2–4: check-runs registration wait, chunked CI stabilization, commit_id-filtered CodeRabbit incremental review
  • plugins/skill-set/skills/shipping-pr/reference/blocker-resolution.md — Steps 5–8: blocker assessment, resolver dispatch, convergence check, cycle bookkeeping
  • plugins/skill-set/skills/shipping-pr/reference/troubleshooting.md — six common pitfalls with Problem/Fix pairs
  • plugins/skill-set/commands/pr/ship.md — thin wrapper command exposing flags
  • AGENTS.md — adds shipping-pr to the skill list and project structure

Design Highlights

  • Race-free polling: HEAD SHA tracking + commits/{SHA}/check-runs registration wait eliminates stale-check false-clean exits
  • Bash 10-min cap workaround: chunked gh pr checks --watch at 540s with model re-entry between chunks
  • macOS portable: auto-detects timeout vs gtimeout, fails fast with install guidance if neither found
  • Convergence single signal: "did the resolver produce a new commit?" + HARD_BLOCKERS flag disambiguates clean exit from stuck exit
  • CodeRabbit recency check: gh pr list --state merged --limit 1 is more reliable than .coderabbit.yaml (org-level installs have no repo config)

Test Plan

  • Trigger sanity: /skill-set:pr:ship on a branch without a PR — verify PR creation flow runs
  • CI failure path: deliberately break CI, run ship — verify resolver dispatches and re-polls after fix
  • Convergence failure: introduce an unfixable blocker — verify exit 1 with stuck message
  • Clean PR path: ship a PR with no blockers — verify exit 0 without spurious resolver dispatch
  • CodeRabbit timeout: ship in a repo without CodeRabbit configured — verify WAIT_CR=false skips Step 4
  • --max-cycles 1 cap: verify loop terminates after one cycle
  • --required-only=false: verify advisory checks are awaited
  • macOS without coreutils: verify Step 0 fails fast with install guidance

Summary by CodeRabbit

  • New Features

    • Added an end-to-end automated PR workflow that creates PRs, polls CI and reviews, detects and resolves blockers, and repeats fix cycles until the PR is clean or stops.
    • Exposed via a new /skill-set:pr:ship command with flags for max cycles, CI timeout, review timeout, and toggles for PR creation and review waiting.
  • Documentation

    • Added detailed guidance for polling, blocker resolution, troubleshooting, and reorganized related skill reference docs.

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.
@coderabbitai

coderabbitai Bot commented Apr 20, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@ether-moon has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 47 minutes and 5 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4b6f1322-7fec-42f9-9c5c-992c7e102b55

📥 Commits

Reviewing files that changed from the base of the PR and between b2f6e2a and 6acd368.

📒 Files selected for processing (1)
  • plugins/skill-set/skills/using-skill-set/SKILL.md
📝 Walkthrough

Walkthrough

Adds a new top-level skill, shipping-pr (invoked via /skill-set:pr:ship), that automates an end-to-end PR loop: PR discovery/optional creation, CI and CodeRabbit polling, delegating blocker resolution to resolving-pr-blockers, and repeating fix/push cycles until the PR is clean or convergence fails. Includes main spec and reference docs.

Changes

Cohort / File(s) Summary
Top-level docs & command
AGENTS.md, plugins/skill-set/commands/pr/ship.md
Adds /skill-set:pr:ship command doc and updates agents overview to include the shipping-pr flow and flags (--max-cycles, --ci-timeout, --review-timeout, --no-coderabbit, --no-create, --required-only).
New skill spec
plugins/skill-set/skills/shipping-pr/SKILL.md
Introduces the shipping-pr skill: PR discovery/creation, guarded CI polling, optional CodeRabbit waiting, blocker detection, dispatch of resolving-pr-blockers, SHA-based convergence checks, cycle counting, and environment/tool notes.
Reference: polling
plugins/skill-set/skills/shipping-pr/reference/polling.md
Documents polling steps: headRefOid guard, chunked CI stabilization (gh pr checks --watch) with per-cycle deadlines, and commit-filtered CodeRabbit review waiting.
Reference: blocker resolution
plugins/skill-set/skills/shipping-pr/reference/blocker-resolution.md
Describes computing CI failures, mergeability retry, conflict detection, dispatching resolving-pr-blockers with PRE_SHA/POST_SHA capture, and convergence/failure exit codes based on SHA changes and HARD_BLOCKERS.
Reference: troubleshooting
plugins/skill-set/skills/shipping-pr/reference/troubleshooting.md
Adds six common failure modes and corrective actions covering SHA timing, review filtering, advisory checks handling, mergeable UNKNOWN cases, resolver-commit signaling, and polling vs fixed-sleep pitfalls.
Docs reorganization
plugins/skill-set/skills/driving-with-tests/...
Nests reference/ under skills/driving-with-tests/ and explicitly adds test-design.md and probing.md into that folder (documentation restructure).

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I hopped in to ship a PR so bright,
Polling checks by day and reviews by night,
When blockers appear, I call a friend to try,
Push, wait, compare SHAs — repeat till it's dry.
Off it goes, with a happy little sigh.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: introduction of a new 'shipping-pr' skill for automating the end-to-end PR lifecycle.
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
  • Commit unit tests in branch pr-ship-skill

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.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between a8a6bcf and e228780.

📒 Files selected for processing (6)
  • AGENTS.md
  • plugins/skill-set/commands/pr/ship.md
  • plugins/skill-set/skills/shipping-pr/SKILL.md
  • plugins/skill-set/skills/shipping-pr/reference/blocker-resolution.md
  • plugins/skill-set/skills/shipping-pr/reference/polling.md
  • plugins/skill-set/skills/shipping-pr/reference/troubleshooting.md

Comment thread AGENTS.md Outdated
Comment thread plugins/skill-set/commands/pr/ship.md Outdated
Comment thread plugins/skill-set/skills/shipping-pr/SKILL.md Outdated
- 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
@ether-moon

Copy link
Copy Markdown
Owner Author

pr-review-feedback summary (shipping-pr cycle 1)

Resolved all 4 unresolved CodeRabbit threads from review 4137971945 on SHA e2287804.

File Issue Resolution
AGENTS.md (L114-115) shipping-pr subtree missing reference/ files Added polling.md, blocker-resolution.md, troubleshooting.md under the shipping-pr node
plugins/skill-set/commands/pr/ship.md (L9-10) --ci-timeout 30m / --review-timeout 10m examples conflict with skill contract (MIN integer minutes) Replaced with 30 / 10 and clarified "in minutes"
plugins/skill-set/skills/shipping-pr/reference/blocker-resolution.md (L47) sleep 2 shorter than the documented 3-second UNKNOWN-mergeable retry convention; risk of stale headRefOid Bumped to sleep 3
plugins/skill-set/skills/shipping-pr/SKILL.md (L30-44) Three command-example fences missing language identifier (markdownlint MD040) Added text to all three fences

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 b2f6e2a. The shipping-pr orchestrator will re-poll on the new HEAD.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 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 & Flags

Based 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:

  1. Read and manually follow that reference file's workflow
  2. Programmatically invoke the managing-git-workflow skill
  3. 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

📥 Commits

Reviewing files that changed from the base of the PR and between e228780 and b2f6e2a.

📒 Files selected for processing (4)
  • AGENTS.md
  • plugins/skill-set/commands/pr/ship.md
  • plugins/skill-set/skills/shipping-pr/SKILL.md
  • plugins/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.
@ether-moon
ether-moon merged commit 14a2f67 into main Apr 20, 2026
1 check passed
@ether-moon
ether-moon deleted the pr-ship-skill branch April 20, 2026 08:37
ether-moon added a commit that referenced this pull request Apr 20, 2026
Minor bump for the new shipping-pr skill (PR #18) — adds the
end-to-end PR ship orchestrator and the /skill-set:pr:ship command,
both shipped in 14a2f67.
ether-moon added a commit that referenced this pull request Apr 20, 2026
Back-fill the CHANGELOG entry that should have accompanied the 1.10.0
version bump in b78d029. Documents the new shipping-pr skill and
/skill-set:pr:ship command from PR #18.
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.

1 participant