gitlab-api
Skill10 starsChanged 54 days agoMITView on GitHub
Fetches and analyzes GitLab merge request (MR) comments, metadata, and review feedback using authenticated API calls. Capabilities include fetching comment threads, retrieving reviewer feedback, filtering unresolved discussions, and generating MR activity reports. Use when the user asks about GitLab MR comments, code review discussions, review feedback, approval status, troubleshooting review delays, or needs to fetch merge request metadata via the GitLab API.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- mabhub/skillstheir own version, first seen Nov 22, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- mabhub/skills★ 1same name
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 repository81 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/development/biome-complete/AGENTS.mdAGENTS.md
- skills/development/bun-development/AGENTS.mdAGENTS.md
- skills/development/commanderjs/AGENTS.mdAGENTS.md
- skills/documentation/markdown-authoring/AGENTS.mdAGENTS.md
- skills/package-mgmt/mise-complete/AGENTS.mdAGENTS.md
- skills/testing/bdd-testing/AGENTS.mdAGENTS.md
- agents-mdSkill
- cache-auditSkill
- context-radar-auditSkill
- create-contextSkill
- guided-interviewSkill
- handover-document-creatorSkill
- load-contextSkill
- pick-modelSkill
- pinSkill
- professional-honestySkill
- rules-managementSkill
- save-contextSkill
- session-reflectionSkill
- socratic-methodSkill
- vault-captureSkill
- vault-consolidateSkill
- vault-fetchSkill
- vault-searchSkill
- bird-fortune-political-satireSkill
- brooker-esque-media-satireSkill
- clarke-dawe-esqueSkill
- comedy-style-skill-generatorSkill
- cunk-esque-mockumentarySkill
- gervais-esque-cringe-satireSkill
- monty-python-esqueSkill
- pryor-esque-confessional-standupSkill
- rock-esque-observational-standupSkill
- biome-completeSkill
- bun-developmentSkill
- commanderjsSkill
- conventional-commitsSkill
- humanizerSkill
- journal-entry-importSkill
- markdown-authoringSkill
- mermaid-diagramsSkill
- plain-englishSkill
- professional-communicationSkill
- sop-structureSkill
- logql-generatorSkill
- mise-completeSkill
- context-indexSkill
- create-context-fileSkill
- follow-upSkill
- goal-trackerSkill
- nasa-pm-lessonsSkill
- plan-createSkill
- plan-executeSkill
- plan-reviewSkill
- risk-registerSkill
- tech-debtSkill
- tech-evaluationSkill
- blast-radiusSkill
- bridgeSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 69
Read script source (scripts/get_mr_comments.sh, ~80 lines) when debugging unexpected output, extending for custom metadata, or …
- Very specific: line 144
Check System to exclude bot messages — it is independent of Type, so don't conflate the two axes (see Mindset)
- Very specific: line 145
Use jq for JSON parsing; never grep on raw API JSON
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
GitLab API Integration
Retrieve and analyze GitLab merge request comments and metadata using authenticated API calls.
Mindset
Every GitLab MR comment fetch is a snapshot of a moving target, not a stable record. Comments get edited, resolved, and deleted between when a review happens and when it's analyzed, and the GitLab API returns 200 OK even when the payload inside is an error object — HTTP status alone does not mean "this data is valid." Treat every fetch as provisional: validate the shape of what came back before trusting it, and re-fetch rather than cache when the analysis is time-sensitive (an "unresolved discussion" report generated from an hour-old cache is actively misleading, not just stale).
The second load-bearing habit: System and Type are two independent axes, not one. System: true/false answers "who/what generated this" (bot vs human); Type: DiffNote/comment answers "where does this comment live" (inline on a diff line vs a general MR-level remark). A report that conflates them — e.g. treating all DiffNotes as human or all comments as automated — will misclassify real feedback.
When to Use
- Fetching, filtering, or summarizing GitLab MR comment threads, reviewer feedback, or approval/discussion status via the API
- Building a script or report that needs to distinguish human review feedback from automated/bot comments, or inline code comments from general discussion
- Diagnosing why an MR API call fails (401/404, malformed URL, missing scope)
When NOT to Use
- GitLab CI/CD pipeline configuration or
.gitlab-ci.ymlauthoring — unrelated to the MR comments API this skill wraps - Working with GitLab issues, epics, or wikis — this skill's script and output format are scoped to merge request discussions only
Prerequisites
- Set
GITLAB_TOKENorGITLAB_PATwithread_apiscope - Requires:
curl,jq
Available Scripts
get_mr_comments.sh
Fetches all comments from a GitLab merge request. Run it relative to this skill's own directory:
scripts/get_mr_comments.sh <merge_request_url>Example:
# Prerequisites assumed: GITLAB_TOKEN with read_api scope
scripts/get_mr_comments.sh "https://gitlab.com/your-group/your-project/-/merge_requests/123"Output Format:
---
Author: Name (@username)
Date: ISO8601 timestamp (UTC)
Type: DiffNote|comment
System: true|false
Comment body textSystem: true— automated/system-generated message;System: false— human commentType: DiffNote— inline code review comment;Type: comment— general MR comment- Timestamps are UTC in ISO8601 format
Exit Codes:
0: Success1: Invalid URL format, missing token, or API error
When to Examine Script Internals:
Read script source (scripts/get_mr_comments.sh, ~80 lines) when debugging unexpected output, extending for custom metadata, or understanding URL encoding. For basic usage, the examples above suffice.
Common Workflows and Error Handling
See references/workflows-and-error-handling.md for the step-by-step review-summary and progress-tracking workflows, plus 401/404/200-with-error-body diagnosis.
Anti-Patterns
NEVER hardcode personal access tokens in scripts
WHY: PATs stored in source code are exposed in git history even after removal and create a permanent security risk — anyone with repo access, at any point in the future, can recover a token committed once.
❌ BAD:
GITLAB_TOKEN="glpat-xxxxxxxxxxxxxxxxxxxx" # inline in a script committed to version control✅ GOOD:
GITLAB_TOKEN="${GITLAB_TOKEN:?Set GITLAB_TOKEN with read_api scope}"Consequence: A leaked PAT grants read_api access to every project the token owner can see, not just the one repo it was committed to.
NEVER assume a single page has all the results
WHY: The API always paginates; requesting per_page=100 does not guarantee the result set fits on one page, and both under- and over-estimating the true count silently truncate downstream analysis.
❌ BAD:
curl "$API_URL/merge_requests?per_page=100" # assumes this is everything✅ GOOD:
page=1
while :; do
resp=$(curl -sD headers.txt "$API_URL/merge_requests?per_page=100&page=$page")
# process $resp
next=$(grep -i '^x-next-page:' headers.txt | tr -d '\r' | cut -d' ' -f2)
[ -z "$next" ] && break
page=$next
doneConsequence: Reports built on the first page only silently omit older or later comments/MRs, and nothing in the response signals that truncation happened — it looks like a complete, valid result.
NEVER call the GitLab API without respecting rate limits
WHY: The API enforces rate limits (typically 2000 req/min for REST); bulk operations without backoff must always check for 429 responses rather than assuming every request succeeds.
❌ BAD: firing parallel bulk API calls with no retry logic.
✅ GOOD: check for 429 status codes and implement exponential backoff, honoring the Retry-After header when the API provides one.
Consequence: A burst of unthrottled calls gets throttled mid-run, and any call that doesn't check its own status code silently treats a 429 error body as if it were real data.
NEVER use the API v3 endpoint path
WHY: GitLab removed API v3 in GitLab 11.0; all integrations must use v4.
❌ BAD:
https://gitlab.example.com/api/v3/projects/✅ GOOD:
https://gitlab.example.com/api/v4/projects/Consequence: v3 endpoints return 404 or are silently redirected on current GitLab instances, producing confusing failures that look like an auth or URL problem rather than a versioning one.
Critical Pitfalls
- Check
Systemto exclude bot messages — it is independent ofType, so don't conflate the two axes (see Mindset) - Use
jqfor JSON parsing; never grep on raw API JSON - Validate responses before processing — the API can return
200 OKwith an error body - URL-encode nested groups (
%2Ffor/in project paths) - Re-fetch for time-sensitive analysis — comments can be edited or deleted between fetches
- Handle UTC timestamps with proper timezone conversion when displaying to users in another zone
Eval Scenarios
- Scenario 1: Generate MR review summary
- Scenario 2: Monitor MR review activity
- Scenario 3: Diagnostic tool for MR access issues
- Scenario 4: Separate code review from discussion comments
- Scenario 5: GitLab MR integration starter kit
References
| Topic | Reference | When to Use |
| Step-by-step review-summary/progress-tracking workflows and 401/404/200-with-error-body diagnosis | Workflows and Error Handling | Building a report/monitoring script, or diagnosing a failed API call |
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.

