glab-mr
glab-mr
User-invoked: /glab-mr to prepare or publish a GitLab MR. Follow the user's requested scope: a draft-only request ends with a local draft; an explicit request to push and create an MR authorizes those steps without asking again. It does not authorize merging.
1. Resolve context and intent
Inspect repository instructions, git status --short --branch, git remote -v, git branch -a, and git log --oneline -10. Verify the hosting service and project; use this workflow only for GitLab. For GitHub, use its corresponding workflow.
Use the installed git-flow skill when available for repository conventions. When installed alone, resolve base/target and commit style from explicit user instructions, repository instructions, then verified remote branches and MR history. Do not assume develop, origin, a ticket prefix, or a universal commit format.
Fetch relevant refs and inspect existing MRs for the source/target pair before creating one. Reuse an open matching MR; if a prior MR merged, compare against the current target and isolate only remaining requested changes. Ask only when ambiguity about scope or target would change the result.
Inspect repository MR templates and the existing MR description, including required sections and established language. Infer the title and description from the complete verified MR diff and ticket context, including previously committed changes. Use requested assignee/reviewer values, otherwise repository defaults if available; omit optional assignments when no evidence identifies them. Verify exact usernames before assigning them.
Completion: project/host, remote, source, target, requested publication scope, and existing MR state are known.
2. Select and verify changes
Read unstaged and staged diffs and inspect relevant untracked files. Preserve unrelated work, including changes already in the index. Stage explicit paths or hunks only; if unrelated staged work would enter the commit, isolate the operation without discarding or committing that work.