pr
Publish one green slice as one PR in a base-branch stack and hand it to the reviewer, human or bot.
What it does
/factory:pr opens a pull request or merge request for the current slice
branch, targeting its parent branch in the stack, with a body built from
the verify evidence. It runs only when the user explicitly invokes it or
asks to open a PR. It never opens one on its own initiative, refuses on a
red tree, never opens drafts, and never merges.
Reads
factory.tomlforbase.plan.mdfor the slice’sBranch,Parent, and tracker item..verify/greenand.verify/summary.txtfor the evidence.git remote -vandgh auth statusorglab auth status.
Steps
- Confirm the user invoked the skill. Resolve the forge and check auth. Stop on failure; never run a login.
- Refuse when
.verify/greendoes not match the current change or when there are uncommitted changes. Do not commit them. - Rebase the slice branch onto the tip of its parent when the parent
moved, then rerun
/factory:verify. - Push with
git push -u origin <branch>. - Write the body from the PR template, with the verification numbers
from
.verify/summary.txtand a mention of the tracker item. - Create or update the PR with
--base <parent>(the root slice targetsbase), read it back, and confirm base, head, title, and that it is not a draft. An open PR for the same head branch is reused. - If the repository has a CodeRabbit config or a GitHub app review will
run, stop and post the URL. Otherwise say no bot review is configured
and suggest
/factory:review.
–stack
/factory:pr --stack runs the steps above once per slice, bottom up, for
every slice in plan.md whose branch exists. Each body carries a stack
table (NN | branch | parent | PR); once the last PR is open the earlier
bodies are updated so every table is complete. The first slice that
refuses, red or dirty, stops the walk, and the reply says which PRs were
opened.
After the PR
Driving the stack to merge-ready through conflicts, review threads, and
CI is steward.
Rules
- Never
--draft. Never merge. Never force-push. Never pushbase. - Plain words, short sentences, no em dashes in the body.
Done when
The PR URL is posted, it targets the right parent, it is not a draft, and the body carries real verify evidence.
Upstream
Wraps the cursor-plugins/pstack opening-a-PR playbook for commits,
titles, descriptions, stacks, and readiness, and mattpocock-skills/pr
for the evidence and merge-danger sections. Upstream’s Origin, Graphite,
and swarm tools do not exist here; only gh and glab are used.