Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

gitlab-mr-inline-commentGitLab MR inline comment 开发

Agent Skill

用于围绕 GitLab 项目、Merge Request、Issue、分支、流水线和代码审查流程提供辅助能力。它适合让 Agent 查询项目状态、整理提交差异、辅助检查合并请求或汇总 CI 结果。使用时需要确认项目权限、访问 token 和目标分支范围;涉及合并、推送、改工单或触发流水线时,应先预览影响并核对团队流程。

总安装

245

周安装

10

GitHub Stars

16

下载量

78
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gitlab-mr-inline-comment(GitLab MR inline comment 开发)
来源仓库:https://github.com/flc1125/skills
仓库路径:skills/gitlab-mr-inline-comment
安装命令:
npx skills add https://github.com/flc1125/skills --skill gitlab-mr-inline-comment
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/flc1125/skills --skill gitlab-mr-inline-comment

简介

用于围绕 GitLab 项目、合并请求、Issue、分支和流水线提供辅助能力。

  • 适合查询项目状态、整理提交差异、检查合并请求或汇总 CI 结果。
  • 通过命令行安装并配置访问 token 后,支持在 MR 中添加内联评论。
  • 涉及合并、推送或改工单时,应先预览影响并核对团队流程。
  • gitlab-mr-inline-comment 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

GitLab MR Inline Comment

Publish one anchored inline comment on a GitLab merge request.

Operating Mode

Act as a narrow GitLab review helper.

Prioritize:

  • correct GitLab host and repository context before any write
  • valid MR diff SHAs before payload assembly
  • valid file path and line anchors before posting
  • explicit failure over silent downgrade to a general comment
  • reuse of the user's existing glab authentication and repository context

Assume glab is installed unless local evidence shows otherwise.

Do not require extra tokens, .env files, or custom auth setup when the user's existing glab session already has access.

Read these references only when needed:

Required Inputs

Collect or derive these values before posting:

  • mr_iid
  • body
  • old_path
  • new_path
  • one valid line anchor shape:

- added line: new_line - removed line: old_line - unchanged line: both old_line and new_line

Resolve one repository context:

  • current repository glab context, or
  • explicit GitLab project path such as group/subgroup/repo, or
  • a GitLab merge request URL that can be parsed into host, project, and MR IID

Resolve these MR diff fields from the current merge request version:

  • base_sha
  • start_sha
  • head_sha

Workflow

Follow this sequence unless the user asks for one narrower part.

1. Confirm GitLab context with the lightest viable command

Prefer the user's current repository context first.

Use bare glab commands when the current directory is already the target GitLab repository.

Only inspect git remote -v, add GITLAB_HOST, or use explicit repository arguments when:

  • glab resolves to the wrong host
  • the task targets another repository
  • authentication fails against an unexpected instance
  • the user provides a merge request URL on another GitLab host

Do not introduce extra authentication if glab auth status already shows valid access for the target host.

2. Identify the target merge request

Normalize the task to one merge request.

If the user gives a merge request URL, parse it into:

  • host
  • project path
  • MR IID

If the user gives a project path and MR IID, use them directly.

If the current repository is already the target project, prefer repository-context commands over manual URL construction.

3. Read the current MR version SHAs

Before building the discussion payload, fetch the merge request state needed for inline anchors.

Use references/current-diff-resolution.md when exact field names or version-selection rules matter.

Resolve:

  • base_sha
  • start_sha
  • head_sha

Do not guess or reuse stale SHAs from old output.

If the current MR version cannot be read reliably, stop and report that inline comment posting is blocked by missing diff context.

4. Validate the anchor

Confirm that:

  • old_path and new_path match the current MR diff position
  • the line anchor matches one valid text diff case:

- added line: new_line only - removed line: old_line only - unchanged line: both old_line and new_line

Use references/current-diff-resolution.md when deciding whether the target line is safely anchorable.

Do not guess the path or line.

Do not silently switch to a general merge request comment when the anchor is invalid.

5. Build the payload and post the discussion

Use the minimal payload shape from references/api-shape.md.

Post to the merge request discussions endpoint with glab api.

Use the user's existing glab authentication and host context whenever possible.

6. Return a concise result

On success, report:

  • target project and MR IID
  • anchored paths and line position
  • short confirmation that the inline comment was posted

On failure, report the concrete blocking reason, such as:

  • host or auth mismatch
  • missing MR version SHAs
  • path not in diff
  • line not commentable
  • GitLab API validation error

Output Structure

When the task is to post the comment directly, summarize the execution result like this:

# Inline Comment Result

## Target
- project: <group/subgroup/repo>
- mr: !<iid>
- old_path: <old_path>
- new_path: <new_path>
- old_line: <old_line or omitted>
- new_line: <new_line or omitted>

## Result
- status: <posted | failed>
- detail: <short reason or confirmation>

Decision Rules

  • Prefer repository-context glab commands over manual encoded project IDs when the current directory already matches the target project.
  • Use explicit GITLAB_HOST only when the target host differs from the current repository context or glab resolves incorrectly.
  • Treat inline comment posting as blocked when the current MR diff SHAs are unavailable or ambiguous.
  • Treat invalid anchors as hard failures.
  • Keep v1 limited to one text diff inline comment with one valid position shape.

Red Flags

Stop and reassess if:

  • multiple GitLab hosts are present and the write target is unclear
  • the authenticated host and intended host disagree
  • the merge request URL, project, or IID do not resolve to one clear target
  • base_sha, start_sha, and head_sha cannot be read from the current MR state
  • old_path or new_path cannot be reconciled with the current diff position
  • the provided old_line / new_line combination does not form a valid text diff anchor
  • the only fallback would be posting a non-inline general comment

Out Of Scope For V1

Do not add these behaviors in v1:

  • multi-line or range comments
  • batch comment publishing
  • draft review or pending review workflows
  • automatic comment placement based on code analysis
  • automatic downgrade to a general merge request note

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.44%
按下载量换算28

Claude

27.67%
按下载量换算22

Cursor

19.53%
按下载量换算15

Gemini CLI

9.92%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills