/gitlab:merge-request [create | merge | review | discussions | block] [--draft] [--auto] [--role author|reviewer]from gitlab
Manages GitLab merge requests via glab: create, merge, review, handle discussions, auto-merge, merge trains, and stacked MRs. Use when working with MRs.
Ships in gitlab. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Scripts directory (absolute, for invocations from other skills where ${CLAUDE_SKILL_DIR} points elsewhere): !mkdir -p /tmp/claude/gitlab-skill 2>/dev/null; touch "/tmp/claude/gitlab-skill/${CLAUDE_SESSION_ID}" 2>/dev/null; echo "${CLAUDE_SKILL_DIR}/scripts"
$0 (optional verb) routes to a section below. With no verb, infer the operation from the request.
create: open an MR, see Creating. --draft opens it as a draft.merge: see Merging. --auto enables auto-merge (merge.ts --auto-merge).review: see Reviews. --role reviewer (default) fetches MRs awaiting your review. --role author triages threads on MRs you authored.discussions: see Discussions.block: block an MR until another merges, see blocking.md.Merge only through merge.ts, which handles merge trains, auto-merge, and squash. A bare glab mr merge silently enables auto-merge while a pipeline runs.
bun ${CLAUDE_PLUGIN_ROOT}/scripts/merge.ts
bun ${CLAUDE_PLUGIN_ROOT}/scripts/merge.ts feature-branch --auto-merge --squash
bun ${CLAUDE_PLUGIN_ROOT}/scripts/merge.ts --status 1298 1299 1300
--status prints a read-only readiness line per MR. Use it after a push or rebase, and trust its git-computed rebased_on_target over the API's conflict fields, which lag.
A push cancels queued auto-merge and drops the MR from the merge train. Re-run merge.ts --auto-merge after every push to an MR meant to auto-merge. It is idempotent and retries through the approvals_syncing window after a push. When reset_approvals_on_push is on, also re-request reviewers in the same pass.
To inspect the active train or clear a stuck entry, see merge-trains.md.
Merging one layer of a stack leaves the layer above it targeting the merged branch, and GitLab does not retarget it. After every layer merges, retarget, rebase, and verify the next one per stacked-mrs.md.
git push -u origin feature-branch && glab mr create --fill.--fill populates title and description from commits and cannot combine with --title/--description.--description-file file.md, or - for stdin. gh's --body-file does not exist here.--attach <path> (repeatable) on glab mr create, glab mr update, and glab mr note create.--reviewer and --assignee silently drop unknown usernames. Resolve exact usernames first, then confirm they appear in glab mr view:glab api "projects/:id/members/all?query=<name>" | jq '.[] | {name, username}'
Review feedback goes out as draft notes published together, per review.md, which also covers the review base, code suggestions, and approvals.
review-queue.ts lists MRs awaiting your first review across all projects as [{ url, reference, title }]:
bun ${CLAUDE_SKILL_DIR}/scripts/review-queue.ts
For the underlying GraphQL, reading review state, and grouping every review-requested MR by next actor, see review-state.md.
After a push resets approvals, a note holding only /request_review @user sets that reviewer's reviewState back to UNREVIEWED. See Re-Request Review.
# Open threads, one line each
bun ${CLAUDE_SKILL_DIR}/scripts/discussions.ts list <iid> --resolvable --unresolved --format digest
# Only review-bot threads
bun ${CLAUDE_SKILL_DIR}/scripts/discussions.ts list <iid> --bots --reviewers=${user_config.reviewers}
# Reply in a thread, then resolve it
glab mr note create <iid> --reply <discussion-id> < tmp/reply.md
glab mr note resolve <iid> <discussion-id>
See discussions.md for the other commands, the JSON schema, and API pitfalls.
The glab mr note commands (create, draft, list, resolve, reopen) need glab 1.128 or later. Check glab --version before relying on them. Every script here takes -R group/project to target an MR outside the current checkout.
For any glab api call, read api.md first. It covers jq, error bodies, pagination, path encoding, field types, uploads, and GraphQL.
api.md (opens in a new tab)blocking.md (opens in a new tab)discussions.md (opens in a new tab)merge-trains.md (opens in a new tab)review-state.md (opens in a new tab)review.md (opens in a new tab)scripts/discussions.test.ts (opens in a new tab)scripts/discussions.ts (opens in a new tab)scripts/draft-note.test.ts (opens in a new tab)scripts/draft-note.ts (opens in a new tab)scripts/review-queue.test.ts (opens in a new tab)scripts/review-queue.ts (opens in a new tab)scripts/reviewers.test.ts (opens in a new tab)scripts/reviewers.ts (opens in a new tab)stacked-mrs.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub bendrucker/claude --plugin gitlab2 skills in this plugin
Other plugins' skills for the same job