gitlab-create-mr
Skill1 starsChanged 49 days agoMITView on GitHub
Creates draft GitLab Merge Requests with glab. Use when a branch is ready for review.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- flc1125/skillstheir own version, first seen Aug 12, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- flc1125/skills★ 38same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository24 other files it gives its agents.
- accessing-microsoft-learn-docsSkill
- architecture-validatorSkill
- autonomous-researcherSkill
- clean-up-stale-inline-review-notesSkill
- create-artifactsSkill
- create-worktreeSkill
- github-check-pr-review-comments-graphqlSkill
- github-create-draft-prSkill
- github-creating-issuesSkill
- github-replying-to-pr-threadsSkill
- github-sub-issue-creatorSkill
- gitlab-check-mr-review-commentsSkill
- gitlab-create-issueSkill
- gitlab-reply-mr-threadsSkill
- gitlab-sub-issue-linkerSkill
- hypothesis-driven-planningSkill
- japanese-writingSkill
- load-inline-review-notesSkill
- operating-gitSkill
- operating-jetbrains-projectsSkill
- referencing-commit-conventionSkill
- rust-coding-conventionsSkill
- sequential-thinkingSkill
- web-artifacts-builderSkill
The file
Files
GitLab Merge Request (Draft MR) 作成ガイドライン
情報収集と分析 あなたが以下の情報を自動的に収集・分析する。 以下のコマンドリストは、修正や最適化を行わず、文字列として完全に一致する状態で実行すること。別コマンドへの置換は禁止する。 セキュリティエラーが発生するので
&&などでコマンドを接続することは禁止する。- 現在のブランチ名: !{git rev-parse --abbrev-ref HEAD}
- mainからの差分コミット: !{git log main..HEAD --oneline --pretty=format:"%h - %s"}
- リモートURL: !{git remote get-url origin}
- MRテンプレート: !{cat "$(git rev-parse --show-toplevel)/.gitlab/merge_request_templates/*.md"} (存在しない場合は取得不要)
- チケット番号: !{git rev-parse --abbrev-ref HEAD | grep -oE '^[0-9]+'}
- 対象リポジトリ(自動検出): !{git remote get-url origin} からリポジトリを特定する。ハードコード禁止
- Actual Code Changes (Diff) ノイズを除外し、本質的な変更差分のみを取得する: !{git diff main..HEAD -- . ':(exclude)package-lock.json' ':(exclude)yarn.lock' ':(exclude)*.lock'}
- Issueの確認
チケット番号が存在する場合、Issueの内容を確認するため、
glab issue view <チケット番号>を実行して背景情報を抽出する。 対象リポジトリはカレントディレクトリの git リモートから自動検出されるため、-Rは原則不要である。 推論と構築 (Reasoning) 取得した情報を以下の優先順位で統合し、MRの内容を構築せよ。
- Diff情報: 実際のコード変更が最優先。「何をしたか」の事実とする。
- Issue情報: 「なぜそれをしたか」の背景情報として利用する。
- Commit情報: 作業の流れを補足する情報として利用する。
MR内容の生成 分析結果に基づき、以下の項目を生成する。
- MRタイトル: 変更内容の要点を的確に表現したタイトルを生成する。
- MR本文: 読み込んだテンプレートに基づき、変更の概要、背景、詳細などを具体的に記述する。テンプレートがない場合は適当に作る。
- Issue連携: 関連するIssueを自動的に閉じるため、本文内に必ず
Closes #チケット番号の形式で記述を含めること。- チケット番号の頭には
#を付与する。 - GitLab はこのクローズパターン(Close / Fixes / Resolves 等)を MR マージ時に検出し、対象 Issue を自動クローズする。
- チケット番号の頭には
コマンド生成と実行 GitLab CLI (
glab) を使用して Draft MR を作成する。--draft: Draft MRとして作成する(--wipでも可)。--title: 生成したMRタイトルを設定する。--description-file: 生成したMR本文を設定する(ファイル経由を推奨)。--target-branch: ベースブランチは常にmainとする。省略時はプロジェクトのデフォルトブランチが使われる。--source-branch: 現在のブランチ(デフォルト)を使用する。--assignee: "@me" を設定する。PowerShell では@が splatting 演算子として解釈されるため、-a '@me'のように引用符で囲むこと。--yes: 確認プロンプトを省略する。
a. GitLab CLI (glab) を使用する:
run_shell_commandを使用し、上記の仕様でglab mr createを実行する。- 注意: 引数のパース精度を優先するため、
cmd /cを介さず直接実行すること。 b. いずれも使用できない場合: - 実行すべき
glab mr createコマンドとその引数をテキストとして出力する。
- 結果報告 MRが正常に作成されたことをユーザーに報告する。
PowerShell ヒアドキュメントの注意点
MR本文に Markdown のインラインコード(バッククォート `)を含める場合は、シングルクォートのヒアドキュメント(@' ... '@)を使用すること。
$body = @'
## 概要
- `GraphDocument` の更新系ユースケースを追加した
Closes #26
'@
$body | Out-File -Encoding UTF8 temporary.local\mr_body.md
glab mr create --draft -b main -a '@me' --yes --title "feat: 更新系ユースケースを追加" --description-file temporary.local\mr_body.mdGitLab 固有の仕様差
- GitHub の Pull Request は GitLab では Merge Request (MR) と呼ぶ。番号参照は
!番号形式 - Draft は
--draft(旧--wip)で作成する。タイトルに "Draft:" は自動付与されないため、発言や通知から Draft 状態を判別する Closes #番号は MR がプロジェクトのデフォルトブランチ(通常 main)へマージされた時点で Issue をクローズする。Draft 作成時点ではクローズされない- MRテンプレートは
.gitlab/merge_request_templates/に配置する(GitHub の.github/pull_request_template.mdに相当) - 対象リポジトリはカレントディレクトリの git リモートから自動検出される。別リポジトリのみ
-R OWNER/REPOで指定する - 認証は
glabの設定(GITLAB_TOKENまたはglab auth loginの保存済み認証)に依存する。トークンをコマンドに埋め込まないこと
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
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.

