mr-approve
Skill2 starsChanged 41 days agoMITView on GitHub
Approve GitLab merge request. Run only when the user explicitly asks for it.
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 125
Fetch MR details: Verify MR exists and get current state
- Distinctive: line 170
When required approvals met → can merge
- Distinctive: line 182
Must ask before approving
- Distinctive: line 233
Verify MR number is correct
- Distinctive: line 234
Check you have access to the project
- Very specific: line 235
Ensure MR is in <PROJECT_PATH> project
- Very specific: line 240
Check token in ~/.config/glab-cli/config.yml
- Very specific: line 245
Check MR status with /mr-status 1598
- Very specific: line 249
Check approval status with /mr-status 1598
- Distinctive: line 250
No action needed if all approvals met
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/mr-approve
Project resolution (project-agnostic)
This command works in any GitLab repo — nothing here is tied to a specific project. Resolve the target at runtime:
- Instance, project path, and IDs — auto-detected by
glabfrom the current repo's git remotes; never hardcode them.glabreadsorigin/upstreamdirectly. When a numeric id is needed:glab api projects/$(git remote get-url origin | sed -E 's#^[a-z]+://[^/]+/##; s#^.*@[^:]+:##; s#\.git$##' | sed 's#/#%2F#g') | jq -r '.id' - Fork vs single-repo — if both
originandupstreamremotes exist, treatoriginas your fork (push target) andupstreamas the MR/issue target; otherwise operate onorigin. - Optional extras — if
.claude/gitlab-config.jsonexists in the current repo, loaddevelopers(assignee/reviewer shortcuts) andlabels(auto-label rules) from it. If it is absent, those features degrade gracefully: ask the user for the assignee/reviewer/labels instead of resolving a shortcut.
All URLs, namespaces, and IDs in the examples below (
<GITLAB_URL>,<PROJECT_PATH>,projects/<FORK_ID>, etc.) are illustrative placeholders — resolve real values per the steps above.
Approves a GitLab merge request, indicating you've reviewed the code and it meets quality standards.
⚠️ Permission Required: This command will ask for user confirmation before approving the MR.
Usage
/mr-approve <mr-number>Arguments:
<mr-number>- MR number (e.g.,1598or!1598)
Examples:
/mr-approve 1598 # Approve MR !1598
/mr-approve !1598 # Approve MR !1598What it does
- Fetches MR details to verify existence and current state
- Checks if you've already approved
- Asks user for permission to approve
- Approves the MR via GitLab API
- Confirms approval
- Shows updated approval status
Example Output
Example 1: First approval
🔍 Fetching MR !1598...
📋 MR #1598: feat(shipments): add pickup details to API responses
Status: Open
Author: dana.lee
Source: <FORK_PATH>:feature/add-pickup-details → <PROJECT_PATH>:dev
👥 Current Approvals: 1/2
✓ Eng Bob
⚠️ Approve MR #1598? (yes/no)
> yes
✅ Approving MR...
✓ MR #1598 approved successfully!
👥 Updated Approvals: 2/2 ✅
✓ Eng Bob
✓ Dana Lee (You)
✅ All required approvals received - Ready to merge!
🔗 MR URL: <GITLAB_URL>/<PROJECT_PATH>/-/merge_requests/1598Example 2: Already approved
🔍 Fetching MR !1598...
📋 MR #1598: feat(shipments): add pickup details to API responses
ℹ️ You have already approved this MR.
👥 Current Approvals: 2/2 ✅
✓ Eng Bob
✓ Dana Lee (You)
✅ All required approvals received - Ready to merge!
💡 Next steps:
• Merge MR: /mr-merge 1598
• View MR: /mr-status 1598
🔗 MR URL: <GITLAB_URL>/<PROJECT_PATH>/-/merge_requests/1598Example 3: User cancels
🔍 Fetching MR !1598...
📋 MR #1598: feat(shipments): add pickup details to API responses
⚠️ Approve MR #1598? (yes/no)
> no
✗ Approval cancelledExample 4: Cannot approve own MR
🔍 Fetching MR !1598...
📋 MR #1598: feat(shipments): add pickup details to API responses
Author: dana.lee
❌ Cannot approve your own merge request.
💡 Request reviews instead:
/mr-review-request 1598 alice bobProcess
- Parse MR number: Extract MR number from argument
- Fetch MR details: Verify MR exists and get current state
- Check author: Prevent self-approval
- Check existing approval: See if user already approved
- ⚠️ ASK USER PERMISSION: Display approval preview and await confirmation
- Approve MR (if approved): POST to
/api/v4/projects/2/merge_requests/{iid}/approve - Fetch updated approvals: Get new approval count
- Confirm: Display updated approval status
GitLab API
Endpoint: POST /api/v4/projects/{id}/merge_requests/{iid}/approve
Example API call:
# Approve MR
glab api --method POST projects/2/merge_requests/1598/approve
# Check approval status
glab api projects/2/merge_requests/1598/approvals | jq '{
approvals_required,
approvals_left,
approved_by: [.approved_by[].user.username]
}'
# Unapprove MR (if needed)
glab api --method POST projects/2/merge_requests/1598/unapproveApproval Rules
Can approve when:
- ✅ You are listed as a reviewer
- ✅ You have Developer role or higher
- ✅ You are not the MR author
- ✅ MR is open (not merged or closed)
Cannot approve when:
- ❌ You are the MR author (self-approval not allowed)
- ❌ MR is already merged or closed
- ❌ You don't have permission
Approval workflow:
- MR created by author
- Reviewers assigned
- Reviewers approve after review
- When required approvals met → can merge
- Author or assignee merges
Permissions
Requires user permission because:
- Changes MR state (adds approval)
- Affects merge readiness
- Indicates code review completion
Per GITLAB_PERMISSIONS.md:
approve:mris inrequiresPermissionlist- Must ask before approving
Related Commands
/mr-status <mr>- Check MR status before approving/mr-review-request <mr> <dev>- Request additional reviews/mr-merge <mr>- Merge MR (after approvals)/mr-list- List MRs needing approval- View
.claude/core/GITLAB_PERMISSIONS.mdfor permission rules
Approval Status Indicators
| Status | Meaning |
| ✅ 2/2 | All required approvals received |
| ⚠️ 1/2 | Partially approved, more needed |
| ⚠️ 0/2 | No approvals yet |
| ✓ | Specific user approved |
Best Practices
Before approving:
- ✅ Review the code changes thoroughly
- ✅ Check pipeline status (should pass)
- ✅ Verify no merge conflicts
- ✅ Ensure coding standards are met
- ✅ Test functionality if needed
Don't approve if:
- ❌ You haven't reviewed the code
- ❌ Pipeline is failing
- ❌ There are merge conflicts
- ❌ Code doesn't meet standards
- ❌ You have concerns or questions
Workflow:
# 1. Check MR status
/mr-status 1598
# 2. Review code changes (in IDE or browser)
# 3. If satisfied, approve
/mr-approve 1598
# 4. If all approvals received, merge
/mr-merge 1598Troubleshooting
"MR not found"
- Verify MR number is correct
- Check you have access to the project
- Ensure MR is in
<PROJECT_PATH>project
"Permission denied"
- Your GitLab token needs
apiscope - You must have Developer role or higher
- Check token in
~/.config/glab-cli/config.yml
"Cannot approve"
- You might be the MR author (self-approval not allowed)
- MR might be closed or merged
- Check MR status with
/mr-status 1598
"Already approved"
- You've already approved this MR
- Check approval status with
/mr-status 1598 - No action needed if all approvals met
Notes
- Approving indicates you've reviewed and code meets standards
- Different from just commenting "LGTM"
- Approvals are tracked and required for merge
- Can unapprove if you change your mind (use GitLab UI)
- Cannot approve your own MRs
Created: 2025-12-27
Last updated: 2025-12-27
Config file: .claude/gitlab-config.json
Other versions1 project uses a version of this.
Word for word · 1
- AhmedMerza/claude-skills★ 2100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository53 other files it gives its agents.
- animateSkill
- api-docs-completeSkill
- best-optionSkill
- browseSkill
- changelog-generateSkill
- checkpointSkill
- claimSkill
- commitSkill
- courtSkill
- design-driftSkill
- designSkill
- expandSkill
- explainSkill
- fix-reviewSkill
- grill-meSkill
- handover-listSkill
- handover-resumeSkill
- handover-saveSkill
- i18n-syncSkill
- issueSkill
- leadSkill
- mr-assignSkill
- mr-createSkill
- mr-guideSkill
- mr-listSkill
- mr-mergeSkill
- mr-review-requestSkill
- mr-reviewSkill
- mr-statusSkill
- persona-walkthroughSkill
- ponytailSkill
- prove-the-testSkill
- qa-crawlSkill
- qa-sweepSkill
- reflectSkill
- reviewSkill
- root-causeSkill
- scoutSkill
- second-opinionSkill
- ship-checkSkill
- skill-auditSkill
- skill-compareSkill
- spinoffSkill
- story-siteSkill
- tool-compareSkill
- ui-auditSkill
- ui-polishSkill
- usage-weekSkill
- ux-auditSkill
- validate-planSkill
- video-teardownSkill
- wait-whatSkill
- where-were-weSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

