gitlab-reply-mr-threads
Skill1 starsChanged 49 days agoMITView on GitHub
Replies to specific GitLab Merge Request review threads with glab. Use when responding to an individual review comment.
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-create-mrSkill
- 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 MRレビューコメントへの返信方法
特定のレビューコメントスレッド(discussion)に対して返信を行う場合、以下の手順を実行する。
1. スレッドID(discussion_id)の取得
対象 MR の IID(番号)を指定して glab mr note list を実行し、返信対象のスレッドを特定する(glab mr note list は EXPERIMENTAL 機能。docs.gitlab.com/cli/mr/note/list/ に明記)。
スレッド構造と ID を正確に取得する場合は、Discussions API を glab api で呼び出す。:fullpath はカレントの git リポジトリから自動置換される。
glab api "projects/:fullpath/merge_requests/123/discussions"レスポンス内の discussions[].id(例: abc123...)がスレッドIDである。スレッド内の各ノートは discussions[].notes[].body で確認できる。
2. 返信コマンドの実行
取得したスレッドID (<DISCUSSION_ID>) と返信内容 (<BODY>) を用いて、以下の手順で返信を実行する。
- コマンド実行:
run_shell_commandを使用し、glab apiで Discussions API に返信を投稿する。PowerShell では複数行の本文をシングルクォートのヒアドキュメントで変数に格納して渡す。
$body = @'
<BODY>
:robot: Commented by {AI}
'@
glab api -X POST "projects/:fullpath/merge_requests/123/discussions/<DISCUSSION_ID>/notes" -f body=$body- 結果確認:
run_shell_commandの実行結果(例:{"id":12345,"body":"...","author":{...}})から、投稿が成功したかを確認する。
署名プロトコル
本文の最後に必ず署名 :robot: Commented by {AI} を追加すること。署名は本文と改行で区切る(上記例のとおり、<BODY> の直後に空行を挟んで署名を付与する)。
{AI} は置換用プレースホルダーである。実行時に、実際に投稿する AI の名前(例: Codex)へ置換してから投稿すること。プレースホルダーのまま投稿しないこと。
PowerShell では Markdown のバッククォート消失防止のため、必ずシングルクォートのヒアドキュメント(@' ... '@)を使用すること。ダブルクォート(@" ... "@)を使用すると <BODY> 内の $ やバッククォートが展開・消失されるため禁止する。
$body = @'
<BODY>
:robot: Commented by {AI}
'@
glab api -X POST "projects/:fullpath/merge_requests/123/discussions/<DISCUSSION_ID>/notes" -f body=$bodyGitLab 固有の仕様差
- GitHub の
addPullRequestReviewThreadReply(GraphQL)に相当する操作は、Discussions API の ノート追加 エンドポイントで行う- 既存スレッドへの返信:
POST /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes - 新規スレッドの作成:
POST /projects/:id/merge_requests/:merge_request_iid/discussions - 通常コメント(スレッド外):
POST /projects/:id/merge_requests/:merge_request_iid/notes
- 既存スレッドへの返信:
- 対象リポジトリはカレントディレクトリの git リモートから自動検出される。ハードコード禁止
- 認証は
glabの設定(GITLAB_TOKENまたは保存済み認証)に依存する。トークンをコマンドに埋め込まないこと
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.

