Skip to main content

Creating an MR

Use the gitlab-mr skill to generate a GitLab merge request from your current branch. Claude analyzes your commits and diff, then drafts the title, description, affected features, and a testing checklist for you to review.

Prerequisites

The skill needs a GitLab token with api scope. You already have one if you completed Step 1 of the AI Quickstart Getting Started — the skill reads it from your glab config automatically.

Branch naming

The skill extracts the Jira task ID from your branch name. Use one of these patterns so it works out of the box:

  • task/PSDK-1234-short-description
  • feature/PSDK-1234-short-description
  • bugfix/PSDK-5678-short-description

If your branch doesn't match, Claude will ask you for the Jira task ID.

Create the MR

Once you have unsaved code changes (or unpushed commits), just ask Claude to create the MR — it handles staging, committing, pushing, and the MR itself in one flow.

In your terminal, navigate to your widget's directory and start Claude Code there (if it isn't already open):

cd path/to/your-widget
claude
  1. At the Claude Code prompt, ask:
    create an MR
    Other phrasings work too — "submit MR", "create a merge request", "push MR", etc. (These are natural-language requests to Claude, not shell commands.)
  2. Claude will:
    • Review your working tree and existing commits.
    • If there are uncommitted changes, stage them and commit with a semantic message (feat: / fix:), asking for approval first.
    • Push the branch to GitLab (with approval).
    • Generate a draft title, description, affected features, and testing checklist from the diff.
    • Ask you to review and edit each section.
    • Ask whether to create a draft MR or a regular MR.
  3. Once you confirm, the skill creates the MR via the GitLab API and returns the URL.

You don't need to touch the shell yourself after starting Claude Code. If you've already committed and pushed manually, Claude detects this and skips those steps.

What gets generated

The MR description follows this template:

**Related Jira task:** PSDK-XXXX

## General
Brief description of changes and their purpose.

## Affected features
1. Feature or component A
2. Feature or component B

## Things should be tested additionally
1. Test scenario 1
2. Test scenario 2

## Remarks
Additional notes, breaking changes, or deployment considerations.

You can edit any section before the MR is created.

Troubleshooting

  • 401 Unauthorized — your GitLab token has expired or doesn't have api scope. Re-run glab auth login --hostname gitlab.apptrium.io in your terminal, then try again from the Claude Code prompt.
  • 404 Project Not Found — Claude couldn't resolve the project from your git remote. In your terminal, run git remote -v and confirm it shows the correct GitLab URL.
  • 409 Conflict — an MR already exists for this branch, or the branch has merge conflicts with master.
  • Branch not pushed — if you declined Claude's request to push, ask "push the branch and try again" at the Claude Code prompt and the skill will retry.