GitHub CLI — draft PR (HOW)
Use this skill when the remote is GitHub and you need to push and open a draft pull request. Workflow skills delegate here; this skill does not replace Jira or ClickUp procedures.
Prerequisites
ghauthenticated (gh auth status).- Branch pushed to
origin(or the remote your team uses).
Recommended flow
- Ensure the working branch tracks the remote: push with upstream as usual for the repo.
- Prefer the repository PR template for the body: use
--body-filepointing at a generated file that includes template sections, or paste from.github/pull_request_template.mdwhen required. If no template exists in the repo, usepr-fallback(WHAT) to build the body andoutput-handshaketo confirm where the file lives and that a human will review beforegh pr create. - Create a draft PR:
bashgh pr create --draft --title "YOUR_TITLE" --body-file /path/to/body.md
If the repo expects a base branch other than the default:
bashgh pr create --draft --base develop --title "YOUR_TITLE" --body-file /path/to/body.md
- If
--draftis rejected bygh, retry once without--draftand state in chat that the PR could not be created as draft via CLI.
Title and body
- Keep titles within team conventions (often including ticket keys).
- Validate title and body with the user before calling the step complete.
Fallback (CLI failure)
- Write an untracked file
PR_DESCRIPTION_<WORK_ITEM_ID>.mdin the repo root or/tmpwith title + body ready to paste. - Do not
git addthis file. - Give manual steps: open the compare URL on GitHub and create a draft PR from the branch, pasting from the file.
Safety
- Do not expose tokens or paste secrets into PR bodies.
- Do not force-push shared default branches unless the user explicitly requests it.


