| name | gitlab:merge-request |
| description | Working with GitLab merge requests via glab. Use when creating, updating, reviewing, or merging MRs. |
| argument-hint | [create | merge | review | discussions | block] [--draft] [--auto] [--role author|reviewer] |
| allowed-tools | ["Bash(bun ${CLAUDE_SKILL_DIR}/scripts/*:*)","Bash(bun ${CLAUDE_PLUGIN_ROOT}/scripts/merge.ts:*)","Bash(glab mr:*)","Bash(glab api:*)"] |
Merge Requests
Working with GitLab merge requests via glab mr.
Arguments
$0 (optional verb) routes to a section below. With no verb, infer the operation from the request.
create: open an MR. See Patterns. --draft opens it as a draft (glab mr create --draft).
merge: merge the MR. See Merging. --auto enables auto-merge (merge.ts --auto-merge).
review: review MRs. See Reviews. --role reviewer (default) fetches MRs awaiting your review; --role author triages threads on MRs you authored.
discussions: work MR discussion threads. See Discussions.
block: block an MR until another merges. See Blocking.
Flag defaults: --draft off, --auto off, --role reviewer.
Key Commands
glab mr create --fill
glab mr list
glab mr view
glab mr checkout <id>
Use glab mr --help and glab mr <command> --help for full options.
Merging
Always use merge.ts to merge. It handles merge trains, auto-merge, and squash, falling back to glab mr merge internally when appropriate.
bun ${CLAUDE_PLUGIN_ROOT}/scripts/merge.ts
bun ${CLAUDE_PLUGIN_ROOT}/scripts/merge.ts --auto-merge
bun ${CLAUDE_PLUGIN_ROOT}/scripts/merge.ts feature-branch --auto-merge --squash
Patterns
Always push before creating:
git push -u origin feature-branch && glab mr create --fill
Draft MRs: Use --draft to prevent accidental merges.
Auto-fill vs custom: --fill auto-populates from commits but cannot combine with --title/--description. Choose one approach.
Body from file: No --body-file flag; use --description "$(cat file.md)".
Username resolution: Flags like --reviewer and --assignee require exact usernames; invalid names are silently ignored. Look up users first:
glab api projects/:id/members/all --paginate | jq '.[] | select(.name | test("<name>"; "i")) | {name, username}'
Blocking
Prevent an MR from merging until another MR merges first. Uses the REST API since glab mr has no blocking subcommand.
glab api projects/:id/merge_requests/10/blocks -X POST -f blocking_merge_request_iid=5
glab api projects/:id/merge_requests/10/blocks
glab api projects/:id/merge_requests/10/blocks/<block-id> -X DELETE
Reviews
Submit review feedback as draft notes that accumulate before publishing. See review.md for the draft notes workflow, code suggestions, and approvals.
Fetch MRs awaiting your first review across all projects (the UNREVIEWED bucket; REST's scope=reviews_for_me cannot filter by review state). Emits [{ url, reference, title }] as JSON:
bun ${CLAUDE_SKILL_DIR}/scripts/review-queue.ts
See review-state.md for the underlying GraphQL query and filter.
To group all your review-requested MRs by next actor (not just the UNREVIEWED slice), see Review Inbox (Next-Actor Triage) in review-state.md.
Re-request reviewers
Re-trigger a review after a push reset approvals. The mergeRequestReviewerRereview mutation flips the target's reviewState back to UNREVIEWED and re-surfaces the MR. The reviewer must already be assigned. See Re-Request Review for the user-ID lookup and exact mutation.
Discussions
Fetch, filter, resolve, and summarize MR discussion threads. See discussions.md for the discussions script, resolution workflow, and pagination pitfalls.
Stacking
glab stack manages stacked diffs — small changes that build on each other. See stack.md.
Reference Files
- review.md - Draft notes review workflow
- review-state.md - GraphQL mutations for review decisions, the cross-project review queue, and next-actor triage
- discussions.md - Discussion threads and resolution
- stack.md - Stacked diff workflow