create-mr

Create GitLab merge requests with glab and announce them in Lark code-review chats.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/TrayMachi/dotfiles --skill create-mr-traymachi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-mr
Source: https://github.com/TrayMachi/dotfiles/tree/main/agents/skills/create-mr
Command: npx skills add https://github.com/TrayMachi/dotfiles --skill create-mr-traymachi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Opening a merge request involves repetitive manual steps: pushing the branch, picking the target branch, formatting the title with the Jira ticket, writing a structured description, assigning reviewers, and notifying the team chat. This Skill automates that entire GitLab MR workflow with glab and Lark messaging. ## Core Features & Use Cases - Automated MR creation: Pushes the current branch, derives the target branch from the remote default, builds a [OTP-XXXX]-prefixed title from the branch name, and creates the MR with a structured Summary / Key Changes / Testing description. - Reviewer assignment and announcement: Optionally assigns GitLab reviewers and posts a formatted code-review message to the Lark OTP-CodeReviews chat with resolved @ mentions via open_id lookup. - Use Case: After finishing a feature on branch feature/otp-2733, ask the assistant to create an MR — it pushes the branch, titles it [OTP-2733] <summary>, targets main, assigns you, and prints the MR URL. ## Quick Start Ask the assistant to create a merge request for the current branch using the create-mr skill.

Frequently Asked Questions about create-mr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a GitLab merge request from the command line?

Use `glab mr create` with the source branch, target branch, title, and description flags. This Skill automates that flow: it pushes the branch, derives the target from the remote default branch, and sets you as the assignee via `glab api user`.

How to add a Jira ticket number to a merge request title?

The Skill extracts an `OTP-XXXX` ticket from the branch name (e.g. `feature/otp-2733` becomes `OTP-2733`) and prefixes the MR title as `[OTP-2733] <summary>`. If the branch has no ticket pattern, the prefix is omitted rather than fabricated.

Can I assign reviewers when creating a GitLab MR with glab?

Yes, via `glab mr update <number> --reviewer user1,user2`, but this Skill deliberately keeps reviewer assignment as a separate optional step. At creation time only the assignee (the current user) is set; reviewers are added afterward on request.

Why do @ mentions not work in Lark messages sent via API?

Lark does not auto-convert plain `@name` text into mentions. You must resolve each user's `open_id` and wrap it as `<at user_id="ou_xxx">Name</at>`, sending the message as a text payload rather than markdown so the tags survive.

When should I not use this MR creation workflow?

Do not use it from a default branch like `main` or `develop` — the Skill stops and warns instead. It also does not force-push, push other branches, or auto-announce MRs unless you explicitly request the announcement step.