mr-create

Generate merge request descriptions from branch commits and create MRs via gh or glab.

1|Updated Sep 11, 2026
One-click install
npx skills add https://github.com/lldwb/lldwb-claude-skills --skill mr-create-lldwb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mr-create
Source: https://github.com/lldwb/lldwb-claude-skills/tree/main/skills/mr-create
Command: npx skills add https://github.com/lldwb/lldwb-claude-skills --skill mr-create-lldwb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Creating a merge request by hand means manually summarizing commits, checking branch push state, and formatting platform-specific commands, which often produces empty MRs, stale diffs, or descriptions with unverifiable claims. This Skill validates the source and target branches, collects commit history and diffs, drafts a four-section description grounded in real evidence, and creates the MR through gh or glab only after user confirmation. ## Core Features & Use Cases - Branch validation and material collection: A Python script verifies the repo, branch existence, common ancestor, and effective diff, then writes commit logs, grouped change scope, file lists, and a full raw diff to disk. - Push-state handling: Nine push states (up-to-date, not-pushed, ahead, behind, diverged, remote-only, and more) are reported as facts, with a fixed decision table governing when pushing is allowed and when to stop. - Platform-aware creation: Detects GitHub vs GitLab, honors repository PR/MR templates, uses --body-file/--description-file for safe multiline descriptions, and falls back to manual compare links when no CLI exists. - Use Case: After finishing a feature branch, ask for an MR against main; the Skill fetches origin, validates the diff, drafts a description covering background, changes, impact, and testing, pushes the branch only with your consent, and creates the MR. ## Quick Start Ask the assistant to create a merge request from the current branch to main with an auto-generated description based on the commit history.

Frequently Asked Questions about mr-create

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

FAQPage Schema
How do I create a merge request with an auto-generated description?

Run the prepare-mr.py script with optional --source and --target branches to collect commits, diffs, and push state into a material file. The agent then drafts a four-section description from that evidence and creates the MR via gh or glab after you confirm the title and body.

How to create a GitLab MR from the command line with glab?

Use glab mr create with --source-branch, --target-branch, --title, and --description-file pointing to a description file. Avoid --fill because it pushes the branch and overwrites your description with commit messages.

Does this work if the source branch is not pushed to the remote?

Yes, but pushing happens only for not-pushed or ahead states and only after your explicit approval. States like behind, diverged, or remote-only stop the workflow with a report instead of pushing, since they would require force-push or would fail.

Why does the script refuse to create a merge request?

It exits with an error when the directory is not a git repo, a branch does not exist, source and target point to the same commit, there is no common ancestor, or there is no effective diff. This prevents creating empty merge requests.

Can it create a PR without gh or glab installed?

Yes. When no CLI is available, it outputs the full description plus a manual creation link, such as a GitHub compare URL or a GitLab merge_requests/new URL, so you can create the MR by hand.

What are the safety limits of this merge request workflow?

It never merges, deletes branches, force-pushes, modifies code, or pushes the target branch. It only handles already-committed content; uncommitted changes should go through a commit workflow first, and reviewing existing MRs is out of scope.