gitlab-mr-roundtrip
Skill1 starsChanged 10 days agoMITView on GitHub
GitLab MR comment round-trip: fetch threads, judge vs code, fix in atomic commits, push, reply+resolve, watch CI. Use on MR review feedback.
- Commits and pushes
1 other project uses a version of this.
Adopted by
Most recently taken up by
- vladcheck/skillsword for word, first seen Nov 8, 2026
Other versions1 project uses a version of this.
Word for word · 1
- vladcheck/skills★ 1100% 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 repository19 other files it gives its agents.
- analyze-session-pingpong-logsSkill
- create-glossarySkill
- deepseek-reasoning-tier-clarifierSkill
- defineSkill
- find-alternativesSkill
- get-note-links-from-textSkill
- gitlab-eas-tickets-publishSkill
- git-rebuild-branchSkill
- git-sequentialSkill
- gost-report-rebuildSkill
- mattpocock-skills-researchSkill
- mirea-moodle-downloadSkill
- obsidian-add-links-to-noteSkill
- opsx-spec-validateSkill
- paretto-principleSkill
- publish-spec-gitlab-milestoneSkill
- publish-tickets-gitlabSkill
- solidSkill
- update-skills-via-skills-shSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Tokens stay invisible: Never --show-token, never cat a token file, never paste credentials into notes, replies, or logs.
- Distinctive: line 46
Sync before you judge: Verify against the live branch, not stale files:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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 MR comment round-trip
The whole loop behind "see comments on MR X, evaluate, fix, make atomic commits, push, resolve": fetch every thread → judge each against code → fix atomically → push → reply + resolve → CI green. One pass, nothing left open except threads the owner forbade touching.
Hard rules
- Merge only on explicit ask. Without human approval the MR is not ready; approval by a person or automerge set by the owner is the only green light.
- Your MRs only. On an MR owned by someone else, nothing changes: no fixes pushed, no replies, no resolves — track it as a dependency and report.
- Push with hooks or not at all.
--no-verifystays out; a failing hook is the next reviewer. Three failed push attempts → report exact hook output and stop. - A thread is settled only when your reply note and
resolved=trueare both visible in a re-fetched discussions response. A plan, a chat message, or "will do" settles nothing. - Tokens stay invisible. Never
--show-token, never cat a token file, never paste credentials into notes, replies, or logs.
Procedure
Pin the MR. Take project path and iid from the URL, never from memory — iids collide across projects. On
scm.x5.rualways pass--hostname scm.x5.ru(glab defaults to gitlab.com and 401s there).glab mr view <iid> --repo <group>/<project> --hostname scm.x5.ruRecord: title, source branch, target branch, head SHA. Done when you can recite head SHA and both branches.
- ❌ Reusing a remembered numeric project id — the baobab notes you fetch may be x5m-web's (
34535is x5m-web; baobab is108880). "The raw notes look like they belong to a different project" is this bug. - ✅
x5m/frontend/baobab/-/merge_requests/20→ pathx5m%2Ffrontend%2Fbaobab, derived fresh from the URL.
- ❌ Reusing a remembered numeric project id — the baobab notes you fetch may be x5m-web's (
Fetch every thread, full text. System notes are noise; bot threads (e.g.
SRV.COPILOT-*) are not — they judge just like human ones, even when the instance marks them non-blocking (blocking_discussions_resolved=truesays nothing about whether the point is real).glab api --paginate --hostname scm.x5.ru \ "projects/<group%2Fproject>/merge_requests/<iid>/discussions" > /tmp/mr<iid>-discussions.jsonFilter
.[] | select(.notes[0].system == false). List output truncates long bodies — get the full body via.../notes/<note-id>(or pipe JSON tojq;glab apihas no--jq). Per thread record:discussion_id, author,resolved, existing replies,position.new_path/new_line. Done when every non-system thread sits in one table, verdict column empty.- ❌ Replying to the two-line truncated preview of a diff note and confidently fixing the wrong thing.
- ✅ Pull the single note, read the reviewer's repro, then judge.
- Sync before you judge. Verify against the live branch, not stale files:
A colleague may have rebased the branch mid-review (new SHAs for the same commits). Fast-forward or rebase onto the new head before fixing; stop on a failed ff and report rather than force it.git -C <worktree> fetch origin && git -C <worktree> merge --ff-only origin/<branch>- ❌ Amending an annotation fix onto the SHA you fetched an hour ago — push is rejected, or worse, silently clobbers the rebase.
- ✅ Notice remote head changed, rebase the fix onto
d30c699d-equivalent, continue.
- Judge each comment against code. Open the file at the comment's position and reproduce the claim. Reviewer repros against real behavior are usually right; check claims about upstream APIs against real API shapes and repo docs/specs, not fixtures or a worker's summary. Your own past verdicts and subagent assurances get the same treatment: re-verify with a fresh command before repeating.
Verdict per thread: fix (point is real) / explain (already handled or claim is wrong — evidence required) / question (answer from code). Done when every thread has a verdict and the evidence line that earned it.
- ❌ "Well, this is all planned" — three concrete bot points about duplication, missing
extends, wrong variable, dismissed with one sentence, zero code read. - ✅ "Fair challenge — re-verify rather than rely on the earlier worker's claim":
git greponmainfor the deleted configs, zero references, file last-touched dates attached.
- ❌ "Well, this is all planned" — three concrete bot points about duplication, missing
- Fix in atomic commits. One commit per logical change, in the ticket's worktree. Stage deliberately per file; if a commit sweeps extra content, undo with
git reset --soft HEAD~1and redo. Verify each commit carries exactly its files:
Message follows the repo convention, ticket key first, Russian fine:git show --stat HEADTEXCOB-1040: fix(ci): .... After all fixes, run the repo's full check suite once (order-dependent fixture breakage shows up only there) — not just the touched test.- ❌
git commit -a— six review fixes plus half the scratch files in one blob; the reviewer can't map any comment to any diff. - ✅ Six commits, each named after the thread it closes; reply cites its SHA.
- ❌
- Push. Plain push first attempt. Branch already pushed → new commit on top; amend only local-only commits, and rewrite pushed history only on your unreviewed branch with
--force-with-lease. Done whengit ls-remote origin <branch>equals your local HEAD.- ❌
git push --no-verifybecause the hook complains about one file — the hook just filed a real review comment you skipped. - ✅
git push origin <branch>; rejected → ff-sync (step 3) → push again.
- ❌
- Settle every thread: reply, then resolve. A note alone does not close a thread. Write the body to a file first (quoting), then:
Reply in the reviewer's language, cite the fix SHA and the test that locks it, keep technical tokens verbatim, drop internal codenames. On a merged MR the threaded-reply endpoint 404s — post an MR-level note instead and say what it covers. Never blindly repeat a POST you already saw succeed. Done = re-run step 2 and confirm yourglab api -X POST --hostname scm.x5.ru \ "projects/<path>/merge_requests/<iid>/discussions/<discussion_id>/notes" -f "body=$(cat /tmp/reply.md)" glab api -X PUT --hostname scm.x5.ru \ "projects/<path>/merge_requests/<iid>/discussions/<discussion_id>" -f resolved=truenote_idandresolved=trueon every targeted thread, everything else unchanged.- ❌ Reporting "all comments addressed" while five threads still show
resolved=falseand the merge gate sits onblocking_discussions_resolved. - ✅ Five replies with
reply_note_ids, five PUTs, re-fetch shows the table closed.
- ❌ Reporting "all comments addressed" while five threads still show
- Watch CI to a terminal state. Poll the head pipeline on the fix SHA:
Right after a push the status reads transient (glab mr view <iid> --repo <path> --hostname scm.x5.ru --output json | jq -r '.head_pipeline.status'checking/pendingeven for a healthy pipeline) — re-poll, report only the final verdict with the SHA it belongs to. Some projects have no MR pipeline at all (boilerplate repos: CI lives in the paired application MR) — confirm from the merge-request fields, then report that, don't invent a green check.- ❌ "Pipeline failed" from one snapshot taken mid-check, three minutes before it goes green.
- ✅
successon4cf0174, reported with the SHA.
Failure triage
Consult on the first error; each signature has one cause and one action.
| Signature | Cause | Action |
DNS/timeout on scm.x5.ru | VPN off | Retry once, then tell the user to turn the VPN on; never loop the same call |
401 mentioning gitlab.com | Wrong host — glab defaults there | Add --hostname scm.x5.ru; check glab auth status --hostname scm.x5.ru; token at ~/.secrets/gitlab-token |
GETs 200, POST/PUT 403 | read_api token can't write | Error body names the missing permission ("Merge Request: Create") — get an api-scope token; a PRIVATE-TOKEN header may work where Authorization: Bearer 403s |
404 on notes/discussions for an iid that exists in the UI | Wrong numeric project id (iid collision) | Re-derive path from the MR URL (step 1) |
| Push rejected / non-fast-forward | Remote moved (colleague rebase) | Fetch, rebase onto new head, --force-with-lease (own branch only) |
404 posting a threaded reply | MR merged; threads are sealed | MR-level note, state what it answers |
assignee_ids won't clear | Form encoding ignored | PUT with JSON body {"assignee_ids": []} + Content-Type: application/json |
Subagents
Parallel fixers are fine; uncoordinated closers are not.
- One thread-owner per MR. The implementer of the code answers comments about it. Two agents replying to one thread produces two half-answers.
- Give the dispatch contract: every assigned thread ends settled (reply+resolve) or with an explain-verdict backed by code evidence, in the reviewer's language, citing SHAs. Non-blocking bot threads are in scope.
- Demand a structured receipt so step 7's Done check is mechanical: per thread
{verdict, commit, discussion_id, reply_note_id, resolved}+{push_attempts, hook_output, head_sha}. - Fixers working in side branches land via cherry-pick onto the MR branch after the full suite runs — never "join them later" by hand.
- ❌ "Dispatch agents to handle comments" with no closing criterion → agent reports "all planned", zero replies, user finds it two hours later.
- ✅ Agent that under-delivered gets reopened with: explain the verdict to me, or fix, commit atomically, reply, resolve. Receipt verified against a re-fetch.
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.

