运维审查
- 作者仓库星标 0
- 作者更新于 实时读取
- 作者仓库 skills-registry
- 领域
- 文档
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- Python
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: gitlab-mr
description: Create and manage GitLab Merge Requests on gitlab.example.com repositories, driving them to a tr…
category: 文档
runtime: Python
---
# gitlab-mr 输出预览
## PART A: 任务判断
- 适用问题:PRD、RFC、README、项目说明或知识库整理。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Rules / Execution Flow / Step 1: Check Prerequisites”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于PRD、RFC、README、项目说明或知识库整理,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Rules / Execution Flow / Step 1: Check Prerequisites”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、会按任务需要访问外部网络、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令。
先用一个小任务确认它会围绕“Rules / Execution Flow / Step 1: Check Prerequisites”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: gitlab-mr
description: Create and manage GitLab Merge Requests on gitlab.example.com repositories, driving them to a tr…
category: 文档
source: tomevault-io/skills-registry
---
# gitlab-mr
## 什么时候使用
- 用于审阅代码、文档或方案并给出可执行反馈 适合处理README、PRD、RFC、教程和知识库文档,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;通常不需要…
- 面向PRD、RFC、README、项目说明或知识库整理,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Rules / Execution Flow / Step 1: Check Prerequisites」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "gitlab-mr" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Rules / Execution Flow / Step 1: Check Prerequisites
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Python | 读取文件、写入/修改文件、执行终端命令 | 会按任务需要访问外部网络
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} GitLab MR
Create an MR and drive it to a truly mergeable state (all CI green + no merge conflicts). Core principle: write documentation first, then submit the MR, verify with APIs, and loop through fixes until the MR is mergeable.
Prerequisite: The current repository's remote points to gitlab.example.com, and glab CLI is installed.
Rules
- Never use the
skip-doc-checklabel — every MR must have a real documentation link - User Story must be relevant to the MR changes — CI checks relevance (
check:mr-us-relevance); irrelevant links will be rejected - Blob links must point to pushed files — the branch name and file path in the link must exist on the remote
- Verify with APIs, don't guess — confirm results at every step using
glabcommands
Execution Flow
Step 1: Check Prerequisites
# Confirm remote points to gitlab.example.com
git remote get-url origin
# Confirm current branch is not main/master
git branch --show-current
# Confirm no uncommitted changes
git status
If there are uncommitted changes, commit or stash them first.
Step 2: Ensure Documentation Exists
The MR description must contain documentation links. CI performs two checks:
check:mr-documentation: whether the link format is validcheck:mr-us-relevance: whether the linked document is relevant to the MR changes
Prefer GitLab blob links pointing to documentation files within the repository.
2a: Find or Create Documentation
Check whether related documentation already exists in the repository:
# Look for potentially related documents
ls docs/plans/ docs/04-user-stories/ 2>/dev/null
If no related documentation exists, create one for this MR:
- Place the document at
docs/plans/YYYY-MM-DD-<feature-name>.md(design doc) ordocs/04-user-stories/<feature-name>.md(User Story) - The document content must cover the core changes in this MR (otherwise the relevance check will fail)
- The document does not need to be long, but must describe: what was done and why
2b: Commit and Push Documentation
git add docs/plans/<doc-file>.md
git commit -m "docs: add <feature> design document"
Step 3: Push the Branch
git push -u origin <branch-name>
Step 4: Create or Update MR
Check if an MR already exists
glab mr list --source-branch <branch-name>
If no MR exists, create one
Analyze all commits in git log main..HEAD to write the MR title and description.
Blob link format: https://gitlab.example.com/<group>/<project>/-/blob/<branch>/<filepath>
<group>/<project>parsed fromgit remote get-url origin<branch>is the current branch name<filepath>is the in-repo path to the document
glab mr create \
--title "<concise title, <70 chars>" \
--description "$(cat <<'EOF'
## Change Summary
<Summary based on all commits, 2-3 bullet points>
## Related Documentation
- User Story (required): https://gitlab.example.com/<group>/<project>/-/blob/<branch>/docs/plans/<doc>.md
- Tech Design: <fill if available, otherwise remove this line>
## Change Type
- [x] <corresponding type>
EOF
)" \
--push
If an MR exists but the description lacks documentation links
glab mr update <mr-id> --description "$(cat <<'EOF'
<complete description with blob links>
EOF
)"
Step 5: Wait and Check Pipeline
After creating/updating the MR, wait for the pipeline to trigger and complete.
# Wait for pipeline to start (usually takes a few seconds after push)
sleep 5
# Check pipeline status
glab ci status
If the pipeline is still running, wait and check again:
sleep 20
glab ci status
Step 6: Handle Failed Jobs
If the pipeline fails, check which specific job failed:
# Get status of all jobs in the pipeline
glab api "projects/:id/merge_requests/<mr-iid>/pipelines" | python3 -c "
import sys,json
pipelines = json.load(sys.stdin)
if pipelines:
pid = pipelines[0]['id']
print(f'Latest pipeline: {pid}, status: {pipelines[0][\"status\"]}')
"
# View failed job logs
glab api "projects/:id/pipelines/<pipeline-id>/jobs" | python3 -c "
import sys,json
for j in json.load(sys.stdin):
if j['status'] == 'failed':
print(f'FAILED: {j[\"name\"]} (id={j[\"id\"]})')
"
# Get the tail of a failed job's log
glab api "projects/:id/jobs/<job-id>/trace" 2>&1 | tail -30
Common Failures and Fixes
| Failed Job | Cause | Fix |
|---|---|---|
check:mr-documentation |
MR description missing a valid documentation link | glab mr update <id> --description "..." to add blob links |
check:mr-us-relevance |
Document content is not relevant to MR changes | Edit the document to cover the MR's core changes, commit and push |
validate:skills |
SKILL.md format is non-compliant | Run uv run python scripts/validate.py --skills to fix locally |
validate:security |
Security scan detected an issue | Run uv run python scripts/validate.py --security to fix locally |
| Merge conflict | Branch conflicts with main | git fetch origin main && git rebase origin/main, resolve conflicts and force push |
After fixing:
- If the issue was in the MR description (
check:mr-documentation): update the description then retry the job - If the issue was in code/docs: commit the fix, push, and a new pipeline will trigger automatically
# Retry a failed job
glab ci retry <job-id>
# Or push a new commit to trigger a new pipeline
git push
Step 7: Confirm MR Is Mergeable
After CI passes, also confirm the MR has no merge conflicts. CI passing does not mean mergeable.
glab ci status # Confirm CI is all green
glab mr view <branch> # Confirm no merge conflict
If there are merge conflicts, resolve them (rebase onto main), force push, and wait for the new CI to pass.
Loop through Steps 5-7 until both conditions are met: CI all green + no conflicts.
Once the MR is truly mergeable, report the MR URL to the user.
Examples
Full Workflow Example
# Create MR
glab mr create --title "feat: add retry logic" --description "..." --push
# Loop until CI passes
glab ci status # -> if failed, check logs, fix -> check again
# After CI passes, check merge status
glab mr view feat/add-retry-logic
# -> conflicts? rebase to resolve -> force push -> wait for new CI
# Final confirmation: CI all green + no conflicts -> report MR URL
Bad/Good Examples
Bad — Declaring done just because CI passed
glab ci status # -> success
# -> "MR !42 is created, CI passed!" <- but there's actually a merge conflict, cannot merge
Bad — Posting an irrelevant link
glab mr create --description "User Story: .../README.md" # unrelated to changes, CI will reject
Good — Driving to a truly mergeable state
# Create MR -> poll CI and fix failures -> check merge status -> resolve conflicts -> confirm mergeable
Notes
- Branch names containing
/(e.g.,feat/my-branch) are correctly handled by GitLab in blob links glab ci statusshows the status of all jobs in the latest pipeline- If the pipeline doesn't trigger for a long time, you can manually run:
glab ci run - After updating the MR description, you need to retry the failed job or wait for a new pipeline
Source: addxai/enterprise-harness-engineering — distributed by TomeVault.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核