gitlab-mr-inline-comments

Fix GitLab inline MR comments posted as general discussion notes.

Updated Nov 18, 2025
One-click install
npx skills add https://github.com/cajias/claude-skills --skill gitlab-mr-inline-comments
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gitlab-mr-inline-comments
Source: https://github.com/cajias/claude-skills/tree/main/skills/gitlab-mr-inline-comments
Command: npx skills add https://github.com/cajias/claude-skills --skill gitlab-mr-inline-comments

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill fixes the common GitLab review issue where inline merge request comments are accidentally posted as general discussion notes because position data is formatted incorrectly.

Core Features & Use Cases

  • Correct Inline Commenting: Ensures GitLab receives nested position objects so comments land on the exact code line instead of the MR thread.
  • API Troubleshooting: Helps diagnose why glab api requests return DiscussionNote, position: null, or silently ignore nested parameters.
  • Developer Workflow: Useful when writing review automation, posting programmatic code review feedback, or verifying diff line metadata such as base_sha, start_sha, and head_sha.

Quick Start

Ask the assistant to help you post a GitLab merge request comment as a true inline discussion note by using a JSON request body with properly nested position fields.

Frequently Asked Questions about gitlab-mr-inline-comments

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why do my GitLab merge request inline comments show up as general discussion notes?

GitLab merge request inline comments appear as general discussion notes when the position data in your API request body is formatted incorrectly or lacks properly nested position fields. The API needs valid diff reference fields like base_sha, start_sha, and head_sha to place the comment on the exact code line.

How do I post GitLab inline comments on a specific code line using glab api?

To post GitLab inline comments on a specific code line using glab api, structure a JSON request body with a properly nested position object containing the base_sha, start_sha, head_sha, and line-specific placement parameters to create a valid inline MR discussion.

What is the correct JSON structure for GitLab merge request inline comments?

The correct JSON structure for GitLab merge request inline comments requires a nested position object within the request body. This object must include SHA references and line-specific placement fields to ensure the API creates a positioned diff note instead of a DiscussionNote.

Why does glab api return position null when posting merge request comments?

The glab api returns position null when posting merge request comments because nested position parameters are being silently ignored or flattened. You must ensure the request body contains a properly nested JSON position object with correct SHA references to preserve line-specific comment placement.

Do I need base_sha and start_sha to post inline code review comments on GitLab merge requests?

Yes, you need base_sha, start_sha, and head_sha to post inline code review comments on GitLab merge requests. These diff reference fields are required within the nested position object to map the comment to the correct line in the diff.