gitlab-create-mr

Create GitLab merge requests from the current branch using glab.

1|Updated Dec 9, 2024
One-click install
npx skills add https://github.com/hadenlabs/tasks --skill gitlab-create-mr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gitlab-create-mr
Source: https://github.com/hadenlabs/tasks/tree/main/.claude/skills/gitlab-create-mr
Command: npx skills add https://github.com/hadenlabs/tasks --skill gitlab-create-mr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates the lifecycle of creating and pushing a GitLab Merge Request from your current branch, removing manual steps and ensuring consistent MR metadata.

Core Features & Use Cases

  • Validate before opening the MR to ensure code quality and tests pass
  • Inspect the diff and recent commits to summarize the branch
  • Detect whether an MR already exists for the current branch to avoid duplicates
  • Push the current branch with upstream if needed
  • Build the MR title and description from .gitlab/merge_request_templates/MERGE_REQUEST_TEMPLATE.md
  • Create the MR with glab and return the URL

Quick Start

Ask me to open a GitLab merge request for the current branch and I will validate, push, and create the MR automatically.

Frequently Asked Questions about gitlab-create-mr

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

FAQPage Schema
How do I automatically create a GitLab merge request from my current branch?

You can automatically create a GitLab merge request by using an automation tool that validates your code, pushes the branch with upstream tracking, and generates the MR via glab. This removes manual steps and ensures consistent MR metadata from your local working branch.

How does automated MR templating work with GitLab branches?

Automated MR templating works by reading the file .gitlab/merge_request_templates/MERGE_REQUEST_TEMPLATE.md to build the title and description. The automation inspects recent commits and diffs to summarize the branch before creating the merge request.

Can I prevent duplicate GitLab merge requests when automating branch pushes?

Yes, you can prevent duplicate GitLab merge requests by detecting whether an MR already exists for the current branch. The automation checks branch state before validating, pushing upstream, and generating a new MR to avoid creating duplicates.

Do I need glab installed to automate GitLab merge request creation?

Yes, you need glab installed because the automation uses the glab CLI to create the merge request and return the URL. The tool handles pre-MR validation, branch state checks, and upstream push before executing the glab MR creation command.

What is the best way to validate code before opening a GitLab merge request?

The best way to validate code before opening a GitLab merge request is using an automation workflow that performs pre-MR validation checks. It inspects the diff and recent commits to ensure code quality and tests pass before pushing the branch and creating the MR.

Why does my automated GitLab MR creation fail on the current branch?

Automated GitLab MR creation may fail if pre-MR validation checks do not pass or the branch state is incorrect. The automation requires successful validation and an upstream push before it can build MR metadata from templates and create the request via glab.