Babysit PR
Your job is to babysit this PR until it is ready for human review - reviewed by Copilot, addressed, verified, and CI green. Keep it as a draft and assign it to the current user. The human decides when to open and merge it.
Mandatory first action
The first PR mutation is the Copilot review request. Do this before checking CI, reporting status, or waiting:
- Resolve the PR URL and repository, and capture
headRefOid. - Ensure the PR is a draft and assigned to the current user.
- Inspect
reviewRequestsandreviewsfor that head. If there is no completed Copilot review for the currentheadRefOid, request one immediately withgh pr edit <pr_url> --add-reviewer "@copilot". - Run a fresh PR lookup and verify that Copilot is either requested or has already submitted a review for the captured head.
The invocation is incomplete until this gate has passed. A CI-only status check is not a babysit completion.
Polling protocol
Relentlessly poll until copilot has submitted a review for the current head commit, but keep every tool call bounded:
- Run one status lookup per tool call. Never start an unbounded shell loop or background poller.
- Fail the command immediately if the
ghlookup fails; a failed lookup is not a pending review. - Inspect a fresh
gh pr view --json headRefOid,reviewRequests,reviewsresponse on every lookup. Scan all reviews; response order is not significant. Compare each copilot review'scommit.oidwithheadRefOid. A review of an earlier head is stale. - If the current head is still pending, use a bounded wait of at most 30 seconds before the next lookup. Each tool call must return after that lookup.
- Copilot is complete only when a review authored by
copilot-pull-request-reviewerhas a non-nullsubmittedAtand itscommit.oidequals the current head commit. - Treat user interruptions and GitHub review links as new status evidence, not as reasons to reuse the previous polling result. Query a supplied review URL or ID, then run a fresh PR lookup. If no current-head review appears, wait up to 10 seconds and look up the PR once more before reporting that the review is missing or stale; GitHub may publish the review between polls or expose it with brief eventual consistency.
After completion, fetch unresolved inline threads through pullRequest.reviewThreads; the review summary alone is not the feedback.
jj workspace add workspaces may not contain .git, so gh cannot infer the repository there. Capture OWNER/REPO before creating or entering an amends workspace, and pass --repo OWNER/REPO to every repository-dependent gh command.
Follow the "review-amends" skill.
Once "review-amends" completes, capture the new GitHub head commit, request another review from copilot as the mandatory first action for the new head, and repeat the bounded polling protocol. Never let a review of the previous head satisfy the new review cycle.
Repeat until there is no more work to be done.
Finish state
Assign the PR to the current user with gh pr edit <pr_url> --add-assignee "@me". Verify the final head has a completed Copilot review, CI is green, and isDraft is true. If the PR is not a draft, return it to draft with gh pr ready <pr_url> --undo. Never call gh pr ready without --undo.