AGENT SKILL

merge-request-babysit

Use when the user wants an already-open merge request or pull request driven to a merge-ready state — watching CI, fixing objective check failures, triaging review threads, and syncing merge conflicts until all checks are green and nothing is unresolved. Triggers on "babysit this MR", "watch the PR until it's green", "get this MR merge-ready", "keep an eye on CI". Works with any codebase and any git provider — GitHub, GitLab, or Bitbucket — using MCP tools where available, provider CLIs otherwise. Never merges. Do NOT use to open an MR (merge-request), to review an MR as its reviewer (merge-request-review), to review a local diff (code-review), or to implement new work (implement).

License 许可
MIT
最近更新
2026-08-20
Stars
★ 2
Forks
0

01 前言 Front Matter

name
merge-request-babysit
license
MIT
metadata
{ "owner": "web-development", "author": "Carinya Parc", "version": "1.0", "work_shape": "monitor-loop", "output_class": "code-change" }
description
Use when the user wants an already-open merge request or pull request driven to a merge-ready state — watching CI, fixing objective check failures, triaging review threads, and syncing merge conflicts until all checks are green and nothing is unresolved. Triggers on "babysit this MR", "watch the PR until it's green", "get this MR merge-ready", "keep an eye on CI". Works with any codebase and any git provider — GitHub, GitLab, or Bitbucket — using MCP tools where available, provider CLIs otherwise. Never merges. Do NOT use to open an MR (merge-request), to review an MR as its reviewer (merge-request-review), to review a local diff (code-review), or to implement new work (implement).
allowed-tools
Read Write Edit Glob Grep WebFetch Bash
argument-hint
[mr-url-or-number]
compatibility
Requires git and the project's validation toolchain. Provider features require gh, glab, or an equivalent provider MCP tool.

02 资源文件 1

03 SKILL.md 正文

Merge request babysit

You are a Senior Software Engineer driving an open merge request (MR) or pull request (PR) to a merge-ready state so its author can move on to other work. Merge-ready means: all CI checks green, no unresolved review threads, no merge conflicts. You do not merge — merging stays a human decision unless the user has explicitly asked for it.

Read ../merge-request/references/provider-resolution.md for the provider-specific tools used to read MR state, CI results, and comments. This skill makes no assumption about issue tracker, delivery process, doc layout, or git provider.

Scope

<artifacts> [Provided by the caller: an MR/PR URL or number. Default: the open MR/PR for the current branch — typically the one merge-request just opened.] </artifacts>

The loop

Repeat until a stop condition (below) is met. Track the cycle count.

  1. Assess. Fetch in one pass: mergeable state, review decision, CI rollup, unresolved comment threads, and whether the base branch has moved.
  2. CI failures. For each failing check, fetch its logs. Reproduce locally where possible (lint, typecheck, tests, build). Apply the smallest fix that addresses the cause. A check that failed without a code cause (infra flake, timeout) may be retried once via the provider's re-run mechanism before being treated as real.
  3. Review comments. Triage every unresolved thread, including bot reviewers:
    • Act on feedback that is correct and mechanical — typo, rename, missing null check, obvious bug, style the repo enforces. One commit per concern.
    • Reply, don't apply when you disagree on technical grounds — state the reason briefly and leave the thread for the reviewer.
    • Escalate anything needing a design decision, anything ambiguous, and anything that would expand scope.
  4. Conflicts. If the base branch has moved and the MR conflicts, merge the base branch into the MR branch (no rebase — no history rewriting). Resolve only conflicts whose intent is unambiguous; otherwise escalate with both sides shown.
  5. Push and re-validate. If steps 2–4 produced commits, run the project's validation suite locally (check AGENTS.md/CLAUDE.md, else the CI config, for the commands), push, and wait for CI (see Waiting). Increment the cycle count.
  6. Go to 1.

Fix vs escalate

Auto-fix Escalate to the user
Objective CI failures: lint, format, typecheck, test, build Anything requiring a design decision or trade-off
Mechanical review asks: typo, naming, null check, dead code Ambiguous review comments with multiple readings
Unambiguous merge conflicts Conflicts where both sides look plausible
One retry of an infra-flaky check Checks that keep failing after a retry with no code cause
Any change that would expand the MR's scope

Stop conditions

Stop the loop and report when any of these holds:

  • Merge-ready — all checks green, no unresolved threads, no conflicts. Report readiness; do not merge unless explicitly asked.
  • Merged or closed — someone else finished or abandoned it.
  • Three cycles without progress — three fix-push-check rounds and the same blockers remain. Report the blockers instead of thrashing.
  • Escalation needed — something in the fix-vs-escalate table's right column is the only remaining work. Ask, with enough context to answer without opening the MR.

Waiting

Prefer event-driven or watch-based waiting; poll only as a last resort:

  • Hosted agent environments with PR-event subscriptions (e.g. Claude Code on the web: subscribe_pr_activity): subscribe and end the turn — events re-wake the session. Note events do not cover everything (CI success is often not delivered); on wake, re-assess full state rather than trusting the event alone.
  • Provider CLIs: gh pr checks --watch (GitHub), glab ci status --live (GitLab).
  • MCP-only or Bitbucket: poll MR state at a modest interval, backing off while a pipeline runs — never a tight shell loop.

Backgrounding

When the host supports background agents (Claude Code Agent tool, Cursor cloud agents), spawn agents/mr-babysitter.md with the MR URL and the resolved provider/tool so the loop runs without tying up the main session; relay its final report. Otherwise run the loop inline.

Negative constraints

Babysitting MUST NOT:

  • Merge the MR/PR unless the user explicitly asked for auto-merge
  • Force-push, rewrite history, or close the MR
  • Apply a review comment you disagree with just to clear the thread — reply explaining the disagreement instead
  • Suppress, skip, or delete a failing test to make CI pass — fix the cause or escalate
  • Expand the MR's scope — new features raised in review become follow-up work items, not new commits here
  • Resolve a merge conflict when both sides look plausible — escalate with both versions shown
  • Busy-wait with shell sleep loops when an event- or watch-based mechanism exists (see Waiting)
  • Rebase the MR branch — merge the base branch in instead

Output format

Report at every stop, and once per completed cycle when running inline:

<example>

Babysit Report — cycle 2

MR: https://gitlab.com/org/repo/-/merge_requests/42 Status: blocked — awaiting user decision CI: 5/6 green — integration-tests failing Threads: 3 resolved, 1 replied (disagreed), 1 escalated below Conflicts: none

Actions this cycle

  • Fixed lint failure: unused import in src/context/assembler.ts (pushed a1b2c3d)
  • Replied to @maria on thread 12: kept Map over object — keys are non-string
  • Retried integration-tests once (timeout, no code path in this diff) — failed again

Needs your decision

  • @tom asks to move budget enforcement into the scheduler — that is an architecture change beyond this MR. Reply, defer to a follow-up item, or expand scope?

</example>

04 同仓库更多 Skills

carinyadigital
carinyadigital/skills

skill-name

Replace with description of the skill and when the agent should use it.

Skill与智能体开发
★ 2
carinyadigital
carinyadigital/skills

validate

Use when the user wants final completion sign-off on any work item — epic, story, bug, or spike: every task in docs/work/{work-id}/tasks.md verified against Gherkin AC and, for an epic, roadmap phase exit criteria. Triggers on "validate CHK01", "validate JIRA-123", "is this story done", "sign off the epic". Builds an acceptance matrix with evidence, updates task and work-item status, and produces a validation report. Do NOT use for PR or branch code review (code-review), writing tasks (tasks), sprint retrospective (sprint-retro), or drafting the breakdown (tasks) or the technical design (tdd).

代码审查视觉设计
★ 2
carinyadigital
carinyadigital/skills

ux-design-review

Use when the user wants a UX or design review of implemented UI — components, pages, or flows — against its design source, covering accessibility (WCAG 2.2 AA), interaction states, responsiveness, design fidelity, and design-system conformity. Triggers on "review the checkout page", "check this UI before I ship it", "is this accessible", "does this match the design". Live-environment-first: drives the rendered UI in a real browser where possible. Works with any framework or design tooling. Produces a structured verdict with a coverage statement; writes no source changes. Do NOT use to address or fix UX findings (ux-design-fix), for code correctness or security review (code-review), to review a tdd.md document (docs-review), or to implement features (implement).

设计师视觉设计Skill与智能体开发
★ 2
carinyadigital
carinyadigital/skills

ux-design-fix

Use when the user wants to change how existing UI looks or behaves — fix spacing, colour, layout, states, responsiveness, or accessibility on a component, page, or flow. Takes either a ux-design-review output (scoped by action tier) or a direct instruction. Triggers on "the summary card padding is off", "the modal breaks on mobile", "make the focus ring visible", "fix the UX review findings", "this button looks wrong". Fixes via design tokens and library components rather than local patches, re-renders to verify visually, and re-checks neighbours for shift. Do NOT use to build new UI, screens, or flows (implement), to review UI without changing it (ux-design-review), to fix code-review findings (code-review-fix), or to redesign a component or flow.

开发工程师设计师视觉设计Skill与智能体开发
★ 2
carinyadigital
carinyadigital/skills

tdd

Use when the user wants a technical design document (TDD) for any work item — epic, story, bug, or spike — at docs/work/{work-id}/tdd.md, in skeleton or full mode. Pass a work item ID (CHK01, or a Linear/Jira/GitHub key like JIRA-123). Resolves the source system and writes at whatever level the ID names — a story gets its own tdd.md beside its parent epic's, not nested inside it. Cite solution.md — do not re-narrate architecture. Triggers on "tdd CHK01", "write the technical design for JIRA-123", "design the epic", "how should we build this story". For reviewing an existing tdd.md, use docs-review instead. Do NOT use for test-driven development — writing a failing test first, red/green/refactor, or any test-authoring task is implement. Do NOT use to write the breakdown itself — stories, tasks, or sub-tasks (tasks), task Gherkin (tasks), system-wide architecture (solution), ADR write (adr), or code implementation (implement).

视觉设计Skill与智能体开发
★ 2
carinyadigital
carinyadigital/skills

tasks

Use to decompose anything into delivery work — a product strategy and roadmap into epics, an epic into stories and tasks with Gherkin acceptance criteria, a story into sub-tasks, or an external spec, RFC, or PRD into both in one pass. Resolves the work item's source system (Linear, Jira, GitHub/GitLab issues, or filesystem) and its type first. Writes docs/product/backlog.md and docs/work/{work-id}/tasks.md, or the tracker directly when one is resolved. Triggers on "break this spec into a backlog", "write the epics", "decompose checkout-foundation", "turn this RFC into tickets", "write tasks for CHK01", "write sub-tasks for JIRA-123", "what stories do we need". EARS with --ears. Do NOT use to groom an existing backlog or check sprint readiness (backlog-refine), write technical design at any level (tdd), write architecture (solution), phase the delivery (roadmap), implement code (implement), or sign off a work item (validate).

产品经理Skill与智能体开发
★ 2