GitLab CLI — draft MR (HOW)
Use this skill when the remote is GitLab and you need to push and open a draft merge request. Workflow skills delegate here.
Prerequisites
glabauthenticated for the host (glab auth status).- Branch pushed to the documented remote.
Discover draft flags
Run glab mr create --help on the machine—subcommands and flags evolve. Prefer draft / WIP equivalents when available.
Recommended flow
- Push the branch and set upstream per team practice.
- Create an MR body file: use the project’s merge request template when present. If the project has no template, you may align the Markdown with
pr-fallback(same default sections as the org PR body) andoutput-handshakefor where the description file lives and human review—then use that file for--descriptionor the equivalent. - Draft MR (illustrative; confirm flags with
glab --help):
bashglab mr create --draft --title "YOUR_TITLE" --description "$(cat /path/to/body.md)"
If the CLI prefers a file flag, use that instead of shell substitution.
- If draft creation fails, retry with non-draft only if the user accepts, and note the limitation in chat.
Fallback (CLI failure)
- Write untracked
MERGE_REQUEST_DESCRIPTION_<WORK_ITEM_ID>.md(orPR_DESCRIPTION_<ID>.md) with title + body. - Do not
git addit. - Instruct the user to open the GitLab New merge request UI from the branch and paste content, choosing draft if the UI offers it.
Safety
- No secrets in MR descriptions.
- No force-push to shared defaults without explicit user request.


