/merge-request:fix <ID> — the PR/MR number to monitor (required)from Merge Request
Monitor an open pull/merge request (by id) and, as feedback arrives, gather every actionable item — human + bot/AI review comments and MR-attributable CI failures — deduplicated against a durable ledger so nothing is handled twice. Polls on an adaptive scheduled-wakeup cadence until the PR/MR closes. First runs /detect-source-control and hard-stops when the forge is unsupported. Use as "watch the PR", "monitor the MR for feedback", "fix review feedback on <id>", or the continuation of /merge-request:create.
Ships in Merge Request. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Watch an open PR/MR and keep the review loop moving: on an adaptive interval, gather freshly-arrived feedback (human comments, bot/AI-reviewer comments, and CI failures), deduplicate it against a durable ledger, classify CI failures by attribution, and hand the unseen, actionable items to the triage-and-apply half (fn-10.2). Keep polling via scheduled wakeups until the PR/MR is closed.
This is an assistant-executed skill: you (the assistant) follow the steps
below. The deterministic forge work — fetching comments/threads/CI, computing
stable dedupe keys, diffing against the ## Handled ledger, and writing ledger
records — lives in scripts/gather-feedback.sh. The poll loop itself is your
continuation driven by the harness ScheduleWakeup tool; a script cannot
schedule its own next wake.
Scope note: the monitoring core (fn-10.1) is the
<ID>gate, the wakeup loop, intent reload, feedback gathering + dedupe, CI attribution, and the reported/non-actionable CI write-back (Steps 0–4, 6, 7). The decide-and-apply loop (fn-10.2) — implement criteria, the spec guardrail, test-before-push,Fixed+resolve, and## Declined— is Step 5 below.
<ID> argument/merge-request:fix needs the PR/MR id to monitor. If none was provided,
do nothing beyond a clear message and stop:
/merge-request:fixneeds a PR/MR id to monitor, e.g./merge-request:fix 128. Nothing to do without one. (Run/merge-request:createfirst to open one.)
Never guess an id or pick "the latest" PR/MR — absence of an id means there is nothing for this skill to do.
Invoke the shared /detect-source-control skill and capture its stdout block
and exit code. Apply the fn-8 hard-stop contract (see ../../README.md),
exactly as /merge-request:create does:
git missing). Stop
and report; nothing was changed.0 and supported=false → a successful detection of an unsupported
forge. Stop, naming the detected forge/host.0 and supported=true → proceed. Remember forge (github or
gitlab) — you pass it to gather-feedback.sh.Never key the unsupported stop off a non-zero exit; forge=unsupported is a
normal exit-0 result.
Read the shared artifact .data/merge/<ID>.md (written by /merge-request:create).
Its ## Intent block is the author's pre-MR intent, and it survives a resumed
session — load it so your later judgement is anchored to what the change was
for.
## Intent is present (and not the [TODO] Intent not provided placeholder),
use it as the primary intent.## Change scope is already stashed in the file). Just make sure
you have the best-available intent loaded before acting.(The full cumulative spec guardrail — Intent + PR/MR body + linked .flow
specs + branch diff, asking on conflict — is assembled in Step 5a before you
decide anything.)
Run the gather helper for the resolved forge and id:
bash "${CLAUDE_PLUGIN_ROOT}/skills/fix/scripts/gather-feedback.sh" gather \
--forge <github|gitlab> --id <ID>
It fetches, for the PR/MR:
kind=comment, non-resolvable),kind=thread; source_id is the resolvable thread id —
GitLab discussion id / GitHub review-thread node id — that fn-10.2 resolves),kind=ci-job),each carrying a stable id and a dedupe key (content_hash for
thread/comment, fingerprint for ci-job), then diffs them against the
## Handled ledger and prints only the unseen-or-changed items as JSONL,
followed by a machine-readable trailer:
MR_STATE=open|closed|merged|unknown
MR_UPDATED=<iso8601|unknown>
MR_CADENCE=active|idle
MR_POLL_SECONDS=<int>
MR_FETCHED_COUNT=<int>
MR_ACTIONABLE_COUNT=<int>
Parse the JSONL lines (each begins with {) as your actionable feedback set, and
the MR_* trailer for the loop. Dedupe is the script's job — never re-fetch or
re-diff by hand. Its guarantees:
fingerprint ({forge, job name, commit
SHA, normalized error signature}) — not the job/pipeline id, which changes on
every rerun. A rerun of the same failure is "seen"; a new commit re-surfaces it.source_id + content_hash — the same id with a
changed hash (an edited comment or a new reply) counts as changed and comes
back for reconsideration.pending-user ledger record therefore suppresses re-asking that
item until its source changes (Step 6).For each kind=ci-job item, decide MR-attributable vs non-actionable before
anything downstream touches it:
job_name/signature/commit plus the logs
(pull them via gh/glab when you need more than the signature) to judge.fn-10.1 owns the write path for the CI items you do NOT hand downstream.
Immediately after reporting a non-actionable (or reported-ambiguous) CI item,
write its ## Handled record so the next wakeup does not re-report it:
bash "${CLAUDE_PLUGIN_ROOT}/skills/fix/scripts/gather-feedback.sh" record \
--id <ID> --kind ci-job --decision <non-actionable|reported> \
--fingerprint <fingerprint-from-the-item> \
--commit <commit-from-the-item> \
--rationale "<why it isn't MR-attributable>"
The --fingerprint must be the item's own fingerprint (that is the CI
dedupe key). Only the MR-attributable failures go on to Step 5; fn-10.2 writes
their terminal ## Handled records when it implements or declines them.
You now hold the unseen items Step 3/4 handed you: human comments, bot/AI
comments, and MR-attributable CI failures. For each one, decide whether it
warrants a change, implement the worthy ones (tests first), acknowledge +
resolve, record the declined ones, and write a terminal ## Handled record.
Every item you touch here ends with exactly one ## Handled record written
through gather-feedback.sh record — never hand-edit the ledger.
Before judging anything, load all available guardrail sources and treat them together — none replaces another:
## Intent in .data/merge/<ID>.md (loaded in Step 2) — the author's pre-MR intent.gh pr view <ID> / glab mr view <ID>)..flow/specs/tasks discoverable by id in the branch name, the
PR/MR body, or commit messages (e.g. fn-10, fn-10.2) — read the epic/task
with flowctl cat <id> when one is discoverable.<default>..HEAD (the ## Change scope
stash already holds this) — it describes scope only.The diff never overrides a discoverable epic: it tells you what this change
touches, not what the change is allowed to be. When the sources conflict or are
incomplete — or when a feedback item's spec-impact is genuinely ambiguous —
ask the user once and record pending-user (Step 6) rather than guessing.
Read the repo's technical standards in this precedence: CLAUDE.md /
AGENTS.md first, then docs/. These are what "consistent with repo
standards" (criterion 2 below) is measured against. Absence of any standard is
not license to invent one — fall back to the surrounding code's conventions.
Implement a feedback item only when all three hold:
Outcomes:
pending-user (Step 6); do not implement or decline yet.For each worthy item, make the change following the surrounding code + Step-5b standards. Then, before committing:
CLAUDE.md/AGENTS.md,
package scripts (package.json, pyproject.toml, …), a Makefile/justfile
target, or the CI config. Run the relevant automated tests for what you
changed.pending-user with rationale "no automated test command found" (via the
Step 6 command) so wakeups stop re-processing it until the user answers or the
source changes.Once the change is committed + pushed, post exactly Fixed and resolve the
originating thread through the forge-specific helper:
bash "${CLAUDE_PLUGIN_ROOT}/skills/fix/scripts/reply-resolve.sh" \
--forge <github|gitlab> --id <ID> \
--kind <thread|comment> --source-id <item.source_id>
kind=thread → it replies Fixed and resolves (GitLab resolve-discussion /
GitHub resolveReviewThread). A RESOLVED=0 in its output / a non-zero exit
means the thread stayed open — surface it.kind=comment → non-resolvable plain comment: it posts Fixed as a general
note and reports RESOLVED=skipped (the documented fallback).kind=ci-job has no thread — do not call reply-resolve.sh; the pushed
commit is the acknowledgement. Go straight to the ledger record.Then write the terminal ## Handled record — carrying the item's dedupe key
unchanged from the gather JSONL (--content-hash + --source-id for
thread/comment, --fingerprint for ci-job):
# thread / comment:
bash "${CLAUDE_PLUGIN_ROOT}/skills/fix/scripts/gather-feedback.sh" record \
--id <ID> --kind <thread|comment> --decision implemented \
--source-id <item.source_id> --content-hash <item.content_hash> \
--commit <commit-sha>
# ci-job:
bash "${CLAUDE_PLUGIN_ROOT}/skills/fix/scripts/gather-feedback.sh" record \
--id <ID> --kind ci-job --decision implemented \
--fingerprint <item.fingerprint> --commit <commit-sha>
When an item fails any of the three criteria, do not change code. Append the
item and a short rationale to the ## Declined section of .data/merge/<ID>.md
(create the heading if absent; it is append-only prose), e.g.:
## Declined
- **<thread/comment/CI ref>** — <one-line why>: <declined because it would change
the spec / conflicts with <standard> / isn't a legitimate shortcoming>.
Then write the terminal ## Handled record with --decision declined and the
rationale, carrying the same per-kind dedupe key:
bash "${CLAUDE_PLUGIN_ROOT}/skills/fix/scripts/gather-feedback.sh" record \
--id <ID> --kind <thread|comment> --decision declined \
--source-id <item.source_id> --content-hash <item.content_hash> \
--rationale "<why it was declined>"
# (ci-job declines use --fingerprint <item.fingerprint> instead of --source-id/--content-hash)
The ## Declined prose is the human-readable record (per the user's request);
the ## Handled record is the machine dedupe key so the next wakeup never
re-surfaces the same declined item.
pending-userWhen an item's spec-impact or CI attribution is genuinely ambiguous, ask the user once, then record it so wakeups stop re-asking:
bash "${CLAUDE_PLUGIN_ROOT}/skills/fix/scripts/gather-feedback.sh" record \
--id <ID> --kind <thread|comment|ci-job> --decision pending-user \
<dedupe-key flags: --content-hash <hash> --source-id <id> | --fingerprint <fp>> \
--rationale "<the question you asked>"
While a pending-user record stands, the Step-3 dedupe suppresses re-asking
that item — until either (a) its source changes (a new commit / fingerprint
for CI, or a new content_hash for a thread/comment) or (b) the user answers.
The user's answer supersedes the pending-user record: reprocess that one
item exactly once (implement or decline it via fn-10.2, which writes the
terminal record), rather than waiting for the next fetch.
Read MR_STATE from the trailer:
MR_STATE=closed or merged → the PR/MR is closed. Terminate the loop
and report a short summary (what was handled this session). Do not schedule
another wakeup.
otherwise → schedule the next wakeup with the harness ScheduleWakeup
tool, after MR_POLL_SECONDS (the adaptive cadence hint: ~2–3 min while active,
~15–20 min when idle — you may adjust within that band). The wakeup payload
must carry enough state to run stateless, because each wake re-enters this
skill fresh:
| payload field | value |
|---|---|
id | the PR/MR <ID> |
forge | github / gitlab (from Step 1) |
stash | .data/merge/<ID>.md (holds ## Intent/## Declined/## Handled) |
last_activity | MR_UPDATED from the trailer |
cadence | MR_CADENCE (active/idle) |
terminate_when | PR/MR closed |
The wakeup prompt re-invokes /merge-request:fix <ID> — which re-runs Steps 1–7
from the top. Because gathering is deduped against the durable ## Handled
ledger, a fresh wake never re-handles prior feedback.
/merge-request:fix <ID>. The ## Handled ledger makes resume idempotent.pending-user in fn-10.2. Never re-derive dedupe by
hand — always go through gather-feedback.sh.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub softwareassassin2/plugins --plugin merge-request4 skills in this plugin
/createmerge-request:createOpen a ready pull/merge request for the current branch on whichever forge the repo uses (GitHub via gh, GitLab via glab), then hand the new PR/MR to the fix-monitoring loop. First runs /detect-source-control and hard-stops when the forge is unsupported. Use to create a PR/MR for the current branch, "open a PR", "raise an MR", or start the merge-request workflow./post-findingsmerge-request:post-findingsTake the findings staged by /merge-request:review in .data/merge/<ID>.md and, with per-finding approval, post the approved ones to the forge as inline comments (general-comment fallback when a finding has no valid diff location) — or formally sign off a clean PR/MR with a single "Looks good." First runs /detect-source-control and hard-stops when the forge is unsupported. Nothing reaches the forge except through the bundled scripts. Also runs a propose-then-confirm learned-preferences loop that teaches /merge-request:review what you value (Don't-raise / Wording / Confirmed-valued), and records skipped findings to the artifact's/reviewmerge-request:reviewReview a pull/merge request (by id) or batch-review every open one against Chris's own engineering standards, staging high-signal findings to .data/merge/<ID>.md for later posting. Fetches head SHAs and applies the "Reviewed at commit" skip check BEFORE any checkout, resolves the head fork-safely, builds/tests it in a dedicated worktree, and treats a failing build/checkout as the top blocking finding. First runs /detect-source-control and hard-stops when the forge is unsupported. Use as "review the PR", "review the open MRs", "any PRs need my eyes", "review <id>".