GitLab Code Review by dedalus-erp-pas/foundation-skills
npx skills add https://github.com/dedalus-erp-pas/foundation-skills --skill 'GitLab Code Review'对 GitLab 合并请求执行全面的代码审查,提供关于代码质量、安全性、性能和最佳实践的可操作性反馈。
此技能配置用于自托管的 GitLab 实例:
在以下情况下激活此技能:
重要提示:在审查合并请求之前,请务必确认 project_id
始终以提问的形式提供建设性反馈,而非指令
仅审查合并请求中引入的变更,不审查无关代码
如果提供了合并请求 IID(例如,"review !123" 或 "review MR 123"):
gitlab-mcp(get_merge_request) 获取合并请求详细信息广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
如果提供了 GitLab 问题 ID(例如,"review #456"):
gitlab-mcp(get_issue) 获取问题详细信息以了解上下文gitlab-mcp(list_merge_requests) 和搜索过滤器查找相关合并请求如果未指定 MR(例如,仅输入 "review"):
gitlab-mcp(list_merge_requests) 和 state: "opened" 列出最近打开的合并请求自托管 GitLab 实例: https://gitlab-erp-pas.dedalus.lan
使用 gitlab-mcp(get_merge_request) 检索:
diff_refs(base_sha, head_sha, start_sha)用于准确的差异比较提取关键信息:
Project: namespace/project
MR: !123 - "Feature: Add user authentication"
Author: @username
Source: feature/auth -> Target: main
Status: Open | Pipeline: Passed | Approvals: 1/2
使用 gitlab-mcp(get_merge_request_diffs) 检索:
分页: 如果更改了许多文件,请使用分页参数(page, per_page)来检索所有变更。
对于复杂的变更,使用 gitlab-mcp(get_file_contents) 来:
参数:
project_id: 项目标识符file_path: 文件路径ref: 使用源分支或来自 diff_refs 的 head_sha使用 gitlab-mcp(list_commits) 并指定:
project_id: 项目标识符ref_name: 源分支名称然后使用 gitlab-mcp(get_commit) 和 gitlab-mcp(get_commit_diff) 来:
使用 gitlab-mcp(mr_discussions) 来:
使用 gitlab-mcp(list_pipelines) 和 gitlab-mcp(get_pipeline) 来:
如果流水线失败,使用 gitlab-mcp(get_pipeline_job_output) 来了解失败原因。
对仅在此合并请求中引入的变更进行彻底审查。
创建结构化的代码审查报告,包含:
关键提示:在向 MR 添加评论之前,请先询问用户
如果用户希望将反馈直接添加到 MR:
使用 gitlab-mcp(create_note) 添加一般评论:
project_id: 项目标识符merge_request_iid: MR 内部 IDbody: Markdown 格式的评论内容使用 gitlab-mcp(create_merge_request_thread) 进行特定于代码的反馈:
project_id: 项目标识符merge_request_iid: MR 内部 IDbody: 讨论内容position: 包含差异位置详细信息的对象:
base_sha: 来自 diff_refshead_sha: 来自 diff_refsstart_sha: 来自 diff_refsnew_path: 文件路径new_line: 新代码的行号old_path: 文件路径(用于修改)old_line: 已删除代码的行号将所有反馈构建为问题,而非命令。 这鼓励对话并尊重作者的上下文。
❌ 不要这样写:
✅ 应该这样写:
# Code Review: !{MR_IID} - {MR_TITLE}
## Executive Summary
{Brief overview of changes and overall assessment}
## Merge Request Details
- **Project**: {project_path}
- **Author**: @{author}
- **Source Branch**: {source_branch} → **Target**: {target_branch}
- **Pipeline Status**: {status}
- **Approvals**: {current}/{required}
## Statistics
| Metric | Count |
|--------|-------|
| Files Changed | {count} |
| Lines Added | +{additions} |
| Lines Removed | -{deletions} |
| Commits | {commit_count} |
## Strengths
- {strength_1}
- {strength_2}
## Issues Found
### 🔴 Critical
{critical_issues_or_none}
### 🟡 Important
{important_issues_or_none}
### 🟢 Suggestions
{suggestions_or_none}
## Security Review
{security_findings}
## Performance Review
{performance_findings}
## Testing Recommendations
- {test_recommendation_1}
- {test_recommendation_2}
## Documentation Needs
- {doc_need_1}
## Verdict
{APPROVED | CHANGES_REQUESTED | NEEDS_DISCUSSION}
User: Review !42 in namespace/project
Assistant actions:
1. gitlab-mcp(get_merge_request) with project_id="namespace/project", merge_request_iid=42
2. gitlab-mcp(get_merge_request_diffs) with project_id="namespace/project", merge_request_iid=42
3. gitlab-mcp(mr_discussions) to check existing feedback
4. gitlab-mcp(list_pipelines) to check CI status
5. Analyze changes and generate report
6. Present review to user
7. Ask if user wants comments added to the MR
User: Review the MR for issue #123
Assistant actions:
1. gitlab-mcp(get_issue) with project_id="namespace/project", issue_iid=123
2. gitlab-mcp(list_merge_requests) with search for "#123" or issue reference
3. Present found MRs and ask user to confirm
4. Proceed with code review workflow
User: Show me open merge requests to review
Assistant actions:
1. gitlab-mcp(list_merge_requests) with state="opened"
2. Present list with key details (title, author, pipeline status)
3. Ask user which MR to review
每周安装次数
0
代码仓库
GitHub 星标数
2
首次出现
1970年1月1日
安全审计
Perform comprehensive code reviews of GitLab merge requests, providing actionable feedback on code quality, security, performance, and best practices.
This skill is configured for a self-hosted GitLab instance:
Activate this skill when:
IMPORTANT: Always confirm project_id before reviewing merge requests
Always provide constructive feedback framed as questions, not directives
Only review changes introduced in the merge request, not unrelated code
If a merge request IID is provided (e.g., "review !123" or "review MR 123"):
gitlab-mcp(get_merge_request)If a GitLab issue ID is provided (e.g., "review #456"):
gitlab-mcp(get_issue) to understand contextgitlab-mcp(list_merge_requests) with search filterIf no MR is specified (e.g., just "review"):
gitlab-mcp(list_merge_requests) with state: "opened"Self-hosted GitLab Instance: https://gitlab-erp-pas.dedalus.lan
Use gitlab-mcp(get_merge_request) to retrieve:
diff_refs (base_sha, head_sha, start_sha) for accurate diff comparisonExtract key information:
Project: namespace/project
MR: !123 - "Feature: Add user authentication"
Author: @username
Source: feature/auth -> Target: main
Status: Open | Pipeline: Passed | Approvals: 1/2
Use gitlab-mcp(get_merge_request_diffs) to retrieve:
Pagination : If many files changed, use pagination parameters (page, per_page) to retrieve all changes.
For complex changes, use gitlab-mcp(get_file_contents) to:
Parameters:
project_id: Project identifierfile_path: Path to the fileref: Use the source branch or head_sha from diff_refsUse gitlab-mcp(list_commits) with:
project_id: Project identifierref_name: Source branch nameThen use gitlab-mcp(get_commit) and gitlab-mcp(get_commit_diff) to:
Use gitlab-mcp(mr_discussions) to:
Use gitlab-mcp(list_pipelines) and gitlab-mcp(get_pipeline) to:
If pipeline failed, use gitlab-mcp(get_pipeline_job_output) to understand failures.
Conduct a thorough review of only the changes introduced in this merge request.
Create a structured code review report with:
Executive Summary : High-level overview of changes and overall assessment
Statistics :
Strengths : What was done well
Issues by Priority :
Detailed Findings : For each issue include:
Security Review : Specific security considerations
Performance Review : Performance implications
Testing Recommendations : What tests should be added
Documentation Needs : What documentation should be updated
CRITICAL: Ask user before adding comments to the MR
If user wants to add feedback directly to the MR:
Use gitlab-mcp(create_note) to add a general comment:
project_id: Project identifiermerge_request_iid: MR internal IDbody: Comment content in MarkdownUse gitlab-mcp(create_merge_request_thread) for code-specific feedback:
project_id: Project identifiermerge_request_iid: MR internal IDbody: Discussion contentposition: Object with diff position details:
base_sha: From diff_refshead_sha: From diff_refsstart_sha: From diff_refsnew_path: File pathnew_line: Line number for new codeold_path: File path (for modifications)Frame all feedback as questions, not commands. This encourages dialogue and respects the author's context.
❌ Don't write:
✅ Do write:
# Code Review: !{MR_IID} - {MR_TITLE}
## Executive Summary
{Brief overview of changes and overall assessment}
## Merge Request Details
- **Project**: {project_path}
- **Author**: @{author}
- **Source Branch**: {source_branch} → **Target**: {target_branch}
- **Pipeline Status**: {status}
- **Approvals**: {current}/{required}
## Statistics
| Metric | Count |
|--------|-------|
| Files Changed | {count} |
| Lines Added | +{additions} |
| Lines Removed | -{deletions} |
| Commits | {commit_count} |
## Strengths
- {strength_1}
- {strength_2}
## Issues Found
### 🔴 Critical
{critical_issues_or_none}
### 🟡 Important
{important_issues_or_none}
### 🟢 Suggestions
{suggestions_or_none}
## Security Review
{security_findings}
## Performance Review
{performance_findings}
## Testing Recommendations
- {test_recommendation_1}
- {test_recommendation_2}
## Documentation Needs
- {doc_need_1}
## Verdict
{APPROVED | CHANGES_REQUESTED | NEEDS_DISCUSSION}
User: Review !42 in namespace/project
Assistant actions:
1. gitlab-mcp(get_merge_request) with project_id="namespace/project", merge_request_iid=42
2. gitlab-mcp(get_merge_request_diffs) with project_id="namespace/project", merge_request_iid=42
3. gitlab-mcp(mr_discussions) to check existing feedback
4. gitlab-mcp(list_pipelines) to check CI status
5. Analyze changes and generate report
6. Present review to user
7. Ask if user wants comments added to the MR
User: Review the MR for issue #123
Assistant actions:
1. gitlab-mcp(get_issue) with project_id="namespace/project", issue_iid=123
2. gitlab-mcp(list_merge_requests) with search for "#123" or issue reference
3. Present found MRs and ask user to confirm
4. Proceed with code review workflow
User: Show me open merge requests to review
Assistant actions:
1. gitlab-mcp(list_merge_requests) with state="opened"
2. Present list with key details (title, author, pipeline status)
3. Ask user which MR to review
Weekly Installs
0
Repository
GitHub Stars
2
First Seen
Jan 1, 1970
Security Audits
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
114,200 周安装
色彩可访问性指南:WCAG对比度标准、色盲模拟与最佳实践
212 周安装
AgentOps技能转换器 - 一键将技能转换为Codex、Cursor等AI平台格式
212 周安装
Agile Skill Build:快速创建和扩展ace-skills的自动化工具,提升AI技能开发效率
1 周安装
LLM评估工具lm-evaluation-harness使用指南:HuggingFace模型基准测试与性能分析
212 周安装
Agently TriggerFlow 状态与资源管理:runtime_data、flow_data 和运行时资源详解
1 周安装
Agently Tools 工具系统详解:Python 代理工具注册、循环控制与内置工具使用
1 周安装
old_line: Line number for removed code