flurdy/agent-skills / skills/ready-to-merge
ready-to-merge
UnverifiedPre-merge gate — verify a PR is green, approved, in sync, and free of obvious risk, then (on explicit approval) squash-merge it. Composes /pr-status, /contract-check, and /review-pr rather than reimplementing them.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 23.1 KB |
| references/default-sync.md | markdown | 6.9 KB |
| scripts/default-sync.py | script | 11.8 KB |
| scripts/gh-branch-delete.pyexecutable | script | 417 B |
| scripts/gh-branch-view.pyexecutable | script | 280 B |
| scripts/git-unpushed.shexecutable | script | 204 B |
| scripts/github_branch.py | script | 2.0 KB |
| scripts/merge-timing.pyexecutable | script | 9.1 KB |
| tests/test-skill-contract.shexecutable | script | 2.8 KB |
| tests/test_branch_wrappers.py | script | 7.6 KB |
| tests/test_default_sync.py | script | 11.5 KB |
| tests/test_merge_timing.py | script | 11.0 KB |
scripts/github_branch.py
View on GitHub"""Validated branch targets shared by the fixed-method entry points."""
import os
from pathlib import Path
import re
import subprocess
import sys
from urllib.parse import quote
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "pr-status" / "scripts"))
from github_remote import default_github_host, normalize_host # noqa: E402
def target_host():
"""GH_HOST when gh knows it, else github.com; an unknown GH_HOST is refused."""
host = default_github_host()
requested = os.environ.get("GH_HOST", "")
if requested and normalize_host(requested) != host:
print("GH_HOST is not a GitHub host known to gh", file=sys.stderr)
raise SystemExit(2)
return host
def branch_target():
if len(sys.argv) != 4:
print("usage: helper <owner> <repo> <branch>", file=sys.stderr)
raise SystemExit(2)
owner, repo, branch = sys.argv[1:]
if not all(re.fullmatch(r"[A-Za-z0-9][A-Za-z0-9_.-]*", part) for part in (owner, repo)):
print("invalid repository identifier", file=sys.stderr)
raise SystemExit(2)
if not branch or branch.startswith("-") or branch == "HEAD":
print("invalid branch name", file=sys.stderr)
raise SystemExit(2)
try:
valid = subprocess.run(
["git", "check-ref-format", f"refs/heads/{branch}"],
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=False,
)
except FileNotFoundError:
print("git is required", file=sys.stderr)
raise SystemExit(127) from None
if valid.returncode:
print("invalid branch name", file=sys.stderr)
raise SystemExit(2)
return f"repos/{owner}/{repo}", quote(branch, safe="/")
def gh_api(*args):
host = target_host()
try:
result = subprocess.run(["gh", "api", "--hostname", host, *args], check=False)
except FileNotFoundError:
print("gh is required", file=sys.stderr)
raise SystemExit(127) from None
raise SystemExit(result.returncode if result.returncode >= 0 else 128 - result.returncode)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |