merge-pr
Merge PR
Overview
Merge a prepared PR only after deterministic validation.
Inputs
- Ask for PR number or URL.
- If missing, use
.local/prep.envfrom the PR worktree.
Safety
- Never use
gh pr merge --autoin this flow. - Never run
git pushdirectly. - Require
--match-head-commitduring merge. - Wrapper commands are cwd-agnostic; you can run them from repo root or inside the PR worktree.
Execution Contract
- Validate merge readiness:
scripts/pr-merge verify <PR>
Backward-compatible verify form also works:
scripts/pr-merge <PR>
- Run one-shot deterministic merge:
scripts/pr-merge run <PR>
- Capture and report these values in a human-readable summary (not raw
key=valuelines):
- Merge commit SHA
- Merge author email
- Merge completion comment URL
- PR URL
Steps
- Validate artifacts
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
- Validate checks and branch status
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.
- Merge deterministically (wrapper-managed)
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
- Manual fallback (only if wrapper is unavailable)
scripts/pr merge-run <PR>
- Cleanup
Cleanup is handled by run after merge success.
Guardrails
- End in
MERGED, neverCLOSED. - Cleanup only after confirmed merge.
- In final chat output, use labeled lines or bullets; do not paste raw wrapper diagnostics unless debugging.
More from linuxhsj/openclaw-zero-token
imsg
iMessage/SMS CLI for listing chats, history, and sending messages via Messages.app.
23obsidian
Work with Obsidian vaults (plain Markdown notes) and automate via obsidian-cli.
23coding-agent
Delegate coding tasks to Codex, Claude Code, or Pi agents via background process. Use when: (1) building/creating new features or apps, (2) reviewing PRs (spawn in temp dir), (3) refactoring large codebases, (4) iterative coding that needs file exploration. NOT for: simple one-liner fixes (just edit), reading code (use read tool), thread-bound ACP harness requests in chat (for example spawn/run Codex or Claude Code in a Discord thread; use sessions_spawn with runtime:"acp"), or any work in ~/clawd workspace (never spawn agents here). Claude Code: use --print --permission-mode bypassPermissions (no PTY). Codex/Pi/OpenCode: pty:true required.
22sherpa-onnx-tts
Local text-to-speech via sherpa-onnx (offline, no cloud)
22sonoscli
Control Sonos speakers (discover/status/play/volume/group).
20skill-creator
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".
20