Create PR — End-to-End Workflow
Standard flow (no PR open yet)
- Preflight (see
SKILL.md): confirm you're not on the base branch, checkgit status, checkgh pr viewfor an existing PR, checkgh --versionfor the--attachgate. - Resolve the base branch —
references/base-branch.md. - Read repo conventions:
AGENTS.md/CLAUDE.mdat the repo root, and.eagerworks/create-pr.jsonif present (references/config.md). A repo's own PR-authoring conventions (title style, required sections, acommitskill's message rules) take precedence over this skill's defaults. - Gather the real diff context instead of guessing what changed:
git status git diff --stat origin/<base>...HEAD git log origin/<base>..HEAD --oneline - Commit anything pending. If the repo has its own
commitskill or documented commit-message convention, follow it; otherwise use Conventional Commits. - Push:
git push -u origin <branch>. - Get screenshots if the change is UI-visible —
references/screenshots.md. - Write the description to a temp file per
references/description.md, then create:gh pr create --base <base> --title "<type>(<scope>): <description>" \ --body-file <file> \ --assignee @me \ --label <label1>,<label2> \ --attach './screenshots/foo.png#Alt text' # repeat per screenshot, omit if none - Fix up anything that wasn't set at creation time, or that only became clear afterward:
gh pr edit <number> --add-assignee @me --add-label <label>
When a PR already exists
Rung 1 of the base-branch ladder already told you this. Don't call gh pr create again — update in place:
gh pr edit <number> --title "..." --body-file <file>
gh pr edit <number> --attach './screenshots/foo.png#Alt text'If the user only asked to fix the title or description, touch only that — don't force-push new commits or re-run the whole checklist unless asked.
When gh is missing or unauthenticated
gh auth statusIf gh isn't installed or isn't authenticated, don't fail the task: write the resolved title, body, and checklist, print them in full, and tell the user how to open the PR themselves (or ask them to run gh auth login and offer to run the gh pr create command once they have). The branch can still be pushed with plain git push in the meantime if that part was requested.
Reviewing an existing PR before editing it
If the user is asking to fix up a PR someone already opened (not necessarily the current branch's own), pull its real state before touching anything:
gh pr view <N> --json number,title,body,baseRefName,headRefName,labels,assigneesDiff the resolved changes against that state rather than starting from a blank template — don't overwrite a description section the user didn't ask you to touch.