'HOW — GitLab CLI (glab): push branch, create draft MR with title/body; fallback untracked
Scanned 9/2/2026
Install to Claude Code
npx -y skills add ulises-jeremias/agent-toolkit --skill gitlab-cli-workflow --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Gitlab Cli Workflow?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/ulises-jeremias-gitlab-cli-workflow-7abde8cf)More formats (shields.io, HTML) on the badges page.
---
name: gitlab-cli-workflow
description: 'HOW — GitLab CLI (glab): push branch, create draft MR with title/body; fallback untracked
markdown. Use when origin is GitLab.'
origin:
type: first-party
---
# 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
- `glab` authenticated 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
1. Push the branch and set upstream per team practice.
2. 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) and **`output-handshake`** for where the description file lives and human review—then use that file for `--description` or the equivalent.
3. **Draft** MR (illustrative; confirm flags with `glab --help`):
```bash
glab 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.
4. If draft creation fails, retry with non-draft **only** if the user accepts, and note the limitation in chat.
## Fallback (CLI failure)
1. Write **untracked** `MERGE_REQUEST_DESCRIPTION_<WORK_ITEM_ID>.md` (or `PR_DESCRIPTION_<ID>.md`) with title + body.
2. **Do not** `git add` it.
3. 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.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!