agentleFS
BolasLienBolasLien/skills/skills/glab-mr/SKILL.md

glab-mr

Skill1 starsChanged 2 months agoMITView on GitHub

Assist with GitLab Merge Request operations including branch diff analysis, branch pushing, MR creation/updates, and description drafting. Uses glab CLI, follows branch conventions, and uses standard MR templates. Ideal for create-mr or update-mr commands.

5 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use glab-alias, glab-api and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • a-ng-dSkill

    glab-alias

    Create, list, and delete GitLab CLI command aliases and shortcuts. Use when creating custom glab commands, managing CLI shortcuts, or viewing existing aliases. Triggers on alias, shortcut, custom command, CLI alias.

    Also in 3 projects that use this

  • a-ng-dSkill

    glab-api

    Make direct GitLab REST API calls for advanced queries and operations not covered by other glab commands. Use when accessing GitLab API endpoints directly, making custom API requests, or fetching data in JSON format. Triggers on API call, REST API, GitLab API, JSON query, advanced query.

    Also in 3 projects that use this

  • +10 more from a-ng-d

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 8 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read abbreviations.md first to understand terminology

    line 21
  2. Distinctive:

    Create MRs via glab CLI

    line 32
  3. Distinctive:

    Update existing MRs after follow-up commits

    line 33
  4. Distinctive:

    Follow Conventional Commit format:

    line 86
  5. Distinctive:

    When revising after review:

    line 220
  6. Distinctive:

    Update MR description (Summary/測試/注意事項)

    line 224
  7. Very specific:

    Use glab mr update to update title/description/labels/reviewers

    line 225
  8. Distinctive:

    Before creating or updating an MR:

    line 230
  9. Very specific:

    Keep MR scope reasonable (see mr-config.yaml → mr_size)

    line 247
  10. Distinctive:

    Keep descriptions current after every push

    line 249
  11. Distinctive:

    Use meaningful branch names

    line 250

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

GitLab Merge Request Workflow

Standardized GitLab MR workflow for creating and updating Merge Requests.

References

This skill uses the following reference files:

  • references/commit-types.md: Conventional Commit type definitions (shared with git-commit)
  • references/abbreviations.md: Standard abbreviations (MR, MCP, etc.)
  • references/context.md: Complete workflow guide and best practices
  • references/mr-config.yaml: Structured MR configuration data (scopes, branch patterns, project settings)

Loading strategy:

  1. Read abbreviations.md first to understand terminology
  2. Consult references/commit-types.md when validating MR types
  3. Consult mr-config.yaml when validating scopes or branch names
  4. Refer to context.md for detailed workflow steps and guidelines

Scope

Focus on MR-related tasks:

  • Analyze changes between current and target branches
  • Push current branch to remote
  • Create MRs via glab CLI
  • Update existing MRs after follow-up commits
  • Draft and maintain clear, complete MR descriptions

Core Principles

Analyze Before Acting

Always run branch diff analysis before creating/updating an MR:

# 1. List commits between target and HEAD
git log {target-branch}..HEAD --oneline

# 2. List changed files
git diff {target-branch}..HEAD --name-only

Base MR descriptions strictly on actual changes. Never speculate.

Prohibited Items

❌ Never include:

  • "Generated with Claude Code" tags
  • AI-generated copyright notices
  • Vague or meaningless descriptions

Standard Workflow

1. Run branch diff analysis
   └─> git log {target}..HEAD --oneline
   └─> git diff {target}..HEAD --name-only

2. Create MR with glab (automatically pushes branch)
   └─> glab mr create --push --title "..." --description "..." --target-branch {target}
   └─> --push flag ensures branch is pushed before MR creation
   └─> Fill title and description based on template

4. Draft MR description (actual changes only)
   └─> Use standard template from context.md
   └─> Include: Summary, 相關連結, 如何測試, 注意事項
   └─> Write in Traditional Chinese

5. Update existing MR (when needed)
   └─> Re-run diff analysis after new commits
   └─> Sync Summary/測試/注意事項 with latest state
   └─> Use glab mr update
   └─> Reply to review comments

MR Title Format

Follow Conventional Commit format:

<type>(<scope>): <subject>

Consult references/commit-types.md for valid types (feat, fix, refactor, etc.).

Consult mr-config.yaml for valid scopes.

Rules:

  • ✅ Keep under 50 characters
  • ✅ Write subject in Traditional Chinese
  • ✅ Describe what changed, not how
  • ❌ No Jira IDs in title

MR Description Template

## Summary

<!-- Bullet major changes -->

## 相關連結

- Jira 連結:

## 如何測試

<!-- Verification steps, flows, expected outcomes -->

## 注意事項

<!-- Special configurations or impacts -->

See context.md for detailed guidelines on each section.

Branch Naming

Consult mr-config.yaml → branch_patterns for prefix rules.

Examples:

feature/alert-component
fix/badge-style-issue
refactor/badge-variants
docs/update-readme

glab CLI Integration

Create MR

⚠️ IMPORTANT: Always use --push flag to ensure branch is pushed before MR creation.

Basic usage:

glab mr create \
  --push \
  --title "feat: 新增 XX 功能" \
  --description "..." \
  --target-branch develop

Common options:

  • --push: [REQUIRED] Push branch before creating MR
  • --title, -t: MR title (Conventional Commit format)
  • --description, -d: MR description (use template)
  • --target-branch, -b: Target branch (e.g., develop, main)
  • --assignee, -a: Assign to user by username
  • --reviewer: Request review from users
  • --label, -l: Add labels (comma-separated)
  • --draft: Mark as draft MR
  • --remove-source-branch: Auto-remove branch after merge

Update MR

Update current branch's MR:

glab mr update \
  --title "feat: 調整 XX 功能" \
  --description "..."

Update specific MR by ID or branch:

glab mr update 123 \
  --title "..." \
  --description "..."

Common update options:

  • --title, -t: Update title
  • --description, -d: Update description (use "-" to open editor)
  • --assignee, -a: Update assignees (prefix with +/- to add/remove)
  • --reviewer: Update reviewers (prefix with +/- to add/remove)
  • --label, -l: Add labels
  • --unlabel, -u: Remove labels
  • --draft: Mark as draft
  • --ready, -r: Mark as ready for review
  • --target-branch: Change target branch

View MR

View current branch's MR:

glab mr view

View specific MR:

glab mr view 123
glab mr view feature/xxx

View with details:

glab mr view --comments     # Include comments
glab mr view --web          # Open in browser

Update Workflow

When revising after review:

  1. Re-run branch diff analysis
  2. Push new commits
  3. Update MR description (Summary/測試/注意事項)
  4. Use glab mr update to update title/description/labels/reviewers
  5. Reply to each review comment

Quick Checklist

Before creating or updating an MR:

  • Branch diff analyzed after latest commits
  • Using --push flag with glab mr create (ensures branch is pushed)
  • Title follows Conventional Commit format (validate with mr-config.yaml)
  • Description reflects current changes (Summary/測試/注意事項)
  • Complete test plan included
  • Description written in Traditional Chinese
  • Special considerations documented

Common Issues

For troubleshooting (push rejected, missing upstream, invalid project ID, etc.), refer to context.md → "Common Issues & Fixes".

Best Practices

  1. Rebase frequently: git rebase origin/develop
  2. Keep MR scope reasonable (see mr-config.yaml → mr_size)
  3. Respond to reviews within 24 hours
  4. Keep descriptions current after every push
  5. Use meaningful branch names

For complete details, workflows, and examples, see context.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.