Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计提醒

gitlab-code-reviewerGitLab 代码 reviewer

Agent Skill

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

总安装

11,712

周安装

488

GitHub Stars

1

下载量

3,904
OpenClaw

安装说明

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

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:gitlab-code-reviewer(GitLab 代码 reviewer)
来源仓库:https://github.com/neuyazvimyi/gitlab-code-reviewer
安装命令:
openclaw skills install gitlab-code-reviewer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

ClawHubOpenClaw
openclaw skills install gitlab-code-reviewer

简介

对 GitLab 合并请求执行高级代码审查与质量评估。

  • 分析代码安全性、性能、可维护性及潜在风险点。
  • 输出结构化反馈,辅助开发者优化提交内容。适用宿主包括 OpenClaw,接入前应确认版本、权限和运行环境要求。
  • 适用于 MR 提交流程中的自动化辅助审查环节。
  • gitlab-code-reviewer 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
gitlab-code-review
description

GitLab MR Code Review

Workflow

1. Read credentials and check token scope

Credentials: ~/.openclaw/credentials/gitlab.json

{
  "token": "glpat-xxx",
  "host": "https://gitlab.com",
  "ignore_patterns": ["*.min.js", "*.lock", "forms/*.json"]
}

Required API scopes:

  • api — required for posting inline comments
  • read_api — sufficient for analysis only (no comment posting)

Always run token check first to know upfront whether comments can be posted:

python scripts/gitlab_client.py check-token <mr_url>

Output includes "can_write": true/false. If false, skip step 6 and inform the user that the token needs the api scope to post comments. Do NOT proceed to analysis and then fail at step 6.

2. Fetch MR metadata and diff

python scripts/gitlab_client.py fetch-mr   <mr_url>
python scripts/gitlab_client.py fetch-diff <mr_url>

fetch-diff returns a JSON array. Each entry contains new_path, old_path, diff (unified diff text), and boolean flags new_file, deleted_file, renamed_file.

Fallback: if the /diffs endpoint returns HTTP 500 (some self-hosted GitLab instances), the script automatically retries via /changes. No manual intervention needed.

3. Filter files

Use ignore_matcher.py to exclude files before analysis:

from ignore_matcher import filter_diffs
reviewable = filter_diffs(all_diffs)   # merges defaults + credentials ignore_patterns

Default ignore patterns (always applied, even without credentials file): *.min.js, *.min.css, *.lock, package-lock.json, pnpm-lock.yaml, forms/*.json

Binary extensions (.png, .jar, .class, .map, etc.) are always skipped.

4. Analyze the diff

  • Analyze only modified lines (added/removed in the diff). Do not comment on unchanged context lines.
  • If the total diff is large, process file-by-file and aggregate results.
  • Read references/review-guidelines.md for all review rules, severity definitions, and comment format.

Focus areas:

  • Java / Spring Boot — Clean Code, SOLID, transaction boundaries, lazy loading
  • MongoDB — query correctness, index coverage, atomicity
  • PostgreSQL — SQL correctness, isolation levels, index/schema migrations
  • React / TypeScript — hooks correctness, type safety, XSS, stale closures

5. Structure the chat summary

Group findings by severity:

## Code Review — <MR title> (<source_branch> → <target_branch>)

### Critical
- `UserService.java:42` — Transaction wraps HTTP call; holds DB lock during network I/O.

### Major
- `OrderRepository.java:87` — N+1: `findRolesByUserId` called inside loop. Use batch query.

### Minor
- `PaymentDto.java:15` — Field name `val` is not descriptive.

### Decision: Needs changes

Decision options: Pass / Needs changes / Reject

  • Pass: no Critical or Major findings
  • Needs changes: one or more Major findings, no Critical
  • Reject: one or more Critical findings

6. Post inline comments to GitLab

Only execute this step if check-token (step 1) returned "can_write": true.

Write comments to a temp JSON file, then post via post_comments.py. Never use python -c with inline comment bodies — backticks and special characters break shell escaping.

# 1. Write all findings to a JSON file
cat > /tmp/mr_comments.json << 'EOF'
[
  {
    "file_path": "src/main/UserService.java",
    "line": 42,
    "body": "[CRITICAL] Transaction wraps HTTP call...\
\
Suggestion:\

// fix\

  }
]
EOF

# 2. Post via script
python scripts/post_comments.py <mr_url> /tmp/mr_comments.json

How to determine the correct line number from a diff hunk:

@@ -375,6 +375,8 @@       ← new file starts at line 375
     unchanged line          → 375
     unchanged line          → 376
     unchanged line          → 377
+    added line              → 378  ← use this number
+    added line              → 379

Count from the +A value in @@ -X,Y +A,B @@ for new-file lines.

Each comment body format (from references/review-guidelines.md §8):

[SEVERITY] <one-line issue>

<2-4 sentence explanation referencing the diff.>

Suggestion:

<corrected snippet>

Constraints:

  • Do not auto-approve the MR.
  • Do not add labels or trigger pipelines.
  • Only post comment-type discussions (no approval API calls).
  • If a line is not in the diff, the API returns an error — log it and continue with the next comment.
  • On HTTP 403 insufficient_scope, the script stops immediately and prints a fix instruction. Do not retry.

Behavior Rules

  • Strict engineering tone. No emotional language. No generic praise.
  • Analyze only the modified code in the diff. Do not speculate about code outside the diff.
  • Do not log or persist source code content.
  • Respect ignore patterns strictly.
  • For large diffs: process per file, deduplicate similar findings across files before final output.

References

  • Review rules, severity table, comment format: references/review-guidelines.md

- §2 Java & Spring Boot (Clean Code, transactions, N+1, concurrency) - §3 MongoDB (queries, indexes, atomicity) - §4 PostgreSQL (SQL correctness, isolation, migrations) - §5 React & TypeScript (hooks, type safety, security) - §6 SOLID & DDD alignment - §7 Severity classification table - §8 Inline comment format template

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

OpenClaw

72.27%
按下载量换算2,821

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

未展示

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

来源信息

继续浏览同类 Skills