| name | gitlab-mr |
| description | Create GitLab merge requests with intelligent title and description generation from git commits. Supports stacked MRs by targeting the parent branch (falls back to main). Use when you want to create an MR and need to generate a clear title following git conventions and auto-populate the description from commit messages. |
| model | sonnet |
| context | fork |
GitLab Merge Request
Context
- Current branch: !
git branch --show-current
- Parent branches: !
git parents
- Current glab user: !
glab api user | jq -r .username
Configuration
Default values can be customized when invoking the skill. Current defaults:
| Option | Default | Description |
|---|
--assignee | (current glab user) | GitLab username to assign the MR |
--labels | (dynamic, see below) | Comma-separated labels |
--reviewer | sa_ai_user | Reviewer username |
--target | (dynamic, see below) | Target/base branch |
Target Branch
Use the first parent branch from the Context section. Fall back to main if there are no parents. This enables stacked merge requests.
Labels
The label ai-generated is always included. Additional labels depend on the current branch name:
| Branch prefix | Labels |
|---|
back- | ai-generated,Back,guild-back |
expand- | ai-generated,Back,squad-expand |
| (other) | ai-generated |
If a review app should be deployed, add the label "deploy::review-app".
Commit Conventions
Commit messages follow a Conventional Commit-inspired format:
<type>[(<Optional branch name>)]: <title>
<Optional body>
Types (required):
build: "🏗️ Builds"
chore: "🛠️ Chores"
ci: "👷 CI"
docs: "📚 Documentations"
feat: "✨ Features"
fix: "🐛 Fixes"
other: "❓ Others"
perf: "🚀 Performance Improvements"
refactor: "📦 Code Refactoring"
revert: "🗑️ Reverts"
style: "💄 UI"
test: "🧪 Tests"
Examples:
- fix(back-1023): resolve N+1 query in WorkflowFormSubmissionGenerator
- fix: execute db-migration on live and sandbox
- feat(dx-1593): Add feature flag to use new messager
- chore(dx-1610): Run php using yousign user (2000:2000) in cloud native docker images
Merge Request Templates
Before generating the description, check for templates in .gitlab/merge_request_templates/:
- No templates directory or empty → skip, generate description as usual
- Only
Default.md exists → use it automatically (no prompt needed)
- Multiple templates → ask the user which one to use
When a template is used, append it before the generated description (separated by a blank line). Do not replace the generated description — the template is additional content.
Workflow
1. Get commits for this MR
Get commits between the target branch and HEAD:
git log TARGET_BRANCH..HEAD --pretty=format:"%s%n%b"
2. Generate Title and Description
Title:
- Single commit: Use the commit subject line directly
- Multiple commits: Primary type prefix + summary (e.g.,
feat(expand-100): multiple improvements)
Description:
- Focus on behavior changes: what the MR changes from the user's or system's perspective
- Do not describe implementation details (class names, method names, internal refactoring)
- Explain WHY the change is necessary: SUPER IMPORTANT!
- Keep it concise and straight to the point
- Single commit: Rewrite the commit body as a behavior-focused summary (do not copy verbatim if it contains implementation details)
- Multiple commits: Bullet-point list summarizing the behavior change of each commit
3. Create MR
glab mr create \
-a "ASSIGNEE" \
-l "LABELS" \
--reviewer "sa_ai_user" \
--remove-source-branch \
--push \
-b "TARGET_BRANCH" \
-t "TITLE" \
-d "$(cat <<'EOF'
DESCRIPTION
EOF
)" \
-y
4. Display results
Display the MR link along with a short summary.
Requirements
- Git repository with commits ready to merge
glab CLI installed and authenticated