Skip to content
Back to skills

Merge Pr

ASecurity

Script-first deterministic squash merge with strict required-check gating, head-SHA pinning, and reliable attribution/commenting.

  • 200 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 28, 2026
testingrailsdebugginggit

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 28, 2026

npx -y skills add adoresever/AGI_Ananas --skill merge-pr --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Merge Pr?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Merge Pr
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adoresever-merge-pr/badge)](https://www.skillsdirectory.com/skills/adoresever-merge-pr)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: merge-pr
description: Script-first deterministic squash merge with strict required-check gating, head-SHA pinning, and reliable attribution/commenting.
---

# Merge PR

## Overview

Merge a prepared PR only after deterministic validation.

## Inputs

- Ask for PR number or URL.
- If missing, use `.local/prep.env` from the PR worktree.

## Safety

- Never use `gh pr merge --auto` in this flow.
- Never run `git push` directly.
- Require `--match-head-commit` during merge.
- Wrapper commands are cwd-agnostic; you can run them from repo root or inside the PR worktree.

## Execution Contract

1. Validate merge readiness:

```sh
scripts/pr-merge verify <PR>
```

Backward-compatible verify form also works:

```sh
scripts/pr-merge <PR>
```

2. Run one-shot deterministic merge:

```sh
scripts/pr-merge run <PR>
```

3. Capture and report these values in a human-readable summary (not raw `key=value` lines):

- Merge commit SHA
- Merge author email
- Merge completion comment URL
- PR URL

## Steps

1. Validate artifacts

```sh
require=(.local/review.md .local/review.json .local/prep.md .local/prep.env)
for f in "${require[@]}"; do
  [ -s "$f" ] || { echo "Missing artifact: $f"; exit 1; }
done
```

2. Validate checks and branch status

```sh
scripts/pr-merge verify <PR>
source .local/prep.env
```

`scripts/pr-merge` treats “no required checks configured” as acceptable (`[]`), but fails on any required `fail` or `pending`.

3. Merge deterministically (wrapper-managed)

```sh
scripts/pr-merge run <PR>
```

`scripts/pr-merge run` performs:

- deterministic squash merge pinned to `PREP_HEAD_SHA`
- reviewer merge author email selection with fallback candidates
- one retry only when merge fails due to author-email validation
- co-author trailers for PR author and reviewer
- post-merge verification of both co-author trailers on commit message
- PR comment retry (3 attempts), then comment URL extraction
- cleanup after confirmed `MERGED`

4. Manual fallback (only if wrapper is unavailable)

```sh
scripts/pr merge-run <PR>
```

5. Cleanup

Cleanup is handled by `run` after merge success.

## Guardrails

- End in `MERGED`, never `CLOSED`.
- Cleanup only after confirmed merge.
- In final chat output, use labeled lines or bullets; do not paste raw wrapper diagnostics unless debugging.

Files in this skill

  • SKILL.md2.3 KB
  • agents/openai.yaml174 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.