mj-agent-git-check-merge

Checks GitHub PR merge readiness across conflicts, CI, reviews, and description completeness.

1|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/MJ-AgentLab/mj-agent --skill mj-agent-git-check-merge-mj-agentlab
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mj-agent-git-check-merge
Source: https://github.com/MJ-AgentLab/mj-agent/tree/main/.claude/skills/mj-agent-git-check-merge
Command: npx skills add https://github.com/MJ-AgentLab/mj-agent --skill mj-agent-git-check-merge-mj-agentlab

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Before merging a pull request in the mj-agent repository, developers must manually verify CI status, review approvals, merge conflicts, and PR description completeness across multiple GitHub CLI commands. This Skill consolidates that into one structured merge-readiness gate (Stage 16 of the HITL workflow) with a clear pass/fail table and actionable fix list. ## Core Features & Use Cases - Five automated checks: Runs 4 gating checks (merge conflicts, CI status via statusCheckRollup, review approvals, branch-type-aware PR description completeness) plus 1 informational merge-commit detection, all from a single gh pr view call. - Branch-type-aware description validation: Validates required PR body sections for mj-agent's 5 branch types (feature, bugfix, documentation, maintain, hotfix), including mandatory rollback plans for hotfixes. - Structured verdict output: Produces a status table with Pass/Fail/Pending/Skip/Info states, an overall verdict (Ready to Merge / Not Ready / Waiting for Review), and a prioritized action list. - Use Case: A developer finishes a feature branch and asks "PR 能合并吗". The Skill identifies the open PR, runs all checks, reports that CI passed but the PR description is missing the review checklist, and tells them exactly what to fix before re-checking. ## Quick Start Ask the assistant to check whether the current branch's pull request is ready to merge in the mj-agent repository.

Frequently Asked Questions about mj-agent-git-check-merge

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check if a GitHub PR is ready to merge?▼

Run this Skill inside the mj-agent worktree with an authenticated gh CLI. It identifies the open PR for your current branch, then checks merge conflicts, CI status, review approvals, and description completeness, returning a Ready to Merge, Not Ready, or Waiting for Review verdict.

How to check GitHub CI status for a pull request with gh CLI?▼

Use gh pr view with the statusCheckRollup JSON field rather than gh pr checks, because gh pr checks exits with code 8 while checks are pending. The Skill deduplicates checks by name, keeping the latest run, and maps CheckRun conclusions and StatusContext states to Pass, Fail, or Pending.

What PR description fields are required for each branch type?▼

Feature branches need change summary, impact scope, review points, and a self-check list; bugfix adds root cause and fix plan; hotfix additionally requires a mandatory rollback plan; documentation and maintain have their own section sets. A section passes only if it has non-empty, non-comment content.

Why does the merge check show Pending instead of Fail for reviews?▼

Review approval depends on external people, not something the developer can fix directly, so zero approvals is reported as Pending rather than Fail. A PR with only Pending items and no Failures gets a Waiting for Review verdict instead of Not Ready.

What happens when GitHub reports mergeable status as UNKNOWN?▼

When GitHub is still computing mergeability, the Skill stops and asks you to retry later instead of guessing Pass or Fail. This avoids false verdicts while GitHub finishes its background merge-state calculation.

When should I not use this merge readiness check?▼

Do not use it for architecture review of someone else's PR (use mj-agent-git-review-pr), drafting replies to review comments (use mj-agent-flow-review-respond), or post-merge cleanup (use mj-agent-flow-post-merge or mj-agent-git-delete).