ship-pr
Invoking this skill authorizes branch creation, staging, commits, pushes, PR
creation or updates, and eligible comment replies needed to prepare one PR for
merge. It does not authorize the merge itself.
If references/repo-specific-pr-policy.md exists, read it before starting the
workflow and treat it as authoritative.
Inputs
Require a pr_worker dispatch target and use /dispatch-agent for every
dispatch. Relay any additional caller input in every pr_worker prompt.
Unless the user narrows the scope, include the entire current working tree.
Workflow
Create a branch when repository norms require one. Commit the intended
changes, push, and create or reuse the PR. Derive its title from the changes
and fill assets/pr-body-template.md, removing unused sections and
placeholders.
Start one watcher in a managed background session. Keep it running until the
PR merges or the workflow stops, then stop it. If it exits after a transient
transport failure, refetch authoritative state and restart it with the same
append-only log.
bash <skill_dir>/scripts/watch-pr-events.sh \
--repo <owner/name> \
--pr <pr-number> \
--log-file .agent-layer/tmp/ship-pr-events-<pr-number>.jsonl \
--interval-seconds 300
Fetch the current head, checks, and mergeability with gh. Read comments
with this stateless command; never infer current state from the watcher log:
bash <skill_dir>/scripts/read-pr-comments.sh \
--repo <owner/name> \
--pr <pr-number>
Dispatch pr_worker for unresolved feedback with the exact PR, head, and
references/address-pr-comments.md; for a failed required check, also
provide its evidence and references/fix-ci.md. The worker edits the local
tree but does not commit, push, or post replies. Resolve mechanical conflicts
automatically.
The PR is ready to merge only when:
- The PR is mergeable at its latest head.
- At least one agent or human reviewer has posted feedback as a formal review
or comment.
- Every required check and repository gate is green.
- Every eligible comment has a validated reply.
- If the optional repository policy exists, every merge criterion it defines
is met.
If no agent or human reviewer posts feedback within 10 minutes of PR
creation, stop and report that no feedback was received. If ready, continue
to step 5. Otherwise, address the full actionable round before committing.
Commit and push accepted fixes. Post each supported worker-proposed reply one
at a time: reply natively to inline comments; for conversation comments or
review summaries, post an issue comment linking the source. Rerun the comment
command and correct any missing or unsupported reply. Return to step 3 until
ready. If only checks or reviews are pending, wait for the watcher.
Request single-use merge authorization for the exact PR and head. Report any
substantive findings, a concise comment disposition summary, and readiness
evidence.
After authorization, refetch the head, checks, mergeability, and comments.
Confirm the local tree is complete and every eligible comment has a supported
posted reply. If anything changed, return to step 3 and obtain new
authorization for the resulting PR head; otherwise merge.
Confirm the checkout is clean, switch to the default branch, fast-forward it,
and delete branches or worktrees created by this workflow. Preserve state and
report any cleanup that is unsafe to perform.
1---2name: ship-pr3description: Ship one pull request, monitor hosted CI and review feedback, follow PR policy, and request authorization before merging and cleaning up.4---56# ship-pr78Invoking this skill authorizes branch creation, staging, commits, pushes, PR9creation or updates, and eligible comment replies needed to prepare one PR for10merge. It does not authorize the merge itself.1112If `references/repo-specific-pr-policy.md` exists, read it before starting the13workflow and treat it as authoritative.1415## Inputs1617Require a `pr_worker` dispatch target and use `/dispatch-agent` for every18dispatch. Relay any additional caller input in every `pr_worker` prompt.1920Unless the user narrows the scope, include the entire current working tree.2122## Workflow23241. Create a branch when repository norms require one. Commit the intended25 changes, push, and create or reuse the PR. Derive its title from the changes26 and fill `assets/pr-body-template.md`, removing unused sections and27 placeholders.28292. Start one watcher in a managed background session. Keep it running until the30 PR merges or the workflow stops, then stop it. If it exits after a transient31 transport failure, refetch authoritative state and restart it with the same32 append-only log.3334 ```bash35 bash <skill_dir>/scripts/watch-pr-events.sh \36 --repo <owner/name> \37 --pr <pr-number> \38 --log-file .agent-layer/tmp/ship-pr-events-<pr-number>.jsonl \39 --interval-seconds 30040 ```41423. Fetch the current head, checks, and mergeability with `gh`. Read comments43 with this stateless command; never infer current state from the watcher log:4445 ```bash46 bash <skill_dir>/scripts/read-pr-comments.sh \47 --repo <owner/name> \48 --pr <pr-number>49 ```5051 Dispatch `pr_worker` for unresolved feedback with the exact PR, head, and52 `references/address-pr-comments.md`; for a failed required check, also53 provide its evidence and `references/fix-ci.md`. The worker edits the local54 tree but does not commit, push, or post replies. Resolve mechanical conflicts55 automatically.5657 The PR is ready to merge only when:5859 - The PR is mergeable at its latest head.60 - At least one agent or human reviewer has posted feedback as a formal review61 or comment.62 - Every required check and repository gate is green.63 - Every eligible comment has a validated reply.64 - If the optional repository policy exists, every merge criterion it defines65 is met.6667 If no agent or human reviewer posts feedback within 10 minutes of PR68 creation, stop and report that no feedback was received. If ready, continue69 to step 5. Otherwise, address the full actionable round before committing.70714. Commit and push accepted fixes. Post each supported worker-proposed reply one72 at a time: reply natively to inline comments; for conversation comments or73 review summaries, post an issue comment linking the source. Rerun the comment74 command and correct any missing or unsupported reply. Return to step 3 until75 ready. If only checks or reviews are pending, wait for the watcher.76775. Request single-use merge authorization for the exact PR and head. Report any78 substantive findings, a concise comment disposition summary, and readiness79 evidence.80816. After authorization, refetch the head, checks, mergeability, and comments.82 Confirm the local tree is complete and every eligible comment has a supported83 posted reply. If anything changed, return to step 3 and obtain new84 authorization for the resulting PR head; otherwise merge.85867. Confirm the checkout is clean, switch to the default branch, fast-forward it,87 and delete branches or worktrees created by this workflow. Preserve state and88 report any cleanup that is unsafe to perform.