Merge Status
Purpose
Use this skill to produce a read-only merge-readiness report for the current
branch, worktree, or PR. Do not mutate the repo unless the user explicitly asks
for fixes.
Default Command
Start with the bundled collector script from the repository root:
<skill-dir>/scripts/merge-status.sh
<skill-dir>/scripts/merge-status.sh --json
<skill-dir>/scripts/merge-status.sh --run-checks
The script is read-only by default. It fetches remote refs unless --offline is
passed, emits a human summary by default, emits structured output with --json,
and only executes local lint/test/build commands when --run-checks is
explicitly passed. Use the checklist below to interpret the output, fill any
repo-specific gaps the script cannot infer, and decide the final status.
Evidence Checklist
Dirty state
- Prefer
<skill-dir>/scripts/merge-status.sh --json for collection.
- Run
git status --short --branch and git status --porcelain=v2 --branch.
- Report unstaged, staged, untracked, ignored-required, ahead, and behind
state separately.
Branch and mergeability
- Identify current branch, upstream, base branch, HEAD, and open PR if any.
- Fetch remote refs unless the user asked for an offline check.
- Check mergeability with the forge CLI when available:
gh pr view --json mergeable,reviewDecision,statusCheckRollup,url.
- Locally simulate merge risk without changing the working tree. Prefer a
temporary clone/worktree or
git merge-tree when available; otherwise use
git merge-base, git diff --name-only <base>...HEAD, and report that a
true merge simulation was unavailable.
Conflicts and overlap
- Review any actual conflict markers in touched files.
- Compare touched files with other open branches and registered worktrees.
- Report possible conflicts if another branch/worktree touches the same
files and might merge first.
Lint, tests, and build
- Use
<skill-dir>/scripts/merge-status.sh --run-checks when the user wants
the skill to execute the discovered local checks.
- Run the repo's normal lint, test, typecheck, build, and generated-doc
checks. Prefer documented commands from
CONTRIBUTING.md, README.md,
package.json, Cargo.toml, pyproject.toml, Makefile, justfile,
Taskfile.yml, or CI workflow files.
- If a check is too expensive or unavailable, state the exact reason and the
command that should be run before merge.
CI status
- Use the forge CLI/API when configured. For GitHub:
gh pr view --json statusCheckRollup,mergeable,reviewDecision and
gh run list --branch <branch> --limit 10.
- CI must be green before reporting merge-ready. Pending, skipped critical,
failed, or unknown CI means not ready or unverified.
Docs and generated artifacts
- Inspect changed files and decide whether docs are stale.
- Run repo-local generated-doc checks when present.
- If behavior, CLI flags, config keys, schemas, examples, or user workflows
changed, verify the matching docs were updated.
Config examples and live config notice
- Check
.env.example, .env.sample, config.toml.example,
config.example.*, *.template, and similar tracked examples for drift
against new or changed config keys.
- Check runtime config docs for the same drift.
- Inform the user when their live
.env, config.toml, or equivalent local
config may need a matching update. Do not edit live secret/config files
unless explicitly asked.
Report Format
Lead with one status:
ready_to_merge
not_ready
blocked
unverified
Then include:
- Branch, HEAD, base, upstream, PR URL.
- Dirty state summary.
- Merge/conflict risk, including overlapping branches/worktrees.
- Lint/test/build/generated-doc commands and results.
- CI status and review status.
- Docs/config-example freshness.
- Live config follow-up notice if applicable.
- Required fixes before merge.
Completion Standard
Report ready_to_merge only when the worktree is clean, local mergeability is
confirmed, linting is clean, all tests pass, generated docs/examples are fresh,
CI is green, review requirements are satisfied, and no unresolved conflict risk
or config drift remains.
1---2name: merge-status3description: Check whether the current branch or worktree is ready to merge, including dirty state, mergeability, conflicts, overlap with other branches/worktrees, lint/tests/CI, stale docs, config/example drift, and live config follow-up.4---56# Merge Status78## Purpose910Use this skill to produce a read-only merge-readiness report for the current11branch, worktree, or PR. Do not mutate the repo unless the user explicitly asks12for fixes.1314## Default Command1516Start with the bundled collector script from the repository root:1718```bash19<skill-dir>/scripts/merge-status.sh20<skill-dir>/scripts/merge-status.sh --json21<skill-dir>/scripts/merge-status.sh --run-checks22```2324The script is read-only by default. It fetches remote refs unless `--offline` is25passed, emits a human summary by default, emits structured output with `--json`,26and only executes local lint/test/build commands when `--run-checks` is27explicitly passed. Use the checklist below to interpret the output, fill any28repo-specific gaps the script cannot infer, and decide the final status.2930## Evidence Checklist31321. **Dirty state**33 - Prefer `<skill-dir>/scripts/merge-status.sh --json` for collection.34 - Run `git status --short --branch` and `git status --porcelain=v2 --branch`.35 - Report unstaged, staged, untracked, ignored-required, ahead, and behind36 state separately.37382. **Branch and mergeability**39 - Identify current branch, upstream, base branch, HEAD, and open PR if any.40 - Fetch remote refs unless the user asked for an offline check.41 - Check mergeability with the forge CLI when available:42 `gh pr view --json mergeable,reviewDecision,statusCheckRollup,url`.43 - Locally simulate merge risk without changing the working tree. Prefer a44 temporary clone/worktree or `git merge-tree` when available; otherwise use45 `git merge-base`, `git diff --name-only <base>...HEAD`, and report that a46 true merge simulation was unavailable.47483. **Conflicts and overlap**49 - Review any actual conflict markers in touched files.50 - Compare touched files with other open branches and registered worktrees.51 - Report possible conflicts if another branch/worktree touches the same52 files and might merge first.53544. **Lint, tests, and build**55 - Use `<skill-dir>/scripts/merge-status.sh --run-checks` when the user wants56 the skill to execute the discovered local checks.57 - Run the repo's normal lint, test, typecheck, build, and generated-doc58 checks. Prefer documented commands from `CONTRIBUTING.md`, `README.md`,59 `package.json`, `Cargo.toml`, `pyproject.toml`, `Makefile`, `justfile`,60 `Taskfile.yml`, or CI workflow files.61 - If a check is too expensive or unavailable, state the exact reason and the62 command that should be run before merge.63645. **CI status**65 - Use the forge CLI/API when configured. For GitHub:66 `gh pr view --json statusCheckRollup,mergeable,reviewDecision` and67 `gh run list --branch <branch> --limit 10`.68 - CI must be green before reporting merge-ready. Pending, skipped critical,69 failed, or unknown CI means not ready or unverified.70716. **Docs and generated artifacts**72 - Inspect changed files and decide whether docs are stale.73 - Run repo-local generated-doc checks when present.74 - If behavior, CLI flags, config keys, schemas, examples, or user workflows75 changed, verify the matching docs were updated.76777. **Config examples and live config notice**78 - Check `.env.example`, `.env.sample`, `config.toml.example`,79 `config.example.*`, `*.template`, and similar tracked examples for drift80 against new or changed config keys.81 - Check runtime config docs for the same drift.82 - Inform the user when their live `.env`, `config.toml`, or equivalent local83 config may need a matching update. Do not edit live secret/config files84 unless explicitly asked.8586## Report Format8788Lead with one status:8990- `ready_to_merge`91- `not_ready`92- `blocked`93- `unverified`9495Then include:9697- Branch, HEAD, base, upstream, PR URL.98- Dirty state summary.99- Merge/conflict risk, including overlapping branches/worktrees.100- Lint/test/build/generated-doc commands and results.101- CI status and review status.102- Docs/config-example freshness.103- Live config follow-up notice if applicable.104- Required fixes before merge.105106## Completion Standard107108Report `ready_to_merge` only when the worktree is clean, local mergeability is109confirmed, linting is clean, all tests pass, generated docs/examples are fresh,110CI is green, review requirements are satisfied, and no unresolved conflict risk111or config drift remains.