Open mr
My personal collection of AI skills
npx -y skills add abijith-suresh/skills --skill open-mrAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Pushes the current branch and opens a new GitLab MR via glab CLI. Use only when the user explicitly invokes the open-mr skill. Requires a ticket number. Do not trigger from ordinary requests that mention merge requests.
SKILL.md
3.3 KB, as published. Nobody here has run it
Open MR (GitLab)
Push the current branch and create a new merge request on GitLab.
Prerequisites
glabCLI must be installed and authenticated — verify withglab auth status.- If
glabis missing: "glab CLI is required. Install it from https://gitlab.com/gitlab-org/cli#installation." - Ticket number required in the branch name or conversation.
Steps
1. Check branch state
git branch --show-current
git remote show origin | grep "HEAD branch"
git status --porcelain
- If current branch is
main,master, or the remote default branch — stop: "Cannot open an MR from the default branch. Switch to a feature branch first." - If
git status --porcelainreturns any output — stop: "Uncommitted changes detected. Commit or stash them before opening an MR."
2. Check for existing MR
glab mr list --source-branch <branch-name> -F json
Parse the JSON output. If the array is non-empty — stop: "An MR already exists for this branch. Use update-mr to modify it."
3. Push the branch
git push -u origin <branch-name>
- If push fails — stop and show the exact error.
4. Derive title and body
Run the following to gather branch data:
git log origin/<default-branch>..HEAD --oneline
git log origin/<default-branch>..HEAD --format="%s %b"
git diff origin/<default-branch>..HEAD --stat
Title format:
TICKET-123: Short description
Examples:
PROJ-214: Add investigation workflowPROJ-214: Fix target branch detection
MR body template:
## Summary
[What changed and why. 2–3 concise sentences.]
## Changes
- [Specific action taken]
- [Specific action taken]
## Testing
- [ ] [Specific verification step]
- [ ] [Edge case or regression check]
## Notes
[Risks, follow-ups, rollout notes, or reviewer context. Omit this section if
there is nothing useful to say.]
Rules:
- Derive the Testing checklist from the real changes, not a generic template
- Each Changes bullet describes an action, not just a file name
- Omit
Notesif there is nothing useful to say - No References section — the ticket is already in the title
5. Create the MR
glab mr create \
--title "<title>" \
--description "<body>" \
--push \
--yes
Note: --push pushes the branch first, then creates the MR. --yes skips the confirmation prompt.
6. Report
Print the MR URL returned by glab mr create. Note any follow-up the user still needs to do manually.
Failure Conditions
| Condition | Message |
|---|---|
glab CLI not installed | "glab CLI is required. Install it from https://gitlab.com/gitlab-org/cli#installation." |
| Not authenticated | "glab CLI is not authenticated. Run glab auth login first." |
| On default branch | "Cannot open an MR from the default branch. Switch to a feature branch first." |
| Uncommitted changes | "Uncommitted changes detected. Commit or stash them before opening an MR." |
| MR already exists | "An MR already exists for this branch. Use update-mr to modify it." |
| Push failed | Show the exact git error and stop. |