Fix red GitLab pipelines and review merge requests from Claude Code through the glab CLI: failed-job log triage, draft-only MR review, MR creation and thread resolution. Works on self-managed GitLab, no MCP or admin toggle.
Claude Code:
/plugin marketplace add brianshepardpss/plugin-creator /plugin install merge-medic@plugin-creator
/gl-fix-pipeline demo
This builds a small demo repo whose remote is a fictional self-managed host (gitlab.example-corp.test) and uses a bundled fake glab that replays recorded API responses. Merge Medic finds the 3 failed jobs in pipeline 1873:
max that shouldbe min in late_fees.py, fixes it, and reruns the tests locally.
code and offers glab ci retry 90414 plus the Dependency Proxy fix.
reported, but nothing is changed for it.
Then it asks before pushing. Logs are cut by a script before Claude reads them. The 6,245-line OOM log in samples/ comes down to 5 lines plus a header.
| Piece | Purpose | ||
|---|---|---|---|
| `/gl-fix-pipeline [iid\ | branch\ | demo]` | Hero. Failed jobs via glab ci get, finished logs via glab api .../trace (never the blocking glab ci trace), excerpted and secret-masked by trace_excerpt.py, classified (test, lint, build, dependency, config, infra-flaky, resource, timeout), fixed and verified locally, pushed or retried only after you say yes |
| `/gl-review [iid\ | url\ | demo]` | One glab mr diff, one reviewer subagent, line numbers computed by diff_lines.py, findings posted as draft inline comments that only you see until you publish |
/gl-mr | Pushes the branch and opens a draft MR on your remote's host with a title and description from the commits and Closes #N | ||
/gl-threads | Lists only unresolved threads, fixes what was asked, replies in-thread, and resolves only the threads it changed code for | ||
| SessionStart check | In a GitLab repo, prints one line if glab is missing, too old, or not logged in to *your* host. Silent otherwise | ||
| Confirmation guard | Asks before glab mr merge/approve/close, mr note publish/delete, ci delete/cancel, glab api -X DELETE/PUT/PATCH, variable set, other delete/revoke commands, and force pushes |
Skills trigger on plain requests too: "my pipeline is red", "review !42", "open an MR for this branch, it fixes 17", "address the review comments".
Nothing is sent anywhere by the plugin itself. Commands go from your machine to your own GitLab instance through glab, with your token. Job logs are saved to your temp directory. Common secret formats (GitLab, AWS, npm, GitHub and Slack tokens, auth headers, URL credentials, *_PASSWORD= style variables, JWTs, private keys) are masked before log text reaches Claude; masking is pattern-based, so treat it as a safety net. Pushes and retries always wait for your yes. MR creation, thread replies and resolves happen only when you asked for them in the conversation, or after you confirm. Review comments are always drafts, and Merge Medic never publishes them, approves or merges on its own. There is no telemetry.
MIT licensed, with its design brief and eval suite: github.com/brianshepardpss/merge-medic. Ideas or problems? Open an issue there, or ask the plugin's request skill to draft one for you.
Not affiliated with or endorsed by GitLab Inc. This plugin is not