work-ship
Work ship
Take a work branch from "committed" to "in review". Run every command against the branch's worktree path. The reviewer is the one the user names in the arguments, or else the PR reviewer the repo's AGENTS.md names; with neither, ask. The issue always goes to the reviewer.
A review round is a run on an open PR that has a review requesting changes. In a review round, review is re-requested from the change requesters: every user whose latest review on the PR is REQUEST_CHANGES, read in order from gt api repos/<owner>/<repo>/pulls/<pr>/reviews.
Steps
-
Check the branch. Read the branch name, take the issue number from it (
jd-<n>-...orjd-<n>/...), and rungit log origin/development..HEAD --onelineandgit status --short. Look for an open PR whose head is this branch withgt pr list -R <owner>/<repo> --head <branch> --json number,title. With an open PR, read its reviews and list the change requesters. Done when you hold the issue number, at least one commit ahead ofdevelopment, a clean working tree, the open PR number or none, and, for an open PR, whether this is a review round and who the change requesters are. Stop and report when the tree has uncommitted changes or the branch has no commits. -
Draft the PR. In a review round, compare the PR body with the commits pushed since the change request: when the body still describes the branch, keep it, say so in one line, and skip this step and step 4. Otherwise read
~/.agents/skills/work-pr-info/SKILL.mdand follow its steps 1 to 6; running inside this skill, the PR counts as ready for review unless the user said otherwise. Give the draft path and the title in one line, then stop until the user approves it or asks for changes. Done when the user has approved<root>/tmp/draft-pr-<n>.md(<root>as work-pr-info defines it) as it stands. -
Push. Run the push as one plain command, with nothing chained before or after it:
git -C <path> push -u origin <branch>A chained push was denied in auto mode before any prompt appeared. Done when the remote branch matches
HEAD.